[Asterisk-Dev] DTMF Error
Brent Franks
mwless at mindworks.net
Sun Jan 11 09:33:28 MST 2004
Brent Franks wrote:
> WARNING[1236268096]: File channel.c, Line 1296 (do_senddigit): Unable
to
> handle DTMF tone 'f' for 'SIP/####-####'
>
Olle E. Johnson wrote:
>>SIP DTMF only defines A-D, not 'f'
>>http://www.voip-info.org/tiki-index.php?page=SIP+DTMF+Signalling
>>If there an 'f' and who's sending it for what?
>>/O
>>>Brent Franks wrote:
>>>The Polycom Soundpoint IP 500 Phones send a DTMF code of 'f' when the
>>>mic mute button is pressed a second time (e.g. the phone is unmuted).
>>>To resolve this, I simply changed the channel.c file and made it so
that
>>>Asterisk logs the error, but does not return a -1 and disconnect the
>>>call. I think that returning -1 (thus killing the call) is a bit
>>>extreme for this type of error.
>>>I was able to resolve this two ways. The way below, I simply created
>>>another else if statement saying: else if (digit == 'f');
>>>Another way to resolve it is to get rid of the return -1;.
>>>- Brent
>>> if (f && (f->frametype == AST_FRAME_VOICE) &&
>>> chan->generatordata) {
>>> /*
>>> * Device does not support DTMF tones, lets fake
>>> * it by doing our own generation. (PM2002)
>>> */
>>> static const char* dtmf_tones[] = {
>>> "!941+1336/50,!0/50", /* 0 */
>>> "!697+1209/50,!0/50", /* 1 */
>>> "!697+1336/50,!0/50", /* 2 */
>>> "!697+1477/50,!0/50", /* 3 */
>>> "!770+1209/50,!0/50", /* 4 */
>>> "!770+1336/50,!0/50", /* 5 */
>>> "!770+1477/50,!0/50", /* 6 */
>>> "!852+1209/50,!0/50", /* 7 */
>>> "!852+1336/50,!0/50", /* 8 */
>>> "!852+1477/50,!0/50", /* 9 */
>>> "!697+1633/50,!0/50", /* A */
>>> "!770+1633/50,!0/50", /* B */
>>> "!852+1633/50,!0/50", /* C */
>>> "!941+1633/50,!0/50", /* D */
>>> "!941+1209/50,!0/50", /* * */
>>> "!941+1477/50,!0/50" }; /* # */
>>> if (digit >= '0' && digit <='9')
>>> ast_playtones_start(chan,0,dtmf_tones[digit-'0'],
0);
>>> else if (digit >= 'A' && digit <= 'D')
>>>
ast_playtones_start(chan,0,dtmf_tones[digit-'A'+10], >>> 0);
>>> else if (digit == '*')
>>> ast_playtones_start(chan,0,dtmf_tones[14], 0);
>>> else if (digit == '#')
>>> ast_playtones_start(chan,0,dtmf_tones[15], 0);
>>> else if (digit == 'f');
>>> else {
>>> /* not handled */
>>> ast_log(LOG_WARNING, "Unable to handle DTMF tone
'%c'
>>> for '%s'\n", digit, chan->name);
>>> return -1;
>>> }
>>> }
>>> return 0;
For the upcoming release of 0.7.0 should * return -1; for the else
clause above? It seems that cutting off a call for an unhandled dtmf
tone is a bit servere. Maybe just simply log the error and send it to
the consolve, but don't return -1?
I would assume that as time progresses and more companies begin to
develop SIP phones, that some of these devices will send odd DTMF tones
that typically aren't handled, like F in my case of the Polycom SIP 500.
Just a thought?
- Brent
More information about the asterisk-dev
mailing list