SIP INFO based DTMF detection problem and remedy.
Hi All, With Sofia talking to a gw using SIP INFO for DTMF transport, I was not able to get any DTMF based features (e.g. IVR) to work. In the traces I saw the following when I pressed a key on the phone (in this example, key=4): **************************************************************************** ********************************** I send 489 bytes to udp/[44.33.22.11]:5060 at 16:43:54.656234: ------------------------------------------------------------------------ SIP/2.0 200 OK Via: SIP/2.0/UDP 44.33.22.11:5060;rport=5060;branch=z9hG4bK848e4e821f09dcf2847c25da87f5296b From: <sip:27118091700@44.33.22.11:5060>;tag=GR52RWG346-34 To: "unknown" <sip:878050000@99.88.77.66>;tag=7pBSryH1mjBUg Call-ID: a666e4af-d996-122a-9e99-000a9d08b6ea CSeq: 4 INFO User-Agent: FreeSWITCH(mod_sofia) Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO Supported: 100rel, precondition Content-Length: 0 ------------------------------------------------------------------------ nta: sent 200 OK for INFO (4) nua(0x815c130): event i_info 200 OK nua: nua_event: entering [33m2007-09-09 18:43:54 [DEBUG] sofia.c:1643 sofia_handle_sip_i_info() Unknown INFO Recieved: sip:27118091700@44.33.22.11:5060[signal=4 duration=100] **************************************************************************** ********************************** Looking through the code, I found in sofia.c: **************************************************************************** ********************************** void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[]) { //placeholder for string searching char *signal_ptr; //Try and find signal information in the payload signal_ptr = strstr(sip->sip_payload->pl_data, "Signal="); //See if we found a match if (signal_ptr) { struct private_object *tech_pvt = NULL; switch_channel_t *channel = NULL; char dtmf_digit[2] = { 0, 0 }; //Get the channel channel = switch_core_session_get_channel(session); Etc.etc. **************************************************************************** *********************************** Note that the line "signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");" has the 'S' in 'Signal=' capitalized. But from the above traces it appears sofia sends the INFO string through to freeswitch in lower case. That's why freeswitch was not 'getting' the DTMF correctly. After just changing this to lower case and recompiling - works perfectly! Not sure, but maybe the code needs to be ammended to check for both variants? Would be interesting to know if this issue impacted any other freeswitch users - could also be an issue with my voip connection talking to kit not compling with latest standards. Let me know if this was of any use. Best Regads Keith
It sounds like the Sofia code needs to be a little more forgiving as far as case here. Some vendors may use uppercase and others lower. Sent from my iPhone On Sep 9, 2007, at 2:58 PM, "Keith Laaks" <keithl@voxtelecom.co.za> wrote:
Hi All,
With Sofia talking to a gw using SIP INFO for DTMF transport, I was not able to get any DTMF based features (e.g. IVR) to work.
In the traces I saw the following when I pressed a key on the phone (in this example, key=4):
*** *** *** *** *** *** *** *** *** *** *** *** *** *** ******************************************************************** I send 489 bytes to udp/[44.33.22.11]:5060 at 16:43:54.656234:
--- --------------------------------------------------------------------- SIP/2.0 200 OK Via: SIP/2.0/UDP 44.33.22.11: 5060;rport=5060;branch=z9hG4bK848e4e821f09dcf2847c25da87f5296b From: <sip:27118091700@44.33.22.11:5060>;tag=GR52RWG346-34 To: "unknown" <sip:878050000@99.88.77.66>;tag=7pBSryH1mjBUg Call-ID: a666e4af-d996-122a-9e99-000a9d08b6ea CSeq: 4 INFO User-Agent: FreeSWITCH(mod_sofia) Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO Supported: 100rel, precondition Content-Length: 0
--- --------------------------------------------------------------------- nta: sent 200 OK for INFO (4) nua(0x815c130): event i_info 200 OK nua: nua_event: entering [33m2007-09-09 18:43:54 [DEBUG] sofia.c:1643 sofia_handle_sip_i_info () Unknown INFO Recieved: sip:27118091700@44.33.22.11:5060[signal=4
duration=100] *** *** *** *** *** *** *** *** *** *** *** *** *** *** ********************************************************************
Looking through the code, I found in sofia.c:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** ********************************************************************
void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[])
{
//placeholder for string searching char *signal_ptr;
//Try and find signal information in the payload signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");
//See if we found a match if (signal_ptr) { struct private_object *tech_pvt = NULL; switch_channel_t *channel = NULL; char dtmf_digit[2] = { 0, 0 };
//Get the channel channel = switch_core_session_get_channel(session); Etc.etc. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *********************************************************************
Note that the line "signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");" has the 'S' in 'Signal=' capitalized. But from the above traces it appears sofia sends the INFO string through to freeswitch in lower case.
That’s why freeswitch was not 'getting' the DTMF correctly.
After just changing this to lower case and recompiling - works perfectly!
Not sure, but maybe the code needs to be ammended to check for both variants?
Would be interesting to know if this issue impacted any other freeswitch users - could also be an issue with my voip connection talking to kit not compling with latest standards.
Let me know if this was of any use.
Best Regads
Keith
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I see no issue putting a patch in to change this to allow both, I would however like to know for sure what the standards say about what we should accept in this case, if it does not specify either way, we should just patch it to do case insensitive compare most likely. If it specifies only one way or another, I might want a config option to specify behavior, but would have to think a bit more if accepting more liberally there could cause other issues, it probably would not. All that being said, could you please post a bug to jira.freeswitch.org in regards to this with a patch and an rfc reference so we can get this merged into tree. Thanks Mike On 9/9/07, Jason Garland <jgarland@gmail.com> wrote:
It sounds like the Sofia code needs to be a little more forgiving as far as case here. Some vendors may use uppercase and others lower.
Sent from my iPhone
On Sep 9, 2007, at 2:58 PM, "Keith Laaks" <keithl@voxtelecom.co.za> wrote:
Hi All,
With Sofia talking to a gw using SIP INFO for DTMF transport, I was not able to get any DTMF based features (e.g. IVR) to work.
In the traces I saw the following when I pressed a key on the phone (in this example, key=4):
************************************************************************************************************** I send 489 bytes to udp/[44.33.22.11]:5060 at 16:43:54.656234:
------------------------------------------------------------------------ SIP/2.0 200 OK Via: SIP/2.0/UDP 44.33.22.11:5060 ;rport=5060;branch=z9hG4bK848e4e821f09dcf2847c25da87f5296b From: <sip:27118091700@44.33.22.11:5060>;tag=GR52RWG346-34 To: "unknown" <sip:878050000@99.88.77.66>;tag=7pBSryH1mjBUg Call-ID: a666e4af-d996-122a-9e99-000a9d08b6ea CSeq: 4 INFO User-Agent: FreeSWITCH(mod_sofia) Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO Supported: 100rel, precondition Content-Length: 0
------------------------------------------------------------------------ nta: sent 200 OK for INFO (4) nua(0x815c130): event i_info 200 OK nua: nua_event: entering [33m2007-09-09 18:43:54 [DEBUG] sofia.c:1643 sofia_handle_sip_i_info() Unknown INFO Recieved: sip:27118091700@44.33.22.11:5060[signal=4
duration=100]
**************************************************************************************************************
Looking through the code, I found in sofia.c:
**************************************************************************************************************
void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[])
{
//placeholder for string searching char *signal_ptr;
//Try and find signal information in the payload signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");
//See if we found a match if (signal_ptr) { struct private_object *tech_pvt = NULL; switch_channel_t *channel = NULL; char dtmf_digit[2] = { 0, 0 };
//Get the channel channel = switch_core_session_get_channel(session); Etc.etc.
***************************************************************************************************************
Note that the line "signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");" has the 'S' in 'Signal=' capitalized. But from the above traces it appears sofia sends the INFO string through to freeswitch in lower case.
That's why freeswitch was not 'getting' the DTMF correctly.
After just changing this to lower case and recompiling - works perfectly!
Not sure, but maybe the code needs to be ammended to check for both variants?
Would be interesting to know if this issue impacted any other freeswitch users - could also be an issue with my voip connection talking to kit not compling with latest standards.
Let me know if this was of any use.
Best Regads
Keith
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Can you paste the INFO message the phone sent and not the 200 OK freeswitch sent as the responce? On 9/9/07, Keith Laaks <keithl@voxtelecom.co.za> wrote:
Hi All,
With Sofia talking to a gw using SIP INFO for DTMF transport, I was not able to get any DTMF based features (e.g. IVR) to work.
In the traces I saw the following when I pressed a key on the phone (in this example, key=4):
************************************************************************************************************** I send 489 bytes to udp/[44.33.22.11]:5060 at 16:43:54.656234:
------------------------------------------------------------------------ SIP/2.0 200 OK Via: SIP/2.0/UDP 44.33.22.11:5060;rport=5060;branch=z9hG4bK848e4e821f09dcf2847c25da87f5296b From: <sip:27118091700@44.33.22.11:5060>;tag=GR52RWG346-34 To: "unknown" <sip:878050000@99.88.77.66>;tag=7pBSryH1mjBUg Call-ID: a666e4af-d996-122a-9e99-000a9d08b6ea CSeq: 4 INFO User-Agent: FreeSWITCH(mod_sofia) Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO Supported: 100rel, precondition Content-Length: 0
------------------------------------------------------------------------ nta: sent 200 OK for INFO (4) nua(0x815c130): event i_info 200 OK nua: nua_event: entering [33m2007-09-09 18:43:54 [DEBUG] sofia.c:1643 sofia_handle_sip_i_info() Unknown INFO Recieved: sip:27118091700@44.33.22.11:5060[signal=4
duration=100] **************************************************************************************************************
Looking through the code, I found in sofia.c:
**************************************************************************************************************
void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[])
{
//placeholder for string searching char *signal_ptr;
//Try and find signal information in the payload signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");
//See if we found a match if (signal_ptr) { struct private_object *tech_pvt = NULL; switch_channel_t *channel = NULL; char dtmf_digit[2] = { 0, 0 };
//Get the channel channel = switch_core_session_get_channel(session); Etc.etc. ***************************************************************************************************************
Note that the line "signal_ptr = strstr(sip->sip_payload->pl_data, "Signal=");" has the 'S' in 'Signal=' capitalized. But from the above traces it appears sofia sends the INFO string through to freeswitch in lower case.
That's why freeswitch was not 'getting' the DTMF correctly.
After just changing this to lower case and recompiling - works perfectly!
Not sure, but maybe the code needs to be ammended to check for both variants?
Would be interesting to know if this issue impacted any other freeswitch users - could also be an issue with my voip connection talking to kit not compling with latest standards.
Let me know if this was of any use.
Best Regads
Keith _______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Jason Garland
-
Keith Laaks
-
Michael Jerris