Dear List,
At below config. i setted up OpenSER on Public IP and PSTN Gateway is again on another Public IP. I use Zyxel Prestige Series 660-HW ADSL modems on both client side and note that they have SIP ALG, also i've completed port forwarding in each modem, so SIP2SIP call happens (voice traffic goes from UA to UA) without need of anything extra as STUN or RTP RELAY. But since those are very away from each other if a UA needs to call PSTN the voice traffic flows from UA to PSTN and that lowers QoS :(
I would like to activate MediaProxy again but just for one case which is PSTN, so whenever a UA needs to call PSTN the voice traffic flows like :
UA (ATA) >>> OpenSER + MediaProxy >>> PSTN
How can i setup this like above without touching SIP2SIP calls between UA's... or adding the lines beginning with # these to my existing config is enough ?
Thanks, Ozan Blotter
debug=3 fork=yes log_stderror=no check_via=no listen=212.XXX.104.XXX # This is OpenSER's Public IP port=5060 children=4 dns=no rev_dns=no fifo="/tmp/openser_fifo"
# fifo_db_url="mysql://openser:openserrw@localhost/openser"
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/mediaproxy.so"
modparam("usrloc", "db_mode", 0) modparam("rr", "enable_full_lr", 1) # modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock") # modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/openser/sip-asymmetric-clients") # modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/openser/rtp-asymmetric-clients")
route { 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; };
if (method!="REGISTER") { record_route(); };
if (loose_route()) { route(1); break; };
if (uri!=myself) { route(1); break; };
if (uri==myself) {
if (method=="REGISTER") { route(2); break; };
lookup("aliases"); if (uri!=myself) { route(1); break; };
if (uri=~"^sip:0[0-9]*@*") { rewritehost("195.XXX.122.XXX"); # This is PSTN Gateways's Public IP # use_media_proxy(); route(1); break; };
if (!lookup("location")) { sl_send_reply("404", "User Not Found"); break; };
route(1); }; }
route[1] { if (!t_relay()) { sl_reply_error(); }; }
route[2] { if (!save("location")) { sl_reply_error(); }; }