[Users] mediaproxy problem

jayesh nambiar jayesh_1017 at yahoo.com
Wed Aug 10 09:09:50 CEST 2005


hi,
I did admin the other SER and that works. Thanx.
Now if the request is for foreign calls I send the request from my OPENSER to a foreign SER . That SER does trust me through the source IP. We buy pstn minutes from them. Now the calls are possible when the users are with public IP and also behind NAT. But when the call is for the Cisco phone that is to be handled by the Foriegn SER it does not get established neither the rtp sesions gets established between my SER and the end called party.
Can u pls suggest a particular way to handle such calls. Can u pls suggest wat might b the problem. Thanx a lot
 
My configuration is:
 
debug=3
fork=yes
log_stderror=no
listen=203.XXX.64.XX  # INSERT YOUR IP ADDRESS HERE
port=5060
children=4
dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
fifo_db_url="mysql://openser:openserrw@localhost/openser"
loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
loadmodule "/usr/local/lib/openser/modules/uri.so"
loadmodule "/usr/local/lib/openser/modules/uri_db.so"
loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"
loadmodule "/usr/local/lib/openser/modules/nathelper.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/avpops.so"
loadmodule "/usr/local/lib/openser/modules/domain.so"
loadmodule "/usr/local/lib/openser/modules/permissions.so"
loadmodule "/usr/local/lib/openser/modules/acc.so"
modparam("auth_db|permissions|uri_db|usrloc|acc", 
 "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
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-asymmetric-clients")
modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-asymmetric-clients")
modparam("usrloc", "db_mode", 2)
modparam("registrar", "nat_flag", 6)
modparam("rr", "enable_full_lr", 1)
modparam("tm", "fr_inv_timer", 27)
modparam("tm", "fr_inv_timer_avp", "inv_timeout")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "db_flag", 1)
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 Overflow");
  break;
 };
 # -----------------------------------------------------------------
 # Record Route Section
 # -----------------------------------------------------------------
 if (method=="INVITE" && client_nat_test("3")) {
  # INSERT YOUR IP ADDRESS HERE
  record_route_preset("203.XXX.64.XX: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 (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 (uri!=myself) {
  route(5);
  route(1);
  break;
 };
 if (uri==myself) {
  if (method=="ACK") {
   route(6);
   break;
  } else if (method=="CANCEL") {
   route(3);
   break;
  } else if (method=="INVITE") {
   route(3);
   break;
  } else  if (method=="REGISTER") {
   route(2);
   break;
  };
  lookup("aliases");
  if (uri!=myself) {
   route(5);
   route(1);
   break;
  };
  if (!lookup("location")) {
   sl_send_reply("404", "User Not Found");
   break;
  };
 };
 route(1);
}
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
 # -----------------------------------------------------------------
 sl_send_reply("100", "Trying");
 if (!search("^Contact:\ +\*") && client_nat_test("7")) {
  setflag(6);
  fix_nated_register();
  force_rport();
 };
 if (!www_authorize("my_domain","subscriber")) {
  www_challenge("my_domain","0");
  break;
 };
 if (!check_to()) {
  sl_send_reply("401", "Unauthorized");
  break;
 };
 consume_credentials();
 if (!save("location")) {
  sl_reply_error();
 };
}
route[3] {
 # -----------------------------------------------------------------
 # CANCEL and INVITE Message Handler
 # -----------------------------------------------------------------
 setflag(1);
  
 if (client_nat_test("3")) {
  setflag(7);
  force_rport();
  fix_nated_contact();
 };
 
  if (method=="INVITE" && !allow_trusted()) {
  if (!proxy_authorize("my_domain","subscriber")) {
   proxy_challenge("my_domain","0");
   break;
  } else if (!check_from()) {
   sl_send_reply("403", "Use From=ID");
   break;
  };
  consume_credentials();
 };
 lookup("aliases");
 if (uri!=myself) {
  route(5);
  route(1);
  break;
 };
 if (uri=~"^sip:011[0-9]*@") {  # International PSTN
  route(4);
  break;
 };
 if (!lookup("location")) {
  if (uri=~"^sip:[0-9]{10}@") { # Domestic PSTN
   route(4);
   break;
  };
  sl_send_reply("404", "User Not Found");
  break;
 };
 if (method=="CANCEL") {
  route(1);
  break;
 };
 route(5);
 route(1);
}
route[4] {
 # -----------------------------------------------------------------
 # PSTN Handler
 # -----------------------------------------------------------------
 #rewritehost("66.XXX.11.XX"); # INSERT YOUR PSTN GATEWAY IP ADDRESS
 avp_write("i:45", "inv_timeout");
 route(5);
 route(1);
}
route[5] {
 # -----------------------------------------------------------------
 # RTP Proxy Enabler
 # -----------------------------------------------------------------
 if (isflagset(6) || isflagset(7)) {
  use_media_proxy();
 };
}
route[6] {
 # ------------------------------------------------------------------------
 # ACK Handler
 # ------------------------------------------------------------------------
 # ------------------------------------------------------------------------
 # Aliases Section
 # ------------------------------------------------------------------------
 lookup("aliases");
 if (uri!=myself) {
  route(5);
  route(1);
  break;
 };
 lookup("location");
 route(1);
}

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();
 };
}

 
 
 
 
 
 
 
 


		
---------------------------------
 Start your day with Yahoo! - make it your home page 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20050810/2022b3f3/attachment.htm 


More information about the Users mailing list