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,