PDA

View Full Version : display inbound calls on asterisk on squeezebox



gramels
2007-03-11, 16:25
In case you wanna make your squeezebox display callerID from inbound
calls on your asterisk pbx, check out my howto:

http://blog.gramels.info/blog/archives/50-display-asterisk-callerID-on-a-squeezebox-slimp3-using-a-slimserver.html

Jono
2007-03-21, 16:06
Oh I wish I could get this to work....

I can run the test, which I've had to modify to ./slimdisplay.pl --server 192.168.1.2 --name=lounge --line1=Hallo --Line2="Du Da"

.....the thing is it doesn't actually display when the phones ring!

I'm running Asterisk@home & have put the line exten => 208,2,system(usr/local/slimserver/slimdisplay.pl --name=lounge --line1=${CALLERIDNAME} --Line2=${CALLERIDNUM}) in extensions_custom.conf

Jono
2007-03-23, 12:07
No takers?

Sorry to be impatient!

seanadams
2007-03-23, 13:06
Maybe a slash before usr/local/slimserver/slimdisplay.pl ?

Jono
2007-03-24, 11:45
Doh!

Thank you. Gramels also pointed this silly error out.

I have now got it working for internal calls, however, I'm grappling with the asterisk backend, which I'm not used to, to get it working on external calls.

Jono
2007-03-24, 12:25
Not the most elegant of solutions, however, with grateful thanks to gramels, I have now got this working.

As I'm using asterisk@home, I had some fiddling to do:

in extensions_custom.conf, somewhere near the top, I created a dummy extension number 1660 with the following:
exten => 1660,1,ringing(1)
exten => 1660,2,system(/usr/local/slimserver/slimdisplay.pl --name=lounge --line1=${CALLERIDNAME} --Line2=${CALLERIDNUM})
exten => 1660,3,wait(10)

I found that dialling 1660 produced the desired effect on internal calls, however, if I included extension 1660 in the ring group (which falls over to an IVR after 15 seconds usually) the IVR would kick in immediately for the caller, the house phones would ring and when answered, no-one was there....and the script failed to run.

So......., I created another dummy extension, however, this time, through AMP/FreePBX - ext 211.

I dialled into the call forwarding system (*72) and diverted all calls for 211 to 1660. Then I included extension 211 in my ring group.

Now I have caller display on my slimp3.

rudholm
2007-05-06, 19:24
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 include data set by an untrusted party in a 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)

NOTE: the forum software seems to be inserting a space into the second "CALLERID" variable name. I've no idea why.

rudholm
2007-05-08, 21:41
Just found out from another thread (http://forums.slimdevices.com/showthread.php?p=200664) that using "player=*" will send the CallerID info to all connected squeezeboxes.

Very handy, and simplifies things even further.

g7pkf
2008-11-12, 16:39
I cant seem to get this to work any pointers?

tried both methods, the script way i can display via the command line but not from asterisk.

the wget way nothing nada, any way to test/debug whats going on? using asterisk and freepbx on a clarkconnect box, squeezecenter is on the same box

okay update running the cli i get this

== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/1020-08626218'
-- Executing [1029@from-internal:1] Ringing("SIP/1000-08626218", "1") in new stack
-- Executing [1029@from-internal:2] System("SIP/1000-08626218", "/usr/local/bin/slimdisplay.pl --name=Squeezebox --line1= --Line2=") in new stack
-- Executing [1029@from-internal:3] Wait("SIP/1000-08626218", "10") in new stack
== Spawn extension (from-internal, 1029, 3) exited non-zero on 'SIP/1000-08626218'




this is my extension_custom.conf file

exten => 1029,1,ringing(1)
exten => 1029,2,system(/usr/local/bin/slimdisplay.pl --name=Squeezebox --line1=${CALLERIDNAME} --Line2=${CALLERIDNUM})
exten => 1029,3,wait(10)

and the squeezebox diplays 16 for a fraction of a second, think i must have a syntax wrong any ideas?