Someone else will have to kick in now, I haven't played with SIMPLE or the chat api yet.<div><br></div><div>Regards,<br clear="all">João Mesquita<br>
<br><br><div class="gmail_quote">On Thu, Jan 20, 2011 at 12:31 AM, John Rose <span dir="ltr"><<a href="mailto:johnrose@comtex.net">johnrose@comtex.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Yes but there should be an option to turn it off. When a UA receives the MESSAGE Request the “dp+” gets displayed on some clients which is confusing and the reply needs to route back potentially though many sip hops with lookups etc.. Having a “dp+” prepended on the From URI may not be the best sip based solution for that, maybe adding a custom header perhaps?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">John</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>João Mesquita<br>
<b>Sent:</b> Wednesday, January 19, 2011 8:15 PM<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> Re: [Freeswitch-users] dp+ prefixed on From URI</span></p></div></div><div><div></div><div class="h5"><p class="MsoNormal">
</p><p class="MsoNormal">John, you should read what he wrote one more time. The code shows precisely what he said. I am going to quote here:</p><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">"<span><span style="font-size:10.0pt">you sent it from mod_commands which chose the dp realm to advertise dp+</span></span>"</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">If you _received_ a message from SIP, you would've seen the sip+ prefix and if you sent from the conference module, you would've seen the conf+ prefix on the event. Makes more sense now?</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Regards,</p></div><div><div><p class="MsoNormal" style="margin-bottom:12.0pt">João Mesquita<br><br></p><div><p class="MsoNormal">On Thu, Jan 20, 2011 at 12:10 AM, John Rose <<a href="mailto:johnrose@comtex.net" target="_blank">johnrose@comtex.net</a>> wrote:</p>
<div><div><p> </p><p>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.</p><p> </p><p><span style="font-size:10.0pt;font-family:Fixedsys;color:green">//-------------------------------------------------------------------------------------------</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys">SWITCH_STANDARD_API(chat_api_function)</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys">{</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];</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;</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </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))</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) {</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </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) {</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>);</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> } <span style="color:blue">else</span> {</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>);</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> } <span style="color:blue">else</span> {</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>);</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> switch_safe_free(lbuf);</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;</span></p>
<p><span style="font-size:10.0pt;font-family:Fixedsys">}</span></p><p><span style="font-size:10.0pt;font-family:Fixedsys;color:green">//-------------------------------------------------------------------------------------------</span></p>
<p> </p><p>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… </p>
<div><p> </p><p>From: \"+15186819448\" <<a href="mailto:sip%3Adp%2B%2B15186819448@65.41.13.124" target="_blank">sip:dp++15186819448@65.41.13.124</a>>;tag=FUetK564c4egm\\r\\n</p><p> </p><p> </p></div><p>John</p>
<p> </p><p><span style="font-size:10.0pt;font-family:Fixedsys;color:green">//-------------------------------------------------------------------------------------------</span></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)) {</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> from = hint;</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> } <span style="color:blue">else</span> {</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;</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> </span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> fp = strdup(from);</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> </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) {</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>);</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;</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </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>))) {</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>;</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </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)) {</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> p = profile->domain_name;</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)) {</span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:Fixedsys"> p = host;</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </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\" <<a>sip:%s+%s@%s</a>>"</span>, fp, proto, fp, p);</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> </span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> from = ffrom;</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys"> switch_safe_free(fp);</span></p><p><span style="font-size:10.0pt;font-family:Fixedsys"> }</span></p><p>
<span style="font-size:10.0pt;font-family:Fixedsys;color:green">//-------------------------------------------------------------------------------------------</span></p><div><p><span style="font-size:10.0pt;font-family:Fixedsys;color:green"> </span></p>
<p> </p><p> </p><p>> -----Original Message-----</p><p>> From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-" target="_blank">freeswitch-</a></p>
<p>> </p><p>> It's not a bug, you are being presumptuous.</p><p>> </p><p>> Every chat interface has a proto prefix that helps FS to route the messages to</p><p>> the right module.</p><p>> you sent it from mod_commands which chose the dp realm to advertise dp+</p>
<p>> </p><p>> if you came in from SIP it is sip+ and conference are conf+ etc.....</p><p>> </p><p>> </p><p>> On Wed, Jan 19, 2011 at 1:43 PM, John Rose <<a href="mailto:johnrose@comtex.net" target="_blank"><span style="color:windowtext;text-decoration:none">johnrose@comtex.net</span></a>> wrote:</p>
<p>> >> -----Original Message-----</p><p>> >> From: John Rose [mailto:<a href="mailto:johnrose@comtex.net" target="_blank">johnrose@comtex.net</a>]</p><p>> >></p><p>> >> Why does the chat API command prefix a "dp+" onto the From URI when I</p>
<p>> >> call the chat API? Here is an argument that I am using:</p><p>> >></p><p>> >></p><p>> "sip|+<a href="mailto:15186819448@65.41.13.124" target="_blank">15186819448@65.41.13.124</a>|external/<a href="mailto:sip%3A%2B12062990047@65.41.13.125" target="_blank">sip:+12062990047@65.41.13.125</a></p>
<p>> >> |</p><p>> >> Test message."</p><p>> >></p><p>> >> Then the From header:</p><p>> >></p><p>> >> From: \"+15186819448\"</p><p>> >> <<a href="mailto:sip%3Adp%2B%2B15186819448@65.41.13.124" target="_blank">sip:dp++15186819448@65.41.13.124</a>>;tag=FUetK564c4egm\\r\\n</p>
<p>> >></p><p>> ></p><p>> ></p><p>> > Argh, after looking through the code I think this is a FS bug where it</p><p>> > was intended for this "dp+" to be prefixed in the Jingle protocol</p>
<p>> > under certain circumstances not SIP.... looks very suspicious...</p><p>> ></p><p>> > John</p><p>> ></p></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></p>
</div><p class="MsoNormal"> </p></div></div></div></div></div></div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>