Page 1 of 1

Webserver, can I capture variables?

Posted: Mon May 20, 2013 6:14 am
by scastano
I'm working on integrating my phone systems, an asterisk based freepbx distribution and I can't seem to figure out how to capture variables sent to the webserver plugin.

I've got every phone call that comes in executing a web get to:

Code: Select all

http://eventghost.myhome.com/nothing.html?PHONEISRINGING&CallerIDName&CallerIDNumber
So I do get an action that works great and it comes in like:

Code: Select all

HTTP.PHONEISRINGING [u'Callers Name',u'1235551212']
I've got a macro setup to execute every time a call comes in and that's working great too.... What I can't figure out is, how to I capture the "Callers Name" and the phone number ("1235551212") in variables so I can use them in python scripts, single commands, on screen text displaces, growl notifications, etc....?

Anyone have any ideas, or a link to a good fully functional freepbx plugin with these options?

Re: Webserver, can I capture variables?

Posted: Mon May 20, 2013 10:30 am
by jonib
scastano wrote:

Code: Select all

HTTP.PHONEISRINGING [u'Callers Name',u'1235551212']
I've got a macro setup to execute every time a call comes in and that's working great too.... What I can't figure out is, how to I capture the "Callers Name" and the phone number ("1235551212") in variables so I can use them in python scripts, single commands, on screen text displaces, growl notifications, etc....?
You use the Python variable eg.event.payload to access the "[u'Callers Name',u'1235551212']" part of the event, eg.event.payload[0] gives you 'Callers Name' and eg.event.payload[1] the number.

jonib

Re: Webserver, can I capture variables?

Posted: Wed May 22, 2013 7:48 pm
by scastano
BINGO!!!

This is working great, thanks!! I'm capturing all kinds of good stuff now!!