[Asterisk-Dev] DTMF Error
Brent Franks
mwless at mindworks.net
Tue Dec 30 17:30:52 MST 2003
-----Original Message-----
From: asterisk-dev-admin at lists.digium.com
[mailto:asterisk-dev-admin at lists.digium.com] On Behalf Of Olle E.
Johansson
Sent: Tuesday, December 30, 2003 4:53 PM
To: asterisk-dev at lists.digium.com
Subject: Re: [Asterisk-Dev] DTMF Error
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
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'
fo
r '%s'\n", digit, chan->name);
return -1;
}
}
return 0;
More information about the asterisk-dev
mailing list