Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Webserver, can I capture variables?

Questions and comments specific to a particular plugin should go here.
Post Reply
scastano
Posts: 10
Joined: Mon May 20, 2013 6:07 am

Webserver, can I capture variables?

Post 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?
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Webserver, can I capture variables?

Post 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
XBMC2 plugin to control XBMC. If you want to flatter me Image
scastano
Posts: 10
Joined: Mon May 20, 2013 6:07 am

Re: Webserver, can I capture variables?

Post by scastano »

BINGO!!!

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