Here is how I solve this.<br><br>In Asterisk, I add a SIP header just before sending it to OpenSER using the 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") || !(method==INVITE)) {<br>
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><br><br><div class="gmail_quote">On Thu, Apr 3, 2008 at 12:50 AM, Cosimo Fadda <<a href="mailto:cosimo.fadda@klarya.it">cosimo.fadda@klarya.it</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;">Hi everybody,<br>
I'm using Opeser as Proxy and one Asterisk as Gateway and Voicemail server.<br>
Suppose that an incoming calls arrives to Ser from Asterisk and the user<br>
is offline;<br>
Then Openser sends back the Invite to Asterisk that should activate the<br>
voicemail application but<br>
unfortunately it detects a Loop (482) and rejects the invite.<br>
I think I have to mangle the SIP message in Openser before the send to<br>
Asterisk again.<br>
This is what I currently do:<br>
<br>
if(!lookup("location"))<br>
{<br>
#send to voicemail if active but not registerd<br>
xlog("L_INFO", "Local user offline - M=$rm RURI=$ru F=$fu T=$tu<br>
IP=$si ID=$ci\n");<br>
if($avp(s:vmail) == "1")<br>
{<br>
route(11);<br>
}<br>
else<br>
{<br>
route(20);<br>
}<br>
}<br>
else<br>
{<br>
xlog("L_INFO", "Local user online - M=$rm RURI=$ru F=$fu T=$tu<br>
IP=$si ID=$ci\n");<br>
route(9);<br>
}<br>
exit;<br>
<br>
....<br>
<br>
route[11]<br>
{<br>
xlog("L_INFO", "Forwarding request to VM\n");<br>
prefix("vm");<br>
sethostport("asterisk-gw:5060");<br>
#append_branch();<br>
if (!t_relay())<br>
{<br>
xlog("L_INFO", "Unable TO Forward the request to VM\n");<br>
route(20);<br>
exit;<br>
}<br>
<br>
<br>
What can I do to avoid Loop Detection?<br>
<br>
Thanks in advance,<br>
<br>
Cosimo Fadda<br>
___________<br>
<br>
_______________________________________________<br>
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>
</blockquote></div><br>