<!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>&nbsp;</DIV>
<DIV>failure_route[2]<BR>{<BR>&nbsp;if(!t_was_cancelled())<BR>&nbsp;{<BR>&nbsp; 
revert_uri();<BR>&nbsp; rewritehostport("asterisk-ip-voicemail:5090");<BR>&nbsp; 
append_branch();<BR>&nbsp; #PREVENT SOME CRAZY VOICEMAIL LOOP<BR>&nbsp; 
xlog("L_INFO", "INFO: CALL TO VOICEMAIL"); <BR>&nbsp; 
setflag(10);<BR>&nbsp;&nbsp;t_relay();<BR>&nbsp;}<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>&nbsp;</DIV>
  <DIV>here is my config</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>iam able to dial *86, i get voice message that no voice messages</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>But the call&nbsp; rewriting when the user not available</DIV>
  <DIV>it should go to asterisks voice mail</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>ram</DIV>
  <DIV>&nbsp;</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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
  debug level (cmd line: 
  -dddddddddd)<BR>log_facility=LOG_LOCAL7<BR>fork=yes<BR>log_stderror=no&nbsp;&nbsp;&nbsp; 
  # (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&nbsp;&nbsp;&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"</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>&nbsp;</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", 
  "&lt;sip:") <BR>modparam("auth", "rpid_suffix", 
  "@myip&gt;;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; 
  =&gt; 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>#&nbsp;&nbsp; 1 == 
  should account(all to gateway),<BR>#&nbsp;&nbsp; 3 == should report on missed 
  calls (transactions to <A href="http://iptel.org">iptel.org</A>'s 
  users),<BR>#&nbsp;&nbsp; 4 == destination user wishes to use 
  voicemail<BR>#&nbsp;&nbsp; 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># 
  -------------------------&nbsp; request routing logic -------------------</P>
  <P># main routing logic<BR>#Routing Script<BR>route {<BR>&nbsp;#check for old 
  messages: could mean a problem with the DNS entries or some other 
  loop-causer...<BR>&nbsp;if 
  (!mf_process_maxfwd_header("10"))<BR>&nbsp;{<BR>&nbsp;&nbsp; xlog("L_WARN", 
  "WARNING: Too many hops\n"); <BR>&nbsp;&nbsp; sl_send_reply("483", "Too many 
  hops, forward count exceeded limit\n");<BR>&nbsp;&nbsp; 
return;<BR>&nbsp;};</P>
  <P>&nbsp;#check for extremely large messages; we don't need a sip dos 
  attack<BR>&nbsp;if (msg:len &gt;= 2048)<BR>&nbsp;{<BR>&nbsp;&nbsp; 
  xlog("L_WARN", "WARNING: Message too large, &gt;= 2048 
  bytes\n");<BR>&nbsp;&nbsp; sl_send_reply("513", "Message too large, exceeded 
  limit\n"); <BR>&nbsp;&nbsp; return;<BR>&nbsp;};</P>
  <P>&nbsp;#record everything besides registers and 
  acks<BR>&nbsp;if(method!="REGISTER" &amp;&amp; 
  method!="ACK")<BR>&nbsp;{<BR>&nbsp; setflag(1);<BR>&nbsp;};</P>
  <P>&nbsp;#do not send to voicemail if BYE or CANCEL<BR>&nbsp;#is used to end 
  call before user pickup or timeout<BR>&nbsp;if(method=="CANCEL" || 
  method=="BYE")<BR>&nbsp;{<BR>&nbsp; setflag(10);<BR>&nbsp;};</P>
  <P>&nbsp;#grant route if route headers already present<BR>&nbsp;if 
  (loose_route())<BR>&nbsp;{<BR>&nbsp;&nbsp; route(1);<BR>&nbsp;&nbsp; 
  return;<BR>&nbsp;};</P>
  <P>&nbsp;#Always require authentication, which could result in a PSTN, ie 
  $$$<BR>&nbsp;if (method=="REGISTER")<BR>&nbsp;{<BR>&nbsp;&nbsp; 
  if(!www_authorize("<A href="http://domain.com">domain.com</A>", "subscriber")) 
  <BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; www_challenge("<A 
  href="http://domain.com">domain.com</A>", "0");<BR>&nbsp;&nbsp;&nbsp; 
  return;<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; else<BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp; #Save into user database, used below when checking if 
  user is available <BR>&nbsp;&nbsp;&nbsp; xlog("L_INFO", "REGISTER: User 
  Authenticated Correctly\n");<BR>&nbsp;&nbsp;&nbsp; 
  save("location");<BR>&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp; 
  };<BR>&nbsp;};</P>
  <P>&nbsp;if (method=="INVITE")<BR>&nbsp;{<BR>&nbsp; if 
  (uri=~"sip:1[0-9]+@.*")<BR>&nbsp; {<BR>&nbsp;&nbsp; #authorize if a call is 
  going to PSTN<BR>&nbsp;&nbsp; if(!proxy_authorize("<A 
  href="http://domain.com">domain.com</A>", "subscriber")) <BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp; proxy_challenge("<A 
  href="http://domain.com">domain.com</A>", "0");<BR>&nbsp;&nbsp;&nbsp; 
  return;<BR>&nbsp;&nbsp; };</P>
  <P>&nbsp;&nbsp; xlog("L_INFO", "CALL: Call to international 
  number\n");<BR>#&nbsp;&nbsp; 
  rewritehostport("voip_gw.domain.net:5060");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  rewritehostport("myprovider-voip:port");<BR>&nbsp; }<BR>&nbsp; else 
  if(uri=~"sip:\*86@.*") <BR>&nbsp; {<BR>&nbsp;&nbsp; #authorize if a call is 
  going to PSTN<BR>&nbsp;&nbsp; if(!proxy_authorize("<A 
  href="http://domain.com">domain.com</A>", "subscriber"))<BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp; proxy_challenge("<A href="http://domain.com"> 
  domain.com</A>", "0");<BR>&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp; };</P>
  <P>&nbsp;&nbsp; xlog("L_INFO", "CALL: Call to check 
  voicemail\n");<BR>&nbsp;&nbsp; 
  rewritehostport("asterisk-server-ip:5090");<BR>&nbsp; }<BR>&nbsp; 
  else<BR>&nbsp; {<BR>&nbsp;&nbsp; if (does_uri_exist())</P>
  <P>{<BR>&nbsp;&nbsp;&nbsp; #Call is to sip client, so do nothing but 
  route<BR>&nbsp;&nbsp;&nbsp; xlog("L_INFO", "CALL: Sip 
  client\n");<BR>&nbsp;&nbsp;&nbsp; if 
  (!lookup("location"))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  sl_send_reply("404", "Not Found"); <BR>&nbsp;&nbsp;&nbsp;&nbsp; log(1, "ERROR: 
  User Not Found\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp;&nbsp; 
  };<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; else<BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp; #authorize if a call is going to 
  PSTN<BR>&nbsp;&nbsp;&nbsp; if(!proxy_authorize("<A 
  href="http://domain.com">domain.com </A>", 
  "subscriber"))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  proxy_challenge("domain", "0");<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
  return;<BR>&nbsp;&nbsp;&nbsp; };</P>
  <P>&nbsp;&nbsp;&nbsp; #Call destination is PSTN, so send it to the gateway (<A 
  href="http://Net.com">Net.com</A>)<BR>&nbsp;&nbsp;&nbsp; xlog("L_INFO", "CALL: 
  PSTN gateway\n");<BR>#&nbsp;&nbsp;&nbsp; 
  rewritehostport("voip_gw.domain.net:5060"); 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  rewritehostport("myprovider-voip:port");</P>
  <P>&nbsp;&nbsp; };<BR>&nbsp; };</P>
  <P>&nbsp; #Make sure that all subsequent requests go through us;<BR>&nbsp; 
  record_route();<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp; if 
  (does_uri_exist())<BR>&nbsp; {<BR>&nbsp;&nbsp; #Call is to sip client, so do 
  nothing but route<BR>&nbsp;&nbsp; xlog("L_INFO", "CALL: Sip client\n"); 
  <BR>&nbsp;&nbsp; if (!lookup("location"))<BR>&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp; sl_send_reply("404", "Not 
  Found");<BR>&nbsp;&nbsp;&nbsp; log(1, "ERROR: User Not Found\n");</P>
  <P>&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp; };<BR>&nbsp; }<BR>&nbsp; 
  else<BR>&nbsp; {<BR>&nbsp;&nbsp; #Call destination is PSTN, so send it to the 
  gateway (<A href="http://Net.com">Net.com</A>)<BR>&nbsp;&nbsp; xlog("L_INFO", 
  "CALL: PSTN gateway\n");<BR>&nbsp;&nbsp; 
  rewritehostport("voip_gw.domain.net:5060"); </P>
  <P>&nbsp; };<BR>&nbsp; record_route();<BR>&nbsp;};</P>
  <P>&nbsp;#ALL PROCESSING IS DONE, SO ROUTE<BR>&nbsp;route(1);<BR>}</P>
  <P><BR>route[1]<BR>{<BR>#send the call outward</P>
  <P>&nbsp;if(method=="INVITE" &amp;&amp; !isflagset(10))<BR>&nbsp;{<BR>&nbsp; 
  t_on_failure("2");<BR>&nbsp;};</P>
  <P>&nbsp;if (!t_relay())<BR>&nbsp;{<BR>&nbsp; xlog("L_WARN", "ERROR: t_relay 
  failed");<BR>&nbsp; sl_reply_error();<BR>&nbsp;};</P>
  <P>}</P>
  <P>failure_route[2]<BR>{<BR>&nbsp;if(!t_was_cancelled())<BR>&nbsp;{<BR>&nbsp; 
  revert_uri();<BR>&nbsp; 
  rewritehostport("asterisk-ip-voicemail:5090");<BR>&nbsp; 
  append_branch();<BR>&nbsp; #PREVENT SOME CRAZY VOICEMAIL LOOP<BR>&nbsp; 
  xlog("L_INFO", "INFO: CALL TO VOICEMAIL"); <BR>&nbsp; setflag(10);<BR>&nbsp; 
  route(1);<BR>&nbsp;}<BR>}</P></DIV>
  <DIV><BR>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>ram</DIV></BLOCKQUOTE></BODY></HTML>