Hi everybody I having a weird behavior with Mediaproxy I'm using SER 0.9.1 and Mediaproxy Release 1.2.1 The Gateway is a Cisco AS5300 using release 12.2(15)T
I have a UA using behind a NAT, the PSTN gateway and the SER server both are using public IP addresses.
The behaviors are the following: 1. When I tried to place a call from a NATed UA to the PSTN gateway I'm not receiving the call progress tone or ring back tone at the NATed UA. 2. If I decide to wait until the call is completed (doesn't matter if a heard death air as progress tone) I start hearing the calling party as soon the call is completed and we can talk each other without any troubles. 3. If I cancel the call and hang up the phone at the NATed UA before the call is completed (during the call progress stage) the SER/Mediaproxy don't cancel the call it still in progress until it is completed or cancelled by the PSTN.
I'm attaching my ser configuration and the logging I'm getting when I cancel the call before it's completed.
Please Help me to know how to fix this If I'm making some mistake with mediaproxy or routing configuration at the ser configuration.
Thanks in advanced.
Regards
Alberto Cruz
Mar 20 00:10:02 matrix proxydispatcher[1379]: command request call-80BF3413-4297-D911-0217-21@172.31.254.240 172.31.254.240:10286:audio 200.67.33.247 172.31.254.240 remote 65.208.39.219 remote Quintum/1.0.0 info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag: Mar 20 00:10:02 matrix proxydispatcher[1379]: will use default mediaproxy for this call. Mar 20 00:10:02 matrix mediaproxy[1376]: command request call-80BF3413-4297-D911-0217-21@172.31.254.240 172.31.254.240:10286:audio 200.67.33.247 172.31.254.240 remote 65.208.39.219 remote Quintum/1.0.0 info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:,dispatcher Mar 20 00:10:02 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: started. listening on 65.208.39.215:35150 Mar 20 00:10:02 matrix mediaproxy[1376]: command execution time: 9.23 ms Mar 20 00:10:02 matrix proxydispatcher[1379]: forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '65.208.39.215 35150' Mar 20 00:10:02 matrix proxydispatcher[1379]: command execution time: 13.13 ms Mar 20 00:10:06 matrix proxydispatcher[1379]: command lookup call-80BF3413-4297-D911-0217-21@172.31.254.240 65.208.39.219:18342:audio 65.208.39.219 172.31.254.240 remote 65.208.39.215 unknown Cisco-SIPGateway/IOS-12.x info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:711504-73 Mar 20 00:10:06 matrix mediaproxy[1376]: command lookup call-80BF3413-4297-D911-0217-21@172.31.254.240 65.208.39.219:18342:audio 65.208.39.219 172.31.254.240 remote 65.208.39.215 unknown Cisco-SIPGateway/IOS-12.x info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:711504-73,dispatcher Mar 20 00:10:06 matrix mediaproxy[1376]: command execution time: 1.63 ms Mar 20 00:10:06 matrix proxydispatcher[1379]: forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '65.208.39.215 35150' Mar 20 00:10:06 matrix proxydispatcher[1379]: command execution time: 4.88 ms Mar 20 00:10:06 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: caller signed in from 200.67.33.247:49125 (RTP) (will return to 200.67.33.247:49125) Mar 20 00:10:06 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: called signed in from 65.208.39.219:18342 (RTP) (will return to 65.208.39.219:18342) Mar 20 00:10:08 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: caller signed in from 200.67.33.247:49126 (RTCP) (will return to 200.67.33.247:49126) Mar 20 00:10:11 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: called signed in from 65.208.39.219:18343 (RTCP) (will return to 65.208.39.219:18343) Mar 20 00:10:13 matrix proxydispatcher[1379]: command delete call-80BF3413-4297-D911-0217-21@172.31.254.240 info= Mar 20 00:10:13 matrix mediaproxy[1376]: command delete call-80BF3413-4297-D911-0217-21@172.31.254.240 info=dispatcher Mar 20 00:10:13 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: 29/44/73 packets, 1380/5320/6700 bytes (caller/called/relayed) Mar 20 00:10:13 matrix mediaproxy[1376]: session call-80BF3413-4297-D911-0217-21@172.31.254.240: ended. Mar 20 00:10:13 matrix mediaproxy[1376]: command execution time: 1.43 ms Mar 20 00:10:13 matrix proxydispatcher[1379]: forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '' Mar 20 00:10:13 matrix proxydispatcher[1379]: command execution time: 4.29 ms Mar 20 00:10:45 matrix proxydispatcher[1379]: command lookup call-80BF3413-4297-D911-0217-21@172.31.254.240 65.208.39.219:18342:audio 65.208.39.219 172.31.254.240 remote 65.208.39.215 unknown Cisco-SIPGateway/IOS-12.x info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:711504-73 Mar 20 00:10:45 matrix proxydispatcher[1379]: warning: trying to lookup session with non-existent id: 'call-80BF3413-4297-D911-0217-21@172.31.254.240' Mar 20 00:10:45 matrix proxydispatcher[1379]: command execution time: 0.91 ms Mar 20 00:10:45 matrix /usr/local/sbin/ser[11723]: error: use_media_proxy(): empty response from mediaproxy Mar 20 00:10:45 matrix /usr/local/sbin/ser[11723]: ERROR: on_reply processing failed Mar 20 00:10:46 matrix proxydispatcher[1379]: command lookup call-80BF3413-4297-D911-0217-21@172.31.254.240 65.208.39.219:18342:audio 65.208.39.219 172.31.254.240 remote 65.208.39.215 unknown Cisco-SIPGateway/IOS-12.x info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:711504-73 Mar 20 00:10:46 matrix proxydispatcher[1379]: warning: trying to lookup session with non-existent id: 'call-80BF3413-4297-D911-0217-21@172.31.254.240' Mar 20 00:10:46 matrix proxydispatcher[1379]: command execution time: 1.08 ms Mar 20 00:10:46 matrix /usr/local/sbin/ser[11725]: error: use_media_proxy(): empty response from mediaproxy Mar 20 00:10:46 matrix /usr/local/sbin/ser[11725]: ERROR: on_reply processing failed Mar 20 00:10:47 matrix proxydispatcher[1379]: command lookup call-80BF3413-4297-D911-0217-21@172.31.254.240 65.208.39.219:18342:audio 65.208.39.219 172.31.254.240 remote 65.208.39.215 unknown Cisco-SIPGateway/IOS-12.x info=from:8412@172.31.254.240,to:018183324166@65.208.39.215,fromtag:ac1ffef0-20,totag:711504-73 Mar 20 00:10:47 matrix proxydispatcher[1379]: warning: trying to lookup session with non-existent id: 'call-80BF3413-4297-D911-0217-21@172.31.254.240' Mar 20 00:10:47 matrix proxydispatcher[1379]: command execution time: 1.09 ms Mar 20 00:10:47 matrix /usr/local/sbin/ser[11723]: error: use_media_proxy(): empty response from mediaproxy Mar 20 00:10:47 matrix /usr/local/sbin/ser[11723]: ERROR: on_reply processing failed
# # $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $ # # #
# ----------- global configuration parameters ------------------------
debug=3 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E)
/* Uncomment these lines to enter debugging mode fork=no log_stderror=yes */
check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) listen=65.208.39.215 port=5060 alias=65.208.39.215 alias=sip.telereunion.com.mx children=4 fifo_mode=0666 fifo="/tmp/ser_fifo" fifo_db_url="mysql://ser:heslo@localhost/ser" # ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/rr.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/uri.so" loadmodule "/usr/local/lib/ser/modules/uri_db.so" loadmodule "/usr/local/lib/ser/modules/group.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" loadmodule "/usr/local/lib/ser/modules/textops.so" loadmodule "/usr/local/lib/ser/modules/domain.so" loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
# Uncomment this if you want digest authentication # mysql.so must be loaded ! loadmodule "/usr/local/lib/ser/modules/auth.so" loadmodule "/usr/local/lib/ser/modules/auth_db.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
#modparam("usrloc", "db_mode", 0)
# Uncomment this if you want to use SQL database # for persistent storage and comment the previous line modparam("usrloc", "db_mode", 2) modparam("domain", "db_mode", 1) modparam("auth_db|usrloc|domain|group", "db_url", "mysql://ser:heslo@localhost/ser") modparam("group", "use_domain", 0) # -- auth params -- # Uncomment if you are using auth module # modparam("auth_db", "calculate_ha1", yes) # # If you set "calculate_ha1" parameter to yes (which true in this config), # uncomment also the following parameter) # modparam("auth_db", "password_column", "password")
# -- rr params -- # add value to ;lr param to make some broken UAs happy modparam("rr", "enable_full_lr", 1) modparam("mediaproxy", "natping_interval", 60) modparam("registrar", "nat_flag", 2)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with # max_forwards==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { if (method!="ACK") { sl_send_reply("483","Too Many Hops"); }; break; }; if (msg:len >= 2048 ) { if (method!="ACK") { 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=="REGISTER") record_route();
if (method=="REGISTER") { if (uri==myself || is_from_local()) { # Mark as NAT'ed if (client_nat_test("3")) { setflag(2); force_rport(); fix_contact(); }; if (!www_authorize("", "subscriber")) { www_challenge("", "0"); break; } else if (!check_to()) { sl_send_reply("403", "Username!=To not allowed"); break; }; if (!save("location")) { sl_reply_error(); }; } else { append_hf("P-hint: outbound alias\r\n"); sl_send_reply("403", "This domain is not served here"); }; break; };
if (method=="INVITE") { if (!(is_from_local() || uri==myself || is_uri_host_local())) { sl_send_reply("403", "Relaying is forbidden"); break; }; t_on_failure("1"); } else if (method == "BYE" || method == "CANCEL") { end_media_session(); };
# subsequent messages withing a dialog should take the # path determined by record-routing if (loose_route()) { append_hf("P-hint: rr-enforced\r\n"); # The following lines are added due media proxy if (method=="INVITE" || method=="ACK") { use_media_proxy(); }; # end media session for BYE and CANCEL is done above # before entering the loose route. no need to call it here t_relay(); break; };
if (client_nat_test("3") && !search("^Record-Route:")) { # Mark as NAT'ed force_rport(); fix_contact(); }; ### Begin PSTN evaluation if (method=="INVITE") { if (uri=~"sip:01[1-9][0-9]+@.*") { if (!is_user_in("From", "ld")) { sl_send_reply("403", "LD permissions needed"); break; }; rewritehostport("65.208.39.219:5060"); } else if (uri=~"sip:00[1-9][0-9]+@.*") { if (!is_user_in("From", "int")) { sl_send_reply("403", "International permissions needed"); break; }; rewritehost("65.208.39.219"); }; t_on_reply("1"); }; ### End PSTN evaluation if (is_uri_host_local() || uri==myself) { # join with next if? # native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "User not found"); break; }; };
if (method=="INVITE" || method=="ACK") { use_media_proxy(); };
if (!uri==myself) { # mark routing logic in request append_hf("P-hint: outbound\r\n"); };
# forward to current uri now; use stateful forwarding; that # works reliably even if we forward from TCP to UDP if (!t_relay()) { if (method=="INVITE" || method=="ACK") { end_media_session(); }; sl_reply_error(); }; }
failure_route[1] { end_media_session(); }
onreply_route[1] { if (status=~"(180)|(183)|(2[0-9][0-9])") { if (client_nat_test("1")) { fix_contact(); }; use_media_proxy(); }; }