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 <[email protected]> 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 > [email protected] > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
