Hello all,
In my situation, it is possible to call forwarding to registered users multiple times on same leg. For each forward i have to update To uri and i am using uac_replace_to to do that.
But on second relaying, To uri was malformed. On below, Im attaching configuration to illustrate my problem. (version-5.4.9)
First relay - /To: //sip:xyz@192.168.0.51/
Second relay - /To: sip:xyz@192.168.0.51sip:abc@192.168.0.51/
Thanks in advance.
Serdar
/loadmodule "uac.so"// //modparam("uac","restore_mode","auto")// // // //request_route {// // ...// // $avp(x) = "abc";// // $avp(x) = "xyz";// // $avp(myip) = "192.168.0.51";// // $avp(i) = 0;// // route(SERDAR);// // ...// //}// // //route[SERDAR] {// // if ($(avp(x)[$avp(i)])!=$null) {// // $avp(destination) = $(avp(x)[$avp(i)]);// // $avp(i) = $avp(i) + 1;// // $rU=$_s($avp(destination));// //uac_replace_to("$_s(sip:$avp(destination)@$avp(myip))");// // route(LOCATION);// // } else {// // send_reply("403", "Opps!");// // exit;// // }// //}// // //route[LOCATION] {// // $avp(oexten) = $rU;// // if (!lookup("location") ) {// // t_newtran();// // switch ($var(rc)) {// // case -1:// // case -3:// // send_reply("480", "Temporarily Unavailable");// // exit;// // case -2:// // send_reply("405", "Method Not Allowed");// // exit;// // }// // }// // t_on_failure("SERDAR_FAILURE");// // if(!t_relay()) sl_reply_error();// // exit;// //}// // //failure_route[SERDAR_FAILURE] {// // route(NATMANAGE);// // if (t_is_canceled()) //exit;// // route(SERDAR);// //}/
Hello,
in this case, you have to perform the update of To header only in branch_route.
Cheers, Daniel
On 03.04.23 14:58, Serdar GUCLUER wrote:
Hello all,
In my situation, it is possible to call forwarding to registered users multiple times on same leg. For each forward i have to update To uri and i am using uac_replace_to to do that.
But on second relaying, To uri was malformed. On below, Im attaching configuration to illustrate my problem. (version-5.4.9)
First relay - /To: //sip:xyz@192.168.0.51/
Second relay - /To: sip:xyz@192.168.0.51sip:abc@192.168.0.51/
Thanks in advance.
Serdar
/loadmodule "uac.so"// //modparam("uac","restore_mode","auto")// // // //request_route {// // ...// // $avp(x) = "abc";// // $avp(x) = "xyz";// // $avp(myip) = "192.168.0.51";// // $avp(i) = 0;// // route(SERDAR);// // ...// //}// // //route[SERDAR] {// // if ($(avp(x)[$avp(i)])!=$null) {// // $avp(destination) = $(avp(x)[$avp(i)]);// // $avp(i) = $avp(i) + 1;// // $rU=$_s($avp(destination));// // uac_replace_to("$_s(sip:$avp(destination)@$avp(myip))");// // route(LOCATION);// // } else {// // send_reply("403", "Opps!");// // exit;// // }// //}// // //route[LOCATION] {// // $avp(oexten) = $rU;// // if (!lookup("location") ) {// // t_newtran();// // switch ($var(rc)) {// // case -1:// // case -3:// // send_reply("480", "Temporarily Unavailable");// // exit;// // case -2:// // send_reply("405", "Method Not Allowed");// // exit;// // }// // }// // t_on_failure("SERDAR_FAILURE");// // if(!t_relay()) sl_reply_error();// // exit;// //}// // //failure_route[SERDAR_FAILURE] {// // route(NATMANAGE);// // if (t_is_canceled()) //exit;// // route(SERDAR);// //}/
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hello Daniel,
Long question, short answer but it worked for me. Thanks for your helping.
Serdar
4.04.2023 08:46 tarihinde Daniel-Constantin Mierla yazdı:
Hello,
in this case, you have to perform the update of To header only in branch_route.
Cheers, Daniel
On 03.04.23 14:58, Serdar GUCLUER wrote:
Hello all,
In my situation, it is possible to call forwarding to registered users multiple times on same leg. For each forward i have to update To uri and i am using uac_replace_to to do that.
But on second relaying, To uri was malformed. On below, Im attaching configuration to illustrate my problem. (version-5.4.9)
First relay - /To: //sip:xyz@192.168.0.51/
Second relay - /To: sip:xyz@192.168.0.51sip:abc@192.168.0.51/
Thanks in advance.
Serdar
/loadmodule "uac.so"// //modparam("uac","restore_mode","auto")// // // //request_route {// // ...// // $avp(x) = "abc";// // $avp(x) = "xyz";// // $avp(myip) = "192.168.0.51";// // $avp(i) = 0;// // route(SERDAR);// // ...// //}// // //route[SERDAR] {// // if ($(avp(x)[$avp(i)])!=$null) {// // $avp(destination) = $(avp(x)[$avp(i)]);// // $avp(i) = $avp(i) + 1;// // $rU=$_s($avp(destination));// // uac_replace_to("$_s(sip:$avp(destination)@$avp(myip))");// // route(LOCATION);// // } else {// // send_reply("403", "Opps!");// // exit;// // }// //}// // //route[LOCATION] {// // $avp(oexten) = $rU;// // if (!lookup("location") ) {// // t_newtran();// // switch ($var(rc)) {// // case -1:// // case -3:// // send_reply("480", "Temporarily Unavailable");// // exit;// // case -2:// // send_reply("405", "Method Not Allowed");// // exit;// // }// // }// // t_on_failure("SERDAR_FAILURE");// // if(!t_relay()) sl_reply_error();// // exit;// //}// // //failure_route[SERDAR_FAILURE] {// // route(NATMANAGE);// // if (t_is_canceled()) //exit;// // route(SERDAR);// //}/
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email tosr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
-- Daniel-Constantin Mierla --www.asipto.com www.twitter.com/miconda --www.linkedin.com/in/miconda Kamailio World Conference - June 5-7, 2023 -www.kamailioworld.com
-
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
Hello,
try this: https://www.kamailio.org/wikidocs/cookbooks/5.6.x/core/#user_agent_header
Cheers,
Henning
Hi Henning
Thank you, this was easy ;-) But first I wanted to achieve this only for the hosts where I perform topology hiding. Anyway, I change the UA Header now globally.
Cheers, Stefan
Am 04.04.23 um 15:35 schrieb Henning Westerholt:
Hello,
try this: https://www.kamailio.org/wikidocs/cookbooks/5.6.x/core/#user_agent_header
Cheers,
Henning
Hi all
I am playing with topos on kamailio 5.5.6, but when I want to activate it only for specific hosts, it works only on the initial INVITE request. Subsequent requests like PRACK, ACK, BYE are not modified. As soon as I remove the code part below, it works for all requests, but I need it only on a specific host.
event_route[topos:msg-sending] { # Topology hiding for one host if (is_request() and $sndto(ip)=="1.1.1.1") { xlog("L_INFO","$ci Test event_route topos:msg-sending\n"); } else { # No topology hiding drop; } }
Is it meant to function like that or is it a bug?
Regards Stefan
Hello,
just to sort out the obvious, you are doing record-routing for the initial requests?
Cheers,
Henning
Hi Henning
Yes, we do record routing.
UAC -> UAS (Kamailio Registrar Server) -> SIP-Proxy (Kamailio Carrierrouting) -> PSTN
I would like to do topos on the SIP-Proxy direction PSTN but only for specific hosts.
Regards Stefan
Am 05.04.23 um 19:35 schrieb Henning Westerholt:
Hello,
just to sort out the obvious, you are doing record-routing for the initial requests?
Cheers,
Henning
Hi Stefan
I would like to do topos on the SIP-Proxy direction PSTN but only for specific hosts.
I ran in a quite similar issue with topos which made it unsuitable for my needs.
Same situation:
CPE <=> Kamailio Registrar (TM Module) <=> Kamailio Routing Core (Dialogue aware) <=> IC
I would like to hide topo towards the CPE, so they don't have to deal with route-sets etc. (found some CPE which are and don't correctly set route header)
But I need the routes towards the kamailio core.
When topos is used, topology is being hidded on both legs, towards CPE and towards Core. This causes issues with Hairpin Calls (CPE to CPE) via Core, as the Record-Route contains the registrar twice and topos removing all Route header containing it's local IP.
If I try to drop topos on calls with destination core, topology hiding is completely dropped from the transaction.
So any hints on how to do topology hiding on one leg only (towards one ip only) is highly appreciated.
Mit freundlichen Grüssen
-Benoît Panizzon-
Hi together
Tested now with 5.3.9 and 5.6.4, same result. Does anyone use topos only with specific destination hosts?
Cheers Stefan
Am 06.04.23 um 09:19 schrieb Benoit Panizzon:
Hi Stefan
I would like to do topos on the SIP-Proxy direction PSTN but only for specific hosts.
I ran in a quite similar issue with topos which made it unsuitable for my needs.
Same situation:
CPE <=> Kamailio Registrar (TM Module) <=> Kamailio Routing Core (Dialogue aware) <=> IC
I would like to hide topo towards the CPE, so they don't have to deal with route-sets etc. (found some CPE which are and don't correctly set route header)
But I need the routes towards the kamailio core.
When topos is used, topology is being hidded on both legs, towards CPE and towards Core. This causes issues with Hairpin Calls (CPE to CPE) via Core, as the Record-Route contains the registrar twice and topos removing all Route header containing it's local IP.
If I try to drop topos on calls with destination core, topology hiding is completely dropped from the transaction.
So any hints on how to do topology hiding on one leg only (towards one ip only) is highly appreciated.
Mit freundlichen Grüssen
-Benoît Panizzon-
Hi,
I would suggest just putting another PSTN topos Kamailio in between. This way the problem is solved and you don't make an all in one complex configuration.
Kind regards Karsten Horsmann
Stefan sr.maillists@gmail.com schrieb am Do., 6. Apr. 2023, 15:14:
Hi together
Tested now with 5.3.9 and 5.6.4, same result. Does anyone use topos only with specific destination hosts?
Cheers Stefan
...