<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Ricardo,</FONT></DIV>
<DIV><FONT face=Arial size=2>Can you help us in setting OpenSer as a central 
proxy for multiple Asterisk PSTN GWs,</FONT></DIV>
<DIV><FONT face=Arial size=2>we current have trouble in routing UAs call through 
OpenSer without being registered with Asterisk..</FONT></DIV>
<DIV><FONT face=Arial size=2>We like to just have OpenSer registered with all 
the Asterisk and OpenSer will be the AAA proxy for SIP users, once authenticated 
through MYSQL db look up, OpenSer will pass the call to Asterisk 
Box.</FONT></DIV>
<DIV><FONT face=Arial size=2>Asterisk Boxes will then make connection to PSTN or 
VM service.</FONT></DIV>
<DIV><FONT face=Arial size=2>Please see the script below and 
comment.</FONT></DIV>
<DIV><FONT face=Arial size=2>Thank you in advance,</FONT></DIV>
<DIV><FONT face=Arial size=2>Michael</FONT></DIV>
<DIV><FONT face=Arial 
size=2>--------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>#<BR># $Id: openser.cfg,v 1.6 2006/02/15 18:23:46 
bogdan_iancu Exp $<BR>#<BR># simple quick-start config script<BR>#</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># ----------- global configuration parameters 
------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# debug level (cmd line: 
-dddddddddd)<BR>fork=yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# Set to no to enter debugging mode<BR>log_stderror=no&nbsp;&nbsp;&nbsp; # (cmd 
line: -E) Set to yes to enter debugging mode</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>check_via=no&nbsp;# (cmd. line: 
-v)<BR>dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. 
line: -r)<BR>rev_dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: 
-R)<BR>port=5060<BR>children=4<BR>fifo="/tmp/openser_fifo"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#<BR># uncomment the following lines for TLS 
support<BR>#disable_tls = 0<BR>#listen = tls:your_IP:5061<BR>#tls_verify = 
1<BR>#tls_require_certificate = 0<BR>#tls_method = TLSv1<BR>#tls_certificate = 
"/build/buildd/openser-1.1.0/debian/openser/etc/openser/tls/user/user-cert.pem"<BR>#tls_private_key 

"/build/buildd/openser-1.1.0/debian/openser/etc/openser/tls/user/user-privkey.pem"<BR>#tls_ca_list 

