Is there any way to run mediaproxy.py an make it listen on various ip adresses of a machine
Thanks
Fernando Rodriguez V. frod@aitelecom.net AITelecom S.A. de C.V. http://www.aitelecom.net
Yes Fernando, I'm doing it on multiproccessor machines. I'm using as many mediaproxy proccesses as proccessors. You have to have separate mediaproxy installation directories (e.g. /usr/local/mediaproxy1/, /usr/local/mediaproxy2/ etc.), each one with its own mediaproxyX.ini file, socket file, and its own /etc/init.d/mediaproxyX start script. It's quite easy.
On Monday 10 October 2005 21:20, Fernando Rodriguez wrote:
Is there any way to run mediaproxy.py an make it listen on various ip adresses of a machine
Thanks
Fernando Rodriguez V. frod@aitelecom.net AITelecom S.A. de C.V. http://www.aitelecom.net
And how do u tell openser wich mediaproxy sock to use since you only have one openser running.
Basicaly my setup is like this
Eth0 ______________ Lan 1 192.168.10.23 | Openser |eth3 Internet no-ip.domain ------------------------| Media Proxy |-------------------- |______________| |eth1 |Lan 10.10.20.1 |
My problem is that i want to Proxy the different lans My configuration for openser is, as you can see I use different prefix number depending on the lan they use so I don't use the mediaproxy channels when the call is going to be between the same lan and use the media proxy when the call is destined to a different lan.
And my problem is that if the mediaproxy.py starts running using ip 192.168 and I start a call from network 10.10 the mediaproxy dosnt foreward the packets and so on..
Thanks
# ----------- global configuration parameters ------------------------
#debug=9 # 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) #port=5060 children=4 fifo="/tmp/openser_fifo" fifo_db_url="mysql://openser:openserrw@localhost/openser"
alias="aitelecom.net" # ------------------ module loading ----------------------------------
#loadmodule "/usr/lib/openser/modules/acc.so" loadmodule "/usr/lib/openser/modules/mysql.so" loadmodule "/usr/lib/openser/modules/sl.so" loadmodule "/usr/lib/openser/modules/tm.so" loadmodule "/usr/lib/openser/modules/rr.so" loadmodule "/usr/lib/openser/modules/maxfwd.so" loadmodule "/usr/lib/openser/modules/usrloc.so" loadmodule "/usr/lib/openser/modules/registrar.so" loadmodule "/usr/lib/openser/modules/auth.so" loadmodule "/usr/lib/openser/modules/auth_db.so" loadmodule "/usr/lib/openser/modules/uri.so" loadmodule "/usr/lib/openser/modules/uri_db.so" loadmodule "/usr/lib/openser/modules/domain.so" loadmodule "/usr/lib/openser/modules/mediaproxy.so" loadmodule "/usr/lib/openser/modules/nathelper.so" loadmodule "/usr/lib/openser/modules/textops.so"
# ----------------- setting module-specific parameters --------------- # -- usrloc params --
modparam("usrloc", "db_mode", 2) modparam("usrloc", "timer_interval", 10) modparam("usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")
# -- auth params -- modparam("auth_db", "db_url", "mysql://openser:openserrw@localhost/openser") modparam("auth_db", "calculate_ha1", yes) 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)
# -- tm Params -- modparam("tm", "fr_inv_timer", 45 ) modparam("tm", "fr_timer", 12 )
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "rtpproxy_disable", 1) modparam("nathelper", "natping_interval", 30) #modparam("nathelper", "sipping_from", "sip:ping@sipserver.net")
#modparam("mediaproxy", "ping_nated_only", 1) # Ping only clients behind NAT #modparam("mediaproxy", "natping_interval", 20) modparam("mediaproxy", "mediaproxy_socket", "/var/run/proxydispatcher.sock")
modparam("registrar", "nat_flag", 6)
# ------------------------- request routing logic -------------------
# main routing logic
route {
# ----------------------------------------------------------------- # Procesos de Limpieza # ----------------------------------------------------------------- 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; };
# ----------------------------------------------------------------- # Registro # ----------------------------------------------------------------- log(1, "Entrando al area de Registro\n"); if (method!="REGISTER") { log(1, "Area de Registro\n");
record_route(); };
log(1, "Saliendo del area de Registro\n");
# ----------------------------------------------------------------- # Call Tear Down Section # ----------------------------------------------------------------- log(1, "Entrando al area de Fin de LLamada\n"); if (method=="BYE" || method=="CANCEL") { log(1, "Proceso de fin de llamada\n"); end_media_session(); }; log(1, "Saliendo de Fin de LLamada\n"); # ----------------------------------------------------------------- # 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(1); break; };
if (uri==myself) {
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(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(dst_ip==192.168.1.1) { # log("message received on loopback interface\n"); # setflag(7); # fix_nated_register(); # force_rport(); # }; # if(dst_ip==192.168.108.253) { # log("message received on loopback interface\n"); # setflag(6); # fix_nated_register(); # force_rport(); # };
if (!www_authorize("aitelecom.net","subscriber")) { www_challenge("aitelecom.net","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 # -----------------------------------------------------------------
if(dst_ip==192.168.1.1) { log("message received on loopback interface\n"); setflag(7); fix_nated_contact(); force_rport(); }; if(dst_ip==192.168.108.253) { log("message received on loopback interface\n"); setflag(6); fix_nated_contact(); force_rport(); };
lookup("aliases"); if (uri!=myself) { route(1); break; };
if (!lookup("location")) { sl_send_reply("404", "User Not Found"); 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 (uri=~"[@:](192.168.|10.|172.(1[6-9]|2[0-9]|3[0-1]).)" && #!search("^Route:")){ # sl_send_reply("479", "We don't forward to private IP addresses"); # break; # };
# if (uri=~"[@:](192.168.108.)" || uri=~"[@:](192.168.1.)") { # use_media_proxy(); #};
# ------------------------------------------------------------------------ # Reglas de LLamada # ------------------------------------------------------------------------
if(uri=~"(^sip:2[0-9]*@.*)" && from_uri=~"(^sip:1[0-9]*@.*)") { log(1, "Llamada de extenciones 1xxx a 2xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:2[0-9]*@.*)" && from_uri=~"(^sip:3[0-9]*@.*)") { log(1, "Llamada de extenciones 3xxx a 2xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:2[0-9]*@.*)" && from_uri=~"(^sip:4[0-9]*@.*)") { log(1, "Llamada de extenciones 4xxx a 2xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:3[0-9]*@.*)" && from_uri=~"(^sip:1[0-9]*@.*)") { log(1, "Llamada de extenciones 1xxx a 3xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:3[0-9]*@.*)" && from_uri=~"(^sip:2[0-9]*@.*)") { log(1, "Llamada de extenciones 2xxx a 3xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:3[0-9]*@.*)" && from_uri=~"(^sip:4[0-9]*@.*)") { log(1, "Llamada de extenciones 4xxx a 3xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:1[0-9]*@.*)" && from_uri=~"(^sip:2[0-9]*@.*)") { log(1, "Llamada de extenciones 2xxx a 1xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:1[0-9]*@.*)" && from_uri=~"(^sip:3[0-9]*@.*)") { log(1, "Llamada de extenciones 3xxx a 1xxx\n"); use_media_proxy(); };
if(uri=~"(^sip:1[0-9]*@.*)" && from_uri=~"(^sip:4[0-9]*@.*)") { log(1, "Llamada de extenciones 4xxx a 1xxx\n"); use_media_proxy(); };
route(1); }
onreply_route[1] {
#if ((isflagset(6) || isflagset(7)) && (status=~"(180)|(183)|2[0-9][0-9]")) {
# if (!search("^Content-Length:\ +0")) { log(1, "Mensaje de prueba en reply route\n"); use_media_proxy(); # }; # };
}
-----Mensaje original----- De: users-bounces@openser.org [mailto:users-bounces@openser.org] En nombre de George Perantinos Enviado el: Lunes, 10 de Octubre de 2005 10:50 p.m. Para: users@openser.org Asunto: Re: [Users] Multiple interfaces and mediaproxy
Yes Fernando, I'm doing it on multiproccessor machines. I'm using as many mediaproxy proccesses as proccessors. You have to have separate mediaproxy installation directories (e.g. /usr/local/mediaproxy1/, /usr/local/mediaproxy2/ etc.), each one with its own mediaproxyX.ini file, socket file, and its own /etc/init.d/mediaproxyX start script. It's quite easy.
On Monday 10 October 2005 21:20, Fernando Rodriguez wrote:
Is there any way to run mediaproxy.py an make it listen on various ip adresses of a machine
Thanks
Fernando Rodriguez V. frod@aitelecom.net AITelecom S.A. de C.V. http://www.aitelecom.net
_______________________________________________ Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users