<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi,<br><br>not sure how is generating this, but it's not a valid SIP URI:<br>&nbsp;&nbsp; &lt;: 17322180369@myserver-ipaddress
:5090&gt;<br><br>regards,<br>bogdan</blockquote>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Hi Bogdan</div>
<div>&nbsp;</div>
<div>I have redirecting the user if not available to to Voice mail of Asterisk</div>
<div>that run on myserver-ipaddress:5090</div>
<div>&nbsp;</div>
<div>i have integrated OpenSer+Asterisk</div>
<div>&nbsp;</div>
<div>so when the local user not availble it should go to Voice mail</div>
<div>&nbsp;</div>
<div>but when iam dialing from X-lite call going out.</div>
<div>&nbsp;</div>
<div>but when iam dialing from Sipura the call Going to voice mail .. why iam not sure</div>
<div>&nbsp;</div>
<div>here is my openser.cfg looks like</div>
<div>&nbsp;</div>
<div>-----------</div>
<div>
<p>modparam(&quot;uac&quot;,&quot;credential&quot;,&quot;99999:<a href="http://provider.com:99999">provider.com:99999</a>&quot;)</p>
<p># -------------------------&nbsp; request routing logic -------------------</p>
<p>route {<br>&nbsp;#check for old messages: could mean a problem withthe DNS entries or some other loop-causer...<br>&nbsp;if (!mf_process_maxfwd_header(&quot;10&quot;))<br>&nbsp;{<br>&nbsp; xlog(&quot;L_WARN&quot;, &quot;WARNING: Too many hops\n&quot;);
<br>&nbsp; sl_send_reply(&quot;483&quot;, &quot;Too many hops, forward count exceeded limit\n&quot;);<br>&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; xlog(&quot;L_WARN&quot;, &quot;WARNING: Message too large, &gt;= 2048 bytes\n&quot;);<br>&nbsp; sl_send_reply(&quot;513&quot;, &quot;Message too large, exceeded limit\n&quot;);
<br>&nbsp; return;<br>&nbsp;};</p>
<p>&nbsp;#record everything besides registers and acks<br>&nbsp;if(method!=&quot;REGISTER&quot; &amp;&amp; method!=&quot;ACK&quot;)<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==&quot;CANCEL&quot; || method==&quot;BYE&quot;)<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; route(1);<br>&nbsp; return;<br>&nbsp;};</p>
<p>&nbsp;#Always require authentication, which could result in a PSTN, ie $$$</p>
<p>&nbsp;if (method==&quot;REGISTER&quot;)<br>&nbsp;{<br>&nbsp; if(!www_authorize(&quot;<a href="http://mydomain.com">mydomain.com</a>&quot;, &quot;subscriber&quot;))<br>&nbsp; {<br>&nbsp;&nbsp; www_challenge(&quot;<a href="http://mydomain.com">mydomain.com
</a>&quot;, &quot;0&quot;);<br>&nbsp;&nbsp; return;<br>&nbsp; }<br>&nbsp; else<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp; if (!check_to())<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;401&quot;, &quot;Unauthorized&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp;&nbsp; };</p>
<p>&nbsp;&nbsp; #Save into user database, used below when checkingif user is available<br>&nbsp;&nbsp; xlog(&quot;L_INFO&quot;, &quot;REGISTER: User Authenticated Correctly\n&quot;);<br>&nbsp;&nbsp; save(&quot;location&quot;);<br>&nbsp;&nbsp; return;<br>&nbsp; };<br>
&nbsp;};<br>#}<br>&nbsp;if (method==&quot;INVITE&quot;)<br>&nbsp;{<br>&nbsp;if(uri=~&quot;sip:\*98@.*&quot;)<br>&nbsp;#if(uri=~&quot;sip:\*86@.*&quot;)<br>&nbsp;{<br>&nbsp; #authorize if a call is going to PSTN<br>&nbsp; if(!proxy_authorize(&quot;<a href="http://mydomain.com">
mydomain.com</a>&quot;, &quot;subscriber&quot;))<br>&nbsp; {<br>&nbsp;&nbsp; proxy_challenge(&quot;<a href="http://mydomain.com">mydomain.com</a>&quot;, &quot;0&quot;);<br>&nbsp;&nbsp; return;<br>&nbsp; };</p>
<p>&nbsp; xlog(&quot;L_INFO&quot;, &quot;CALL: Call to check voicemail\n&quot;);<br>&nbsp; rewritehostport(&quot;myserver-ipaddress:5090&quot;);<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(&quot;L_INFO&quot;, &quot;CALL: Sip client\n&quot;);<br>&nbsp;&nbsp; if (!lookup(&quot;location&quot;))<br>&nbsp;&nbsp; {<br>#&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>#&nbsp;&nbsp;&nbsp; log(1, &quot;ERROR: User Not Found\n&quot;);
<br>&nbsp;&nbsp;&nbsp; rewritehostport(&quot;myserver-ipaddress:5090&quot;);<br>&nbsp;&nbsp;&nbsp; t_relay();<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp; };<br>&nbsp; }<br>&nbsp; else<br>&nbsp; {<br>&nbsp;&nbsp; #authorize if a call is going to PSTN<br>&nbsp;&nbsp; if(!proxy_authorize(&quot;<a href="http://mydomain.com">
mydomain.com</a>&quot;, &quot;subscriber&quot;))<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; proxy_challenge(&quot;<a href="http://mydomain.com">mydomain.com</a>&quot;, &quot;0&quot;);<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp; };</p>
<p>&nbsp;&nbsp; #Call destination is PSTN, so send it to the gateway (<a href="http://Net.com">Net.com</a>)<br>&nbsp;&nbsp; xlog(&quot;L_INFO&quot;, &quot;CALL: PSTN gateway1\n&quot;);<br>&nbsp; rewritehostport(&quot;provider-ip:5060&quot;);<br>
&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; #Call is to sip client, so do nothing but route<br>&nbsp; xlog(&quot;L_INFO&quot;, &quot;CALL: Sip client\n&quot;);
<br>&nbsp; if (!lookup(&quot;location&quot;))<br>&nbsp;&nbsp; {<br>#&nbsp;&nbsp;&nbsp; sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>#&nbsp;&nbsp;&nbsp; log(1, &quot;ERROR: User Not Found\n&quot;);<br>&nbsp;&nbsp;&nbsp; rewritehostport(&quot;myserver-ipaddress:5090&quot;);
<br>&nbsp;&nbsp;&nbsp; t_relay();<br>&nbsp;&nbsp; return;<br>&nbsp; };<br>}<br>else<br>{<br>&nbsp; #Call destination is PSTN, so send it to the gateway (<a href="http://Net.com">Net.com</a>)<br>&nbsp; xlog(&quot;L_INFO&quot;, &quot;CALL: PSTN gateway2\n&quot;);
<br>&nbsp; rewritehostport(&quot;provider-ip:5060&quot;);<br>&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==&quot;INVITE&quot; &amp;&amp; !isflagset(10))<br>&nbsp;{<br>&nbsp;t_on_failure(&quot;2&quot;);<br>&nbsp;};</p>
<p>&nbsp;if (!t_relay())<br>&nbsp;{<br>&nbsp;xlog(&quot;L_WARN&quot;, &quot;ERROR: t_relay failed&quot;);<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(&quot;myserver-ipaddress:5090&quot;);<br>&nbsp;append_branch();<br>&nbsp;#PREVENT SOME CRAZY VOICEMAIL LOOP<br>&nbsp;xlog(&quot;L_INFO&quot;, &quot;INFO: CALL TO VOICEMAIL&quot;);
<br>&nbsp;setflag(10);<br>&nbsp;route(1);</p>
<p>&nbsp;}<br>}<br></p>
<p>ram</p></div><br>&nbsp;</div>