Extension in call notification via netcat

Hey guys,

I want to send a notification to a home automation server i’m running when a specified extension is in call.

I get that i can use the command line tool netcat to send the message, but how do i get freepbx to initiate the command?

i found some info on the net, but it seems to me it’s not that easy.

Anyone who can help?

Thanks!

You could do that with a bit of custom work and add a “system call” to /bin/nc conditionally, you will have to do that for both incoming and outgoing calls, so no it is not easy and will possibly break things on an update.

I would however suggest that you look into AMI , it is better designed to do what you wish and runs asynchronously to your asterisk/FreePBX instance without touching it’s function.

https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239

and a simple bash script to base your code on:-

http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Bash

If you are inquisitive you could also look how XMBC’s asterisk plugin does it in python

https://code.google.com/p/xbmc-pbx-addon/