<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>SIP INFO based DTMF detection problem and remedy.</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Hi</FONT><FONT SIZE=2 FACE="Arial"> All,</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">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.</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">In the traces I saw the following when I pressed a key on the phone (in this example, key=4):</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">**************************************************************************************************************</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">I send 489 bytes to udp/[44.33.22.11]:5060 at 16:43:54.656234:</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; ------------------------------------------------------------------------</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; SIP/2.0 200 OK</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; Via: SIP/2.0/UDP 44.33.22.11:5060;rport=5060;branch=z9hG4bK848e4e821f09dcf2847c25da87f5296b</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; From: &lt;sip:27118091700@44.33.22.11:5060&gt;;tag=GR52RWG346-34</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; To: &quot;unknown&quot; &lt;sip:878050000@99.88.77.66&gt;;tag=7pBSryH1mjBUg</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; Call-ID: a666e4af-d996-122a-9e99-000a9d08b6ea</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; CSeq: 4 INFO</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; User-Agent: FreeSWITCH(mod_sofia)</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE, REGISTER, INFO</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; Supported: 100rel, precondition</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; Content-Length: 0</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; </FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">&nbsp;&nbsp; ------------------------------------------------------------------------</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">nta: sent 200 OK for INFO (4)</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">nua(0x815c130): event i_info 200 OK</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">nua: nua_event: entering</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">[33m2007-09-09 18:43:54 [DEBUG] sofia.c:1643 sofia_handle_sip_i_info() Unknown INFO Recieved:&nbsp; sip:27118091700@44.33.22.11:5060[signal=4</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">duration=100]</FONT> </SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">**************************************************************************************************************</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Looking through the code, I found in sofia.c:</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">**************************************************************************************************************</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">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[])</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">{</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">//placeholder for string searching</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">char *signal_ptr;</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">//Try and find signal information in the payload</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">signal_ptr = strstr(sip-&gt;sip_payload-&gt;pl_data, &quot;Signal=&quot;);</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">//See if we found a match</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">if (signal_ptr) {</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">struct private_object *tech_pvt = NULL;</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">switch_channel_t *channel = NULL;</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">char dtmf_digit[2] = { 0, 0 };</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">//Get the channel</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="System">channel = switch_core_session_get_channel(session);</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Etc.etc.</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">***************************************************************************************************************</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Note that the line &quot;</FONT><FONT SIZE=2 FACE="System">signal_ptr = strstr(sip-&gt;sip_payload-&gt;pl_data, &quot;Signal=&quot;);</FONT><FONT SIZE=2 FACE="Arial">&quot; has the 'S' in 'Signal=' capitalized. </FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">But from the above traces it appears sofia sends the INFO string through to freeswitch in lower case. </FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">That&#8217;s why freeswitch was not 'getting' the DTMF correctly.</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">After just changing this to lower case and recompiling - works perfectly!</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Not sure, but maybe the code needs to be ammended to check for both variants?</FONT></SPAN>
</P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">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.</FONT></SPAN></P>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Let me know if this was of any use. </FONT></SPAN>
</P>
<BR>

<P><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Best Regads</FONT> </SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">&nbsp;</FONT></SPAN>

<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Keith</FONT></SPAN>
</P>

</BODY>
</HTML>