usenet@netassist.info
2006-Jan-28 17:29 UTC
[Asterisk-Users] Multiple Subscriptions to SIP accounts at Same Domain
Sorry not to have observed etiquet and lurked here for a bit before wading in with a question but I have an issue that may well be because I dont know enough about what asterisk is actually doing under the hood to understand why I cant do what I want with asterisk. Im hoping that someone can point me in the right direction :-) This is what I have: Mandrake 2006 running Asterisk 1.2.3 - no additional hardware - everything is going to be running via SIP. To enable inbound and outbound connectivity I have been experimenting with using various accounts provided by Gosspitel, Sipgate, aql and others and have found the most sucessful have been those provided by Gossiptel. Herein lies the problem. I need to register about six incoming lines all provided by Gossiptel - half of them to be active within one context and half within another. I have sucessfully registered all the lines within sip.conf as follows: register => username1:password1:authuser1@sip.gossiptel.com register => username2:password2:authuser2@sip.gossiptel.com etc and then I created a peer and a user for the sip.gossiptel.com domain, but I now find that any calls that come in to any of these registered accounts all ring the 's' extension within the default context. Thats fine as far as it goes but I need to be able to handle each SIP account in its own context. As a half way house, in the course of testing this I did play with creating extensions for each sip account and directing them thus: register => username1:password1:authuser1@sip.gossiptel.com/ext1 register => username2:password2:authuser2@sip.gossiptel.com/ext2 and this works fine as well - inbound calls end up activating the assigned extensions within extensions.conf but the problem remains that these extensions themselves have to be within a single context (in my case the default context). So my question in short is - does anyone know how I can regester multiple SIP accounts so that, at the time of registration they each become active in different contexts - I have scoured the manual and see no way of allocating contexts to each individual registration if they are all at the same domain. OK, Im labouring the point now because its late :-) I would have thought that one way of doing this would be to have some way of forcing a peer and user definition to register with the server and for that registration to be within the context of the peer or user - so that inbound calls to that line would activate the extension within the assigned context - or perhaps to have a context switch that could be procesed by register => wherever it was in sip.conf I would have thought the former solution would be better as it seems more logical and understandable to put this within a peer definition - does anyone know if simply putting the register => command in a peer definition has the desired effect ? Certainly it didnt seem to when I tried it. Hope that this is clear enough and that someone has the answer to this one! Its quite annoying as to my mind it should clearly be possible, especially for those of us who need multiple lines and want to stick to one voip provider externally. Kind Regards and thanks in advance for any help with this one, Geoff.
Leif Neland
2006-Jan-28 17:50 UTC
[Asterisk-Users] Multiple Subscriptions to SIP accounts at SameDomain
---- Original Message ---- From: <usenet@netassist.info> To: <asterisk-users@lists.digium.com> Sent: Sunday, January 29, 2006 1:29 AM Subject: [Asterisk-Users] Multiple Subscriptions to SIP accounts at SameDomain> Sorry not to have observed etiquet and lurked here for a bit before > wading in with a question but I have an issue that may well be because > I dont know enough about what asterisk is actually doing under the > hood to understand why I cant do what I want with asterisk. > > Im hoping that someone can point me in the right direction :-) > > This is what I have: > > Mandrake 2006 running Asterisk 1.2.3 - no additional hardware - > everything is going to be running via SIP. > > To enable inbound and outbound connectivity I have been experimenting > with using various accounts provided by Gosspitel, Sipgate, aql and > others and have found the most sucessful have been those provided by > Gossiptel. > > Herein lies the problem. I need to register about six incoming lines > all provided by Gossiptel - half of them to be active within one > context and half within another. > > I have sucessfully registered all the lines within sip.conf as > follows: > > register => username1:password1:authuser1@sip.gossiptel.com > register => username2:password2:authuser2@sip.gossiptel.com > etc > > and then I created a peer and a user for the sip.gossiptel.com domain, > but I now find that any calls that come in to any of these registered > accounts all ring the 's' extension within the default context. Thats > fine as far as it goes but I need to be able to handle each SIP > account in its own context. As a half way house, in the course of > testing this I did play with creating extensions for each sip account > and directing them thus: > > register => username1:password1:authuser1@sip.gossiptel.com/ext1 > register => username2:password2:authuser2@sip.gossiptel.com/ext2 > > and this works fine as well - inbound calls end up activating the > assigned extensions within extensions.conf but the problem remains > that these extensions themselves have to be within a single context > (in my case the default context). > >From sip.conf:;register => 2345@mysipprovider.com/1234 ; ; Register 2345 at sip provider. Calls from this provider connect to local ; extension 1234 in extensions.conf default context, unless you define ; [mysipprovider.com] in a section below, and configure a context Wild guess: A kludge is if you run your own dns: *.gossiptel.mydom.dom. IN CNAME sip.gossiptel.com. Then register each user to his "own" domain: register => username1:password1:authuser1@username1.gossiptel.mydom.dom register => username2:password2:authuser2@username2.gossiptel.mydom.dom Then define [username1.gossiptel.mydom.dom] context=user1context [username2.gossiptel.mydom.dom] context=user2context Otherwise, you should just create a patch to allow the syntax register => user[:secret[:authuser]]@host[:port][/context[/extension]] Shouldn't be so hard to do :-) Leif
Joe Greco
2006-Jan-28 17:57 UTC
[Asterisk-Users] Multiple Subscriptions to SIP accounts at Same
> register => username1:password1:authuser1@sip.gossiptel.com > register => username2:password2:authuser2@sip.gossiptel.com > etc > > and then I created a peer and a user for the sip.gossiptel.com domain, > but I now find that any calls that come in to any of these registered > accounts all ring the 's' extension within the default context.change the context within sip.conf to "from-sip-provider" or something like that.> Thats > fine as far as it goes but I need to be able to handle each SIP account > in its own context.use extensions.conf for this purpose (we did). in sip.conf you have: register => username1:password1:authuser1@sip.gossiptel.com/ext1 register => username2:password2:authuser2@sip.gossiptel.com/ext2 then in extensions.conf you have [from-sip-provider] exten => ext1,1,Goto(context-for-ext1,s,1) exten => ext2,1,Goto(context-for-ext2,s,1)> As a half way house, in the course of testing this > I did play with creating extensions for each sip account and directing > them thus:so you were halfway there> and this works fine as well - inbound calls end up activating the > assigned extensions within extensions.conf but the problem remains that > these extensions themselves have to be within a single context (in my > case the default context).that's the dialplan's problem - to sort it all out. :-) note that we're doing this with dozens of numbers with no problem. as a possibly helpful hint, it is nice to include the phone number as part of the extension, such as "ext4148441414" or "did4148441414" rather than "ext1". there may be some downsides to using just the number by itself; it's been a while and i don't recall for sure. it seems like there should be a way to make this work within sip.conf itself, but the interactions between the registrations and definitions has always seemed to be loose at best and i've never been able to get them to work the way i would expect, so beware that other more "correct" solutions may exist. ... JG -- Joe Greco - sol.net Network Services - Milwaukee, WI - http://www.sol.net "We call it the 'one bite at the apple' rule. Give me one chance [and] then I won't contact you again." - Direct Marketing Ass'n position on e-mail spam(CNN) With 24 million small businesses in the US alone, that's way too many apples.
Olle E Johansson
2006-Mar-09 00:10 UTC
[Asterisk-Users] Multiple Subscriptions to SIP accounts at Same Domain
THis is too hard to solve in Asterisk, even though it can be solved. I've answered the question far too many times to answer again - search the mailing lists and the wiki and you will find out how to work with peer matching to fix this issue. In the "sipregister" development branch I am working with Luigi Rizzo to solve this issue once and for all. In that code, we change the registration process so you simply add "register=yes" in a peer section and we will match all incoming calls to that peer. If you have multiple accounts with the same service provider, simply create more peers and we will match each one properly. This patch is part of the test-branch "test-this-branch" if you want to test it. I need feedback from testers, so please do. /Olle --- * Olle E Johansson - oej@edvina.net * Asterisk Training http://edvina.net/training