Looking to have an HTTP trigger command sent to a door access controller when an extension is called then play a message over the paging system. In this situation it will be a lock down for a school, locking all the mag locks on their doors. I have created a custom extension in extensions_custom.conf [lockdown-lock-doors] then made a customer extension 7777 and set the Dial to “local/s@lockdown-lock-doors”. In extensions_custom.conf I have the following lines of code.
Call files are handy if you want to playback an announcement to a called party or execute additional dialplan after it answers.
You can try something like this:
[lockdown-lock-doors]
exten => s,1,CURL(http://192.168.xxx.xxx/vapix/doorcontrol?format=simple&action=LockDownDoor&Token=Axis-accc8ee11020:1566846890.452790000)
same => n,System(echo -e "Channel: Local/12100@from-internal\\nContext: announcement-lockdown\\nExtension: s" > /tmp/file.call)
same => n,System(mv /tmp/file.call /var/spool/asterisk/outgoing/)
[announcement-lockdown]
exten => s,1,Playback(custom/Lockdown)
same => n,Hangup()
You can also reference the playback application in the call file itself without the extra announcement-lockdown context, but in above example you could do a bit more dialplan if you wanted.
Thanks all for the ideas. Igaetz you have the correct string there. Unfortunately the username and password keep getting stripped off of the string and it keeps returning looking for the username and password.
Finally figured it out after lots of research and figured I would post incase anyone else runs into the issue. The exact line of code with username:password and IP address replaced is:
After doing lots of wiresharking an other testing/log reading it was the was it was pulling the username and password out of the string and not passing it.
Now to try and figure out/understand call files. Never used them before and that’s my next issue