Hi, I have Openser 1.1 with Mediaproxy terminating calls to a AS5350 Cisco gateway. Everything works fine, except when the PSTN party terminates the call. The cisco gateway then sends a bye message to the user-agents internal IP address instead of to the sip proxy's ip address. Here's an ngrep: 1.2.3.204=cisco gateway 1.2.3.201=openser proxy 62.1.2.122=useragent external ip 192.168.1.10 = useragent internal ip
U 1.2.3.201:5060 -> 192.168.1.10:5060 BYE sip:test@62.1.2.122:5060 SIP/2.0. Record-Route: sip:1.2.3.201;lr=on;ftag=E6EFE450-D54. Via: SIP/2.0/UDP 1.2.3.201;branch=z9hG4bKebda.e0002794.0. Via: SIP/2.0/UDP 1.2.3.204:5060;branch=z9hG4bKCC881474. From: sip:04766343@192.168.1.10;tag=E6EFE450-D54. To: "3227842234" sip:101002936@sip.server.com;tag=6b26b6926603729o0. Date: Tue, 23 Oct 2007 20:36:05 GMT. Call-ID: 656e89a4-6b2eb629@192.168.1.24. User-Agent: Cisco-SIPGateway/IOS-12.x. Max-Forwards: 69. Route: sip:192.168.1.10;lr=on;ftag=6b26b6926603729o0;vsf=AAAAAEVVQkRwAwABGHFFUV5SAFpCaWVuc2ludmVzdG1lbnQuY29t. Timestamp: 1193171774. CSeq: 101 BYE. Reason: Q.850;cause=16. Content-Length: 0.
So it looks to me like the Cisco is simply ignoring the record-route header. Is this a config error in the cisco, or in Openser? Pertinent bits of the openser config are:
# Record Route Section if (method=="INVITE" && client_nat_test("3")) { record_route_preset("1.2.3.201:5060;nat=yes"); } else if (method!="REGISTER") { record_route(); }; # Call Tear Down Section if (method=="BYE" || method=="CANCEL") { end_media_session(); }; # Loose Route Section if (loose_route()) { if ((method=="INVITE" || method=="REFER") && !has_totag()) { sl_send_reply("403", "Forbidden"); exit; }; if (method=="INVITE") { if (!allow_trusted()) { if (!proxy_authorize("","subscriber")) { proxy_challenge("","0"); exit; } else if (!check_from()) { sl_send_reply("403", "Use From=ID"); exit; }; consume_credentials(); }; if (client_nat_test("3")||search("^Route:.*;nat=yes")){ setflag(6); use_media_proxy(); }; }; route(1); exit; }; # Call Type Processing Section if (!is_uri_host_local()) { if (is_from_local() || allow_trusted()) { route(4); route(1); } else { sl_send_reply("403", "Forbidden"); }; exit; }; if (method=="ACK") { route(1); exit; } else if (method=="CANCEL") { route(1); exit; } else if (method=="INVITE") { route(3); exit; } else if (method=="REGISTER") { route(2); exit; };
route[1] { # Default Message Handler t_on_reply("1"); if (!t_relay()) { if (method=="INVITE" || method=="ACK") { end_media_session(); }; sl_reply_error(); }; } route[2] { # REGISTER Message Handler # snipped } route[3] { # INVITE Message Handler if (client_nat_test("3")) { setflag(7); force_rport(); fix_nated_contact(); }; if (!allow_trusted()) { if (!proxy_authorize("","subscriber")) { proxy_challenge("","0"); exit; } else if (!check_from()) { sl_send_reply("403", "Use From=ID"); exit; }; consume_credentials(); }; lookup("aliases"); if (!is_uri_host_local()) { route(4); route(1); exit; }; route(4); route(5); exit; }; route[4] { # NAT Traversal Section if (isflagset(6) || isflagset(7)) { if (!isflagset(8)) { setflag(8); use_media_proxy(); }; }; }
route[5] { # PSTN Handler Cisco rewritehost("1.2.3.204"); route(1); } failure_route[1] { end_media_session(); } onreply_route[1] { if (status=~"(180)|(183)|2[0-9][0-9]") { if (!search("^Content-Length:[ ]*0")) { use_media_proxy(); }; }; if (client_nat_test("1")) { fix_nated_contact(); }; }
Thanks for any help,
Richard