Dear All,
I apologize for asking a repeated question.
I tried ser 0.8.14 and 0.9 to work with mediaproxy. I could setup call but there are silence.
I did try to bypass the proxydispatcher
modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy.sock") #modparam("mediaproxy", "mediaproxy_socket","/var/run/proxydispatcher.sock")
and the result is the same.
I have been stuck for days.
Thanks in advenced for any help available.
Regards,
TC Chan
The proxydispatcher dump the following:
[root@ser mediaproxy]# ./proxydispatcher.py --no-fork Listening for commands on local socket `/var/run/proxydispatcher.sock' Default mediaproxy server is on `/var/run/mediaproxy.sock' command request fe5a6f36-c6092310@192.228.118.240 192.228.118.240:18278:audio 210.187.111.86 219.94.42.174 remote 210.187.111.86 remote Sipura/SPA2000-2.0.13(g) info=from:01548900@219.94.42.174,to:01548901@219.94.42.174,fromtag:d9170fe31e4cbe8o0,totag: forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '127.0.0.1 35000' command execution time: 16.89 ms command lookup fe5a6f36-c6092310@192.228.118.240 192.228.118.240:18280:audio 210.187.111.86 219.94.42.174 remote 219.94.42.174 unknown Sipura/SPA2000-2.0.13(g) info=from:01548900@219.94.42.174,to:01548901@219.94.42.174,fromtag:d9170fe31e4cbe8o0,totag:8f2251e89d625018i1 forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '127.0.0.1 35000' command execution time: 3.92 ms
After a long while ..........
command delete fe5a6f36-c6092310@192.228.118.240 info= forwarding to mediaproxy on /var/run/mediaproxy.sock: got: '' command execution time: 2.53 ms
While Mediaproxy dump the following:
[root@ser mediaproxy]# ./mediaproxy.py --no-fork Listening for commands on local socket `/var/run/mediaproxy.sock' Listening for remote commands is disabled Using IP address `127.0.0.1' for the RTP/RTCP proxy command request fe5a6f36-c6092310@192.228.118.240 192.228.118.240:18278:audio 210.187.111.86 219.94.42.174 remote 210.187.111.86 remote Sipura/SPA2000-2.0.13(g) info=from:01548900@219.94.42.174,to:01548901@219.94.42.174,fromtag:d9170fe31e4cbe8o0,totag:,dispatcher session fe5a6f36-c6092310@192.228.118.240: started. listening on 127.0.0.1:35000 command execution time: 11.72 ms command lookup fe5a6f36-c6092310@192.228.118.240 192.228.118.240:18280:audio 210.187.111.86 219.94.42.174 remote 219.94.42.174 unknown Sipura/SPA2000-2.0.13(g) info=from:01548900@219.94.42.174,to:01548901@219.94.42.174,fromtag:d9170fe31e4cbe8o0,totag:8f2251e89d625018i1,dispatcher command execution time: 1.32 ms command status command execution time: 0.36 ms session fe5a6f36-c6092310@192.228.118.240: 0/0/0 packets, 0/0/0 bytes (caller/called/relayed) session fe5a6f36-c6092310@192.228.118.240: ended (did timeout). command status command execution time: 0.18 ms command delete fe5a6f36-c6092310@192.228.118.240 info=dispatcher command execution time: 0.24 ms
Session dump the following:
./[root@ser mediaproxy]# ./sessions.py
Caller Via Called Status Duration Codec Type Traffic ------------------------------------------------------------------------------------------------------------ 192.228.118.240:18278 - 127.0.0.1:35000 - 192.228.118.240:18280 inactive 0'04" Unknown Audio 0/0/0
Total traffic: 0bps/0bps/0bps (in1/in2/out) Session count: 1
[root@ser mediaproxy]# ./sessions.py No RTP sessions
My ser script is as follow:
#debug=3 #fork=no #log_stderror=yes check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) #port=5060 #children=4 fifo="/tmp/ser_fifo"
# ------------------ module loading ---------------------------------- #loadmodule "/usr/local/lib/ser/modules/nathelper.so" 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/registrar.so" loadmodule "/usr/local/lib/ser/modules/xlog.so" loadmodule "/usr/local/lib/ser/modules/exec.so" loadmodule "/usr/local/lib/ser/modules/auth.so" loadmodule "/usr/local/lib/ser/modules/auth_db.so" loadmodule "/usr/local/lib/ser/modules/acc.so" loadmodule "/usr/local/lib/ser/modules/group.so" loadmodule "/usr/local/lib/ser/modules/textops.so" #loadmodule "/usr/local/lib/ser/modules/uri.so"
loadmodule "/usr/local/lib/ser/modules/domain.so" loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
#---------------------------------------------------------------------- # mediaproxy modparam("mediaproxy", "natping_interval", 60) #modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy.sock") modparam("mediaproxy", "mediaproxy_socket", "/var/run/proxydispatcher.sock") modparam("registrar", "nat_flag", 2) #----------------------------------------------------------------------
#---------------------------------------------------------------------- # uri #modparam("uri", "db_url", "sql://root:heslo@localhost/ser") #modparam("uri", "uri_table", "subscriber") #----------------------------------------------------------------------
#---------------------------------------------------------------------- # TCN: no forking #modparam("registrar","desc_time_order",1) #modparam("usrloc","desc_time_order",1) #modparam("registrar","append_branches",0) #-----------------------------------------------------------------------
# ----------------- setting module-specific parameters --------------- modparam("usrloc", "db_mode", 1) #modparam("usrloc", "db_mode", 2)
#------------------------------------------------------------------------------------- #TCN: To chnage the database loc to remote PC change the following lines #grep -r 'db_url' sersrc review that the following modules need to be changed: # group,vm,usrloc,uri,domain,jabber,auth_db,pdt,acc,msilo #modparam("auth_db", "db_url", "sql://root:heslo@219.94.42.174/ser") #modparam("usrloc", "db_url", "sql://root:heslo@219.94.42.174/ser") #modparam("group", "db_url", "sql://root:heslo@219.94.42.174/ser")
modparam("acc", "db_url", "mysql://root:heslo@localhost/ser") modparam("auth_db", "db_url", "mysql://root:heslo@localhost/ser") modparam("usrloc", "db_url", "mysql://root:heslo@localhost/ser") modparam("group", "db_url", "mysql://root:heslo@localhost/ser") #-------------------------------------------------------------------------------------
modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("rr", "enable_full_lr", 1) modparam("tm", "fr_inv_timer", 30 )
################### NAT ##################### # We will you flag 6 to mark NATed contacts #modparam("registrar", "nat_flag", 6) # Enable NAT pinging #modparam("nathelper", "natping_interval", 3) # Ping only contacts that are known to be # behind NAT #modparam("nathelper", "ping_nated_only", 1) ##############################################
#---------------------------------------------------------------------- # accounting #modparam("acc", "log_flag", 2) #modparam("acc", "db_flag", 2) #----------------------------------------------------------------------
alias="redtone" alias="redtone.sip" alias="redtone.sip.com" alias="redtone.sip.com.my"
# ------------------------- request routing logic ------------------- 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"); xlog ("L_ERR","-----------------------------------------------------------------\r\n\r\n\r\n\r\n"); break; }; if ( msg:len > max_len ) { sl_send_reply("513", "Message too Large"); xlog ("L_ERR","-----------------------------------------------------------------\r\n\r\n\r\n\r\n"); break; };
if (method=="REGISTER") { xlog("L_ERR","xlog %Tf: REGISTER route uri:%ru method:%rm\r\nfrom:% fu To:%tu Contact:%ct\r\n\r\n\r\n");
#if (is_from_local()) #{ xlog("L_ERR","xlog %Tf: FROM LOCAL REGISTER route uri:%ru method:%rm\r\nfrom:%fu To:%tu Contact:%ct\r\n\r\n\r\n");
# Mark as NAT'ed if (client_nat_test("3")) { #setflag(2); force_rport(); fix_contact(); }; xlog("L_ERR","xlog %Tf: start REGISTER route uri:%ru method:%rm\r \nfrom:%fu To:%tu Contact:%ct\r\n\r\n\r\n"); if (!www_authorize("redtone", "subscriber")) { xlog("L_ERR","%fu failed authentification!\r\n"); www_challenge("redtone", "0"); xlog("L_ERR","%fu failed authentification and challenge!\r\n"); xlog ("L_ERR","-----------------------------------------------------------------\r\n\r\n\r\n\r\n"); break; }; save("location"); xlog("L_ERR","username %fu location REGISTERed!\r\n"); xlog ("L_ERR","-----------------------------------------------------------------\r\n\r\n\r\n\r\n"); break; /* } else { xlog("L_ERR","This domain is not served here!\r\n"); sl_send_reply("403", "This domain is not served here"); }; */ break; };
/* if (method=="INVITE") { if (!(is_from_local() || 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(); }; /* if (loose_route()) { 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; }; */ # Force subsequent messages to pass trough this proxy if (method == "INVITE") { record_route(); };
if (client_nat_test("3") && !search("^Record-Route:")) { # Mark as NAT'ed force_rport(); fix_contact(); };
if (method=="INVITE") { t_on_reply("1"); };
# if (is_uri_host_local()) { if (!lookup("location")) { sl_send_reply("404", "User not found"); break; }; # };
if (method=="INVITE" || method=="ACK") { use_media_proxy(); };
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=~"(183)|(2[0-9][0-9])") { #if (status=~"200") {
if (client_nat_test("1")) { fix_contact(); }; use_media_proxy(); }; }