Took a month, but finally have a sleepy Saturday. Can’t test any of this 'cause I don’t have a windows phone
Add block of code below to /etc/asterisk/extensions_custom.conf:
[zoiper-notify]
exten => _X.,1,Verbose(0, Entering user defined context [zoiper-notify] in extensions_custom.conf)
exten => _X.,n,Set(location=${DB(SIP/Registry/${EXTEN})})
exten => _X.,n,Verbose(0, getting push info ${location} );
exten => _X.,n,Set(regx="X-PUSH-URI=([0-9a-zA-Z\.\:\/\_]+)")
exten => _X.,n,Set(push=$["${location}" =~ ${regx}])
exten => _X.,n,System(/usr/bin/push.sh ${push});
exten => _X.,n,Wait(3);
exten => _X.,n,Return;
Copy push.sh
to PBX:
cd /usr/bin
wget http://www.zoiper.com/downloads/push.sh
chown asterisk:asterisk /usr/bin/push.sh
To create a zoiper notify for extension 1001, browse to Admin, Custom Destination, create a new custom destination for extension 1001 with the text:
zoiper-notify,1001,1
select return, and set the destination to ring extension 1001
If a dialable feature code is required, create one in Misc Applications, otherwise use the Custom Destination as FreePBX destination where required.
The zoiper-notify
context hard codes SIP, which surprisingly appears to work with PJSIP extensions as well, requires testing tho. The above method is bare bones, there are much more elegant ways of doing this. A more advanced user might consider a splice into the context func-apply-sipheaders
check for the existence of the zoiper register string in the astdb, if it exists gosub to the notify context and return. Requires no additional FreePBX config and would all happen invisibly behind the scenes. Left as an exercise for the reader.