2006/7/20, voiplist <<a href="mailto:gotvoip@gmail.com">gotvoip@gmail.com</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 7/20/06, Mat Stace <<a href="mailto:mps@colewood.net">mps@colewood.net</a>> wrote:<br>><br>><br>> I'm not exactly sure on the /how/ * mathes items from the sip.conf (I<br>> suspect it goes to the latter for whichever provider), but the way
<br>> configured my extenions.conf to handle multiple incoming accounts from<br>> sipgate is like this (obviously much simplified for ease of explanation):<br>><br>><br>> [incoming_sipgate]<br>><br>> exten => 1111,1,Answer
<br>> exten => 1111,2,Dial(SIP/ciscophone,12)<br>><br>><br>> exten => 2222,1,Answer<br>> exten => 2222,2,Dial(SIP/pcsoftphone,12)<br>><br>><br>><br>> Also, in the sip.conf, each peer has context=incoming_sipgate in it.
<br>> HTH,<br>><br>> Mat<br>><br>><br>> -----Original Message-----<br>> From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a><br>> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com">
asterisk-users-bounces@lists.digium.com</a>] On Behalf<br>> Of Benjamin Stocker<br>> Sent: 20 July 2006 16:05<br>> To: Asterisk Users Mailing List<br>> Subject: [asterisk-users] Two phone numbers, one SIP provider
<br>><br>><br>><br>> Hi<br>><br>> I have two phone numbers from my SIP provider <a href="http://sippro.com">sippro.com</a>, say 1111 and 2222.<br>> I use two sip.conf entries to register this phone numbers:
<br>><br>> register => <a href="http://1111:pass@sippro.com/1111">1111:pass@sippro.com/1111</a><br>> register => <a href="http://2222:pass@sippro.com/2222">2222:pass@sippro.com/2222</a><br>><br>> [1111]
<br>> type=friend<br>> username=1111<br>> secret=pass<br>> insecure=very<br>> host= <a href="http://sip.sippro.com">sip.sippro.com</a><br>> context=incoming-1111<br>><br>> [2222]<br>> type=friend
<br>> username=2222<br>> secret=pass<br>> insecure=very<br>> host=<a href="http://sip.sippro.com">sip.sippro.com</a><br>> context=incoming-2222<br>><br>> Now, from my dialplan I can use them to do outgoing calls, like
<br>> Dial(SIP/9999@1111). That works pretty fine. The problem are incoming calls.<br>> According to [1] asterisk should lookup a match in sip.conf when somebody<br>> (outside <a href="http://sippro.com">sippro.com
</a>) calls 1111 or 2222. For example, a call to 1111 should<br>> look for a extension in context 'incoming-1111'. A call for 2222 should go<br>> to context incoming-2222. But in the above scenario, asterisk always gets a
<br>> match on '2222'. As a result, context 'incoming-2222' is always used.<br>><br>> How does asterisk search for a match in sip,conf for incoming calls and how<br>> can I get it to use the context specified in the account settings?
<br>><br>> 1.<br>> <a href="http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf">http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf</a><br><br><br>I think it might be finding a match on the "host=" field.
<br><br>I could be totally wrong here but this might be worth a try.<br><br>If it IS the host which is matching, you might try splitting up the<br>incoming and outgoing context. This way, you can remove the host entry<br>
from the incoming context completely.<br><br>So something like this:<br><br>[1111]<br>type=friend<br>username=1111<br>secret=pass<br>insecure=very<br>context=incoming-1111<br><br>[2222]<br>type=friend<br>username=2222<br>
secret=pass<br>insecure=very<br>context=incoming-2222<br><br>[sippro_out]<br>type=peer<br>host=<a href="http://sip.sippro.com">sip.sippro.com</a><br>username=2222 ;OR 1111<br>secret=pass<br><br>Then in your dial string use:
<br>Dial(SIP/username@sippro_out)<br><br>Let us know how it works out..<br></blockquote></div><br>Removing the 'host=' directive has a effect, but not the expected one: Context is always 'default' when no host is specified. There are some comments on [1] discussing the same problem, see the comment from rodriguez_chapa.
<br><br>1. <a href="http://www.voip-info.org/wiki/view/Asterisk+SIP+user+vs+peer">http://www.voip-info.org/wiki/view/Asterisk+SIP+user+vs+peer</a><br><br>