[OpenSIPS-Users] a little help

Albert Paijmans albert at vraagalex.nl
Thu Jun 3 13:34:38 CEST 2010


Hi Bogdan,

Thanks for being so patient.
I''ll try to explain, ofcourse OpenSIPS should be te register and proxy, do
authentication etc.
The Asterisk servers should always be in the call path for rtp streams. So
OpenSIPS should also keep state and forward sip messages.

In FreePBX (Asterisk) there are options to not allow anonymous sip invite's
If Asterisk and OpenSIPS do not share the database subscribers can not
register with Asterisk. Asterisk will only allow invite requests from the
proxy. And there is an option not not allow the party that is being called
to do on hold and dial out.

Sometimes it is difficult to explain but OpenSIPS should receive an invite
from Ekiga,net or a local subscriber.
Check the usrloc and alias table, send an invite to the destination
(101 at ourdomain or user at ekiga dials 102 at ourdomain. Then the destination 102
is invited and both are send to Asterisk

But for this I do not need an on_reply route? You gave me the option to do
dialplan translation.
Last night I only took the parts I am really sure about, so the below part
is just incomplete but hopefully shows what I am trying to do.

Thanks

Albert

# ----- main routing logic ----- #

route{
if (!mf_process_maxfwd_header("10"))  {
        sl_send_reply("483","Too Many Hops looping");
exit;
}
-------------------------- ^ initial and or sequential requests

# handle cancel and re-transmissions

if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}

t_check_trans();

# authenticate if from local subscriber multidomain version
if (!(method=="REGISTER") && is_from_local())
if(!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
exit;
}
if (!db_check_from()) {
sl_send_reply("","Forbidden auth ID");
exit;
}
consume_credentials(); # caller authenticated
}

-------------------

# requests for my domain


if (!lookup("location")) {
}



if ($rU==NULL) { #request with no Username in RURI
send_reply("484","Address Incomplete");
exit;
}

--------------------------

# Dialplan transformation #

dp_translate("1"); # dialplan ID
   switch ($avp(attrs) ) {
        case "usrloc" :
      load_balance("1","usrloc"); # local subscribers & sip requests
              break;
  case "pstn" :
      load_balance("1","pstn"); # free pstn destinations
      break;
  case "media" :
      load_balance("1","media"); # media services
      break;
  case "prepaid" :
      load_balance("1","prepaid"); # non-free pstn destinantions
      break;
  case "announcement" :
      load_balance("1","announcement"); #
      break;
}


if ($retcode<0) {...
---------------------------

failure_route[1] {
if (t_was_cancelled()) {
exit;
}

# failure code "408 - timeout", "484 - Address Incomplete", "486 - busy"
# forward the calls to voicemail recording
if (t_check_status("408")) {
prefix("timeout_");
load_balance("1","media");
} else
if (t_check_status("484"); {
prefix("incomplete_");
load_balance("1","media");
} else
if (t_check_status("486")) {
prefix("busy_");
load_balance("1","media");
} else { # unknown service
prefix("notavailable_");
load_balance("1","media");
}
t_relay();
exit;
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100603/8f142b0e/attachment.htm 


More information about the Users mailing list