Hello,

On 28.08.24 15:46, panda.paresh--- via sr-users wrote:
Hi,
I was trying this out , but somehow Kamailio is not liking it.  I am getting below error 

Aug 27 14:04:27 kamailio01 /usr/sbin/kamailio[1135093]: DEBUG: <core> [core/tcp_main.c:2879]: tcpconn_do_send(): buf=#012SIP/2.0 500 I'm terribly sorry, server error occurred (1/TM)#015#012Via: SIP/2.0/TCP 192.168.136.153:5061;branch=z9hG4bK-29059-1-0;rport=5061#015#012From: +14164568558 <sip:+14164568558@192.168.136.153:5062>#015#012Call-ID: 1-29059@192.168.136.153#015#012 .....

What I observe is that previous to send_tcp function I am using some transaction related functions like t_suspend/t_continue. and becuse of the tm module I am getting this error.

My query is : do Kamailio can work in both modes ?, some parts transaction way(for internal interfaces like rabbit MQ(kazoo) and some parts(final relay part, send tcp way (stateless)? 

Thank you so much for the quick reply to my previous query! 

the debug message is from tm module, so the send_tcp() is not the reason for that log.

But t_suspend()/t_continue() are designed to work only with the other tm functions (e.g., t_relay()) and using send_tcp() is not updating the transaction state, which at some point is going to time out and send some response back.

Otherwise, Kamailio should work fine with mixing send_tcp() and transactions, but be sure you also reply (or the next hop replies) when using send*() functions, because they are just like writing to the socket/connection, is not even doing stateless sip forwarding as no Via header is added, therefore retransmissions are expected. Also, the next hop might no be able to send the sip reply properly, if the initial sender is behind nat. I do not know your scenarios/needs. but it can be tricky to get it working properly if UAs are behind nat/firewall.

Cheers, Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio Advanced Training, October 8-10, 2024 -- asipto.com