Delayed DTMF code for Door Relay

Anyone have another step to try? Is there any other data I can provide that would be beneficial?

It is happening at line 270 and it is showing in the trace. It looks to me as though it takes 2 to 3 seconds to complete.

Yes, however, I hear nothing on the call as I would expect to and the relay doesnā€™t close.

I can manually dial 3# and the relay closes as programmed.

You wonā€™t hear anything as the call isnā€™t bridged during the sending.

Also, the call seems to be hung up after 3 seconds, so Iā€™m not sure how you found time to manually enter anything. [ Turns out this is just when the local channel optimises out. ]

There is a slight possibility that the local channel is optimising out too quickly. I donā€™t know if you are in a position to disable the optimisation (/n at the end of the local channel dial string).

Enabling DTMF logging should tell you if and when the digits are sent.

Because of the local channels, it might be safer to use the U option, and do the DTMF sending from a subroutine. It looks like the answer is propagating back immediately, and it is possible that the first DTMF digit is triggering the local channel optimisation, which is loosing the digits.

Forgive me for not understanding completely. Would I replace the D with a U?

[DC_Panic]
exten => talk,1,Dial(local/35999@from-internal,,U(wwww3#))
same => n,Wait(2)
same => n,Hangup

See ā€œExample: Dial with post-answer subroutine executed on outbound channelā€ in Asterisk 16 Application_Dial - Asterisk Project - Asterisk Project Wiki and, more generally, the descriptions of the individual options.

You will probably need SendDTMF, and Return, as well.

1 Like

I would start with trying the earlier solution and post a log that has DTMF logging enabled

Thank you @david55! I am learning more about Asterisk and understand some syntax but still lost. Managing FreePBX is 1 of 4 major areas I am over within my company and I am planning on taking Asterisk training soon. In the meantimeā€¦ :slight_smile:

Iā€™m assuming that the ARG1 and ARG2 are variables and those variables are being defined here:
exten => s,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})

For my application what do you suggest?

[my_gosub_routine]
exten => s,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Playback(hello)
same => n,Return()
[default]
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/alice,,U(my_gosub_routine^my_gosub_arg1^my_gosub_arg2))
same => n,Hangup()

@PitzKey, a search on enabling DTMF logging in Asterisk suggests editing the logger.conf file. That file isnā€™t writeable so Iā€™m assuming I would edit the logger_logfiles_custom.conf and add this line?
console => debug,error,notice,verbose,warning,dtmf

No. That line does nothing, except for the side effect of logging its expanded parameter list.

${ARG1} etc., are variable references, but as is common for variables with such names, they are positional parameters, and set to my_gosub_arg1 and my_gosub_arg2 in

same => n,Dial(PJSIP/alice,,U(my_gosub_routine^my_gosub_arg1^my_gosub_arg2))

You might not need any parameters.


1 Like

Which earlier solution? There have been multiple attempts and my brain hurts. :face_with_diagonal_mouth:

This one

This should not require any custom dial plan or other complexity. I donā€™t have a Snom but just tested the below with an ATA, hearing the DTMF played at the destination:

  1. Create a Custom Trunk with Custom Dial String set to PJSIP/35999 and Asterisk Trunk Dial Options set to D(www3#)
  2. Create an Outbound Route with match pattern set to *0911, pointing at the above trunk.
  3. If your Speed Dial Prefix is set to the default *0, you must disable it, change the code, or use something other than *0911 for the trigger.
  4. Test. If the Snom answers but the DTMF is not sent, try forcing DTMF in-band audio for the extension.

If you still have trouble, paste a log, including SIP trace and DTMF.

1 Like

With DTMF logging enabled.

https://pastebin.freepbx.org/view/5c4b0e16

@Stewart1, even though this is internal and never leaves the system?

Iā€™m not attached to *0911 per sayā€¦I can change it.

A normal outside caller would not be able to reach it via an IVR. If you have DISA or intra-company trunks and want to block those users from reaching it, set the CallerID field on the Outbound Route accordingly. (However, they would still be able to call 35999 directly and manually dial 3#.)

I would still need the call to terminate after DTMF is sent.

Asterisk Trunk Dial Options: D(www3#)L(5000)

Will hang up after 5 seconds.

1 Like

Would this be an Intra-Company route since itā€™s internal only?