[OpenSIPS-Users] "Asterisk Contexts" in OpenSIPS

Deon Vermeulen vermeulen.deon at gmail.com
Thu Sep 30 12:25:34 CEST 2010


Hi Stan

Thanks for the very quick response.

Here is a snipped from the ASTERISK v1.4 - The Future of telephony 2nd  
Edition eBook explaining what a Context is.

***** START *****
Contexts
Dialplans are broken into sections called contexts. Contexts are named  
groups of ex-
tensions, which serve several purposes.
Contexts keep different parts of the dialplan from interacting with  
one another. An
extension that is defined in one context is completely isolated from  
extensions in any
other context, unless interaction is specifically allowed. (We’ll  
cover how to allow in-
teraction between contexts near the end of the chapter.)
As a simple example, let’s imagine we have two companies sharing an  
Asterisk server.
If we place each company’s voice menu in its own context, they are  
effectively separated
from each other. This allows us to independently define what happens  
when, say, ex-
tension 0 is dialed: people pressing 0 at Company A’s voice menu will  
get Company
A’s receptionist, and callers pressing 0 at Company B’s voice menu  
will get Company
B’s receptionist. (This example assumes, of course, that we’ve told  
Asterisk to transfer
the calls to the receptionists when callers press 0.)
***** STOP *****

The above is exactly what I need to achieve.

"Contexts" should also have their own set of gateways and not able to  
use each others gateways in any way.


I really want the functionality OpenSIPS can Provide, ie. Fast Calls  
Setups, User Portal for Speed-Dial setup, individual CDR Records  
viewing, etc.. Just to name a few of them.


I still have to integrate Asterisk with OpenSIPS for the Media part,  
but I would first like to sort out the "Context" Part before doing that.

Thanks again for the help.

Really appreciate it.


Regards
Deon


On 30 Sep 2010, at 11:58 AM, Stanisław Pitucha wrote:

> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100930/738e31ae/attachment.htm 


More information about the Users mailing list