Hi, I am using the following ser.cfg with ser and mediaproxy, but I am getting the audio only in one direction. This does not seem a problem of NAT, as the nathelper is correclt rewriting the sdp messages, and the aor shows all clients bound with public IP. Earlier t_on_reply call in route[1] was causing an error sl_reply_error used: I'm terribly sorry, server error occured (1/SL) when one calls from one phone to another. Earlier I was getting proper bi-directional audio when I was using STUN instead of mediaproxy.
Is there something wrong with my ser.cfg
#-------------------------------------------------- # # $Id: ser.cfg,v 1.21 2003/06/04 13:47:36 jiri Exp $ # # simple quick-start config script #
# ----------- 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 #debug=7 #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/textops.so" loadmodule "/usr/local/lib/ser/modules/exec.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/acc.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/domain.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" loadmodule "/usr/local/lib/ser/modules/auth.so" loadmodule "/usr/local/lib/ser/modules/auth_db.so" loadmodule "/usr/local/lib/ser/modules/msilo.so" loadmodule "/usr/local/lib/ser/modules/auth_radius.so" loadmodule "/usr/local/lib/ser/modules/uri.so" loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/nathelper.so" loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
# ----------------- setting module-specific parameters --------------- # -- usrloc params -- #modparam("usrloc", "db_url", "sql://ser:heslo@localhost/ser") modparam("usrloc", "db_mode", 2)
modparam("uri", "db_url", "sql://ser:heslo@localhost/ser")
modparam("auth_radius", "radius_config", "/usr/local/etc/radiusclient/radiusclient.conf") modparam("auth_radius", "service_type", 15)
modparam("acc", "db_url", "sql://ser:heslo@localhost/ser") modparam("acc", "db_missed_flag", 3) modparam("acc", "db_flag", 1)
modparam("acc", "log_fmt", "cdfimorstup")
modparam("acc", "radius_config", "/usr/local/etc/radiusclient/radiusclient.conf") modparam("acc", "service_type", 15) modparam("acc", "radius_flag", 1) modparam("acc", "radius_missed_flag", 1) modparam("acc", "log_level", 2) #modparam("acc", "radius_missed_flag", 3)
modparam("nathelper", "rtpproxy_disable", 1) modparam("nathelper", "natping_interval", 0)
modparam("mediaproxy","natping_interval", 30) modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock") modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/ser/sip-clients") modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-clients")
# -- rr params -- modparam("rr", "enable_full_lr", 1)
modparam("msilo", "registrar", "sip:registrar@mydomainxyz123.com") modparam("msilo", "db_url", "sql://ser:heslo@mydomainxyz123.com/ser")
modparam("auth_db", "db_url", "sql://ser:heslo@localhost/ser") modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password")
modparam("uri", "subscriber_table", "subscriber") modparam("uri", "uri_table", "uri") modparam("uri", "uri_user_column", "username") modparam("uri", "uri_domain_column", "domain") modparam("uri", "uri_uriuser_column", "uri_user") modparam("uri", "subscriber_user_column", "username") modparam("uri", "subscriber_domain_column", "domain")
# !! Nathelper 1 #modparam("registrar", "nat_flag", 6) #modparam("nathelper", "natping_interval", 30) # Ping interval 30 s #modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT # !! NAthelper 1 ends
# ------------------------- request routing logic -------------------
# main routing logic
route{ # ----------------------------------------------------------------- # Sanity Check Section # ----------------------------------------------------------------- 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; };
# ----------------------------------------------------------------- # Record Route Section # ----------------------------------------------------------------- # 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"){ # && client_nat_test("3")) { record_route_preset("mydomainxyz123.com:5060;nat=yes"); route(3); } else if (method!="REGISTER") {record_route(); };
# ----------------------------------------------------------------- # Call Tear Down Section # ----------------------------------------------------------------- # if (method=="BYE" || method=="CANCEL") { end_media_session(); };
# ----------------------------------------------------------------- # Loose Route Section # -----------------------------------------------------------------
lookup("aliases");
if (loose_route()) {
if (has_totag() && (method=="INVITE" || method=="ACK")) { if (client_nat_test("3") || search("^Route:.*;nat=yes")) {setflag(6); #use_media_proxy(); }; ; };
route(1); break; };
# ----------------------------------------------------------------- # Call Type Processing Section # ----------------------------------------------------------------- # 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 (!method=="BYE") { force_rport(); fix_nated_contact(); };
if (uri!=myself) {route(1);break;}; if (uri==myself) { if (method=="CANCEL") {route(3); break;}; if (method=="REGISTER") {route(2); break;}; if (method=="MESSAGE") {route(4); break;}; };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { if ((method=="INVITE" || method=="ACK") && t_newtran() ){ route(3);break; }; sl_send_reply("404", "Not Foundbusip1"); break; } else {setflag(1);t_relay();break;};
# if (!lookup("location")) { sl_send_reply("404", "User Not Found"); break; }; }
route[1] {
# ----------------------------------------------------------------- # Default Message Handler # -----------------------------------------------------------------
# t_on_reply("1");
if (!t_relay()) { if (method=="INVITE" || method=="ACK") { #end_media_session(); ; }; # sl_send_reply("404", "balleballeUser Not Found"); # sl_reply_error();
};
}
route[2] {
# ----------------------------------------------------------------- # REGISTER Message Handler # ---------------------------------------------------------------- sl_send_reply("100", "Trying");
#if (!search("^Contact:\ +*") && client_nat_test("7")) { # setflag(6); #fix_nated_register(); # force_rport(); #};
#if (!radius_www_authorize("")) { #if (!www_authorize("","subscriber")) { # www_challenge("","0"); # break; #};
#if (!check_to()) { # sl_send_reply("401", "Unauthorized"); # break; #};
consume_credentials(); save("location"); m_dump(); acc_rad_request("Some comment");
if (!save("location")) { sl_reply_error(); }; }
route[3] {
# ----------------------------------------------------------------- # CANCEL and INVITE Message Handler # -----------------------------------------------------------------
#if (client_nat_test("3")) { # setflag(7); # force_rport(); # fix_nated_contact(); #};
lookup("aliases"); if (uri!=myself) { route(1); break; };
if (!lookup("location")) { sl_send_reply("404", "User Not Found"); acc_db_request("404 missed call", "missed_calls"); acc_rad_request("404 missed call"); setflag(3);
break; };
if (method=="CANCEL") { route(1); break; };
#if (!proxy_authorize("","subscriber")) { # proxy_challenge("","0"); # break; #} else if (!check_from()) { # sl_send_reply("403", "Use From=ID"); # break; #};
consume_credentials();
if (isflagset(6) || isflagset(7)) { # use_media_proxy(); ; };
route(1);
}
route[4] {
if (!t_newtran()) { sl_reply_error(); break; };
if (m_store("0")) { t_reply("202", "Accepted for Later Delivery"); break; };
t_reply("503", "Service Unavailable"); break; }
onreply_route[1] {
if ((isflagset(6) || isflagset(7)) && (status=~"(180)|(183)|2[0-9][0-9]")) { #if (!search("^Content-Length:\ +0")) { use_media_proxy(); }; ; }; if (client_nat_test("1")) { fix_nated_contact(); }; ; }
Regards, Ashutosh Kumar Chetu, Inc. Ph : 1(305) 402 6724 - Witin US Ph : 91 120 5323340 - Outside US Fax:1 (305) 832 5987 For more information, please visit http://www.chetu.com
Try the http://onsip.org/ Getting Started document and config files. The configs are explained in detail and thus very easy to extend. g-)
Ashutosh Kumar wrote:
Hi, I am using the following ser.cfg with ser and mediaproxy, but I am getting the audio only in one direction. This does not seem a problem of NAT, as the nathelper is correclt rewriting the sdp messages, and the aor shows all clients bound with public IP. Earlier t_on_reply call in route[1] was causing an error "sl_reply_error used: I'm terribly sorry, server error occured (1/SL)" when one calls from one phone to another. Earlier I was getting proper bi-directional audio when I was using STUN instead of mediaproxy.
Is there something wrong with my ser.cfg
#-------------------------------------------------- # # $Id: ser.cfg,v 1.21 2003/06/04 13:47:36 jiri Exp $ # # simple quick-start config script #
# ----------- 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 #debug=7 #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/textops.so" loadmodule "/usr/local/lib/ser/modules/exec.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/acc.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/domain.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" loadmodule "/usr/local/lib/ser/modules/auth.so" loadmodule "/usr/local/lib/ser/modules/auth_db.so" loadmodule "/usr/local/lib/ser/modules/msilo.so" loadmodule "/usr/local/lib/ser/modules/auth_radius.so" loadmodule "/usr/local/lib/ser/modules/uri.so" loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/nathelper.so" loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
# ----------------- setting module-specific parameters --------------- # -- usrloc params -- #modparam("usrloc", "db_url", "sql://ser:heslo@localhost/ser") modparam("usrloc", "db_mode", 2)
modparam("uri", "db_url", "sql://ser:heslo@localhost/ser")
modparam("auth_radius", "radius_config", "/usr/local/etc/radiusclient/radiusclient.conf") modparam("auth_radius", "service_type", 15)
modparam("acc", "db_url", "sql://ser:heslo@localhost/ser") modparam("acc", "db_missed_flag", 3) modparam("acc", "db_flag", 1)
modparam("acc", "log_fmt", "cdfimorstup")
modparam("acc", "radius_config", "/usr/local/etc/radiusclient/radiusclient.conf") modparam("acc", "service_type", 15) modparam("acc", "radius_flag", 1) modparam("acc", "radius_missed_flag", 1) modparam("acc", "log_level", 2) #modparam("acc", "radius_missed_flag", 3)
modparam("nathelper", "rtpproxy_disable", 1) modparam("nathelper", "natping_interval", 0)
modparam("mediaproxy","natping_interval", 30) modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock") modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/ser/sip-clients") modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-clients")
# -- rr params -- modparam("rr", "enable_full_lr", 1)
modparam("msilo", "registrar", "sip:registrar@mydomainxyz123.com") modparam("msilo", "db_url", "sql://ser:heslo@mydomainxyz123.com/ser")
modparam("auth_db", "db_url", "sql://ser:heslo@localhost/ser") modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password")
modparam("uri", "subscriber_table", "subscriber") modparam("uri", "uri_table", "uri") modparam("uri", "uri_user_column", "username") modparam("uri", "uri_domain_column", "domain") modparam("uri", "uri_uriuser_column", "uri_user") modparam("uri", "subscriber_user_column", "username") modparam("uri", "subscriber_domain_column", "domain")
# !! Nathelper 1 #modparam("registrar", "nat_flag", 6) #modparam("nathelper", "natping_interval", 30) # Ping interval 30 s #modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT # !! NAthelper 1 ends
# ------------------------- request routing logic
# main routing logic
route{ # ----------------------------------------------------------------- # Sanity Check Section # ----------------------------------------------------------------- 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; };
# ----------------------------------------------------------------- # Record Route Section # ----------------------------------------------------------------- # 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"){ # && client_nat_test("3")) { record_route_preset("mydomainxyz123.com:5060;nat=yes"); route(3); } else if (method!="REGISTER") {record_route(); };
#
----------------------------------------------------------------- # Call Tear Down Section # ----------------------------------------------------------------- # if (method=="BYE" || method=="CANCEL") { end_media_session(); };
# ----------------------------------------------------------------- # Loose Route Section # -----------------------------------------------------------------
lookup("aliases");
if (loose_route()) {
if (has_totag() && (method=="INVITE" || method=="ACK"))
{ if (client_nat_test("3") || search("^Route:.*;nat=yes")) {setflag(6); #use_media_proxy(); }; ; };
route(1); break; };
# ----------------------------------------------------------------- # Call Type Processing Section # ----------------------------------------------------------------- # 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 (!method=="BYE") { force_rport(); fix_nated_contact(); };
if (uri!=myself) {route(1);break;}; if (uri==myself) { if (method=="CANCEL") {route(3); break;}; if (method=="REGISTER") {route(2); break;}; if (method=="MESSAGE") {route(4); break;}; };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { if ((method=="INVITE" || method=="ACK") && t_newtran() ){ route(3);break; }; sl_send_reply("404", "Not Foundbusip1"); break; } else {setflag(1);t_relay();break;};
# if (!lookup("location")) { sl_send_reply("404", "User Not Found"); break; }; }
route[1] {
# ----------------------------------------------------------------- # Default Message Handler # -----------------------------------------------------------------
# t_on_reply("1");
if (!t_relay()) { if (method=="INVITE" || method=="ACK") { #end_media_session(); ; }; # sl_send_reply("404", "balleballeUser Not Found"); # sl_reply_error();
};
}
route[2] {
# ----------------------------------------------------------------- # REGISTER Message Handler # ---------------------------------------------------------------- sl_send_reply("100", "Trying");
#if (!search("^Contact:\ +\*") && client_nat_test("7")) { # setflag(6); #fix_nated_register(); # force_rport(); #};
#if (!radius_www_authorize("")) { #if (!www_authorize("","subscriber")) { # www_challenge("","0"); # break; #};
#if (!check_to()) { # sl_send_reply("401", "Unauthorized"); # break; #};
consume_credentials(); save("location"); m_dump(); acc_rad_request("Some comment");
if (!save("location")) { sl_reply_error(); }; }
route[3] {
#
----------------------------------------------------------------- # CANCEL and INVITE Message Handler #
#if (client_nat_test("3")) { # setflag(7); # force_rport(); # fix_nated_contact(); #}; lookup("aliases"); if (uri!=myself) { route(1); break; }; if (!lookup("location")) { sl_send_reply("404", "User Not Found"); acc_db_request("404 missed call", "missed_calls"); acc_rad_request("404 missed call"); setflag(3); break; };
if (method=="CANCEL") { route(1); break; };
#if (!proxy_authorize("","subscriber")) { # proxy_challenge("","0"); # break; #} else if (!check_from()) { # sl_send_reply("403", "Use From=ID"); # break; #}; consume_credentials(); if (isflagset(6) || isflagset(7)) { # use_media_proxy();
; };
route(1);
}
route[4] {
if (!t_newtran()) { sl_reply_error(); break; };
if (m_store("0")) { t_reply("202", "Accepted for Later Delivery"); break; }; t_reply("503", "Service Unavailable"); break;
}
onreply_route[1] {
if ((isflagset(6) || isflagset(7)) &&
(status=~"(180)|(183)|2[0-9][0-9]")) { #if (!search("^Content-Length:\ +0")) { use_media_proxy(); }; ; };
if (client_nat_test("1")) { fix_nated_contact();
}; ; }
Regards, Ashutosh Kumar Chetu, Inc. Ph : 1(305) 402 6724 - Witin US Ph : 91 120 5323340 - Outside US Fax:1 (305) 832 5987 For more information, please visit http://www.chetu.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers