[SR-Users] Forcing outbound transport to TCP
Daniel Tryba
d.tryba at pocos.nl
Fri Sep 28 10:40:55 CEST 2018
On Fri, Sep 28, 2018 at 10:07:09AM +0200, Ivan Ribakov wrote:
> In a basic scenario of one2one call, I was able to make Kamailio to forward INVITE to callee over TCP by issuing a REGISTER request with ???transport=tcp??? parameter. Although it worked, as far as I understand that means all communication with the callee will be happening over TCP. I would like to be able to change transport dynamically so looking for a way to do that from config file.
...
> Any pointers as to how can I modify the outbound message transport? Do I need to use some extra modules or can it be achieved with a basic setup?
You can do this by explicitly calling t_relay_to_tcp() instead of
t_relay().
For example I modified route[RELAY] for a specific destination that
wants TCP for large INVITEs.
if($avp(dispatcherid)=="1" && $ml>1249)
{
if(!t_relay_to_tcp())
{
if(!t_relay())
{
sl_reply_error();
}
}
}
else
{
if(!t_relay())
{
sl_reply_error();
}
}
More information about the sr-users
mailing list