hi, I m sorry for my earlier mail as the picture was not very clear. The scenario is something like this:
Client A (Public IP) \ ________ __________________ __________ | My | | Foreign Openser | | PSTN | |Openser |-----------------------| trusts me through |--------------| Gateway | / |_______ | | source IP | |_________| / |__________________| / Client B (Private IP)
Whenever My Openser receives a call with prefix for eg. 011, it t_relay it to the foreign Ser which trusts My Openser with source IP. Now when the client A with public IP makes a call it gets established but when the client B with private IP makes a call I receive the ringing message but the RTP sessions does not start. I have configured the mediaproxy in My Openser but still it does'nt seem to work. Pls help me figure out the problem.
The RTP Proxy session is not happening and that might be the reason for the problem. Can u pls help me understand why RTP proxy is not getting established for Nated clients.
Below is my configuration script:
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"); 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(); }; }
--------------------------------- Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more.
On 08/10/05 13:35, jayesh nambiar wrote:
hi, I m sorry for my earlier mail as the picture was not very clear. The scenario is something like this:
Client A (Public IP)
\ ________ __________________ __________ | My | | Foreign Openser | | PSTN |
|Openser |-----------------------| trusts me through |--------------| Gateway | / |_______ | | source IP | |_________| / |__________________|
/ Client B (Private IP)
Whenever My Openser receives a call with prefix for eg. 011, it t_relay it to the foreign Ser which trusts My Openser with source IP. Now when the client A with public IP makes a call it gets established but when the client B with private IP makes a call I receive the ringing message but the RTP sessions does not start. I have configured the mediaproxy in My Openser but still it does'nt seem to work. Pls help me figure out the problem.
The RTP Proxy session is not happening and that might be the reason for the problem. Can u pls help me understand why RTP proxy is not getting established for Nated clients.
For sure there is a mistake in your config file. You can use xlog module to print debug messages in different places of the config script to identify the path how the INVITE messages are processed by your openser. In this way, you could locate the problem easier.
Daniel
Below is my configuration script: [...]
Jayesh,
the start point is to make a network trace of your call and look if the SDP in properly modified - the INVITE to the Foreign OpenSER must have in SDP in m= your IP and the same the reply from your OpenSER to the client B...
this way you will see if the mediaproxy was correctly triggered.
regards, bogdan
Daniel-Constantin Mierla wrote:
On 08/10/05 13:35, jayesh nambiar wrote:
hi, I m sorry for my earlier mail as the picture was not very clear. The scenario is something like this:
Client A (Public IP) \ ________ __________________ __________ | My | | Foreign Openser | | PSTN | |Openser |-----------------------| trusts me through |--------------| Gateway | / |_______ | | source IP | |_________| / |__________________|
/ Client B (Private IP) Whenever My Openser receives a call with prefix for eg. 011, it t_relay it to the foreign Ser which trusts My Openser with source IP. Now when the client A with public IP makes a call it gets established but when the client B with private IP makes a call I receive the ringing message but the RTP sessions does not start. I have configured the mediaproxy in My Openser but still it does'nt seem to work. Pls help me figure out the problem.
The RTP Proxy session is not happening and that might be the reason for the problem. Can u pls help me understand why RTP proxy is not getting established for Nated clients.
For sure there is a mistake in your config file. You can use xlog module to print debug messages in different places of the config script to identify the path how the INVITE messages are processed by your openser. In this way, you could locate the problem easier.
Daniel