[Freeswitch-users] Hint for DTMF handling in sofia.c
Helmut Kuper
helmut.kuper at ewetel.de
Thu Jan 8 03:46:12 PST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
today we found a DTMF problem in an older FS build. We weren't able to
pass "*" and "#" to PSTN. FS sents those chars as "0". I fixed that on
my own. After that I searched in build 11055M to if it was already fixed
in trunk.
I found it was fixed in parts. I found that in INFO messages of
application type "dtmf-relay" the rfc2833 DTMF events "*#ABCD" are now
handled correct, but "EF" are still ignored. In INFO messages of
application type "dtmf" EVENTS 0-9 are considered. The others are still
ignored resp. changed to "0".
So I would recommend to replace the code beginning in line 3535
<<<<<<<<<<<<<<<<<<
if (*signal_ptr && (*signal_ptr == '*' || *signal_ptr == '#' ||
*signal_ptr == 'A' || *signal_ptr == 'B' || *signal_ptr == 'C' ||
*signal_ptr == 'D')) {
dtmf.digit = *signal_ptr;
} else {
tmp = atoi(signal_ptr);
dtmf.digit =
switch_rfc2833_to_char(tmp);
}
<<<<<<<<<<<<<<<<<<
with this two lines:
>>>>>>>>>>>>>>
tmp=switch_char_to_rfc2833(*signal_ptr);
dtmf.digit = switch_rfc2833_to_char(tmp);
>>>>>>>>>>>>>>
This will handle all rfc2833 dtmf events in dtmf-relay INFO messages
correctly. This is tested by me with snom and AVM clients.
Further replace the line 3556
<<<<<<<<<<<<<<
int tmp = atoi(sip->sip_payload->pl_data);
<<<<<<<<<<<<<<
with this line:
>>>>>>>>>>>>>>
int tmp=switch_char_to_rfc2833(*(sip->sip_payload->pl_data));
>>>>>>>>>>>>>>
That should handle all rfc2833 DTMF-Events in dtmf INFO messages.
This last patch isn't tested by me, cause I've no phone which genereates
INFO messages of type applicatin/dtmf...
best regards and a late "happy new year" to all of u!
Helmut
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
iEYEARECAAYFAkll54QACgkQ4tZeNddg3dxJgwCfULx8X9hw6xDd1q8r/Iih5unx
c6EAn1T/7GK56pLLrMi140x50HLnO6i1
=3ENR
-----END PGP SIGNATURE-----
More information about the FreeSWITCH-users
mailing list