Hi Bogdan I tried what you told me to, however I still have the same problem. Seems like nothing is hanging up now. However if I used this config before the loose route, things are slightly better, just that the caller(softphne) hangs up first, then the calle(softphone) wont hang up itself.<br> <br> if (method=="BYE" || method=="CANCEL") {<br> unforce_rtp_proxy();<br> t_relay();<br> exit;<br> } ;<br> <br> The bye is still not working right. Below is my config that I tried using ur suggestion and ngrep:<br> <br> debug=3<br> fork=yes<br> log_stderror=no<br> <br> listen=68.xxx.xxx.xxx <br> alias=test.com<br> <br> port=5060<br> children=16<br> <br> dns=no<br> rev_dns=no<br> <br> fifo="/tmp/openser_fifo"<br> fifo_db_url="mysql://openser:openserrw@localhost/openser"<br> <br> loadmodule
"/usr/local/lib/openser/modules/mysql.so"<br> loadmodule "/usr/local/lib/openser/modules/sl.so"<br> loadmodule "/usr/local/lib/openser/modules/tm.so"<br> loadmodule "/usr/local/lib/openser/modules/rr.so"<br> loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<br> loadmodule "/usr/local/lib/openser/modules/usrloc.so"<br> loadmodule "/usr/local/lib/openser/modules/registrar.so"<br> loadmodule "/usr/local/lib/openser/modules/auth.so"<br> loadmodule "/usr/local/lib/openser/modules/auth_db.so"<br> loadmodule "/usr/local/lib/openser/modules/uri.so"<br> loadmodule "/usr/local/lib/openser/modules/uri_db.so"<br> loadmodule "/usr/local/lib/openser/modules/domain.so"<br> loadmodule "/usr/local/lib/openser/modules/nathelper.so"<br> loadmodule "/usr/local/lib/openser/modules/avpops.so"<br> loadmodule "/usr/local/lib/openser/modules/textops.so"<br> loadmodule "/usr/local/lib/openser/modules/xlog.so"<br> loadmodule "/usr/local/lib/openser/modules/permissions.so"<br> <br>
modparam("auth_db|permissions|uri_db|usrloc", "db_url",<br> "mysql://openser:openserrw@localhost/openser")<br> modparam("auth_db", "calculate_ha1", 1)<br> modparam("auth_db", "password_column", "password")<br> <br> modparam("nathelper", "natping_interval", 30) <br> modparam("nathelper", "ping_nated_only", 1) <br> modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")<br> <br> modparam("usrloc", "db_mode", 2)<br> <br> modparam("registrar", "nat_flag", 6)<br> <br> modparam("rr", "enable_full_lr", 1)<br> <br> modparam("tm", "fr_inv_timer", 27)<br> modparam("tm", "fr_inv_timer_avp", "inv_timeout")<br> <br> modparam("permissions", "db_mode", 1)<br> modparam("permissions", "trusted_table", "trusted")<br> <br> <br> route {<br> <br> # -----------------------------------------------------------------<br> # Sanity Check Section<br> #
-----------------------------------------------------------------<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483", "Too Many Hops");<br> exit;<br> };<br> <br> if (msg:len > max_len) {<br> sl_send_reply("513", "Message Overflow");<br> exit;<br> };<br> <br> # -----------------------------------------------------------------<br> # Record Route Section<br> # -----------------------------------------------------------------<br> if (method!="REGISTER") {<br> record_route();<br> };<br> <br> if (method=="BYE" || method=="CANCEL") {<br>
unforce_rtp_proxy();<br> if(method=="CANCEL")<br> t_relay();<br> exit;<br> } ;<br> <br> # -----------------------------------------------------------------<br> # Loose Route Section<br> # -----------------------------------------------------------------<br> if (loose_route()) {<br> <br> if ((method=="INVITE" || method=="REFER") && !has_totag()) {<br> sl_send_reply("403", "Forbidden");<br> return;<br> };<br> <br> if (method=="INVITE") {<br> <br> if
(!proxy_authorize("","subscriber")) {<br> proxy_challenge("","0");<br> return;<br> } else if (!check_from()) {<br> sl_send_reply("403", "Use From=ID");<br> return;<br> };<br> consume_credentials();<br> <br> if (nat_uac_test("19")) {<br> setflag(6);<br> force_rport();<br>
fix_nated_contact();<br> };<br> force_rtp_proxy("l");<br> };<br> <br> route(1);<br> return;<br> };<br> <br> # -----------------------------------------------------------------<br> # Call Type Processing Section<br> # -----------------------------------------------------------------<br> if (!is_uri_host_local()) {<br> if (is_from_local() || allow_trusted()) {<br> route(4);<br> route(1);<br> } else {<br>
sl_send_reply("403", "Forbidden");<br> };<br> return;<br> };<br> <br> if (method=="ACK") {<br> route(1);<br> return;<br> } else if (method=="CANCEL") {<br> route(1);<br> return;<br> } else if (method=="INVITE") {<br> route(3);<br> return;<br> } else if (method=="REGISTER") {<br> route(2);<br> return;<br> };<br> <br> lookup("aliases");<br>
if (!is_uri_host_local()) {<br> route(4);<br> route(1);<br> return;<br> };<br> <br> if (!lookup("location")) {<br> sl_send_reply("404", "User Not Found");<br> return;<br> };<br> <br> route(1);<br> }<br> <br> route[1] {<br> <br> # -----------------------------------------------------------------<br> # Default Message Handler<br> # -----------------------------------------------------------------<br> <br> t_on_reply("1");<br> <br> <br> if (!t_relay()) {<br> if ((method=="INVITE" || method=="ACK") && isflagset(6)) {<br>
unforce_rtp_proxy();<br> };<br> sl_reply_error();<br> };<br> }<br> <br> route[2] {<br> <br> # -----------------------------------------------------------------<br> # REGISTER Message Handler<br> # ----------------------------------------------------------------<br> <br> if (!search("^Contact:[ ]*\*") && nat_uac_test("19")) {<br> setflag(6);<br> fix_nated_register();<br> force_rport();<br> };<br> <br> sl_send_reply("100", "Trying");<br> <br> if (!www_authorize("","subscriber")) {<br> www_challenge("","0");<br>
exit;<br> };<br> <br> if (!check_to()) {<br> sl_send_reply("401", "Unauthorized");<br> return;<br> };<br> <br> consume_credentials();<br> <br> if (!save("location")) {<br> sl_reply_error();<br> };<br> }<br> <br> route[3] {<br> <br> # -----------------------------------------------------------------<br> # INVITE Message Handler<br> # -----------------------------------------------------------------<br> <br> if (!allow_trusted()) {<br> <br> if (!proxy_authorize("","subscriber")) {<br> proxy_challenge("","0");<br>
return;<br> } else if (!check_from()) {<br> sl_send_reply("403", "Use From=ID");<br> return;<br> };<br> };<br> <br> consume_credentials();<br> <br> if (nat_uac_test("19")) {<br> setflag(6);<br> }<br> <br> lookup("aliases");<br> if (!is_uri_host_local()) {<br> route(4);<br> route(1);<br> return;<br> };<br> <br> if (uri=~"^sip:[0-9]{3}@") {<br> lookup("aliases");<br>
lookup("location");<br> route(4);<br> route(1);<br> return;<br> }; <br> <br> if(!lookup("location")){<br> if (uri=~"^sip:[0-9]*@") { <br> route(4);<br> route(5);<br> return;<br> };<br> <br> <br> sl_send_reply("404", "User Not Found");<br> return;<br> };<br> <br> route(4);<br> route(1);<br> }<br> <br> route[4] {<br> <br> #
-----------------------------------------------------------------<br> # NAT Traversal Section<br> # -----------------------------------------------------------------<br> <br> if (isflagset(6)) {<br> force_rport();<br> fix_nated_contact();<br> force_rtp_proxy();<br> }<br> }<br> <br> route[5] {<br> <br> # -----------------------------------------------------------------<br> # PSTN Handler<br> # -----------------------------------------------------------------<br> <br> rewritehostport("pstn.gateway:5060"); <br> <br> avp_write("i:45", "inv_timeout");<br> <br> route(1);<br> }<br> <br> onreply_route[1] {<br> <br> if (isflagset(6) &&
status=~"(180)|(183)|2[0-9][0-9]") {<br> if (!search("^Content-Length:[ ]*0")) {<br> force_rtp_proxy();<br> };<br> };<br> <br> if (nat_uac_test("1")) {<br> fix_nated_contact();<br> };<br> }<br> <br><br> [root@adsl-068-213-154-138 openser]# ngrep -qt port 5060<br> interface: eth0 (68.xxx.xxx.xxx/255.255.255.248)<br> filter: (ip) and ( port 5060 )<br> <br> <br> U 2006/06/30 21:13:29.086503 70.xxx.xxx.xxx:5062 -> 68.xxx.xxx.xxx:5060<br> BYE sip:68.xxx.xxx.xxx SIP/2.0..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..From: CIO<sip:202@test.com>;tag=2d8ac-e57529..To:<br> <sip:200@test.com>;tag=4197719146..CSeq: 102 BYE..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport..Contact: CIO<sip:202@70.xxx.xxx.xxx:5062>..Ma<br>
x-Forwards: 70..Route: <sip:200@70.xxx.xxx.xxx:5060>..User-Agent: BVA8051S (LDTK AR18D ) STUN 1 0 0..Supported: timer..Proxy-Authorization: Digest userna<br> me="202",realm="test.com",uri="sip:68.xxx.xxx.xxx",response="b037fee90080d847fa4c837faba14862",nonce="44a5db70e33b5ec051569d1d7fbc2c6f328d<br> 63f2"..Content-Length: 0....<br> <br> U 2006/06/30 21:13:29.602024 70.xxx.xxx.xxx:5062 -> 68.xxx.xxx.xxx:5060<br> BYE sip:68.xxx.xxx.xxx SIP/2.0..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..From: CIO<sip:202@test.com>;tag=2d8ac-e57529..To:<br> <sip:200@test.com>;tag=4197719146..CSeq: 102 BYE..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport..Contact: CIO<sip:202@70.xxx.xxx.xxx:5062>..Ma<br> x-Forwards: 70..Route: <sip:200@70.xxx.xxx.xxx:5060>..User-Agent: BVA8051S (LDTK AR18D ) STUN 1 0 0..Supported: timer..Proxy-Authorization: Digest userna<br>
me="202",realm="test.com",uri="sip:68.xxx.xxx.xxx",response="b037fee90080d847fa4c837faba14862",nonce="44a5db70e33b5ec051569d1d7fbc2c6f328d<br> 63f2"..Content-Length: 0....<br> <br> U 2006/06/30 21:13:30.259448 70.xxx.xxx.xxx:1024 -> 68.xxx.xxx.xxx:5060<br> SIP/2.0 200 Ok..Via: SIP/2.0/UDP 68.xxx.xxx.xxx;branch=z9hG4bKb10a.4676fc16.0..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport=5062..From: CIO <sip:202@test.com<br> >;tag=2d8ac-e57529..To: <sip:200@test.com>;tag=4197719146..Contact: <sip:200@70.xxx.xxx.xxx:5060>..Record-Route: <sip:68.21<br> 3.154.138;ftag=2d8ac-e57529;lr=on>..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..CSeq: 101 INVITE..Content-Type: application/sdp..Server: X-<br> Lite release 1105x..Content-Length: 308....v=0..o=200 378856709 378857471 IN IP4 70.xxx.xxx.xxx..s=X-Lite..c=IN IP4 70.xxx.xxx.xxx..t=0 0..m=audio 8000 RT<br> P/AVP 0 8 3 98 97 101..a=rtpmap:0 pcmu/8000..a=rtpmap:8
pcma/8000..a=rtpmap:3 gsm/8000..a=rtpmap:98 iLBC/8000..a=rtpmap:97 speex/8000..a=rtpmap:101 tele<br> phone-event/8000..a=fmtp:101 0-15..a=sendrecv..<br> <br> U 2006/06/30 21:13:30.259708 68.xxx.xxx.xxx:5060 -> 70.xxx.xxx.xxx:5062<br> SIP/2.0 200 Ok..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport=5062..From: CIO <sip:202@test.com>;tag=2d8ac-e57529..To: <sip:200@test.com<br> >;tag=4197719146..Contact: <sip:200@70.xxx.xxx.xxx:5060>..Record-Route: <sip:68.xxx.xxx.xxx;ftag=2d8ac-e57529;lr=on>..Call-ID: 7b304ac5-59d54-c0a<br> 814d0@test.com..CSeq: 101 INVITE..Content-Type: application/sdp..Server: X-Lite release 1105x..Content-Length: 308....v=0..o=200 378856709<br> 378857471 IN IP4 70.xxx.xxx.xxx..s=X-Lite..c=IN IP4 70.xxx.xxx.xxx..t=0 0..m=audio 8000 RTP/AVP 0 8 3 98 97 101..a=rtpmap:0 pcmu/8000..a=rtpmap:8 pcma/80<br> 00..a=rtpmap:3 gsm/8000..a=rtpmap:98 iLBC/8000..a=rtpmap:97 speex/8000..a=rtpmap:101
telephone-event/8000..a=fmtp:101 0-15..a=sendrecv..<br> <br> U 2006/06/30 21:13:30.399353 70.xxx.xxx.xxx:5062 -> 68.xxx.xxx.xxx:5060<br> ACK sip:68.xxx.xxx.xxx SIP/2.0..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..From: CIO<sip:202@test.com>;tag=2d8ac-e57529..To:<br> <sip:200@test.com>;tag=4197719146..CSeq: 101 ACK..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport..Contact: CIO<sip:202@70.xxx.xxx.xxx:5062>..Ma<br> x-Forwards: 70..Route: <sip:200@70.xxx.xxx.xxx:5060>..User-Agent: BVA8051S (LDTK AR18D ) STUN 1 0 0..Content-Length: 0....<br> <br> U 2006/06/30 21:13:30.399553 68.xxx.xxx.xxx:5060 -> 70.xxx.xxx.xxx:5060<br> ACK sip:200@70.xxx.xxx.xxx:5060 SIP/2.0..Record-Route: <sip:68.xxx.xxx.xxx;ftag=2d8ac-e57529;lr=on>..Call-ID: 7b304ac5-59d54-c0a814d0@test.com<br> ..From: CIO<sip:202@test.com>;tag=2d8ac-e57529..To: <sip:200@test.com>;tag=4197719146..CSeq: 101 ACK..Via: SIP/2.0/UDP 68<br>
.213.154.138;branch=0..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport=5062..Contact: CIO<sip:202@70.xxx.xxx.xxx:5062>..Max-Forwards: 69..User-Agent: BVA8051S<br> (LDTK AR18D ) STUN 1 0 0..Content-Length: 0....<br> <br> U 2006/06/30 21:13:30.608084 70.xxx.xxx.xxx:5062 -> 68.xxx.xxx.xxx:5060<br> BYE sip:68.xxx.xxx.xxx SIP/2.0..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..From: CIO<sip:202@test.com>;tag=2d8ac-e57529..To:<br> <sip:200@test.com>;tag=4197719146..CSeq: 102 BYE..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5062;rport..Contact: CIO<sip:202@70.xxx.xxx.xxx:5062>..Ma<br> x-Forwards: 70..Route: <sip:200@70.xxx.xxx.xxx:5060>..User-Agent: BVA8051S (LDTK AR18D ) STUN 1 0 0..Supported: timer..Proxy-Authorization: Digest userna<br> me="202",realm="test.com",uri="sip:68.xxx.xxx.xxx",response="b037fee90080d847fa4c837faba14862",nonce="44a5db70e33b5ec051569d1d7fbc2c6f328d<br> 63f2"..Content-Length: 0....<br> <br> U
2006/06/30 21:13:32.324907 70.xxx.xxx.xxx:1024 -> 68.xxx.xxx.xxx:5060<br> BYE sip:202@70.xxx.xxx.xxx:5062 SIP/2.0..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5060;rport;branch=z9hG4bK6DCE6FB5347E4C64B528E78857E75918..From: <sip:200@test.com<br> >;tag=4197719146..To: CIO <sip:202@test.com>;tag=2d8ac-e57529..Contact: <sip:200@70.xxx.xxx.xxx:5060>..Route: <sip:68.xxx.xx<br> x.xxx;ftag=2d8ac-e57529;lr=on>..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..CSeq: 27264 BYE..Max-Forwards: 70..User-Agent: X-Lite release 1<br> 105x..Content-Length: 0....<br> <br> U 2006/06/30 21:13:33.997886 70.xxx.xxx.xxx:1024 -> 68.xxx.xxx.xxx:5060<br> BYE sip:202@70.xxx.xxx.xxx:5062 SIP/2.0..Via: SIP/2.0/UDP 70.xxx.xxx.xxx:5060;rport;branch=z9hG4bK6DCE6FB5347E4C64B528E78857E75918..From: <sip:200@test.com<br> >;tag=4197719146..To: CIO <sip:202@test.com>;tag=2d8ac-e57529..Contact: <sip:200@70.xxx.xxx.xxx:5060>..Route:
<sip:68.xxx.xx<br> x.xxx;ftag=2d8ac-e57529;lr=on>..Call-ID: 7b304ac5-59d54-c0a814d0@test.com..CSeq: 27264 BYE..Max-Forwards: 70..User-Agent: X-Lite release 1<br> 105x..Content-Length: 0....<br> <br> <br> <br> <br> <br> <br> <br><b><i>Bogdan-Andrei Iancu <bogdan@voice-system.ro></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> try something like:<br><br>if<br> (method=="BYE" || method=="CANCEL") {<br> unforce_rtp_proxy();<br> if (method=="CANCEL")<br> t_relay();<br> exit;<br> } <br><br>be doing this you let the BYE to reach the loose_route and be properly <br>routed.<br><br>regards,<br>bogdan<br><br><br> </blockquote><br><p> 
                <hr size=1>Want to be your own boss? Learn how on <a href="http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-index"> Yahoo! Small Business.</a>