Open the gate with a DTMF sequence while in a call with the entry phone

In my house i run both FreePBX and an home automation system.
I’m able to open my external gate by issuing an http GET request to an internal server:
e.g. http://internalserver/

I also installed an external ip SIP entry phone so that when someone rings the bell the call can answered by internal ip phones.

My need is very simple but I’m not able to realize it:

while in the call with the external entry phone, the internal user should be able to digit a DTMF sequence (feature code ?), e.g. “123”, for open the external gate. Asterisk should be able to recognize the DTMF sequence and run a simple system command like

'wget http://internalserver/"

No need to get the response from the command (i assume it always works)

Can you please help me ?

You might want start with:-

and follow up with how to use [applicationmap] and DYNAMIC_FEATURES

Thanks for your suggestions. I read the tutorial but I need a pratical examples to understand what file to edit in FreePbx and how . I think that, for a FreePbx expert, the solution should be very simple: how to run an application from a custom DTMF sequence.

I’m able to run the external command (to open the gate) dialing a custom destination. I found this very pratical guide for that:

I would need a similar post for the DTMF sequence too.


you can use the featuremap and applicationmap outside the dialplan if, as you say there is no need to check the result, just use “system” as the application and your “bash wget line” as the argument, get the callee/caller (probably callee) right or anyone who knows the code can open the gate from the outside.

This is a decent right up.

Understand that the programmers don’t hang out in the forums. They only like talking to other programmer types.

Most of us can hack a few lines of dial plan out but what you are asking about is not dial plan, you want to take actions while a call is inside a channel. This is a much different animal and may not touch much of FreePBX at all.

I would start with the latest Asterisk, The definitive Guide. Without that two or three day read you are really lost in the dessert. It’s a must for anyone serious about this endeavor. Also seek out the older version, Asterisk The future of telephony and read the forward and chapters 1 and 2 for a historical overview of the project.

As far as customizing FreePBX, if the file has the word custom in it that is used for user customization. There are examples in /etc/asterisk for all the different channel types, Asterisk control files and the dial plan itself. An hour of poking around in there and you should have an idea of how it all works. The wiki also has a brief write up on files.

The solution may be simple. If it was two lines of code you would have already been pointed at that.

You can also post a bounty and have someone do it for you.

I also would not use wget, this is what curl is designed for.