Hi All,<br><br>I have followed a tutorial and set up Asterisk as a voice mail server. <br><br><a href="http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+With+OpenSER">http://www.voip-info.org/wiki/view/Realtime+Integration+Of+Asterisk+With+OpenSER
</a><br><br>It works fine when the UA is offline. Now, I want a call forwarded to the Voice mail server when there is no answer from the UA after 60 seconds(UA is registered on the openser).<br><br>What should I do? Below is my config (copy from the above link).
<br><br><br><pre>                # requests for Media server<br>                if(is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag() &amp;&amp; uri=~&quot;sip:\*9&quot;) {<br>                        route(3);<br>                        exit;<br>                }<br><br>                # mark transaction if user is in voicemail group
<br>                if(is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag()<br>                        &amp;&amp; is_user_in(&quot;Request-URI&quot;,&quot;voicemail&quot;))<br>                {<br>                        xdbg(&quot;user [$ru] has voicemail redirection enabled\n&quot;);<br>
                        # backup R-URI<br>                        avp_write(&quot;$ruri&quot;, &quot;i:10&quot;);<br>                        setflag(2);<br>                };</pre><br><pre>                # native SIP destinations are handled using our USRLOC DB<br>                if (!lookup(&quot;location&quot;)) {<br>                        if(isflagset(2)) {
<br>                                # route to Asterisk Media Server<br>                                prefix(&quot;1&quot;);<br>                                rewritehostport(&quot;<a href="http://10.10.10.11:5060">10.10.10.11:5060</a>&quot;);<br>                                route(1);<br>                        } else {<br>                                sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);
<br>                                exit;<br>                        }<br>                };<br><br># voicemail access<br># - *98 - listen caller&#39;s voice messages, being prompted for pin<br># - *981 - listen voice messages, being promted for mailbox and pin<br># - *98XXXX - leave voice message to XXXX
<br>#<br>route[3] {<br>          # direct voicemail<br>        if (uri =~ &quot;sip:\*98@&quot; ) {<br>                rewriteuser(&quot;1&quot;);<br>                xdbg(&quot;voicemail access\n&quot;);<br>        } else if (uri =~ &quot;sip:\*981@&quot; ) {<br>
                 strip(4);<br>                rewriteuser(&quot;11&quot;);<br>        } else if (uri =~ &quot;sip:\*98.+@&quot; ) {<br>                 strip(3);<br>                prefix(&quot;1&quot;);<br>        } else {<br>                xlog(&quot;unknown media extension $rU\n&quot;);<br>                sl_send_reply(&quot;404&quot;, &quot;Unknown media service&quot;);
<br>                exit;<br>        }<br><br>        # route to Asterisk Media Server<br>        rewritehostport(&quot;<a href="http://10.10.10.11:5060">10.10.10.11:5060</a>&quot;);<br>        route(1);<br>}<br><br>failure_route[1] {<br>        if (t_was_cancelled()) {
<br>                xdbg(&quot;transaction was cancelled by UAC\n&quot;);<br>                return;<br>        }<br>        # restore initial uri<br>        avp_pushto(&quot;$ruri&quot;, &quot;i:10&quot;);<br>        prefix(&quot;1&quot;);<br>        # route to Asterisk Media Server
<br>        rewritehostport(&quot;<a href="http://10.10.10.11:5060">10.10.10.11:5060</a>&quot;);<br>        resetflag(2);<br>        route(1);<br><br>}<br></pre><br>