Distributed Device State using XMPP

I’m have a need to monitor DAHDI device states across servers. I’ve followed the instruction listed HERE and have gotten to the point of having jabber connected to the XMPP server.

If I understand it correctly, my next step is to add a function to the dialplan that will change the state on the XMPP server but I’m not sure how to code this functionality into FreePBX. Are there any hooks built into the dialplan that I can use? Any help appreciated!

So I’m as far as being able to update the device state from the command line. How can I hook it into the dialplan? Are there mechanisms already in place? Can I use extensions_custom.conf or will I have to dig into FreePBX itself?

I just need a little pointer in the right direction.

BTW, I’m using FreePBX 2.9.x and Asterisk 1.8.14.x on CentOS

well after a few days effort, I’ve gotten it to work! Yay!

Now I’m trying to figure out how to change the custom devstate when a dahdi channel goes offhook and then back onhook. I added the following to extensions_custom.conf

[macro-dialout-trunk-predial-hook]
exten => s,1,Set(DEVICE_STATE(Custom:abc)=INUSE)

which nicely sets the line in use. I’m not sure how to handle hanging up. I need to Set(DEVICE_STATE(Custom:abc)=NOT_INUSE) and I’m not sure how to hook that into the dialplan.

Any help?

So uhh what’s the secret handshake?

Developers don’t hang out in the forums.

No secret handshake. They meet live on IRC.

ok, thanks. I’ll try there.

Got it. DHADI states now distributed. It took hacking in functions.php but at least it works.

Would you mind showing your functions.php changes with a diff or similar?

It turned out I didn’t need to patch anything. Go into advanced settings and make sure the usedevstates is on and you should start seeing additional devstates created. I was able to get what I need working with tigase/mysql.