Hello,

try this: 
https://www.kamailio.org/wikidocs/cookbooks/5.6.x/core/#user_agent_header

Cheers,

Henning


-- 
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

-----Original Message-----
From: Stefan <sr.mailli...@gmail.com> 
Sent: Dienstag, 4. April 2023 15:04
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Modify User-Agent Header in OPTIONS from Dispatcher Module

Hello all

We are using topos in kamailio 5.5.6 to hide topology to some SIP-Servers.
Now, I am trying to modify the User-Agent header of OPTIONS sent by Dispatcher 
Module, how is this possible?

I tried something like this, because insert_hf or remove_hf does not work in 
event_route:

# Branch cleanup
branch_route[MANAGE_CLEANUP] {
     remove_hf("User-Agent");
     insert_hf("User-Agent: Test\r\n");
     return;
}

# topos route
event_route[topos:msg-sending] {
     # Topology hiding for some hosts
       if (is_request() and $sndto(ip)=="1.1.1.1") {
         if (is_method("OPTIONS")) {
             t_on_branch("MANAGE_CLEANUP");
             t_relay();
         }
       } else {
           # No topology hiding for other hosts...
           drop;
       }
}

But the branch-route is never called. I got two errors in Log:

Apr  4 12:17:27 kamailio /usr/sbin/kamailio[32174]: CRITICAL: <core>
[core/ip_addr.c:234]: ip_addr2sbuf(): unknown address family 0 Apr  4 12:17:27 
kamailio /usr/sbin/kamailio[32174]: ERROR: tm
[t_fwd.c:1752]: t_forward_nonack(): no branches for forwarding

Any hints how to achieve this?

Regards
Stefan

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:

Reply via email to