[SR-Users] Forcing outbound transport to TCP

Ivan Ribakov i.ribakov at zaleos.net
Fri Sep 28 12:07:57 CEST 2018


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 <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 at 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 at 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 at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180928/af9d6b0d/attachment.html>


More information about the sr-users mailing list