If the INVITE comes in from Asterisk, OpenSER replies with 480 and lets Asterisk deal with sending call to voicemail (e.g. dialstatus = unavailable). This eliminates the loop because the INVITE does not come back to Asterisk.<br>
<br><div class="gmail_quote">On Fri, Apr 11, 2008 at 12:33 AM, Iñaki Baz Castillo <<a href="mailto:ibc@in.ilimit.es">ibc@in.ilimit.es</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
El Thursday 10 April 2008 23:00:28 Adrian A escribió:<br>
<div class="Ih2E3d">> Here is how I solve this.<br>
><br>
> In Asterisk, I add a SIP header just before sending it to OpenSER using the<br>
> function: SipAddHeader(P-hint: From Asterisk).<br>
><br>
> Then, in OpenSER I have the following:<br>
><br>
> # check to see if user is online<br>
> if (!lookup("location")) {<br>
> # SIP from Asterisk or not a call attempt<br>
> if (search("(P-hint):.From Asterisk") ||<br>
> !(method==INVITE)) { sl_send_reply("480","User Temporarily Unavailable");<br>
> exit;<br>
> } else {<br>
> route(2);<br>
> exit;<br>
> };<br>
> };<br>
><br>
> route[2] {<br>
> # Let Asterisk deal with voicemail/forward<br>
> sl_send_reply("181", "Forward to Voicemail");<br>
> prefix("vm");<br>
> setflag(9); # forward to Asterisk<br>
> route(1);<br>
> }<br>
<br>
</div>I can't understand why that should work, in fact Asterisk is receiving the<br>
same INVITE he sent (well, RURI modified but the Asterisk bug is that it<br>
doesn't recogniza a spiral).<br>
<div class="Ih2E3d"><br>
<br>
--<br>
Iñaki Baz Castillo<br>
<a href="mailto:ibc@in.ilimit.es">ibc@in.ilimit.es</a><br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">Users mailing list<br>
<a href="mailto:Users@lists.openser.org">Users@lists.openser.org</a><br>
<a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>