Ok so im diving in with both feet here. ill be the first to say I know extremely little about xap and also the plugin. thus far ive just just xap as a conduit for 1 wire temp sensors that are located both on my HS PC and on another PC. I use the hubconsole, and all that works great.
so now I have decided to take the next step and a bit of a big one at that and delve into the idea of beginnings of integration between the asterisk open source PBX, xap and homeseer.
on the lowest level right now what im tryingto do is be able to dial an extension on a telephone and have it turn a light on or off.. in the crudest form im not even yet worried about confirming the light actually did turn on...
so I have a script written by one of the biggies in xap and runs as an AGI on asterisk. I dial an extension, the script runs and sends a simple string of data over the conduit, right now it sends the strings "execx9" and "execx10". if I dial 4799 on my phone I infact see the string "execx10" come across the conduit, homeseer plugin sees it, I set it to work in raw xap mode as basic control wasnt an option given to me, when I dial 4798 it sends execx9 over the conduit.. the homeseer device created by the plugin changes its display in the HS GUI correctly so I know im doing something right with configuring stuff.
now here is where I run into a bit of a block.. trying to get a xap variable to set and trigger a homeseer event to occur.
so I wrote a simple homeseer script to turn on a light a2. seems really easy
then I went into the xap plugin and created an event called lighton, the sequence name is lighton I made it a homeseer command triggerscript and put lighton.txt in the data1 field.
then I created a xap variable using the xap message I got below from the asterisk box
ok seems simple enough so I opened the create variable dialog and gave it a name I put the source under source and the class under class however I have no section or item in my message above so I didnt put that in, I left those fields blank, then under event to run for update and variable change I put in lighton and saved it all.
I dial 4798 from the phone I see the HS device in the gui change to execx9 but my event doesnt fire.. same with 4799.. no good...
any help on where I went wrong would be greatly appreciated. and also I do have the source to the file that asterisk runs so if I need to add something to the xap message i can do that.. im not a great perl programmer but I can figure out a few things with it on the asterisk PBX end.
-christopher
so now I have decided to take the next step and a bit of a big one at that and delve into the idea of beginnings of integration between the asterisk open source PBX, xap and homeseer.
on the lowest level right now what im tryingto do is be able to dial an extension on a telephone and have it turn a light on or off.. in the crudest form im not even yet worried about confirming the light actually did turn on...
so I have a script written by one of the biggies in xap and runs as an AGI on asterisk. I dial an extension, the script runs and sends a simple string of data over the conduit, right now it sends the strings "execx9" and "execx10". if I dial 4799 on my phone I infact see the string "execx10" come across the conduit, homeseer plugin sees it, I set it to work in raw xap mode as basic control wasnt an option given to me, when I dial 4798 it sends execx9 over the conduit.. the homeseer device created by the plugin changes its display in the HS GUI correctly so I know im doing something right with configuring stuff.
now here is where I run into a bit of a block.. trying to get a xap variable to set and trigger a homeseer event to occur.
so I wrote a simple homeseer script to turn on a light a2. seems really easy
then I went into the xap plugin and created an event called lighton, the sequence name is lighton I made it a homeseer command triggerscript and put lighton.txt in the data1 field.
then I created a xap variable using the xap message I got below from the asterisk box
PHP Code:
xap-header
{
v=12
hop=1
uid=FF000100
class=command.external
source=Asterisk.AGI.Perl
}
command.external
{
command=execx10
}
I dial 4798 from the phone I see the HS device in the gui change to execx9 but my event doesnt fire.. same with 4799.. no good...
any help on where I went wrong would be greatly appreciated. and also I do have the source to the file that asterisk runs so if I need to add something to the xap message i can do that.. im not a great perl programmer but I can figure out a few things with it on the asterisk PBX end.
-christopher
Comment