[OpenSIPS-Users] "Asterisk Contexts" in OpenSIPS

Stanisław Pitucha viraptor at gmail.com
Thu Sep 30 11:58:23 CEST 2010


On 30/09/10 10:48, Deon Vermeulen wrote:
> Is there perhaps someone that could give me a 2 "Context" config  
> example for OpenSIPS?

It depends what you mean by a context. If you want to sort by the source
host, just use

if ($si == "1.2.3.4") {
  route(something);
} else if ($si == "3.4.5.6") {
  route(something_else);
}

In case you want to sort by specific users, do that after authorization:

if (!proxy_authorize...) {
  proxy_chanllenge(...);
  exit;
}
if ($au == "some_username") {
...
} else if ($au == "some_other_username") {
...
}

Or was there something else you were thinking about?

Regards,
Stan



More information about the Users mailing list