Why SendDTMF is not working?

Home » Asterisk Users » Why SendDTMF is not working?
Asterisk Users 6 Comments

Am 06.05.2012 13:46, schrieb Shahid H:
> Hello,
>
> I am having a problem with SendDTMF – it is not sending the numbers
> properly during the phone call.. I want the numbers key to to be
> pressed/sent automatically after 3 seconds during a phone call.

Log the actual DTMF to your console, set in logger.conf:

console => something,something,dtmf
^^^^

Then try again and check if you see the actual DTMF. If you do and it
still doesn’t work, try

dtmfmode=inband

for your voipms peer.

rfc2833 has been working always unreliable for me.

Also, I’m doing DTMF like this:

exten => 5000,n,Dial(SIP/123456@provider,,D(wwwwww1ww2ww3ww4))

Just use more w’s to generate your 3 seconds pause. No need for SendDTMF.

For more debugging just call yourself on your UK mobile from a softphone
and press digits and watch the console and listen on your mobile if you
hear the DTMF.

6 thoughts on - Why SendDTMF is not working?

  • Am 06.05.2012 13:46, schrieb Shahid H:

    PS: You are only allowing the GSM codec for your voipms peer, why? Maybe
    that is the reason why DTMF isn’t working properly. You should try alaw
    and ulaw, respectively both.

  • Thanks for the suggestion Markus. Here what I did:

    In the logger.config I have added ‘dtmf’:

    console => notice,warning,error,dtmf

    and then in sip.conf:

    allow=ulaw
    allow=alaw
    ; allow=gsm
    dtmfmode=inband

    I’ve added a test to call my mobile:

    exten => 123,1,Dial(SIP/+4477XXXXXXX@voipms,,D(wwwwwwww1ww2ww3ww4))
    exten => 123,n,Hangup()

    then restarted asterisk and logged into console (asterisk -r)

    I’ve call my mobile using softphone, I did not see 1,2,3,4 digits being
    sent on the console but I can hear broken/unclear DTMF on the mobile…

    however when I press digits on the softphone I can hear DTMF clear how it
    should be on my mobile and on the console it is showing DTMF:

    astrisk*CLI> [May 6 14:13:06] DTMF[28559]: channel.c:3082 __ast_read: DTMF
    begin ‘4’ received on SIP/test-0000001c
    [May 6 14:13:06] DTMF[28559]: channel.c:3092 __ast_read: DTMF begin
    passthrough ‘4’ on SIP/test-0000001c
    [May 6 14:13:06] DTMF[28559]: channel.c:2997 __ast_read: DTMF end ‘4’
    received on SIP/test-0000001c, duration 120 ms
    [May 6 14:13:06] DTMF[28559]: channel.c:3037 __ast_read: DTMF end accepted
    with begin ‘4’ on SIP/test-0000001c
    [May 6 14:13:06] DTMF[28559]: channel.c:3066 __ast_read: DTMF end
    passthrough ‘4’ on SIP/test-0000001c
    [May 6 14:13:07] DTMF[28559]: channel.c:3082 __ast_read: DTMF begin ‘5’
    received on SIP/test-0000001c
    [May 6 14:13:07] DTMF[28559]: channel.c:3092 __ast_read: DTMF begin
    passthrough ‘5’ on SIP/test-0000001c
    [May 6 14:13:07] DTMF[28559]: channel.c:2997 __ast_read: DTMF end ‘5’
    received on SIP/test-0000001c, duration 120 ms
    [May 6 14:13:07] DTMF[28559]: channel.c:3037 __ast_read: DTMF end accepted
    with begin ‘5’ on SIP/test-0000001c
    [May 6 14:13:07] DTMF[28559]: channel.c:3066 __ast_read: DTMF end
    passthrough ‘5’ on SIP/test-0000001c
    [May 6 14:13:08] DTMF[28559]: channel.c:3082 __ast_read: DTMF begin ‘6’
    received on SIP/test-0000001c
    [May 6 14:13:08] DTMF[28559]: channel.c:3092 __ast_read: DTMF begin
    passthrough ‘6’ on SIP/test-0000001c
    [May 6 14:13:08] DTMF[28559]: channel.c:2997 __ast_read: DTMF end ‘6’
    received on SIP/test-0000001c, duration 120 ms
    [May 6 14:13:08] DTMF[28559]: channel.c:3037 __ast_read: DTMF end accepted
    with begin ‘6’ on SIP/test-0000001c
    [May 6 14:13:08] DTMF[28559]: channel.c:3066 __ast_read: DTMF end
    passthrough ‘6’ on SIP/test-0000001c

    Thanks!

  • Now you have a totally different issue. 😎

    While the call is up do a “sip show channels” in the CLI. This will show you the ACTUAL codec for the call. Likely the call was still using GSM. Did you remember to put a disallow=all before the allow= lines?

    I recommend dtmfmode=rfc2833 with whatever codec you want to use. Inband DTMF will sound broken and distorted if it is sent over most codecs.

  • When I changed back to dtmfmode=rfc2833 and I cant hear the DTMF
    sound.. completely silent.

    Indeed I have put disallow=all before the allow=ulaw allow=alaw

    “sip show channels” in the CLI show during a call:

    78.129.xxx.xx +4477xxxxxxxx 15d909406db14d2 0x4 (ulaw) No
    Tx: ACK
    94.192.xxx.xx test MTNlNGNkYjlhODA 0x4 (ulaw)
    No Rx: ACK

    Still no luck to get DTMF to work 🙁

    Thanks
    Shahid

  • Hey guys,

    I have managed to get to work!!!! Thanks for the help..

    I just registered a new account at sipgate.co.uk and test it on asterisk…
    and DTMF worked well 🙂

    It seem voip.ms dont work well when sending DTMF to UK.

    Do anyone know UK/Europe voip provider to allow you change any callerID as
    you like without validation?

    I know voip.ms does it and sipgate don’t allow it.

    Thanks!