<div>Hi all</div>
<div> </div>
<div>iam trying to read the getting started document from onsip</div>
<div>when iam configuring pstn-gw.cfg</div>
<div>with the below config</div>
<div> </div>
<div>when the X-lite user try to loging , SIP/2.0 403 Forbidden, in the Log of X-lite</div>
<div> </div>
<div>what is wrong , even i have changed AVP after reading module configs in openser.</div>
<div> </div>
<div>any one suggest me what is wrong iam doing here</div>
<div> </div>
<div>Ram</div>
<div> </div>
<div>-----------------<br>openser.cfg<br>#<br># $Id: openser.cfg,v 1.6 2006/02/15 18:23:46 bogdan_iancu Exp $<br>#<br># simple quick-start config script<br>#</div>
<p># ----------- global configuration parameters ------------------------</p>
<p>debug=9 # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no # (cmd line: -E)</p>
<p>/* Uncomment these lines to enter debugging mode<br>#fork=no<br>#log_stderror=yes<br>*/</p>
<p>check_via=no # (cmd. line: -v)<br>dns=no # (cmd. line: -r)<br>rev_dns=no # (cmd. line: -R)<br>listen=myip<br>port=5060<br>children=4<br>fifo="/tmp/openser_fifo"<br>fifo_db_url="mysql://openser:openserrw@localhost
/openser"</p>
<p><br># ------------------ module loading ----------------------------------</p>
<p><br>loadmodule "/usr/local/lib/openser/modules/mysql.so"<br>loadmodule "/usr/local/lib/openser/modules/sl.so"<br>loadmodule "/usr/local/lib/openser/modules/tm.so"<br>loadmodule "/usr/local/lib/openser/modules/rr.so"
<br>loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<br>loadmodule "/usr/local/lib/openser/modules/usrloc.so"<br>loadmodule "/usr/local/lib/openser/modules/registrar.so"<br>loadmodule "/usr/local/lib/openser/modules/textops.so"
<br>loadmodule "/usr/local/lib/openser/modules/auth.so"<br>loadmodule "/usr/local/lib/openser/modules/auth_db.so"<br>loadmodule "/usr/local/lib/openser/modules/uri.so"<br>loadmodule "/usr/local/lib/openser/modules/uri_db.so"
<br>loadmodule "/usr/local/lib/openser/modules/domain.so"<br>loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"<br>loadmodule "/usr/local/lib/openser/modules/nathelper.so"<br>loadmodule "/usr/local/lib/openser/modules/avpops.so"
<br>loadmodule "/usr/local/lib/openser/modules/permissions.so"</p>
<p>modparam("auth_db|permissions|uri_db|usrloc","db_url", "mysql://openser:openserrw@localhost/openser")<br>modparam("auth_db", "calculate_ha1", 1)<br>modparam("auth_db", "password_column", "password")
</p>
<p>modparam("nathelper", "rtpproxy_disable", 1)<br>modparam("nathelper", "natping_interval", 0)</p>
<p>modparam("mediaproxy","natping_interval", 30)<br>modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock")<br>modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/ser/sip-clients")
<br>modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/ser/rtp-clients")</p>
<p>modparam("usrloc", "db_mode", 2)<br>modparam("auth_db", "calculate_ha1", yes)<br>modparam("auth_db", "password_column", "password")</p>
<p>modparam("registrar", "nat_flag", 6)</p>
<p>modparam("rr", "enable_full_lr", 1)</p>
<p>modparam("tm", "fr_timer_avp", "i:25")<br>modparam("tm", "fr_inv_timer_avp", "i:25")</p>
<p>modparam("permissions", "db_mode", 1)<br>modparam("permissions", "trusted_table", "trusted")</p>
<p>route {</p>
<p> # -----------------------------------------------------------------<br> # Sanity Check Section<br> # -----------------------------------------------------------------<br> if (!mf_process_maxfwd_header("10")) {
<br> sl_send_reply("483", "Too Many Hops");<br> return;<br> };</p>
<p> if (msg:len > max_len) {<br> sl_send_reply("513", "Message Overflow");<br> return;<br> };</p>
<p> # -----------------------------------------------------------------<br> # Record Route Section<br> # -----------------------------------------------------------------<br> if (method=="INVITE" && client_nat_test("3")) {
<br> # INSERT YOUR IP ADDRESS HERE<br> record_route_preset("myproxyip:5060;nat=yes");<br> } else if (method!="REGISTER") {<br> record_route();<br> };
</p>
<p> # -----------------------------------------------------------------<br> # Call Tear Down Section<br> # -----------------------------------------------------------------<br> if (method=="BYE" || method=="CANCEL") {
<br> end_media_session();<br> };</p>
<p> # -----------------------------------------------------------------<br> # Loose Route Section<br> # -----------------------------------------------------------------<br> if (loose_route()) {
</p>
<p> if (has_totag() && (method=="INVITE" || method=="ACK")) {</p>
<p> if (client_nat_test("3")||search("^Route:.*;nat=yes")){<br> setflag(6);<br> use_media_proxy();<br> };
<br> };</p>
<p> route(1);<br> return;<br> };</p>
<p> # -----------------------------------------------------------------<br> # Call Type Processing Section<br> # -----------------------------------------------------------------<br> if (!is_uri_host_local()) {
<br> if (is_from_local() || allow_trusted()) {<br> route(4);<br> route(1);<br> } else {<br> sl_send_reply("403", "Forbidden");
<br> };<br> return;<br> };</p>
<p> if (method=="CANCEL") {<br> route(1);<br> return;<br> } else if (method=="INVITE") {<br> route(3);<br> return;<br> } else if (method=="REGISTER") {
<br> route(2);<br> return;<br> };</p>
<p> lookup("aliases");<br> if (uri!=myself) {<br> route(4);<br> route(1);<br> return;<br> };</p>
<p> if (!lookup("location")) {<br> sl_send_reply("404", "User Not Found");<br> return;<br> };</p>
<p> route(1);<br>}</p>
<p>route[1] {</p>
<p> # -----------------------------------------------------------------<br> # Default Message Handler<br> # -----------------------------------------------------------------</p>
<p> t_on_reply("1");</p>
<p> if (!t_relay()) {</p>
<p> if (method=="INVITE" || method=="ACK") {<br> end_media_session();<br> };</p>
<p> sl_reply_error();<br> };<br>}</p>
<p>route[2] {</p>
<p> # -----------------------------------------------------------------<br> # REGISTER Message Handler<br> # -----------------------------------------------------------------</p>
<p> sl_send_reply("100", "Trying");</p>
<p> if (!search("^Contact:[ ]*\*") && client_nat_test("7")) {<br> setflag(6);<br> fix_nated_register();<br> force_rport();<br> };</p>
<p> if (!www_authorize("","subscriber")) {<br> www_challenge("","0");<br> return;<br> };</p>
<p> if (!check_to()) {<br> sl_send_reply("401", "Unauthorized");<br> return;<br> };</p>
<p> consume_credentials();</p>
<p> if (!save("location")) {<br> sl_reply_error();<br> };<br>}</p>
<p>route[3] {</p>
<p> # -----------------------------------------------------------------<br> # INVITE Message Handler<br> # -----------------------------------------------------------------</p>
<p> if (!allow_trusted()) {</p>
<p> if (!proxy_authorize("","subscriber")) {<br> proxy_challenge("","0");<br> return;<br> } else if (!check_from()) {
<br> sl_send_reply("403", "Use From=ID");<br> return;<br> };</p>
<p> consume_credentials();<br> };</p>
<p> if (client_nat_test("3")) {<br> setflag(7);<br> force_rport();<br> fix_nated_contact();<br> };</p>
<p> if (uri=~"^sip:1[0-9]{10}@") {<br> strip(1);<br> };</p>
<p> lookup("aliases");<br> if (uri!=myself) {<br> route(4);<br> route(1);<br> return;<br> };</p>
<p> if (uri=~"^sip:011[0-9]*@") { # International PSTN<br> route(4);<br> route(5);<br> return;<br> };</p>
<p> if (!lookup("location")) {<br> if (uri=~"^sip:[0-9]{10}@") { # Domestic PSTN<br> route(4);<br> route(5);<br> return;
<br> };</p>
<p> sl_send_reply("404", "User Not Found");<br> return;<br> };</p>
<p> route(4);<br> route(1);<br>}</p>
<p>route[4] {</p>
<p> # -----------------------------------------------------------------<br> # NAT Traversal Section<br> # -----------------------------------------------------------------</p>
<p> if (isflagset(6) || isflagset(7)) {<br> use_media_proxy();<br> };<br>}</p>
<p>route[5] {</p>
<p> # -----------------------------------------------------------------<br> # PSTN Handler<br> # -----------------------------------------------------------------</p>
<p> rewritehost("mygateway:5060"); # INSERT YOUR PSTN GATEWAY IP ADDRESS</p>
<p> # avp_write("i:45", "inv_timeout");</p>
<p> route(4);<br> route(1);<br>}</p>
<p>onreply_route[1] {</p>
<p> if ((isflagset(6) || isflagset(7)) &&<br> (status=~"(180)|(183)|2[0-9][0-9]")) {</p>
<p> if (!search("^Content-Length:[ ]*0")) {<br> use_media_proxy();<br> };<br> };</p>
<p> if (client_nat_test("1")) {<br> fix_nated_contact();<br> };<br>}<br></p>