Hi<br><br>We managed to have our solution to work perfectly behind NAT. And I thank you all for your help and <u>very</u> insteresting emails.<br><br>Daniel: So far I haven&#39;t found any other bug in NATHelper module on supporting multpart payloads. Could you please backport NATHelper from sip-router to kamailio ?<br>

<br>Cheers<br>Pascal<br><br><div class="gmail_quote">On Tue, Jun 23, 2009 at 12:01 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Pascal,<br>
<br>
you are right, a stupid bug introduced with the support for the multipart. I committed to the git repo.<br>
<br>
Thanks,<br><font color="#888888">
Daniel</font><div class="im"><br>
<br>
<br>
On 06/23/2009 11:55 AM, Pascal Maugeri wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Daniel<br>
<br>
Are you sure that this source fragment (in nhelpr_funcs.c):<br>
<br>
        /* no need for parse_headers(msg, EOH), get_body will<br>
         * parse everything */<br>
        /*is the content type correct?*/<br>
        if((ret = check_content_type(msg))==1)<br>
        {<br>
                LM_ERR(&quot;content type mismatching\n&quot;);<br>
                goto error;<br>
        }<br>
<br>
shouldn&#39;t be<br>
<br>
        /* no need for parse_headers(msg, EOH), get_body will<br>
         * parse everything */<br>
        /*is the content type correct?*/<br>
        if((ret = check_content_type(msg))== -1)<br>
        {<br>
                LM_ERR(&quot;content type mismatching\n&quot;);<br>
                goto error;<br>
        }<br>
<br>
? ( &quot;==1&quot; --&gt; &quot;==-1&quot;)<br>
<br>
Because now it gives me errors when processing INVITE with application/sdp payload.<br>
<br>
-pascal<br>
<br>
<br></div><div class="im">
On Tue, Jun 23, 2009 at 10:59 AM, Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;&gt; wrote:<br>


<br>
<br>
<br>
    On 06/23/2009 10:16 AM, Pascal Maugeri wrote:<br>
<br>
        This bug is fixed now with your patch Daniel!<br>
        Thank you, I go ahead with my testing<br>
<br>
    ok, I will backport to kamailio 1.5 in few days if there is no<br>
    related bug reported meanwhile.<br>
<br>
    Cheers,<br>
    Daniel<br>
<br>
<br>
        Cheers,<br>
        Pascal<br>
<br>
<br>
<br>
        On Mon, Jun 22, 2009 at 5:34 PM, Daniel-Constantin Mierla<br>
        &lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;<br></div><div><div></div><div class="h5">
        &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;&gt;&gt; wrote:<br>
<br>
           Can you check this patch I just committed?<br>
<br>
                  <a href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=caef5ace2026fcb2a9dffb471e2cec6d843082f8" target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=caef5ace2026fcb2a9dffb471e2cec6d843082f8</a><br>


<br>
           Basically, you simply can get the extract_body() function from<br>
           nathelper/nhelpr_funcs.c and replace it in kamailio.<br>
<br>
           Let me know if works ok now.<br>
<br>
           Thanks,<br>
           Daniel<br>
<br>
<br>
           On 06/22/2009 04:22 PM, Daniel-Constantin Mierla wrote:<br>
<br>
               please send me the original and the new invite so I can see<br>
               how the body is changed afterwards.<br>
<br>
               Cheers,<br>
               Daniel<br>
<br>
               On 06/22/2009 03:23 PM, Pascal Maugeri wrote:<br>
<br>
                   With your patch there is a small bug when<br>
        re-constructing<br>
                   the multipart payload:<br>
<br>
                   [...]<br>
                   --Genaker-boundary<br>
                   Content-Type: application/sdp<br>
<br>
                   v=0<br>
                   [...]<br>
                   a=fmtp:TBCP queuing=0; tb_priority=1; timestamp=0;<br>
                   tb_granted=0; poc_sess_priority=1; poc_lock=0<br>
