Hello,
I'm using Kamailio as SIP proxy between Session Manager and SBC
So here is the scenario : Session Manager sends a call (Invite) to Kamailio, kamailio needs to relay it to SBC after doing some modification. (-----Session Manager-----) ----------- > (----Kamailio----) ----------- > (-----SBC-----)
My routing logic is similar to the below: route{ if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) { options_reply(); } if (is_method("INVITE")) { sql_query("cb", "select number from pool1 order by random() limit 1", "ra"); $var(rand)=$dbr(ra=>[0,0]); uac_replace_from($var(rand),"sip:$var(rand)@192.168.1.1"); xlog("L_INFO","Random: $var(rand)"); $td = "192.168.1.10"; $rd = "192.168.1.10"; t_relay(); } } Where: 192.168.1.1 is Kamailio IP 192.168.1.10 is SBC IP
The issue is that I'm not sure to handle the other SIP packets like 183,CANCEL, BYE etc that can be received from both SBC and session Manager? What to add to my configuration to handle it properly?
Regards,
for other messages, you can find good examples in standard kamailio.conf file ( it is quite a full example file that basically covers your question )
Also, you may need to read more about how uac module works and which instruments it gives you to handle restoring https://www.kamailio.org/docs/modules/5.7.x/modules/uac.html#uac.p.restore_m...
чт, 12 окт. 2023 г. в 11:23, Ali Taher via sr-users < sr-users@lists.kamailio.org>:
Hello,
I’m using Kamailio as SIP proxy between Session Manager and SBC
So here is the scenario :
Session Manager sends a call (Invite) to Kamailio, kamailio needs to relay it to SBC after doing some modification.
(-----Session Manager-----) ----------- > (----Kamailio----) ----------- > (-----SBC-----)
My routing logic is similar to the below:
*route{*
if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {*
options_reply();*
}*
*if (is_method("INVITE")) {*
*sql_query("cb", "select number from pool1 order by random() limit 1", "ra");*
*$var(rand)=$dbr(ra=>[0,0]);*
*uac_replace_from($var(rand),"sip:$var(rand)@192.168.1.1 http://192.168.1.1");*
*xlog("L_INFO","Random: $var(rand)");*
*$td = "192.168.1.10";*
*$rd = "192.168.1.10";*
*t_relay();*
*}*
*}*
Where:
192.168.1.1 is Kamailio IP
192.168.1.10 is SBC IP
The issue is that I’m not sure to handle the other SIP packets like 183,CANCEL, BYE etc that can be received from both SBC and session Manager?
What to add to my configuration to handle it properly?
Regards, __________________________________________________________ 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: