There's a much simpler way to do this.  Assuming you have wget (who
doesn't?) you can do this right inside your extensions.conf without
need of any external script thusly:

exten => s,1,System(/usr/bin/wget -q -b
http://127.0.0.1:9000/"status?p0=display&p1=${CALLERID(num)}&p2=${CALLERID(name)}&p3=10&player=192.168.11.149")

This is the syntax I use.  Replace 127.0.0.1 with your slimserver's IP
address (my slimserver and Asterisk are on the same box) and
192.168.11.149 with your player's ID (according to the Slim docs it's
usually MAC address, but for me it seems to usually be IP address).

The quotes are necessary to escape the special characters and any
spaces that might be in the calling name or number.

If your slimserver's CSRF protection level is not set to "none" you'll
need to add a ";cauth={insert cauth string here}" to the end of the
called URL.  You can get this by sending a web browser to the URL (with
"status.html" rather than just "status") and seeing what it tells you to
use as the cauth string.  Or you can just go to your server's security
control panel and set CSRF protection to "none".

There is a caveat any time you use the System() call.  It's highly
unlikely to be an issue, but it's an interesting read anyway: 
http://www.voip-info.org/wiki/view/Asterisk+cmd+System  (scroll down to
the Security section)


-- 
rudholm
------------------------------------------------------------------------
rudholm's Profile: http://forums.slimdevices.com/member.php?userid=2980
View this thread: http://forums.slimdevices.com/showthread.php?t=33525

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to