<!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.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>ok remove the route(1); and replace t_relay(); in
the failure_route[2]; section as below</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>failure_route[2]<BR>{<BR> if(!t_was_cancelled())<BR> {<BR>
revert_uri();<BR> rewritehostport("asterisk-ip-voicemail:5090");<BR>
append_branch();<BR> #PREVENT SOME CRAZY VOICEMAIL LOOP<BR>
xlog("L_INFO", "INFO: CALL TO VOICEMAIL"); <BR>
setflag(10);<BR> t_relay();<BR> }<BR></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=talk2ram@gmail.com href="mailto:talk2ram@gmail.com">ram</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=glenn@routerboy.com
href="mailto:glenn@routerboy.com">Glenn Dalgliesh</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=users@openser.org
href="mailto:users@openser.org">users@openser.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, June 05, 2006 1:11 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Users] Openser+Asterisk
Voice mail</DIV>
<DIV><BR></DIV>
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>here is my config</DIV>
<DIV> </DIV>
<DIV>iam able to dial *86, i get voice message that no voice messages</DIV>
<DIV> </DIV>
<DIV>But the call rewriting when the user not available</DIV>
<DIV>it should go to asterisks voice mail</DIV>
<DIV> </DIV>
<DIV>ram</DIV>
<DIV> </DIV>
<DIV>
<P>[root@sert openser]# more openser.cfg<BR>#<BR># $Id: openser.cfg,v 1.5
2005/10/28 19:45:33 bogdan_iancu Exp $<BR>#<BR># simple quick-start config
script<BR>#</P>
<P># ----------- global configuration parameters ------------------------</P>
<P>debug=3 #
debug level (cmd line:
-dddddddddd)<BR>log_facility=LOG_LOCAL7<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>port=5060<BR>children=4<BR>fifo="/tmp/openser_fifo"</P>
<P># ------------------ module loading ----------------------------------</P>
<P>loadmodule "/usr/local/lib/openser/modules/tm.so"<BR>loadmodule
"/usr/local/lib/openser/modules/sl.so"<BR>loadmodule
"/usr/local/lib/openser/modules/acc.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/mysql.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/auth.so"<BR>loadmodule
"/usr/local/lib/openser/modules/auth_db.so"<BR>loadmodule
"/usr/local/lib/openser/modules/textops.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/group.so"<BR>loadmodule
"/usr/local/lib/openser/modules/msilo.so"<BR>loadmodule
"/usr/local/lib/openser/modules/nathelper.so" <BR>loadmodule
"/usr/local/lib/openser/modules/enum.so"<BR>loadmodule
"/usr/local/lib/openser/modules/domain.so"<BR>loadmodule
"/usr/local/lib/openser/modules/xlog.so"</P>
<P> </P>
<P>fifo_db_url="mysql://openser:openserrw@localhost/openser"</P>
<P><BR>modparam("usrloc|acc|auth_db|group|msilo", "db_url",
"mysql://openser:openserrw@localhost/openser")</P>
<P><BR># ----------------- setting module-specific parameters
---------------<BR># -- usrloc params --<BR>/* 0 -- dont use mysql, 1 --
write_through, 2--write_back */<BR>modparam("usrloc", "db_mode", 2)
<BR>modparam("usrloc", "timer_interval", 10)<BR>modparam("usrloc",
"use_domain", 1)<BR>modparam("registrar", "use_domain", 1)<BR># -- auth params
--<BR>modparam("auth_db", "calculate_ha1", yes) <BR>modparam("auth_db",
"password_column", "password")<BR>#modparam("auth_db", "use_rpid",
1)<BR>modparam("auth", "nonce_expire", 300)<BR>modparam("auth", "rpid_prefix",
"<sip:") <BR>modparam("auth", "rpid_suffix",
"@myip>;party=calling;id-type=subscriber;screen=yes;privacy=off")</P>
<P># -- rr params --<BR># add value to ;lr param to make some broken UAs
happy<BR>modparam("rr", "enable_full_lr", 1)</P>
<P># -- acc params --<BR># report ACKs too for sake of completeness -- as we
account PSTN<BR># destinations which are RR, ACKs should show
up<BR>modparam("acc", "report_ack", 1)<BR>modparam("acc", "log_level", 1)
<BR># if BYE fails (telephone is dead, record-routing broken, etc.),
generate<BR># a report nevertheless -- otherwise we would have no STOP event;
=> 1<BR>#modparam("acc", "failed_transactions", 1)</P>
<P># that is the flag for which we will account -- don't forget to<BR># set
the same one :-)<BR># Usage of flags is as follows:<BR># 1 ==
should account(all to gateway),<BR># 3 == should report on missed
calls (transactions to <A href="http://iptel.org">iptel.org</A>'s
users),<BR># 4 == destination user wishes to use
voicemail<BR># 6 == nathelper<BR>#<BR>modparam("acc", "log_flag",
1)<BR>modparam("acc", "db_flag", 1) <BR>modparam("acc", "log_missed_flag",
3)<BR>modparam("acc", "db_missed_flag", 3)</P>
<P># report to syslog: From, i-uri, status, digest id,
method<BR>modparam("acc", "log_fmt", "fisumdpr")</P>
<P># -- tm params --<BR>modparam("tm", "fr_timer", 15)<BR>modparam("tm",
"fr_inv_timer", 25)<BR>modparam("tm", "wt_timer", 30)</P>
<P># -- msilo params<BR>modparam("msilo", "registrar", "<A
href="mailto:sip:registrar@mydomain.com">sip:registrar@mydomain.com</A>")</P>
<P># -- enum params --<BR>modparam("enum", "domain_suffix", "e164.arpa.")</P>
<P># -- multi-domain<BR>modparam("domain", "db_mode", 1)<BR>#
------------------------- request routing logic -------------------</P>
<P># main routing logic<BR>#Routing Script<BR>route {<BR> #check for old
messages: could mean a problem with the DNS entries or some other
loop-causer...<BR> if
(!mf_process_maxfwd_header("10"))<BR> {<BR> xlog("L_WARN",
"WARNING: Too many hops\n"); <BR> sl_send_reply("483", "Too many
hops, forward count exceeded limit\n");<BR>
return;<BR> };</P>
<P> #check for extremely large messages; we don't need a sip dos
attack<BR> if (msg:len >= 2048)<BR> {<BR>
xlog("L_WARN", "WARNING: Message too large, >= 2048
bytes\n");<BR> sl_send_reply("513", "Message too large, exceeded
limit\n"); <BR> return;<BR> };</P>
<P> #record everything besides registers and
acks<BR> if(method!="REGISTER" &&
method!="ACK")<BR> {<BR> setflag(1);<BR> };</P>
<P> #do not send to voicemail if BYE or CANCEL<BR> #is used to end
call before user pickup or timeout<BR> if(method=="CANCEL" ||
method=="BYE")<BR> {<BR> setflag(10);<BR> };</P>
<P> #grant route if route headers already present<BR> if
(loose_route())<BR> {<BR> route(1);<BR>
return;<BR> };</P>
<P> #Always require authentication, which could result in a PSTN, ie
$$$<BR> if (method=="REGISTER")<BR> {<BR>
if(!www_authorize("<A href="http://domain.com">domain.com</A>", "subscriber"))
<BR> {<BR> www_challenge("<A
href="http://domain.com">domain.com</A>", "0");<BR>
return;<BR> }<BR> else<BR>
{<BR> #Save into user database, used below when checking if
user is available <BR> xlog("L_INFO", "REGISTER: User
Authenticated Correctly\n");<BR>
save("location");<BR> return;<BR>
};<BR> };</P>
<P> if (method=="INVITE")<BR> {<BR> if
(uri=~"sip:1[0-9]+@.*")<BR> {<BR> #authorize if a call is
going to PSTN<BR> if(!proxy_authorize("<A
href="http://domain.com">domain.com</A>", "subscriber")) <BR>
{<BR> proxy_challenge("<A
href="http://domain.com">domain.com</A>", "0");<BR>
return;<BR> };</P>
<P> xlog("L_INFO", "CALL: Call to international
number\n");<BR>#
rewritehostport("voip_gw.domain.net:5060");<BR>
rewritehostport("myprovider-voip:port");<BR> }<BR> else
if(uri=~"sip:\*86@.*") <BR> {<BR> #authorize if a call is
going to PSTN<BR> if(!proxy_authorize("<A
href="http://domain.com">domain.com</A>", "subscriber"))<BR>
{<BR> proxy_challenge("<A href="http://domain.com">
domain.com</A>", "0");<BR> return;<BR> };</P>
<P> xlog("L_INFO", "CALL: Call to check
voicemail\n");<BR>
rewritehostport("asterisk-server-ip:5090");<BR> }<BR>
else<BR> {<BR> if (does_uri_exist())</P>
<P>{<BR> #Call is to sip client, so do nothing but
route<BR> xlog("L_INFO", "CALL: Sip
client\n");<BR> if
(!lookup("location"))<BR> {<BR>
sl_send_reply("404", "Not Found"); <BR> log(1, "ERROR:
User Not Found\n");<BR> return;<BR>
};<BR> }<BR> else<BR>
{<BR> #authorize if a call is going to
PSTN<BR> if(!proxy_authorize("<A
href="http://domain.com">domain.com </A>",
"subscriber"))<BR> {<BR>
proxy_challenge("domain", "0");<BR>
return;<BR> };</P>
<P> #Call destination is PSTN, so send it to the gateway (<A
href="http://Net.com">Net.com</A>)<BR> xlog("L_INFO", "CALL:
PSTN gateway\n");<BR>#
rewritehostport("voip_gw.domain.net:5060");
<BR>
rewritehostport("myprovider-voip:port");</P>
<P> };<BR> };</P>
<P> #Make sure that all subsequent requests go through us;<BR>
record_route();<BR> }<BR> else<BR> {<BR> if
(does_uri_exist())<BR> {<BR> #Call is to sip client, so do
nothing but route<BR> xlog("L_INFO", "CALL: Sip client\n");
<BR> if (!lookup("location"))<BR>
{<BR> sl_send_reply("404", "Not
Found");<BR> log(1, "ERROR: User Not Found\n");</P>
<P> return;<BR> };<BR> }<BR>
else<BR> {<BR> #Call destination is PSTN, so send it to the
gateway (<A href="http://Net.com">Net.com</A>)<BR> xlog("L_INFO",
"CALL: PSTN gateway\n");<BR>
rewritehostport("voip_gw.domain.net:5060"); </P>
<P> };<BR> record_route();<BR> };</P>
<P> #ALL PROCESSING IS DONE, SO ROUTE<BR> route(1);<BR>}</P>
<P><BR>route[1]<BR>{<BR>#send the call outward</P>
<P> if(method=="INVITE" && !isflagset(10))<BR> {<BR>
t_on_failure("2");<BR> };</P>
<P> if (!t_relay())<BR> {<BR> xlog("L_WARN", "ERROR: t_relay
failed");<BR> sl_reply_error();<BR> };</P>
<P>}</P>
<P>failure_route[2]<BR>{<BR> if(!t_was_cancelled())<BR> {<BR>
revert_uri();<BR>
rewritehostport("asterisk-ip-voicemail:5090");<BR>
append_branch();<BR> #PREVENT SOME CRAZY VOICEMAIL LOOP<BR>
xlog("L_INFO", "INFO: CALL TO VOICEMAIL"); <BR> setflag(10);<BR>
route(1);<BR> }<BR>}</P></DIV>
<DIV><BR> </DIV>
<DIV> </DIV>
<DIV>ram</DIV></BLOCKQUOTE></BODY></HTML>