Hi all.
I have a problem with t_relay_to_udp function.
My topology: UAC -> tcp -> kamailio <-> udp <-> asterisk
Kamailio processes requests from clients over TCP and relays requests to asterisk over UDP.
Kamailio gets INVITE from client, relays it to asterisk, then he sends 100 trying to user client and abruptly sends 500 internal error to client (after 100 trying). But the main interesting thing is, that asterisk answers on INVITE and dialog continues between kamailio and asterisk (without user agent client) - it reaches the destination then, without originator : )
How error on kamailio looks like: Nov 8 15:23:37 ip-10-2-1-229 kamailio[10339]: ERROR: tm [t_fwd.c:1716]: t_forward_nonack(): ERROR: t_forward_nonack: no branches for forwarding Nov 8 15:23:37 ip-10-2-1-229 kamailio[10339]: ERROR: sl [sl_funcs.c:363]: sl_reply_error(): ERROR: sl_reply_error used: I'm terribly sorry, server error occurred (6/SL)
The same problem is, when I change transport protocol between kamailio and asterisk to TCP, using the t_relay_to_tcp function. When I use t_relay function, it works fine, nothing happens that can drop dialogs between kamailio and clients.
Relaying code part: if ($var(to_asterisk)=="1") { xlog("L_NOTICE","Relaying to asterisk - change socket to udp:10.1.1.1:5070 \n");
force_send_socket(udp:10.1.1.1:5070);
if (!t_relay_to_udp()) { sl_reply_error(); } }
I need to use t_relay_to_udp with force_send_socket, because kamailio changes the source port (source socket) every time he generate new INVITEs to asterisk and this is irrelevant.
Dump between kamailio and user agent client:
INVITE sip:1111111111example@kam1.domain.com:5070;transport=TCP SIP/2.0 Via: SIP/2.0/TCP uac.domain.example:5065;branch=z9hG4bK-d8754z-67b9ad24dbc5c1d0-1---d8754z- Max-Forwards: 70 Contact: sip:debug.device-example@uac.domain.example:5065;transport=TCP To: sip:1111111111example@kam1.domain.com:5070;transport=TCP From: sip:debug.device-example@kam1.domain.com:5070 ;transport=TCP;tag=93394e63 Call-ID: NzQ1NWU5NzUxYmY4ZWVjMjYwNDYwMTBmYzYxODZkZmM. CSeq: 2 INVITE Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE Content-Type: application/sdp Proxy-Authorization: Digest username="debug.device-example",realm=" kam1.domain.com ",nonce="WgQGlVoEBWnhH3CF6DE77uKxKJx0tT4e",uri="sip:1111111111example@kam1.domain.com:5070 ;transport=TCP",response="4753aa849715d26d0dde1b3c2314c843",a orithm=MD5 Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri User-Agent: Z 3.3.25608 r25552 Allow-Events: presence, kpml Content-Length: 241
v=0 o=Z 0 0 IN IP4 uac.domain.example s=Z c=IN IP4 uac.domain.example t=0 0 m=audio 8000 RTP/AVP 8 3 110 0 98 101 a=rtpmap:110 speex/8000 a=rtpmap:98 iLBC/8000 a=fmtp:98 mode=20 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=sendrecv
SIP/2.0 100 trying -- your call is important to us Via: SIP/2.0/TCP uac.domain.example:5065;branch=z9hG4bK-d8754z-67b9ad24dbc5c1d0-1---d8754z-;rport=43486 To: sip:1111111111example@kam1.domain.com:5070;transport=TCP From: sip:debug.device-example@kam1.domain.com:5070 ;transport=TCP;tag=93394e63 Call-ID: NzQ1NWU5NzUxYmY4ZWVjMjYwNDYwMTBmYzYxODZkZmM. CSeq: 2 INVITE Server: MS Lync Content-Length: 0
SIP/2.0 500 I'm terribly sorry, server error occurred (6/SL) Via: SIP/2.0/TCP uac.domain.example:5065;branch=z9hG4bK-d8754z-67b9ad24dbc5c1d0-1---d8754z-;rport=43486 To: sip:1111111111example@kam1.domain.com:5070 ;transport=TCP;tag=9a78ee8ed9a3d4ba441c41d83ba2e904.4113 From: sip:debug.device-example@kam1.domain.com:5070 ;transport=TCP;tag=93394e63 Call-ID: NzQ1NWU5NzUxYmY4ZWVjMjYwNDYwMTBmYzYxODZkZmM. CSeq: 2 INVITE Server: example Content-Length: 0
Thanks in advance for hints.