I’m trying to find the best and easiest way (most probably not the same) to create some sort of speeddial to dial and open a door lock with one button press.
So we need to dial the internal extension of the door intercom, wait for it to answer, press a key (dtmf), wait, press another key (dtmf), wait for the doorlock to activate and hangup.
I’m thinking of some custom code that calls the door phone, waits a second, plays the DTMF code, waits 2 seconds and hangs up. And have a virtual extension forwarded to this script.
I’m not good at writing code, i believe other people here are better at this than me. Or someone else has a better idea.
Write a context that answers the call, uses the PlayDTMF function, and hangs up. Connect it through the Custom/Miscellaneous functions on the GUI and make it available as a dialed extension.
There are plenty of examples here on the forums - search for playdtmf.
Custom dial plan is done with a “Custom Destination”. For your example above, you would create a custom destination with a Goto string of:
door-intercom,900,1
and then use this destination in the GUI to direct the call. If you need a dialable feature code, use a Misc Application.
However, your dial string is not going to work as it’s mis-formatted. You also need to look at the help for the Dial application, and the option to pass DTMF post answer is with the D option, so it will look something like: