Macro-zmy msg
Aus metasec wiki
Incomming Call:
exten => 01003, 2, Macro(zmy_msg,123,254,i)
Update after missing:
exten => 01003, 4, Macro(zmy_msg,123,254,m,upd)
or
exten => 01003, 4, Macro(zmy_msg,123,254,h,upd)
[macro-zmy_msg] exten => s, 1, NoOp(== ZPHONE MYSQL MSG MACRO ==) exten => s, 2, MYSQL(Connect connid localhost zphone zphone zphone) exten => s, 3, GoToIf($["${ARG4}"="upd"]?upd) exten => s, 4, MYSQL(Query resultid ${connid} INSERT\ INTO\ user_cdr\ (uc_ext\,uc_dest\,uc_dir\,uc_date\,uc_chan\,uc_uniqid)\ VALUES\ (\'${ARG1}\'\,\'${ARG2}\'\,\'${ARG3}\'\,${EPOCH}\,\'${CHANNEL}\'\,\'${UNIQUEID}\')) exten => s, 5, GoTo(clear) exten => s, 100(upd), MYSQL(Query resultid ${connid} UPDATE\ user_cdr\ SET\ uc_dir=\'${ARG3}\'\ WHERE\ uc_ext=\'${ARG1}\'\ AND\ uc_uniqid=\'${UNIQUEID}\') exten => s, 101, GoTo(clear) exten => s, 200(clear), MYSQL(Clear ${resultid}) exten => s, 201, MYSQL(Disconnect ${connid})