Benjamin Stocker
2006-Jul-20 08:05 UTC
[asterisk-users] Two phone numbers, one SIP provider
Hi I have two phone numbers from my SIP provider sippro.com, say 1111 and 2222. I use two sip.conf entries to register this phone numbers: register => 1111:pass@sippro.com/1111 register => 2222:pass@sippro.com/2222 [1111] type=friend username=1111 secret=pass insecure=very host=sip.sippro.com context=incoming-1111 [2222] type=friend username=2222 secret=pass insecure=very host=sip.sippro.com context=incoming-2222 Now, from my dialplan I can use them to do outgoing calls, like Dial( SIP/9999@1111). That works pretty fine. The problem are incoming calls. According to [1] asterisk should lookup a match in sip.conf when somebody (outside sippro.com) calls 1111 or 2222. For example, a call to 1111 should look for a extension in context 'incoming-1111'. A call for 2222 should go to context incoming-2222. But in the above scenario, asterisk always gets a match on '2222'. As a result, context 'incoming-2222' is always used. How does asterisk search for a match in sip,conf for incoming calls and how can I get it to use the context specified in the account settings? 1. http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060720/e38f4b9a/attachment.htm
I'm not exactly sure on the /how/ * mathes items from the sip.conf (I suspect it goes to the latter for whichever provider), but the way configured my extenions.conf to handle multiple incoming accounts from sipgate is like this (obviously much simplified for ease of explanation): [incoming_sipgate] exten => 1111,1,Answer exten => 1111,2,Dial(SIP/ciscophone,12) exten => 2222,1,Answer exten => 2222,2,Dial(SIP/pcsoftphone,12) Also, in the sip.conf, each peer has context=incoming_sipgate in it. HTH, Mat -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Benjamin Stocker Sent: 20 July 2006 16:05 To: Asterisk Users Mailing List Subject: [asterisk-users] Two phone numbers, one SIP provider Hi I have two phone numbers from my SIP provider sippro.com, say 1111 and 2222. I use two sip.conf entries to register this phone numbers: register => 1111:pass@sippro.com/1111 register => 2222:pass@sippro.com/2222 [1111] type=friend username=1111 secret=pass insecure=very host= <http://sip.sippro.com> sip.sippro.com context=incoming-1111 [2222] type=friend username=2222 secret=pass insecure=very host=sip.sippro.com context=incoming-2222 Now, from my dialplan I can use them to do outgoing calls, like Dial(SIP/9999@1111). That works pretty fine. The problem are incoming calls. According to [1] asterisk should lookup a match in sip.conf when somebody (outside sippro.com) calls 1111 or 2222. For example, a call to 1111 should look for a extension in context 'incoming-1111'. A call for 2222 should go to context incoming-2222. But in the above scenario, asterisk always gets a match on '2222'. As a result, context 'incoming-2222' is always used. How does asterisk search for a match in sip,conf for incoming calls and how can I get it to use the context specified in the account settings? 1. http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.2/393 - Release Date: 19/07/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060720/87ab5f98/attachment.htm
From: Filip Dr?gowski <f.dragowski@ontp.net>> Subject: Re: [asterisk-users] Two phone numbers, one SIP provider > To: Asterisk Users Mailing List - Non-Commercial Discussion > <asterisk-users@lists.digium.com> > Message-ID: <44C07951.6040008@ontp.net> > Content-Type: text/plain; charset=ISO-8859-2; format=flowed > > I think that context=incoming-[number] in firends definion is used > rather for determinig context for outgoing calls. > In sip.conf [general] section there is context= and > register=>..../[extension] > i think that extension in register line should be in context specified > in [general] context=[context] > >> >> >>> register => 1111:pass@sippro.com/1111 >>> register => 2222:pass@sippro.com/2222 >>> >I am only using inbound IAX but I do have multiple DID's from the same provider and I hope the action of parsing the files is the same. I don't think you want the extensions listed after the host. The following is what I have for my IAX trunks ; Registrations for remote IAX servers (dynamic config) register => 416xxxxxxx:zzzzz@myprovider.ca ; Home line register => 416yyyyyyy:zzzzz@myprovider.ca ; Business line Both calls happily go to contexts [416xxxxxxx] and [416yyyyyyyy] respectively. dbc.