[OpenSIPS-Users] "Asterisk Contexts" in OpenSIPS

Stanisław Pitucha viraptor at gmail.com
Thu Sep 30 13:19:47 CEST 2010


On 30/09/10 11:59, Deon Vermeulen wrote:
> Let me try and explain a scenario as brief as I possibly can.
> 
> I have Company A (Domain A) and Company B (Domain B).
> 
> Domain A and B should be completely Transparent to each other.
> 
> See like Domain A and B in their own respective Bubbles completely  
> separated from each other, each with functions like Hunt groups, IVRs,  
> Conferencing, Presence, Music on Hold, etc...
That's fine with domains. Just make sure usrloc / aliases use domains.
(there's a mod_param for that) and that the domain names are filled
correctly in the db.

> Extension 123 should be able to exist in both Domains and make/receive  
> calls.
Handled by domains - usrloc / registrar should handle it just fine. Run
standard lookup("location") before relaying the packet and it will go
the the correct user if he's registered. Make sure that the users in
table `subscribers` use a different domain.

> Domain A and B should not be able to make any VOICE calls between each  
> other, but via their respective PSTN/GSM Gateways, unless they are put  
> in a Group/Class allowing them. Both Bubbles in a bigger bubble.
Aliases will help you resolve that. Bind PSTN numbers to
extensions at domain and lookup("aliases") before sending the call to PSTN
numbers in order to loop back to the correct users. So basically
something like:
if (lookup("aliases")) { route(local_call); }
else { route(external_call); }

route[local_call] {
   if(lookup("location")) { t_relay(); }
   else { return some error, probably 404 }
}

> Each Domain should have their own respective PSTN, GSM, etc Gateways  
> and be completely transparent to the other Domain, ie. Domain A should  
> not be able to use any of Domain Bs gateways to make/receive calls and  
> vise-versa.
I think this can be handled by drouting - I'm not using it, so not 100%
sure. If it doesn't, then you can map domain names onto dispatcher
groups and use ds_select_domain() instead.

As for the received calls, I'm not sure if you want to limit anything?
If you're only going to get pstn numbers, do you really care if you got
a call from the "wrong" gateway? If you do, just check the source
against the domain after lookup("aliases"). If you don't - your incoming
call looks just like your outgoing one. (apart from the
route(external_call) of course - that should be 403 or something like that).

Regards,
Stan



More information about the Users mailing list