Hello,

in KEMI you can do:

KSR.setdsturi("sip:_IP_OR_DOMAIN_:_PORT_;transport=tcp");

KSR.tm.t_relay()

I will review what tm functions are not exported yet and add those that are still relevant. In Kamailio we had the t_relay_to(...), which allow setting the transport in the parameter, the variants for t_relay_to_tcp/tls/... were retrieve via tm branch and I haven't use them.

Cheers,
Daniel

On 28.09.18 12:07, Ivan Ribakov wrote:
How would one achieve the same using KEMI? I can see there is a KSR.tm module - https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#tm which has “t_relay()” function but it has no “t_relay_to_tcp()”.

On 28 Sep 2018, at 11:22, Ivan Ribakov <i.ribakov@zaleos.net> wrote:

Thanks Daniel!

route[RELAY] section is what I’ve been looking for!
I knew about t_relay_to_tcp() function but placing it directly in the end of “request_route” block lead to undesirable behaviour which made me think it’s not what I needed.

On 28 Sep 2018, at 10:40, Daniel Tryba <d.tryba@pocos.nl> wrote:

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();
}
}


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference -- www.kamailioworld.com
Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com