Handling of DTMF tones

We are implementing a small departmental application with Asterisk, and of course Asterisk has to play nice with the company-wide VOIP telephony system (CISCO). And, as you can imagine, the people supporting that system are not too enthusiast to help us start with Asterisk. There is something strange going on with the handling of DTMF tones. Not sure if this is anything in the configuration of Asterisk - or the config of the Cisco-system -, or maybe I stumbled upon a bug…

Anyway, when Asterisk receives an incoming call via the company telephony system, I see on network-level an SIP INVITE message that has no SDP header. Therefore no indication of audio-codecs or dtmf-methods that are supported. Asterisk replies in its 200 OK message that it supports ulaw and alaw (that’s how it is configured), but also nothing about DTMF (telephone-event). Result: audio is transmitted fine in both directions, DTMF tones are completely lost. Not inband, not outband, only silence.

I found that I can fix that by commenting out two lines in chan_sip.c - but I doubt very much that hacking the source code is the best way to solve this problem.

Did you set 4 values for dtmfmode in your sip.conf and test them ?

Choices are inband, rfc2833, info or auto

Depending on the MTP options, Cisco uses late offer SDP. However Asterisk not offering media events is the result of misconfiguring the dtmfmode option, on the Asterisk side.

Tried again. Asterisk 1.8.6.0, with the default samples installed.
I set all four possibilities in the [general] context in sip.conf, then did a ‘sip reload’ - but no luck.
sip debug shows

[Apr 12 11:55:38] VERBOSE[9506] chan_sip.c: Capabilities: us - 0x80000008000e (gsm|ulaw|alaw|h263|testlaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
[Apr 12 11:55:38] VERBOSE[9506] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)

(the ‘telephone-event’ for ‘us’ is only there if dtmfmode is rfc2833 or auto - so the changes in the sip.conf file are being picked up)

However, when I do change the source code of chan_sip.c, the same lines read

[Apr 12 12:31:10] VERBOSE[11084] chan_sip.c: Capabilities: us - 0x80000008000e (gsm|ulaw|alaw|h263|testlaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
[Apr 12 12:31:10] VERBOSE[11084] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)

  • and then it also does work. DTMF tones are send out-of-band, and are correctly interpreted by Asterisk.

I don’t believe there is a bug in this area, so have to assume that you have misconfigured something.

Are you sure it is valid in the general section?

I’m sorry if I was sounding like ‘it’s a bug’. You’re right, it is much more likely a configuration problem. The question then still is ‘where do I have to change what’