<br>
<br>
                   *a=nortpproxy:yes--Genaker-boundary*<br>
                   Content-Type: application/resource-lists+xml<br>
<br>
                   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
                   &lt;resource-lists<br>
                   xmlns=&quot;urn:ietf:params:xml:ns:resource-lists&quot;<br>
                   xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;&gt;<br>
                   [...]<br>
<br>
                   --Genaker-boundary--<br>
<br>
<br>
                   Observe the line &quot;a=nortpproxy:yes--Genaker-boundary&quot; :<br>
                   there are CRLFs missing. And there two CRLF before<br>
                   &quot;a=nortpproxy:yes&quot;. I guess you&#39;re adding the CRLF<br>
        in the<br>
                   incorrect order.<br>
<br>
                   We&#39;re progressing ;-)<br>
<br>
                   -pascal<br>
<br>
                   On Mon, Jun 22, 2009 at 11:36 AM, Daniel-Constantin<br>
        Mierla<br>
                   &lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;<br>
        &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a> &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;&gt;<br>
                   &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a><br>
        &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt; &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a><br>
        &lt;mailto:<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;&gt;&gt;&gt; wrote:<br>
<br>
                      Hello Pascal,<br>
<br>
                      I have just committed support for multipart<br>
        bodies in<br>
                   sip router,<br>
                      if works then I will backport to 1.5.<br>
<br>
                                       <a href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f41271e1c1b879217835b8b3fdbdc2680138f25" target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1f41271e1c1b879217835b8b3fdbdc2680138f25</a><br>


<br>
<br>
<br>
                      Can you test it? Unfortunately I cannot do it these<br>
                   days properly<br>
                      due to traveling. Patch should work pretty<br>
                   straightforward with<br>
                      1.5 though, if you want to test it directly there.<br>
<br>
                      Cheers,<br>
                      Daniel<br>
<br>
<br>
                      On 06/22/2009 11:30 AM, Pascal Maugeri wrote:<br>
<br>
                          I tried to install mediaproxy but it looks<br>
        tricky<br>
                   to install<br>
                          (many dependencies, including kernel specific<br>
                   configurations) :-(<br>
                          and I would like to stick to rtpproxy for<br>
                   performance reason.<br>
<br>
                          Do you believe the same workaround using<br>
                   textops/filter_body<br>
                          can be used using rtpproxy ? I think yes as<br>
        these<br>
                   are two<br>
                          different things as said Juha.<br>
<br>
                          Regards,<br>
                          Pascal<br>
<br>
<br>
                          On Fri, Jun 19, 2009 at 9:26 PM, Pascal Maugeri<br>
                          &lt;<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;<br>
                   &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;&gt;<br>
                   &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;<br>
                   &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;&gt;&gt;<br>
                          &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;<br>
                   &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;&gt;<br>
                          &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;<br>
                   &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a><br>
        &lt;mailto:<a href="mailto:pascal.maugeri@gmail.com" target="_blank">pascal.maugeri@gmail.com</a>&gt;&gt;&gt;&gt;&gt; wrote:<br>
<br>
<br>
<br>
                             On Fri, Jun 19, 2009 at 9:13 PM, Juha<br>
        Heinanen<br>
                          &lt;<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;<br>
        &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;&gt;<br>
                   &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;<br>
        &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;&gt;&gt;<br>
                             &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a><br>
        &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt; &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a><br>
        &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;&gt;<br>
                   &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;<br>
        &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a> &lt;mailto:<a href="mailto:jh@tutpro.com" target="_blank">jh@tutpro.com</a>&gt;&gt;&gt;&gt;&gt; wrote:<br>
<br>
                                 Pascal Maugeri writes:<br>
<br>
                                  &gt; So if I understand well (please<br>
        correct<br>
                   me if I&#39;m wrong)<br>
                                 the &quot;plan&quot; is:<br>
                                  &gt;<br>
                                  &gt; 1º) I install MediaProxy and use<br>
        Kamailio<br>
                   MEDIAPROXY<br>
                          module<br>
                                 instead of<br>
                                  &gt; rtpproxy/NATHelper<br>
                                  &gt;<br>
                                  &gt; 2º) filter the app/sdp part with<br>
                                  &gt;<br>
                                  &gt; if (has_body(&quot;multipart/mixed&quot;)) {<br>
                                  &gt;     if<br>
        (filter_body(&quot;application/sdp&quot;) {<br>
                                  &gt;         remove_hf(&quot;Content-Type&quot;);<br>
                                  &gt;<br>
                                  &gt;         append_hf(&quot;Content-Type:<br>
                   application/sdp\r\n&quot;);<br>
                                  &gt;     } else {<br>
                                  &gt;<br>
                                  &gt;         xlog(&quot;Body part<br>
        application/sdp<br>
                   not found\n&quot;);<br>
                                  &gt;     }<br>
                                  &gt; }<br>
<br>
                                 you don&#39;t need to call filter_body if you<br>
                   use mediaproxy.<br>
<br>
                                  &gt; 3º) then engage the media proxy with<br>
                                  &gt;<br>
                                  &gt; if (method==INVITE &amp;&amp; !has_totag()) {<br>
                                  &gt;<br>
                                  &gt;     # We can also use a specific media<br>
                   relay if we<br>
                          need to<br>
                                  &gt;     #$avp(s:media_relay) = &quot;1.2.3.4&quot;;<br>
                                  &gt;     engage_media_proxy();<br>
                                  &gt; }<br>
