Dialplan stops on Dial()


i have this dial plan. First CURL working fine and asterisk can dial my returned from curl extension number.

My code stops at line 2 and never goes to Goto() and s-ANSWER.

Can anyone help?


Kind regards,

[callin] exten => _X.,1,Macro(uridial,${EXTEN}@${SIPDOMAIN})

[macro-uridial] exten => s,1,Set(extredir=${CURL(http://www.xxx.com/getextension.php?action=callin&id=${CALLERID(num)})}) exten => s,n,Dial(SIP/${extredir},30) exten => s,n,Goto(s-${DIALSTATUS},1) exten => s-ANSWER,1,${CURL(http://www.xxx.com/getextension.php?action=answer&id=${CALLERID(num)})}

If you want the dialplan to continue after the successful completion of a call, you must use the g option.

If you want to do something in parallel with the call, Asterisk doesn’t really support that from the dialplan, as the Dial application is what runs the bridge that connects the two parties. It is a fairly common misunderstanding to believe that Dial exits on answer.

If you want to run something before the call is bridged (and this may also mean before Answer is sent upstream), you can use G, U, or (deprecated) M options, but not with your current dialplan structure.

g parameter solved my problem.

I want to know if the extension answered the phone.

Thank you for your kind help