<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>