<br>
                                 i have never used engage_media_proxy()<br>
                   functions,<br>
                          because it<br>
                                 makes some<br>
                                 assumptions that are not generally<br>
        true.  i use<br>
                                 use_media_proxy() instead.<br>
<br>
                                  &gt; 4º) finally put the body part(s) that<br>
                   have been<br>
                          removed in<br>
                                 1º) and relay the<br>
                                  &gt; INVITE to my next hop.<br>
                                  &gt;      I believe I can save the body<br>
                   part(s) in 1º)<br>
                          and put<br>
                                 them back using<br>
                                  &gt; set_body(txt, content_type).<br>
<br>
                                 you don&#39;t need to do anything like<br>
        that if<br>
                   you use<br>
                                 use_media_proxy()<br>
                                 function, because it does not remove<br>
        anything.<br>
<br>
<br>
                             Thanks Juha ! I can&#39;t wait for monday to<br>
        test it :-)<br>
<br>
                             Have a nice week-end<br>
                             Pascal<br>
<br>
                                           -- juha<br>
<br>
<br>
<br>
                                           ------------------------------------------------------------------------<br>
<br>
                          _______________________________________________<br>
                          Kamailio (OpenSER) - Users mailing list<br>
                          <a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;<br>
                   &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;&gt;<br>
                   &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;<br>
                   &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;&gt;&gt;<br>
                                           <a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
                                           <a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
                      --     Daniel-Constantin Mierla<br>
                      <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
<br>
                          ------------------------------------------------------------------------<br>
<br>
                   _______________________________________________<br>
                   Kamailio (OpenSER) - Users mailing list<br>
                   <a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;<br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
        &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;&gt;<br>
                          <a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
                          <a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
           --    Daniel-Constantin Mierla<br>
           <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
<br>
        ------------------------------------------------------------------------<br>
<br>
        _______________________________________________<br>
        Kamailio (OpenSER) - Users mailing list<br>
        <a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a> &lt;mailto:<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>&gt;<br>
        <a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
        <a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
    --     Daniel-Constantin Mierla<br>
    <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
<br>
</div></div></blockquote><div><div></div><div class="h5">
<br>
-- <br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
<br>
</div></div></blockquote></div><br>