[SR-Users] in-dialog requests

Ali Taher ataher at vanrise.com
Wed Jul 18 15:32:01 CEST 2018


Hello,

 

I'm using Kamailio as a proxy behind freeswitch to alter some packets (183
packets precisely).

 

Here is my scenario:

 

(---Customer---) --> ((port 5065)---Kamailio---) -->
((port5060)---Freeswitch---) --> (---Supplier---)

 

Here is my request route :

 

route{

 

if (is_method("INVITE")) {

        xlog("L_INFO","INSIDE request route $si \n");

          insert_hf("X-AUTH-IP: $si\r\n");

}

 

route(FWD);

}

 

 

reply_route {

#xlog("L_INFO","INSDE reply \n");

    if (status == "183") {

        change_reply_status(180, "Ringing");

        exit;

    }

}

 

route[FWD] {

#xlog("L_INFO","INSIDE FWD \n");

forward(X.X.X.X,5060);

}

Where X.X.X.X is the Freeswitch IP

 

This script is working normally as long as the customer is sending the
requests(INVITE,BYE,ACK,CANCEL..) . But when the supplier or freeswitch
initiated the request , above script causes loop where the packet is bounced
between kamailio and freeswitch.

 

As I know , loose_route is used to handle such requests , but I'm not sure
how to forward these packets to the customer after receiving them from
freeswitch.

 

I'm not sure also if what's I'm doing is statefull or stateless.

 

Any help is appreciated.

 

Thanks,

Ali Taher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180718/889bd853/attachment-0001.html>


More information about the sr-users mailing list