Thanks a lot, it worked.<br><br><div class="gmail_quote">On Thu, Oct 25, 2012 at 1:03 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    You better use t_reply(&quot;487&quot;, &quot;Cancelled&quot;) in a failure_route.<br>
    <br>
    Adding a proper Via header might be a tricky task.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 10/25/12 11:43 AM, Vassilis Radis
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">I have a situation where a far end SIP provider
      doesn&#39;t behave properly when sending 487 replies. The scenario is
      this:
      <div><br>
      </div>
      <div>I have a registered user calling into my kamailio which
        ,using lcr module, routes the call to a SIP provider. When the
        caller Cancels the call, my kamailio forwards the cancel message
        to the provider (along with a 200 Cancelling message to the
        caller). The problem is with the 487 sent by the provider to my
        kamailio: It does not contain all the two Via headers. It only
        contains the via header that names my kamailio. So when kamailio
        gets the 487, it removes its Via header and sends the 487 back
        to the caller, which now doesnt find any via header. </div>
      <div><br>
      </div>
      <div>Note that the far end provider, correctly sends all the Via
        Headers in other replies (183 etc). </div>
      <div><br>
      </div>
      <div>So now I am trying to &quot;intercept&quot; the 487 from this specific
        provider in the onreply route, and patch it with the header that
        the provider should have included. How can I do it? The problem
        is twofold:</div>
      <div>1.I need to detect which header I should manually add (maybe
        store the Via Header set from the initial invites or the 183
        replies, and get it from there? .I dont know how to do that)</div>
      <div>2.I need to add it. (How can I manually add a Via header?
        .This seems easier</div>
      <div><br>
      </div>
      <div>Can anyone help me, maybe with another solution? </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a></pre>
  </font></span></div>

</blockquote></div><br>