Automatically send dtmf to open doorphone

Hi all.
I am trying to figure this out. What I want to do is to have a mode to open the door automatically if the button is pressed.

Step 1: Create a call flow mode: Green = door automatically open, Red = Door opened manually.

Steop 2 open door automatically: (Note: DTMF to open door is “55”)
When the button is pressed it should be forwarded to a custom destination (I think)

This custom destination would be:

dooropen,s,1

in custom_conf would be a script (but this is the first time I try this, so please bear with me as I am propably using the wrong code or something)

[dooropen]
exten => s,1,Answer
exten => s,n,Wait(3)
exten => s,1,Dial(D(55))

Is this the correct way to do it?
I’m sorry if this is a stupid question, or if the code is completely wrong. I tried to figure this out by usng dr. Google…

First - Your priorities are messed up, the first line must be numbered 1, and all lines that follow should be n. You need a Hangup as you last line.

Second - I assume the doorphone is a local extension on the pbx like 100, correct? In which case you need to dial the door phone, wait for a bit then dial the door code, so your dial command would look like this:

Dial(local/[email protected],20,D(wwww55))

Where the number 20 indicates the timeout (seconds to wait for the doorphone to answer) and the w’s indicate a 0.5second wait after the door answers before the 55 is transmitted.

Thanks a lot for your help!

I’ll try this out and report back here.
If I understand correctly with this method you place a call to the doorphone and open it then.
Is it also possible to answer the call (like an IVR) and instead of playing a message or something, send dtmf tones?

Your way might also work, so I’ll give it a try ! Thanks a lot.

EDIT: Ok, I think I have it working. It works in a testing environment, will try it out tomorrow.
Thanks again a lot! Learnt a lot this way.