[OpenSER-Users] Avoid Loops between Openser and Asterisk

Iñaki Baz Castillo ibc at in.ilimit.es
Fri Apr 11 09:33:53 CEST 2008


El Thursday 10 April 2008 23:00:28 Adrian A escribió:
> Here is how I solve this.
>
> In Asterisk, I add a SIP header just before sending it to OpenSER using the
> function: SipAddHeader(P-hint: From Asterisk).
>
> Then, in OpenSER I have the following:
>
>                 # check to see if user is online
>                  if (!lookup("location")) {
>                         # SIP from Asterisk or not a call attempt
>                         if (search("(P-hint):.From Asterisk") ||
> !(method==INVITE)) { sl_send_reply("480","User Temporarily Unavailable");
> exit;
>                         } else {
>                                 route(2);
>                                  exit;
>                         };
>                 };
>
> route[2] {
>         # Let Asterisk deal with voicemail/forward
>         sl_send_reply("181", "Forward to Voicemail");
>          prefix("vm");
>         setflag(9);       # forward to Asterisk
>         route(1);
> }

I can't understand why that should work, in fact Asterisk is receiving the 
same INVITE he sent (well, RURI modified but the Asterisk bug is that it 
doesn't recogniza a spiral).


-- 
Iñaki Baz Castillo
ibc at in.ilimit.es


More information about the Users mailing list