<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Fixedsys;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 129.75pt 1.0in 129.7pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Well from <b>switch_core_chat_send</b> it's hardcoded &quot;dp&quot; as the protocol when <b>argv[0]</b> is the actual protocol being passed from the <b>chat</b> API argument.<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'>//-------------------------------------------------------------------------------------------</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>SWITCH_STANDARD_API(chat_api_function)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>char</span> *lbuf = NULL, *argv[5];<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>int</span> argc = 0;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> (!zstr(cmd) &amp;&amp; (lbuf = strdup(cmd))<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;&amp; (argc = switch_separate_string(lbuf, <span style='color:#A31515'>'|'</span>, argv, (<span style='color:blue'>sizeof</span>(argv) / <span style='color:blue'>sizeof</span>(argv[0])))) &gt;= 4) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> (switch_core_chat_send(argv[0], <span style='color:#A31515'>&quot;dp&quot;</span>, argv[1], argv[2], <span style='color:#A31515'>&quot;&quot;</span>, argv[3], !zstr(argv[4]) ? argv[4] : NULL, <span style='color:#A31515'>&quot;&quot;</span>) == SWITCH_STATUS_SUCCESS) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stream-&gt;write_function(stream, <span style='color:#A31515'>&quot;Sent&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style='color:blue'>else</span> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stream-&gt;write_function(stream, <span style='color:#A31515'>&quot;Error! Message Not Sent&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style='color:blue'>else</span> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stream-&gt;write_function(stream, <span style='color:#A31515'>&quot;Invalid&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch_safe_free(lbuf);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>return</span> SWITCH_STATUS_SUCCESS;<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys'>}</span><o:p></o:p></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'>//-------------------------------------------------------------------------------------------</span><o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>Then here in sophia_prescence.c &nbsp;it prepends &#8220;dp+&#8221; to the sip <b>From</b> URI.&nbsp; The &#8220;dp+&#8221; can cause issues downstream when the sip <b>MESSAGE</b> is gets routed outbound from the FS box... should be an option to turn it off&#8230; <o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>From: \&quot;+15186819448\&quot; &lt;sip:dp++15186819448@65.41.13.124&gt;;tag=FUetK564c4egm\\r\\n<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>John<o:p></o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'>//-------------------------------------------------------------------------------------------</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys;color:blue'>if</span><span style='font-size:10.0pt;font-family:Fixedsys'> (!strcasecmp(proto, SOFIA_CHAT_PROTO)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from = hint;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style='color:blue'>else</span> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>char</span> *fp, *p = NULL;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fp = strdup(from);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> (!fp) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, <span style='color:#A31515'>&quot;Memory Error!\n&quot;</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>goto</span> end;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> ((p = strchr(fp, <span style='color:#A31515'>'@'</span>))) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *p++ = <span style='color:#A31515'>'\0'</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> (zstr(p)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p = profile-&gt;domain_name;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span> (zstr(p)) {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p = host;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ffrom = switch_mprintf(<span style='color:#A31515'>&quot;\&quot;%s\&quot; &lt;sip:%s+%s@%s&gt;&quot;</span>, fp, proto, fp, p);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from = ffrom;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch_safe_free(fp);<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><o:p></o:p></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'>//-------------------------------------------------------------------------------------------<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'><o:p>&nbsp;</o:p></span></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText><o:p>&nbsp;</o:p></p><p class=MsoPlainText>&gt; -----Original Message-----</p><p class=MsoPlainText>&gt; From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-</p><p class=MsoPlainText>&gt; </p><p class=MsoPlainText>&gt; It's not a bug, you are being presumptuous.</p><p class=MsoPlainText>&gt; </p><p class=MsoPlainText>&gt; Every chat interface has a proto prefix that helps FS to route the messages to</p><p class=MsoPlainText>&gt; the right module.</p><p class=MsoPlainText>&gt; you sent it from mod_commands which chose the dp realm to advertise dp+</p><p class=MsoPlainText>&gt; </p><p class=MsoPlainText>&gt; if you came in from SIP it is sip+ and conference are conf+ etc.....</p><p class=MsoPlainText>&gt; </p><p class=MsoPlainText>&gt; </p><p class=MsoPlainText>&gt; On Wed, Jan 19, 2011 at 1:43 PM, John Rose &lt;<a href="mailto:johnrose@comtex.net"><span style='color:windowtext;text-decoration:none'>johnrose@comtex.net</span></a>&gt; wrote:</p><p class=MsoPlainText>&gt; &gt;&gt; -----Original Message-----</p><p class=MsoPlainText>&gt; &gt;&gt; From: John Rose [mailto:johnrose@comtex.net]</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &gt;&gt; Why does the chat API command prefix a &quot;dp+&quot; onto the From URI when I</p><p class=MsoPlainText>&gt; &gt;&gt; call the chat API? &nbsp;Here is an argument that I am using:</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &quot;sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125</p><p class=MsoPlainText>&gt; &gt;&gt; |</p><p class=MsoPlainText>&gt; &gt;&gt; Test message.&quot;</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &gt;&gt; Then the From header:</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &gt;&gt; From: \&quot;+15186819448\&quot;</p><p class=MsoPlainText>&gt; &gt;&gt; &lt;sip:dp++15186819448@65.41.13.124&gt;;tag=FUetK564c4egm\\r\\n</p><p class=MsoPlainText>&gt; &gt;&gt;</p><p class=MsoPlainText>&gt; &gt;</p><p class=MsoPlainText>&gt; &gt;</p><p class=MsoPlainText>&gt; &gt; Argh, after looking through the code I think this is a FS bug where it</p><p class=MsoPlainText>&gt; &gt; was intended for this &quot;dp+&quot; to be prefixed in the Jingle protocol</p><p class=MsoPlainText>&gt; &gt; under certain circumstances not SIP.... looks very suspicious...</p><p class=MsoPlainText>&gt; &gt;</p><p class=MsoPlainText>&gt; &gt; John</p><p class=MsoPlainText>&gt; &gt;</p></div></body></html>