<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> </o:p></p><p class=MsoPlainText>Well from <b>switch_core_chat_send</b> it's hardcoded "dp" 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> </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'> <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'> <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> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> <span style='color:blue'>if</span> (!zstr(cmd) && (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'> && (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])))) >= 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> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> <span style='color:blue'>if</span> (switch_core_chat_send(argv[0], <span style='color:#A31515'>"dp"</span>, argv[1], argv[2], <span style='color:#A31515'>""</span>, argv[3], !zstr(argv[4]) ? argv[4] : NULL, <span style='color:#A31515'>""</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'> stream->write_function(stream, <span style='color:#A31515'>"Sent"</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> } <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'> stream->write_function(stream, <span style='color:#A31515'>"Error! Message Not Sent"</span>);<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'> } <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'> stream->write_function(stream, <span style='color:#A31515'>"Invalid"</span>);<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'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> 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'> <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> </o:p></p><p class=MsoPlainText>Then here in sophia_prescence.c it prepends “dp+” to the sip <b>From</b> URI. The “dp+” 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… <o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>John<o:p></o:p></p><p class=MsoPlainText><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=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'> from = hint;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> } <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'> <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'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> 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> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> <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'> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, <span style='color:#A31515'>"Memory Error!\n"</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> <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'> }<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'> <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'> *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'> }<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'> <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'> p = profile->domain_name;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> <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'> p = host;<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'> }<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'> ffrom = switch_mprintf(<span style='color:#A31515'>"\"%s\" <sip:%s+%s@%s>"</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> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> from = ffrom;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:Fixedsys'> switch_safe_free(fp);<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'>//-------------------------------------------------------------------------------------------<o:p></o:p></span></p><p class=MsoPlainText><span style='font-size:10.0pt;font-family:Fixedsys;color:green'><o:p> </o:p></span></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>> -----Original Message-----</p><p class=MsoPlainText>> From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-</p><p class=MsoPlainText>> </p><p class=MsoPlainText>> It's not a bug, you are being presumptuous.</p><p class=MsoPlainText>> </p><p class=MsoPlainText>> Every chat interface has a proto prefix that helps FS to route the messages to</p><p class=MsoPlainText>> the right module.</p><p class=MsoPlainText>> you sent it from mod_commands which chose the dp realm to advertise dp+</p><p class=MsoPlainText>> </p><p class=MsoPlainText>> if you came in from SIP it is sip+ and conference are conf+ etc.....</p><p class=MsoPlainText>> </p><p class=MsoPlainText>> </p><p class=MsoPlainText>> On Wed, Jan 19, 2011 at 1:43 PM, John Rose <<a href="mailto:johnrose@comtex.net"><span style='color:windowtext;text-decoration:none'>johnrose@comtex.net</span></a>> wrote:</p><p class=MsoPlainText>> >> -----Original Message-----</p><p class=MsoPlainText>> >> From: John Rose [mailto:johnrose@comtex.net]</p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> >> Why does the chat API command prefix a "dp+" onto the From URI when I</p><p class=MsoPlainText>> >> call the chat API? Here is an argument that I am using:</p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> "sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125</p><p class=MsoPlainText>> >> |</p><p class=MsoPlainText>> >> Test message."</p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> >> Then the From header:</p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> >> From: \"+15186819448\"</p><p class=MsoPlainText>> >> <sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n</p><p class=MsoPlainText>> >></p><p class=MsoPlainText>> ></p><p class=MsoPlainText>> ></p><p class=MsoPlainText>> > Argh, after looking through the code I think this is a FS bug where it</p><p class=MsoPlainText>> > was intended for this "dp+" to be prefixed in the Jingle protocol</p><p class=MsoPlainText>> > under certain circumstances not SIP.... looks very suspicious...</p><p class=MsoPlainText>> ></p><p class=MsoPlainText>> > John</p><p class=MsoPlainText>> ></p></div></body></html>