Adapt this piece of dialplan in my extensions

Hi forum , i am trying to add push notification on my asterisk 16/18 , for my mobile users , and i found a library on github , but i think he is using FreePBX , and i am using asterisk 16/18 with my own dialplan.

in step 7 he puts the following:

same => n,GoSubIf($["${pushneed}" = “${CALL_DESTINATION}”]?push,s,1(${CURRENT_DEVICE}))

[push]
exten => s,1,NoOP(SUB: Enviar notificación push)
same => n,Set(MAX_TRIES=15)
same => n,Set(TRY=1)

same => n,System(/var/lib/asterisk/pushscripts/push “${CALL_DESTINATION}” “${CALLERID(num)}” “${CALLERID(name)}” )

my dialplan

exten => _2XXX,1,NoOp(${CALLERID(name)})
exten => _2XXX,n,Noop(Protocolo TLS = ${CHANNEL(pjsip,secure)})
exten => _2XXX,n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,tT)
same=> n,Gosub(voicemail,s,1(${EXTEN}))
same=> n,Hangup

[voicemail]

exten => s,1,Goto(s-${DIALSTATUS},1)
exten => s-BUSY,1,Voicemail(${ARG1}@default,b)
same => n,Hangup
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
same => n,Hangup
exten => _s-.,1,Voicemail(${ARG1}@default,u)
same => n,Hangup

injecting my dialplan

exten => _2XXX,1,NoOp(${CALLERID(name)})
exten => _2XXX,n,Noop(Protocolo TLS = ${CHANNEL(pjsip,secure)})
same=> n,GoSubIf($["${pushneed}" = "${EXTEN}) "]?push,s,1(${CURRENT_DEVICE}))
exten => _2XXX,n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,tT)
same=> n,Gosub(voicemail,s,1(${EXTEN}))
same=> n,Hangup

[push]
exten => s,1,NoOP(SUB: Send push notification)
same=> n,Set(MAX_TRIES=15)
same=> n,Set(TRY=1)

;send args to push script

same=> n,System(/var/lib/asterisk/pushscripts/push “${EXTEN}” “${CALLERID(num)}” “${CALLERID(name)}” )

[voicemail]
exten => s,1,Goto(s-${DIALSTATUS},1)
exten => s-BUSY,1,Voicemail(${ARG1}@default,b)
same => n,Hangup
exten => s-CANCEL,1,Hangup
exten => s-CONGESTION,1,Congestion
same => n,Hangup
exten => _s-.,1,Voicemail(${ARG1}@default,u)
same => n,Hangup

making a call, I see in 0 the variable
Executing [2001@llamadas-inter:2] NoOp(“PJSIP/2000-0000001d”, “Protocolo TLS = 0”) in new stack
– Executing [2001@llamadas-inter:3] GosubIf(“PJSIP/2000-0000001d”, “0?push,s,1()”) in new stack

Any ideas on how to improve this dialplan?

Hi friends , any suggestions?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.