Hello.
I want to send sms to callee when he dont answer call.
I have this code
[macro-send_sms]
exten => s,1,NoOp(ARG1 is: ${ARG1})
exten => s,n,Dial(${ARG1})
exten => s,n,GoToIf($[${DIALSTATUS}=“ANSWER”]:end?send_sms)
exten => s,n(end),NoOp(“All Good!”)
exten => s,n,Hangup
exten => s,n( send_sms),NoOp(“DIALSTATUS is :${DIALSTATUS}”)
exten => s,n(send_sms),AGI(call my script with sms sending)
exten => s,n,Hangup
Script work’s fine.
But when i make call and and cancel it from caller or callee side, i don’t see in CLI(v5) any DIALSATUS output. Only see part before Dial.
although, unless ${ARG1} contains the g option, the end path will never be taken as Dial will return no-zero and the dialplan execution will stop, before the GoToIf.
You can only place a label once. Also, in many cases, spaces are significant.
There is no need to use g if all you do is hangup.
Also, if the the caller hangs up, there is no channel to continue in the dialplan. That includes the case where the caller cancel before the call is answered. You would need a hangup handler to gain control in such cases (or the h extension).
I just don’t understand one thing why GoToIf should be like this GoToIf($[${DIALSTATUS}=ANSWER]:send_sms?end)
I thougt that if condition is True then we go send_sms if it False we go end.
Am I missing something?