[asterisk-users] multiple pbxes, multiple domains, same user ids?

Anselm Martin Hoffmeister
Fri, 03 Aug 2007 08:02:25 -0000

Am Mittwoch, den 01.08.2007, 16:32 +0530 schrieb Benjamin
Jacob:
> Hello good ppl,
> A couple of questions for multiple pbxes
> 1. Is it possible to support multiple pbxes in one Asterisk box(using
> contexts, etc.)?
> 2. Can we use the "domain" field in sip.conf to specify the
different
> domains for sip users, having one domain for each pbx?
>
> I just tried registering two xlites, with different domain names (with
> the same specified in sip.conf). But, Asterisk maintains the
> registration of the latest registree!! thats really sad for me .
>
> Any work around for this one(multiple pbx)?
> I would be zapped and amazed if multiple pbx isn't possible in
Asterisk.
>
> Help anyone?

If "multiple domains" means you want to register SIP phones with the
usernames "sip501" at domain1 and "sip501" at domain2, that
in my
experience will not work out this way, because for registered users only
the peer name is relevant (corrections welcome, but it seems like that
to me).

What you could do of course is name the peers reasonably:

customera-501, customerb-501

On the first thought, this is not as elegant, but on the other hand, if
the phone displays the username, it is better than displaying
"sip-501".

You would need to have some magic to distinguish between your
"domains"
in the dialplan. There is a "static" way of doing it (by setting the
context=blah in the sip peers) or a dynamic way, by giving them all into
the same context, and then do some Asterisk DB magic to make out which
internal partner to reach if "581" is dialled, or which trunk line to
use, or whom to bill calls to. This is absolutely possible, without the
customers noticing.

If you want to support incoming SIP as in sip:secretary at example.com, for
different domains, you can specify that in sip.conf. In my experience
(again, I am ready to learn there are better ways) the best working
thing is having a separate domain name for registrations (to get things
easily separated), like "register.yourcompany.domain", with a line
domain=register.yourcompany.domain
and for all further domains have separate contexts, like
"domain-examplecom" and "domain-exampleorg", looking like

domain=example.com,domain-examplecom
domain=example.org,domain-exampleorg

and in extensions.conf, you could go like

[domain-examplecom]
exten => secretary,1,Dial(SIP/customera-505)
exten => bigboss,1,Dial(SIP/customera-500)

[domain-exampleorg]
exten => secretary,1,Dial(SIP/customerb-555)
exten => sales,1,Dial(SIP/customerb-514&SIP/customerb-519)

HTH
Anselm