<HTML><BODY>
<div>Hello Hakan,<br>
<br>
I have attached my openser.cfg file if you can see any error:<br>
<br>
DB entry is:<br>
<br>
select * from trusted where src_ip = '82.113.11.12';<br>
+--------------+-------+--------------+------+<br>
| src_ip | proto | from_pattern | tag |<br>
+--------------+-------+--------------+------+<br>
| 82.113.11.12 | udp | ^sip:00*@* | NULL |<br>
+--------------+-------+--------------+------+<br>
<br>
<br>
=====<br>
<br>
# ------------------ module loading ----------------------------------<br>
<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>
<br>
<br>
loadmodule "/usr/local/lib/openser/modules/permissions.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/nathelper.so"<br>
loadmodule "/usr/local/lib/openser/modules/uri_db.so"<br>
loadmodule "/usr/local/lib/openser/modules/uri.so"<br>
loadmodule "/usr/local/lib/openser/modules/dispatcher.so"<br>
<br>
<br>
# ----------------- setting module-specific parameters ---------------<br>
<br>
#---- Permissions_Module_Parameters -----<br>
modparam("permissions", "db_mode", 0)<br>
modparam("permissions", "trusted_table", "trusted")<br>
modparam("permissions", "source_col", "src_ip")<br>
modparam("permissions", "proto_col", "proto")<br>
modparam("permissions", "from_col", "from_pattern")<br>
<br>
modparam("permissions", "db_url", "mysql://openser:openserrw@localhost/openser")<br>
# -- usrloc params --<br>
<br>
modparam("usrloc", "db_mode", 0)<br>
<br>
# Uncomment this if you want to use SQL database<br>
modparam("auth_db|uri_db|usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")<br>
<br>
modparam("auth_db", "use_domain", 1)<br>
modparam("auth_db", "calculate_ha1", 1)<br>
modparam("auth_db", "password_column", "password")<br>
<br>
modparam("nathelper", "natping_interval", 30)<br>
modparam("nathelper", "ping_nated_only", 1)<br>
modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")<br>
<br>
modparam( "registrar", "append_branches", 1 )<br>
modparam( "registrar", "desc_time_order", 1 )<br>
modparam( "registrar", "nat_flag", 6 )<br>
<br>
modparam("usrloc", "db_mode", 2)<br>
<br>
##modparam("rr", "enable_full_lr", 1)<br>
####### end old ser<br>
<br>
# -- auth params --<br>
# Uncomment if you are using auth module<br>
#<br>
#modparam("auth_db", "calculate_ha1", yes)<br>
#<br>
# If you set "calculate_ha1" parameter to yes (which true in this config),<br>
# uncomment also the following parameter)<br>
#<br>
#modparam("auth_db", "password_column", "password")<br>
<br>
# -- rr params --<br>
# add value to ;lr param to make some broken UAs happy<br>
modparam("rr", "enable_full_lr", 1)<br>
<br>
# ------------------------- request routing logic -------------------<br>
<br>
# main routing logic<br>
<br>
route {<br>
<br>
###########<br>
if (!mf_process_maxfwd_header("10")) {<br>
sl_send_reply("483", "Too Many Hops");<br>
return;<br>
};<br>
<br>
<br>
if (msg:len > max_len) {<br>
sl_send_reply("513", "Message Overflow");<br>
return;<br>
};<br>
<br>
###############<br>
if ( method != "REGISTER" ) {<br>
record_route();<br>
};<br>
<br>
if ( nat_uac_test( "3" ) ) {<br>
setflag( 6 );<br>
force_rport();<br>
fix_nated_contact();<br>
};<br>
<br>
if ( method=="INVITE" ) {<br>
force_rtp_proxy();<br>
};<br>
<br>
if ( loose_route() ) {<br>
route( 1 );<br>
return;<br>
};<br>
<br>
if ( uri == myself ) {<br>
if ( method == "REGISTER" ) {<br>
if ( ! www_authorize( "", "subscriber" ) ) {<br>
www_challenge( "", "0" );<br>
return;<br>
};<br>
<br>
if ( ! check_to() ) {<br>
sl_send_reply( "403", "Authentication user must match username" );<br>
return;<br>
};<br>
<br>
save( "location" );<br>
return;<br>
};<br>
<br>
if (allow_trusted()) {<br>
<br>
if ( uri =~ "sip:00[1-9]+@.*" ) {<br>
<br>
if ( src_ip == 82.113.11.12){<br>
prefix("2333");<br>
};<br>
<br>
prefix("11");<br>
ds_select_dst( "1", "0" );<br>
route( 1 );<br>
return;<br>
}<br>
<br>
};<br>
<br>
<br>
} else {<br>
if ( method == "INVITE" ) {<br>
sl_send_reply( "403", "Host part forbidden" );<br>
return;<br>
};<br>
};<br>
<br>
route( 1 );<br>
}<br>
<br>
route[1] {<br>
t_on_reply( "1" );<br>
if ( ! t_relay() ) {<br>
sl_reply_error();<br>
};<br>
}<br>
<br>
onreply_route[1] {<br>
if ( status =~ "(180)|(183)|2[0-9][0-9]" ) {<br>
if ( ! search( "^Content-Length:\ +0" ) ) {<br>
force_rtp_proxy();<br>
};<br>
};<br>
<br>
if ( nat_uac_test( "3" ) ) {<br>
force_rport();<br>
fix_nated_contact();<br>
};<br>
} <br>
</div>
<div> </div>
<br>
##=================<br>
<br>
-----Original Message-----<br>
From: hakanyasti@gmail.com<br>
To: ronn100200@aim.com; users@openser.org<br>
Sent: Mon, 14 Aug 2006 8:10 AM<br>
Subject: Re: [Users] Module for Config files<br>
<br>
<div id="AOLMsgPart_2_9a5073a6-b3e7-4862-9f0e-9ce57f3b61a6">
<div><font face="Arial" size="2">You can use permissions module.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><a href="http://www.openser.org/docs/modules/1.1.x/permissions.html" target="_blank">http://www.openser.org/docs/modules/1.1.x/permissions.html</a></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">this is an example of with
trusted_table.....</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">loadmodule
"/usr/local/lib/openser/modules/permissions.so"</font></div>
<font face="Arial" size="2">
</font>
<div><font face="Arial" size="2"><br>
modparam("permissions", "db_url", "postgres or
mysql://username:password@localhost/dbname")</font></div>
<div> </div>
<div><font face="Arial" size="2">#---- Permissions_Module_Parameters
-----<br>
modparam("permissions", "db_mode", 0)<br>
modparam("permissions",
"trusted_table", "trusted")<br>
modparam("permissions", "source_col",
"src_ip")<br>
modparam("permissions", "proto_col",
"proto")<br>
modparam("permissions", "from_col", "from_pattern")</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">route[3] {</font></div>
<div> </div>
<div><font face="Arial" size="2"> #
-----------------------------------------------------------------<br>
# INVITE Message Handler<br>
#
-----------------------------------------------------------------</font></div>
<div> </div>
<div><font face="Arial" size="2"> if
(allow_trusted()) {</font></div>
<div><font face="Arial" size="2">
route(4); # NAT Traversal
Section<br>
route(5); # PSTN Handler <br>
return;<br>
};</font></div>
<div> </div>
<div><font face="Arial" size="2">Welcome to psql 7.4.13, the PostgreSQL interactive
terminal.</font></div>
<div> </div>
<div><font face="Arial" size="2">Type: \copyright for distribution
terms<br>
\h for help with SQL
commands<br>
\? for help on internal slash
commands<br>
\g or terminate with semicolon
to execute query<br>
\q to quit</font></div>
<div><font face="Arial" size="2">dbname=> select * from
trusted;<br>
src_ip |
proto |
from_pattern
<br>
-----------------+-------+-------------------------------<br>
10.1.1.5
| udp | ^sip:120*@*</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Regards,</font></div>
<div><font face="Arial" size="2">Hakan.</font></div>
<div> </div>
<div>----- Original Message ----- </div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>From:</b>
<a title="ronn100200@aim.com" href="javascript:parent.ComposeTo('ronn100200@aim.com');">ronn100200@aim.com</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="users@openser.org" href="javascript:parent.ComposeTo('users@openser.org');">users@openser.org</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Monday, August 14, 2006 5:39
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [Users] Module for Config
files</div>
<div><br>
</div>
<div>Hi All,<br>
<br>
I am using the following if statement to
allow certain calls from pre authorized IPs. <br>
<br>
if ( method ==
"INVITE" && src_ip != 195.xxx.xxx.xx && src_ip !=
195.xxx.xxx.xx && src_ip != 195.xxx.xxx.xx && src_ip !=
195.xxx.xxx.xx) {<br>
<br>
<br>
My issues is the
number of IPs that need to be authorized this way is getting large and was
wondering if there's a module that can be used to read config date from a
config file ? <br>
<br>
regards,<br>
<br>
Ron</div>
<div class="AOLPromoFooter">
<hr style="margin-top: 10px;">
<a href="http://pr.atwola.com/promoclk/100122638x1081283466x1074645346/aol?redir=http%3A%2F%2Fwww%2Eaim%2Ecom%2Ffun%2Fmail%2F" target="_blank"><b>Check Out the new free AIM(R) Mail</b></a> -- 2 GB of storage
and industry-leading spam and email virus protection.<br>
</div>
<div>
</div>
<hr>
<div></div>
_______________________________________________<br>
Users mailing
list<br>
Users@openser.org<br>
http://openser.org/cgi-bin/mailman/listinfo/users<br>
</blockquote></div>
<!-- end of AOLMsgPart_2_9a5073a6-b3e7-4862-9f0e-9ce57f3b61a6 -->
</BODY></HTML>