Hi everybody, I am writing here because I can't find the solution to my problem (my asterisk configuration). I hope somebody can give me a hand with it: I need to provide a PBX service to several companies (extensions with softphones and Digium hardware to manage the analog lines), my problem is that I don't know how to configure the contexts to have, for instance, the following scenario: Company A ext 2000 ext 2001 ext 2002 Company B ext 2000 ext 2001 ext 2002 Company A must not to see extensions of company B and viceversa. I know this is possible with extensions, but I don't know how to distinguish when (for example) a sip phone is connecting to the extension 2000 from company A or company B. It is possible to configure my sip.conf (or iax.conf) like this? If it is, how do I need to configure the softphone? Does Asterisk realizes which context to use depending on the username? Does asterisk allows two extension sections with the same number?: [2000] username=companyA_2000 context=contextCompanyA [2000] username=companyB_2000 context=contextCompanyB Any help will be appreciated. Sebas -- Sebastian Silva G R U P O G A U S S Depto. Sistemas Av. Libertador 6250 4 piso Tl.: 4 706-2222 (int. 121) ssilva@gaussar.com
The short answer is No. The method you describe is intrinsicly illogical. Assuming there is an IVR, how will I know which extension 2000 I am calling if that were possible? I might get company A instead of company B. You can create two * servers with identical dial plans, link them over IAX, and allow users to call each other if they use a rpefix lke 7. Example: Comp-A user 2000 calls comp-B user 2000 by dialing 72000. Now if you want to use one server only, then just use 200x for one company and 300x for the other and segment the dial plans. W -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Sebastian Silva Sent: Tuesday, April 26, 2005 11:29 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Extensions / Contexts Hi everybody, I am writing here because I can't find the solution to my problem (my asterisk configuration). I hope somebody can give me a hand with it: I need to provide a PBX service to several companies (extensions with softphones and Digium hardware to manage the analog lines), my problem is that I don't know how to configure the contexts to have, for instance, the following scenario: Company A ext 2000 ext 2001 ext 2002 Company B ext 2000 ext 2001 ext 2002 Company A must not to see extensions of company B and viceversa. I know this is possible with extensions, but I don't know how to distinguish when (for example) a sip phone is connecting to the extension 2000 from company A or company B. It is possible to configure my sip.conf (or iax.conf) like this? If it is, how do I need to configure the softphone? Does Asterisk realizes which context to use depending on the username? Does asterisk allows two extension sections with the same number?: [2000] username=companyA_2000 context=contextCompanyA [2000] username=companyB_2000 context=contextCompanyB Any help will be appreciated. Sebas -- Sebastian Silva G R U P O G A U S S Depto. Sistemas Av. Libertador 6250 4 piso Tl.: 4 706-2222 (int. 121) ssilva@gaussar.com _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Extensions, Usernames, context, and what the device 'thinks it is' are all different. As SIP goes Make your sip.conf entries like this: [compa2000] username=companyA_2000 context=contextCompanyA [compb2000] username=companyB_2000 context=contextCompanyB That will give each device a unique login and them in your individual company context do: [compA] exten = 2000,1,Dial(SIP/compa2000) [compb] exten => 2000,1,Dial(SIP/compb2000) -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Wiley Siler Sent: Tuesday, April 26, 2005 3:02 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: RE: [Asterisk-Users] Extensions / Contexts The short answer is No. The method you describe is intrinsicly illogical. Assuming there is an IVR, how will I know which extension 2000 I am calling if that were possible? I might get company A instead of company B. You can create two * servers with identical dial plans, link them over IAX, and allow users to call each other if they use a rpefix lke 7. Example: Comp-A user 2000 calls comp-B user 2000 by dialing 72000. Now if you want to use one server only, then just use 200x for one company and 300x for the other and segment the dial plans. W -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Sebastian Silva Sent: Tuesday, April 26, 2005 11:29 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Extensions / Contexts Hi everybody, I am writing here because I can't find the solution to my problem (my asterisk configuration). I hope somebody can give me a hand with it: I need to provide a PBX service to several companies (extensions with softphones and Digium hardware to manage the analog lines), my problem is that I don't know how to configure the contexts to have, for instance, the following scenario: Company A ext 2000 ext 2001 ext 2002 Company B ext 2000 ext 2001 ext 2002 Company A must not to see extensions of company B and viceversa. I know this is possible with extensions, but I don't know how to distinguish when (for example) a sip phone is connecting to the extension 2000 from company A or company B. It is possible to configure my sip.conf (or iax.conf) like this? If it is, how do I need to configure the softphone? Does Asterisk realizes which context to use depending on the username? Does asterisk allows two extension sections with the same number?: Any help will be appreciated. Sebas -- Sebastian Silva G R U P O G A U S S Depto. Sistemas Av. Libertador 6250 4 piso Tl.: 4 706-2222 (int. 121) ssilva@gaussar.com _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Sebastian Silva wrote:> Hi everybody, > > I am writing here because I can't find the solution to my problem (my > asterisk configuration). I hope somebody can give me a hand with it: > > I need to provide a PBX service to several companies (extensions with > softphones and Digium hardware to manage the analog lines), my problem > is that I don't know how to configure the contexts to have, for > instance, the following scenario: > > Company A > ext 2000 > ext 2001 > ext 2002 > > Company B > ext 2000 > ext 2001 > ext 2002 > > Company A must not to see extensions of company B and viceversa.ok. So, use: extension.conf [incomingline1] include => companya exten => s,1,Answer() exten => s,2,Background(welcome_to_companya) [incomingline2] include => companyb exten => s,1,Answer() exten => s,2,Background(welcome_to_companyb) [internalcompanya] include => company_a include => voicemail_a include => utils_a include => dialout_a ... [internalcompanya] include => company_b include => voicemail_b include => utils_b include => dialout_b ... [companya] exten => 2000,1,Dial(SIP/2000a) exten => 2001,1,Dial(SIP/2001a) exten => 2002,1,Dial(SIP/2002a) [companyb] exten => 2000,1,Dial(SIP/2000b) exten => 2001,1,Dial(SIP/2001b) exten => 2002,1,Dial(SIP/2002b) sip.conf [2000a] username=companyA_2000 context=Companya [2000b] username=companyB_2000 context=Companyb -- Cheers, Matt Riddell _______________________________________________ http://www.sineapps.com/news.php (Daily Asterisk News - html) http://www.sineapps.com/rssfeed.php (Daily Asterisk News - rss)
I think, in theory, you could do it. You should be able to create sip users with different contexts and carefully configure the contexts in extensions.conf. The only problem I see you will have is that you cannot define the same block in sip.conf as in your example. What you could try doing is: sip.conf [a_2000] username=2000 secret=2000 context=company_a [b_2000] username=2000 secret=2000 context=company_b then, in your extensions.conf you could have something like this: extensions.conf [company_a] exten => 2000, 1, Dial(SIP/a_2000) ... [company_b] exten => 2000, 1, Dial(SIP/b_2000) Note, this is DEFINITELY not tested and is only a suggestion. - Daniel On Apr 26, 2005, at 3:01 PM, Wiley Siler wrote:> The short answer is No. > > The method you describe is intrinsicly illogical. > Assuming there is an IVR, how will I know which extension 2000 I am > calling if that were possible? > I might get company A instead of company B. > > You can create two * servers with identical dial plans, link them over > IAX, and allow users to call each other if they use a rpefix lke 7. > Example: Comp-A user 2000 calls comp-B user 2000 by dialing 72000. > > Now if you want to use one server only, then just use 200x for one > company and 300x for the other and segment the dial plans. > > W
In your channel config (eg sip.conf) you need to call them things like [companya-200] [companyb-200] Then in extensions.conf [companya] exten => 200,1,Dial(sip/companya-200) [companyb] exten => 200,1,Dial(sip/companyb-200) Hope that helps On 4/26/05, Sebastian Silva <ssilva@gaussar.com> wrote:> Hi everybody, > > I am writing here because I can't find the solution to my problem (my > asterisk configuration). I hope somebody can give me a hand with it: > > I need to provide a PBX service to several companies (extensions with > softphones and Digium hardware to manage the analog lines), my problem > is that I don't know how to configure the contexts to have, for > instance, the following scenario: > > Company A > ext 2000 > ext 2001 > ext 2002 > > Company B > ext 2000 > ext 2001 > ext 2002 > > Company A must not to see extensions of company B and viceversa. > > I know this is possible with extensions, but I don't know how to > distinguish when (for example) a sip phone is connecting to the > extension 2000 from company A or company B. > > It is possible to configure my sip.conf (or iax.conf) like this? If it > is, how do I need to configure the softphone? Does Asterisk realizes > which context to use depending on the username? Does asterisk allows two > extension sections with the same number?: > > [2000] > username=companyA_2000 > context=contextCompanyA > > [2000] > username=companyB_2000 > context=contextCompanyB > > Any help will be appreciated. > Sebas > > -- > Sebastian Silva > G R U P O G A U S S > Depto. Sistemas > Av. Libertador 6250 4 piso > Tl.: 4 706-2222 (int. 121) > ssilva@gaussar.com > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Good points. I stand corrected. -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Chris Wade Sent: Tuesday, April 26, 2005 2:41 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Extensions / Contexts Wiley Siler wrote:> The short answer is No. >Wrong, the short answer is maybe.> The method you describe is intrinsicly illogical. > Assuming there is an IVR, how will I know which extension 2000 I am > calling if that were possible? > I might get company A instead of company B. >If you get this behavior in your IVR's then you need to redesign them. If what you say were true, I couldn't have a multiple level IVR where "1" takes to you another menu which has another "1" in it that takes me to another menu with another "1" in it! Also, remember that a DEVICE is NOT an EXTENSION!> You can create two * servers with identical dial plans, link them over> IAX, and allow users to call each other if they use a rpefix lke 7. > Example: Comp-A user 2000 calls comp-B user 2000 by dialing 72000. >This would work, but why? Use contexts, that's what they are there for - dialplan 'partitioning'.> Now if you want to use one server only, then just use 200x for one > company and 300x for the other and segment the dial plans. > > W >Again, this would work, but why? And now you've got a higher potential of CompanyA customers reaching CompanyB employees - not good.> > -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Sebastian Silva > Sent: Tuesday, April 26, 2005 11:29 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] Extensions / Contexts > > Hi everybody, ><snip>> [2000] > username=companyA_2000 > context=contextCompanyA > > [2000] > username=companyB_2000 > context=contextCompanyB > > Any help will be appreciated. > SebasYour example there should work with one minor change. Make the part in the brackets unique. Meaning [a2000] and [b2000] or similar. Then, from within your dialplan configure extension => 2000 in context [CompanyA] to dial SIP/a2000 and similar for CompanyB, making exten => 2000 in context [CompanyB] dial SIP/b2000. This entire topic has been discussed multiple times on the list. Please read the archives, use google and the 'site:' argument. -Chris PS: Remember that a DEVICE is NOT an EXTENSION! PPS: Remember that an EXTENSION need NOT be a DEVICE! _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users