<div dir="ltr"><div>Hi Daniel,</div><div><br></div><div>Thank for your answering. </div><div>yes, I'm really need to add some parameters to the top most via header. But I only want to add to the outgoing RESPONSE message. I don't want to add to the REQUEST message. how can i do that?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 4, 2016 at 5:35 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>do you really need them in the Via header?</p>
    <p>It is abit delicate to work with, because some UA may be strict
      in what they receive, given that the Via was added by them. There
      are standard parameters that should be added such as received or
      rport, which are added by kamailio automatically if the conditions
      required by them are met.</p>
    <p>Maybe you can get what you need by adding a header instead -- a
      header can be added to the reply using append_to_reply() function
      exported by textops module.</p>
    <p>Otherwise, here are the steps that you can try to add to the Via
      header:</p>
    <p>  1) use functions from textops or textops module to update the
      Via header of the incoming request (inside request_route block),
      such as:</p>
    <p>  *
<a href="https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f.subst_hf" target="_blank">https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f.subst_hf</a><br>
        *
<a href="https://www.kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.insert_hf_value" target="_blank">https://www.kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.insert_hf_value</a></p>
    <p>  2) do msg_apply_changes()</p>
    <p>From that moment Kamailio will see the new Via header, with the
      changes you did. When building a reply, Kamailio should use the
      entire Via header  and you parameter should be visible in the
      reply.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p><div><div class="h5">
    <div>On 04/07/16 03:45, Huynh Quoc Bao
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>Hi all,</div>
        <div><br>
        </div>
        <div>Could someone give me some suggestion? Thank in advance.</div>
        <div><br>
        </div>
        <div>Brs/Bao</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Jul 1, 2016 at 3:31 PM, Huynh
          Quoc Bao <span dir="ltr"><<a href="mailto:baohq110@gmail.com" target="_blank">baohq110@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>Hi all,<br>
                <br>
                As title, i want to add some additional parameters to
                the topmost via header in replied message. </div>
              <div><span>example.
                  REGISTER ==> Kamailio ===> reply 200 OK. So in
                  200 OK message, i will add some additional parameters.</span><br>
              </div>
              <div>And the same for the other message: INVITE,
                SUBSCRIBE, NOTIFY, MESSAGE message.</div>
              <div><br>
                --</div>
              <div>
                Brs/Bao
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </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://www.kamailio.org" target="_blank">http://www.kamailio.org</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></pre>
  </font></span></div>

</blockquote></div><br></div>