I have a routing problem which I cant explain.
A UA communicates with a Sip-Server over ser as a proxy. As the Sip-Server only supports TCP connection the t_relay_to_tcp function is used. And as the Sip-Server doesn't register to the Ser proxy a routeing for that destination (sip server) is done by hand. See ser.cfg and Sip messages below.
Everything seems to work just find except the BYE Message form the Sip Server via the proxy to the UA. Ser sends the received BYE to himself (Message 8) and then back to the Sip Server (Message 9).
listening points: UA: 192.168.0.5:5555 ser: 192.168.0.5:5060 sipserver: 192.168.0.5:5080
Any suggestions?
ser.cfg
route{ # initial sanity checks -- messages with # max_forwards==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); break; }; if ( msg:len > max_len ) { sl_send_reply("513", "Message too big"); break; };
# we record-route all messages -- to make sure that # subsequent messages will go through our proxy; that's # particularly good if upstream and downstream entities # use different transport protocol if (method=="INVITE") record_route();
# loose-route processing if (loose_route()) { t_relay(); break; };
# dest SipAS? then relay via tcp without lookup if(uri=~"sip:sipas@192.168.0.5" || uri=~"sip:192.168.0.5:5080") { if (!t_relay_to_tcp("192.168.0.5","5080")) { sl_reply_error(); break; }; break; };
# if the request is for other domain use UsrLoc # (in case, it does not work, use the following command # with proper names and addresses in it) if (uri==myself) {
if (method=="REGISTER") { log("saving location \n"); save("location"); break; };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); log("not in locDB\n"); break; }; };
if (!t_relay()) { sl_reply_error(); break; };
}
########################################################################### Call flow:
1. ==== UA sends to ser INVITE sip:sipas@192.168.0.5 SIP/2.0 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 INVITE From: "user" sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5 Via: SIP/2.0/UDP 192.168.0.5:5555;branch=z9hG4bK98fa6f82a8447d74fe9a04da3d9dd0a1 Max-Forwards: 70 Contact: "user" sip:192.168.0.5:5555;transport=udp Content-Type: application/sdp Content-Length: 154
(sdp not shown) ---------------------------------------------
2. ==== ser to Sip Server INVITE sip:sipas@192.168.0.5 SIP/2.0 Record-Route: sip:sipas@192.168.0.5;transport=tcp;r2=on;ftag=25591289;lr=on Record-Route: sip:sipas@192.168.0.5;r2=on;ftag=25591289;lr=on Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 INVITE From: "user" sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5 Via: SIP/2.0/TCP 192.168.0.5;branch=z9hG4bK6446.87704592.0 Via: SIP/2.0/UDP 192.168.0.5:5555;branch=z9hG4bK98fa6f82a8447d74fe9a04da3d9dd0a1 Max-Forwards: 69 Contact: "user" sip:192.168.0.5:5555;transport=udp Content-Type: application/sdp Content-Length: 154
sdp not shown ---------------------------------------------
3. ==== Sip Server to ser SIP/2.0 200 OK Via: SIP/2.0/TCP 192.168.0.5;branch=z9hG4bK6446.87704592.0 Via: SIP/2.0/UDP 192.168.0.5:5555;branch=z9hG4bK98fa6f82a8447d74fe9a04da3d9dd0a1 Record-Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on;transport=tcp Record-Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on From: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5;tag=swwmb9 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 INVITE Contact: sip:192.168.0.5:5080;transport=tcp Content-Length: 163 Content-Type: application/sdp
sdp not shown
---------------------------------------------
4. ==== ser to UA SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.0.5:5555;branch=z9hG4bK98fa6f82a8447d74fe9a04da3d9dd0a1 Record-Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on;transport=tcp Record-Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on From: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5;tag=swwmb9 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 INVITE Contact: sip:192.168.0.5:5080;transport=tcp Content-Length: 163 Content-Type: application/sdp
sdpnot shown ---------------------------------------------
5. ==== UA to ser ACK sip:192.168.0.5:5080;transport=udp SIP/2.0 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 ACK From: "user" sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5;tag=swwmb9 Via: SIP/2.0/UDP 192.168.0.5:5555;branch=3139322e3136382e302e353a3535353 Max-Forwards: 70 Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on Content-Length: 0
--------------------------------------------- 6. ==== ser to Sip Server ACK sip:192.168.0.5:5080;transport=udp SIP/2.0 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 ACK From: "user" sip:user@192.168.0.5:5555;transport=udp;tag=25591289 To: sip:sipas@192.168.0.5;tag=swwmb9 Via: SIP/2.0/TCP 192.168.0.5;branch=0 Via: SIP/2.0/UDP 192.168.0.5:5555;branch=3139322e3136382e302e353a3535353 Max-Forwards: 69 Content-Length: 0
--------------------------------------------- 7. ==== Sip Server to ser BYE sip:user@192.168.0.5:5555;transport=udp SIP/2.0 Via: SIP/2.0/TCP 192.168.0.5:5080;branch=z9hG4bKf7kfy5 Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on;transport=tcp Route: sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on Max-Forwards: 70 From: sip:sipas@192.168.0.5;tag=swwmb9 To: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 BYE Content-Length: 0
---------------------------------------------
8. ==== ser to ser! BYE sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on SIP/2.0 Via: SIP/2.0/UDP 192.168.0.5;branch=z9hG4bK6446.97704592.0;i=2 Via: SIP/2.0/TCP 192.168.0.5:5080;branch=z9hG4bKf7kfy5 Max-Forwards: 69 From: sip:sipas@192.168.0.5;tag=swwmb9 To: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 BYE Content-Length: 0
--------------------------------------------- 9. ==== ser to Sip Server! (and not to UA) BYE sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on SIP/2.0 Via: SIP/2.0/TCP 192.168.0.5;branch=z9hG4bK6446.a7704592.0 Via: SIP/2.0/UDP 192.168.0.5;branch=z9hG4bK6446.97704592.0;i=2 Via: SIP/2.0/TCP 192.168.0.5:5080;branch=z9hG4bKf7kfy5 Max-Forwards: 68 From: sip:sipas@192.168.0.5;tag=swwmb9 To: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 BYE Content-Length: 0
--------------------------------------------- 10. ==== ser to Sip Server! BYE sip:sipas@192.168.0.5;ftag=25591289;r2=on;lr=on SIP/2.0 Via: SIP/2.0/UDP 192.168.0.5;branch=z9hG4bK6446.97704592.0;i=2 Via: SIP/2.0/TCP 192.168.0.5:5080;branch=z9hG4bKf7kfy5 Max-Forwards: 69 From: sip:sipas@192.168.0.5;tag=swwmb9 To: user sip:user@192.168.0.5:5555;transport=udp;tag=25591289 Call-ID: f978201facd1ba9e7345af63683f96a1@192.168.0.5 CSeq: 1 BYE Content-Length: 0
and so on.....