Hello,

do you really need them in the Via header?

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.

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.

Otherwise, here are the steps that you can try to add to the Via header:

  1) use functions from textops or textops module to update the Via header of the incoming request (inside request_route block), such as:

  * https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f.subst_hf
  * https://www.kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.insert_hf_value

  2) do msg_apply_changes()

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.

Cheers,
Daniel

On 04/07/16 03:45, Huynh Quoc Bao wrote:
Hi all,

Could someone give me some suggestion? Thank in advance.

Brs/Bao

On Fri, Jul 1, 2016 at 3:31 PM, Huynh Quoc Bao <baohq110@gmail.com> wrote:
Hi all,

As title, i want to add some additional parameters to the topmost via header in replied message.
example. REGISTER ==> Kamailio ===> reply 200 OK. So in 200 OK message, i will add some additional parameters.
And the same for the other message: INVITE, SUBSCRIBE, NOTIFY, MESSAGE message.

--
Brs/Bao



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda