John, you should read what he wrote one more time. The code shows precisely what he said. I am going to quote here:<div><br></div><div>&quot;<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">you sent it from mod_commands which chose the dp realm to advertise dp+</span>&quot;</div>
<div><br></div><div>If you _received_ a message from SIP, you would&#39;ve seen the sip+ prefix and if you sent from the conference module, you would&#39;ve seen the conf+ prefix on the event. Makes more sense now?</div><div>
<br></div><div>Regards,</div><div><div>Joăo Mesquita<br>
<br><br><div class="gmail_quote">On Thu, Jan 20, 2011 at 12:10 AM, John Rose <span dir="ltr">&lt;<a href="mailto:johnrose@comtex.net">johnrose@comtex.net</a>&gt;</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> </p><p>Well from <b>switch_core_chat_send</b> it&#39;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.</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) &amp;&amp; (lbuf = strdup(cmd))</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys">            &amp;&amp; (argc = switch_separate_string(lbuf, <span style="color:#A31515">&#39;|&#39;</span>, argv, (<span style="color:blue">sizeof</span>(argv) / <span style="color:blue">sizeof</span>(argv[0])))) &gt;= 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">&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) {</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys">                  stream-&gt;write_function(stream, <span style="color:#A31515">&quot;Sent&quot;</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-&gt;write_function(stream, <span style="color:#A31515">&quot;Error! Message Not Sent&quot;</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-&gt;write_function(stream, <span style="color:#A31515">&quot;Invalid&quot;</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 class="im"><p> </p><p>From: \&quot;+15186819448\&quot; &lt;<a href="mailto:sip%3Adp%2B%2B15186819448@65.41.13.124" target="_blank">sip:dp++15186819448@65.41.13.124</a>&gt;;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">&quot;Memory Error!\n&quot;</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">&#39;@&#39;</span>))) {</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Fixedsys">                  *p++ = <span style="color:#A31515">&#39;\0&#39;</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-&gt;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">&quot;\&quot;%s\&quot; &lt;sip:%s+%s@%s&gt;&quot;</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 class="im"><p><span style="font-size:10.0pt;font-family:Fixedsys;color:green"> </span></p>
<p> </p><p> </p><p>&gt; -----Original Message-----</p><p>&gt; 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>&gt; </p><p>&gt; It&#39;s not a bug, you are being presumptuous.</p><p>&gt; </p><p>&gt; Every chat interface has a proto prefix that helps FS to route the messages to</p><p>&gt; the right module.</p><p>&gt; you sent it from mod_commands which chose the dp realm to advertise dp+</p>
<p>&gt; </p><p>&gt; if you came in from SIP it is sip+ and conference are conf+ etc.....</p><p>&gt; </p><p>&gt; </p><p>&gt; On Wed, Jan 19, 2011 at 1:43 PM, John Rose &lt;<a href="mailto:johnrose@comtex.net" target="_blank"><span style="color:windowtext;text-decoration:none">johnrose@comtex.net</span></a>&gt; wrote:</p>
<p>&gt; &gt;&gt; -----Original Message-----</p><p>&gt; &gt;&gt; From: John Rose [mailto:<a href="mailto:johnrose@comtex.net" target="_blank">johnrose@comtex.net</a>]</p><p>&gt; &gt;&gt;</p><p>&gt; &gt;&gt; Why does the chat API command prefix a &quot;dp+&quot; onto the From URI when I</p>
<p>&gt; &gt;&gt; call the chat API?  Here is an argument that I am using:</p><p>&gt; &gt;&gt;</p><p>&gt; &gt;&gt;</p><p>&gt; &quot;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>&gt; &gt;&gt; |</p><p>&gt; &gt;&gt; Test message.&quot;</p><p>&gt; &gt;&gt;</p><p>&gt; &gt;&gt; Then the From header:</p><p>&gt; &gt;&gt;</p><p>&gt; &gt;&gt; From: \&quot;+15186819448\&quot;</p><p>&gt; &gt;&gt; &lt;<a href="mailto:sip%3Adp%2B%2B15186819448@65.41.13.124" target="_blank">sip:dp++15186819448@65.41.13.124</a>&gt;;tag=FUetK564c4egm\\r\\n</p>
<p>&gt; &gt;&gt;</p><p>&gt; &gt;</p><p>&gt; &gt;</p><p>&gt; &gt; Argh, after looking through the code I think this is a FS bug where it</p><p>&gt; &gt; was intended for this &quot;dp+&quot; to be prefixed in the Jingle protocol</p>
<p>&gt; &gt; under certain circumstances not SIP.... looks very suspicious...</p><p>&gt; &gt;</p><p>&gt; &gt; John</p><p>&gt; &gt;</p></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></div>