"/build/buildd/openser-1.1.0/debian/openser/etc/openser/tls/user/user-calist.pem"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># ------------------ module loading 
----------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Uncomment this if you want to use SQL 
database<BR>loadmodule "/usr/lib/openser/modules/mysql.so"<BR>loadmodule 
"/usr/lib/openser/modules/domain.so"<BR>loadmodule 
"/usr/lib/openser/modules/sl.so"<BR>loadmodule 
"/usr/lib/openser/modules/tm.so"<BR>loadmodule 
"/usr/lib/openser/modules/rr.so"<BR>loadmodule 
"/usr/lib/openser/modules/maxfwd.so"<BR>loadmodule 
"/usr/lib/openser/modules/usrloc.so"<BR>loadmodule 
"/usr/lib/openser/modules/mediaproxy.so"<BR>loadmodule 
"/usr/lib/openser/modules/registrar.so"<BR>loadmodule 
"/usr/lib/openser/modules/textops.so"<BR>loadmodule 
"/usr/lib/openser/modules/uri.so"<BR>loadmodule 
"/usr/lib/openser/modules/uri_db.so"<BR>loadmodule 
"/usr/lib/openser/modules/avpops.so"<BR>loadmodule 
"/usr/lib/openser/modules/permissions.so"<BR># Uncomment this if you want digest 
authentication<BR># mysql.so must be loaded !<BR>loadmodule 
"/usr/lib/openser/modules/auth.so"<BR>loadmodule 
"/usr/lib/openser/modules/auth_db.so"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># ----------------- setting module-specific 
parameters ---------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># -- usrloc params --</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#modparam("usrloc", "db_mode",&nbsp;&nbsp; 
0)<BR>modparam("auth_db|permissions|uri_db|usrloc",<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
"db_url",&nbsp; "mysql://openser:openserrw@localhost/openser")</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Uncomment this if you want to use SQL database 
<BR># for persistent storage and comment the previous 
line<BR>#modparam("usrloc", "db_mode", 2)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># -- 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")</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># -- rr params --<BR># add value to ;lr param to 
make some broken UAs happy<BR>modparam("rr", "enable_full_lr", 1)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>modparam("permissions", "db_mode", 
1)<BR>modparam("permissions", "trusted_table", "trusted")<BR># 
-------------------------&nbsp; request routing logic 
-------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># main routing logic</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>route{</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;# initial sanity checks -- messages 
with<BR>&nbsp;# max_forwards==0, or excessively long requests<BR>&nbsp;if 
(!mf_process_maxfwd_header("10")) {<BR>&nbsp;&nbsp;sl_send_reply("483","Too Many 
Hops");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;if (msg:len &gt;=&nbsp; 2048 ) 
{<BR>&nbsp;&nbsp;sl_send_reply("513", "Message too 
big");<BR>&nbsp;&nbsp;exit;<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;# we record-route all messages -- to make 
sure that<BR>&nbsp;# subsequent messages will go through our proxy; 
that's<BR>&nbsp;# particularly good if upstream and downstream 
entities<BR>&nbsp;# use different transport protocol<BR>&nbsp;if 
(!method=="REGISTER")<BR>&nbsp;&nbsp;record_route();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;# 
-----------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# Call Tear Down Section<BR>&nbsp;# 
-----------------------------------------------------------------<BR>&nbsp;if 
(method=="BYE" || method=="CANCEL") {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
end_media_session();<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;# subsequent messages withing a dialog should 
take the<BR>&nbsp;# path determined by record-routing<BR>&nbsp;if 
(loose_route()) {<BR>&nbsp;&nbsp;# mark routing logic in 
request<BR>&nbsp;&nbsp;append_hf("P-hint: rr-enforced\r\n"); </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;if (method=="INVITE") 
{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if (!allow_trusted()) 
{<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if (!proxy_authorize("","subscriber")) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
proxy_challenge("","0");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if 
(!check_from()) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sl_send_reply("403", "Use 
From=ID");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
exit;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();<BR>&nbsp;&nbsp; 
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
(client_nat_test("3")||search("^Route:.*;nat=yes")){<BR>&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
setflag(6);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
use_media_proxy();<BR>&nbsp;&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;route(1);<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;if (!uri==myself) {<BR>&nbsp;&nbsp;# mark 
routing logic in request<BR>&nbsp;&nbsp;append_hf("P-hint: outbound\r\n"); 
<BR>&nbsp;&nbsp;# if you have some interdomain connections via 
TLS<BR>&nbsp;&nbsp;#if(uri=~"@tls_domain1.net") 
{<BR>&nbsp;&nbsp;#&nbsp;t_relay("tls:domain1.net");<BR>&nbsp;&nbsp;#&nbsp;exit;<BR>&nbsp;&nbsp;#} 
else if(uri=~"@tls_domain2.net") 
{<BR>&nbsp;&nbsp;#&nbsp;t_relay("tls:domain2.net");<BR>&nbsp;&nbsp;#&nbsp;exit;<BR>&nbsp;&nbsp;#}<BR>&nbsp;&nbsp;route(1);<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;# if the request is for other domain use 
UsrLoc<BR>&nbsp;# (in case, it does not work, use the following 
command<BR>&nbsp;# with proper names and addresses in it)<BR>&nbsp; if 
(uri!=myself) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
route(3);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
return;<BR>&nbsp; };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;if (uri==myself) {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;if (method=="REGISTER") {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;# Uncomment this if you want to 
use digest authentication<BR>&nbsp;&nbsp;&nbsp;if 
(!www_authorize("192.168.0.104", "subscriber")) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;www_challenge("192.168.0.104", 
"0");<BR>&nbsp;&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;save("location");<BR>&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;lookup("aliases");<BR>&nbsp;&nbsp;if 
(!uri==myself) {<BR>&nbsp;&nbsp;&nbsp;append_hf("P-hint: outbound alias\r\n"); 
<BR>&nbsp;&nbsp;&nbsp;route(1);<BR>&nbsp;&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;# native SIP destinations are handled 
using our USRLOC DB<BR>&nbsp;&nbsp;if (lookup("location")) 
{<BR>&nbsp;&nbsp;&nbsp;append_hf("P-hint: usrloc applied\r\n"); 
<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else if (uri=~"sip:[0-9]{10}@.*") 
{<BR>&nbsp;&nbsp;&nbsp;route(3);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else 
{&nbsp;<BR>&nbsp;&nbsp;&nbsp;sl_send_reply("404", "Not 
Found");<BR>&nbsp;&nbsp;&nbsp;exit;<BR>&nbsp;&nbsp;}<BR>&nbsp;};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;route(1);<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=Arial size=2>route[1] {<BR>&nbsp;# send it out now; use 
stateful forwarding as it works reliably<BR>&nbsp;# even for UDP2TCP<BR>&nbsp;if 
(!t_relay()) 
{<BR>&nbsp;&nbsp;sl_reply_error();<BR>&nbsp;};<BR>&nbsp;exit;<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>route[3] 
{<BR>&nbsp;rewriteuser("citywide");<BR>&nbsp;rewriteuserpass("wide2city");<BR>&nbsp;rewritehostport("voip.victoria.tc.ca:5060");<BR>&nbsp;forward("voip.victoria.tc.ca");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
append_hf("P-hint: LOCAL CALL FORWARDED TO IPBX\r\n");<BR>&nbsp;if (!t_relay()) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sl_reply_error();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>&nbsp; 
};<BR>&nbsp; 
exit;<BR>}<BR>------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Ricardo Carvalho" &lt;</FONT><A 
href="mailto:rjcarvalho@reit.up.pt"><FONT face=Arial 
size=2>rjcarvalho@reit.up.pt</FONT></A><FONT face=Arial size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>To: "Daryl Sanders" &lt;</FONT><A 
href="mailto:daryl.sanders@gmail.com"><FONT face=Arial 
size=2>daryl.sanders@gmail.com</FONT></A><FONT face=Arial 
size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>Cc: &lt;</FONT><A 
href="mailto:users@openser.org"><FONT face=Arial 
size=2>users@openser.org</FONT></A><FONT face=Arial size=2>&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Wednesday, March 21, 2007 11:13 
AM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: [Users] To: header in e.164 format - 
adding a plus</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial 
size=2>&gt; You may use the following syntax:<BR>&gt; <BR>&gt; 
subst('/^To:(.*)@(.*)/To:+\1@\2/');<BR>&gt; <BR>&gt; Hope it helps,<BR>&gt; 
Regards,<BR>&gt; Ricardo.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; 
Daryl Sanders wrote:<BR>&gt;&gt; One of my providers requires the To: header to 
be in e.164 format with<BR>&gt;&gt; a "+" in front of it. Since there is no 
uac_replace_to() function yet,<BR>&gt;&gt; what are my options for adding this 
plus symbol?<BR>&gt;&gt;<BR>&gt;&gt; Before anyone suggests it... I cannot just 
use another provider. I<BR>&gt;&gt; must find a solution to add the plus 
symbol.<BR>&gt;&gt;<BR>&gt;&gt; Thanks,<BR>&gt;&gt; 
Daryl<BR>&gt;&gt;<BR>&gt;&gt; 
_______________________________________________<BR>&gt;&gt; Users mailing 
list<BR>&gt;&gt; </FONT><A href="mailto:Users@openser.org"><FONT face=Arial 
size=2>Users@openser.org</FONT></A><BR><FONT face=Arial size=2>&gt;&gt; 
</FONT><A href="http://openser.org/cgi-bin/mailman/listinfo/users"><FONT 
face=Arial 
size=2>http://openser.org/cgi-bin/mailman/listinfo/users</FONT></A><BR><FONT 
face=Arial size=2>&gt;&gt;<BR>&gt;&gt;<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; 
<BR>&gt; _______________________________________________<BR>&gt; Users mailing 
list<BR>&gt; </FONT><A href="mailto:Users@openser.org"><FONT face=Arial 
size=2>Users@openser.org</FONT></A><BR><FONT face=Arial size=2>&gt; </FONT><A 
href="http://openser.org/cgi-bin/mailman/listinfo/users"><FONT face=Arial 
size=2>http://openser.org/cgi-bin/mailman/listinfo/users</FONT></A><BR><FONT 
face=Arial size=2>&gt; <BR>&gt; <BR>&gt; -- <BR>&gt; No virus found in this 
incoming message.<BR>&gt; Checked by AVG Free Edition.<BR>&gt; Version: 7.5.446 
/ Virus Database: 268.18.16/729 - Release Date: 3/21/2007 7:52 AM<BR>&gt; 
<BR>&gt;<BR>
<HR>
I am using the free version of SPAMfighter for private users.<BR>It has removed 
324 spam emails to date.<BR>Paying users do not have this message in their 
emails.<BR>Try <A href="http://www.spamfighter.com/len">SPAMfighter</A> for free 
now!<BR></FONT></BODY></HTML>