2006/7/20, voiplist &lt;<a href="mailto:gotvoip@gmail.com">gotvoip@gmail.com</a>&gt;:<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 &lt;<a href="mailto:mps@colewood.net">mps@colewood.net</a>&gt; wrote:<br>&gt;<br>&gt;<br>&gt; I'm not exactly sure on the /how/ * mathes items from the sip.conf (I<br>&gt; suspect it goes to the latter for whichever provider), but the way
<br>&gt; configured my extenions.conf to handle multiple incoming accounts from<br>&gt; sipgate is like this (obviously much simplified for ease of explanation):<br>&gt;<br>&gt;<br>&gt; [incoming_sipgate]<br>&gt;<br>&gt; exten =&gt; 1111,1,Answer
<br>&gt; exten =&gt; 1111,2,Dial(SIP/ciscophone,12)<br>&gt;<br>&gt;<br>&gt; exten =&gt; 2222,1,Answer<br>&gt; exten =&gt; 2222,2,Dial(SIP/pcsoftphone,12)<br>&gt;<br>&gt;<br>&gt;<br>&gt; Also, in the sip.conf, each peer has context=incoming_sipgate in it.
<br>&gt; HTH,<br>&gt;<br>&gt; Mat<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;-----Original Message-----<br>&gt; From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a><br>&gt; [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com">
asterisk-users-bounces@lists.digium.com</a>] On Behalf<br>&gt; Of Benjamin Stocker<br>&gt; Sent: 20 July 2006 16:05<br>&gt; To: Asterisk Users Mailing List<br>&gt; Subject: [asterisk-users] Two phone numbers, one SIP provider
<br>&gt;<br>&gt;<br>&gt;<br>&gt; Hi<br>&gt;<br>&gt; I have two phone numbers from my SIP provider <a href="http://sippro.com">sippro.com</a>, say 1111 and 2222.<br>&gt; I use two sip.conf entries to register this phone numbers:
<br>&gt;<br>&gt; register =&gt; <a href="http://1111:pass@sippro.com/1111">1111:pass@sippro.com/1111</a><br>&gt; register =&gt; <a href="http://2222:pass@sippro.com/2222">2222:pass@sippro.com/2222</a><br>&gt;<br>&gt; [1111]
<br>&gt; type=friend<br>&gt; username=1111<br>&gt; secret=pass<br>&gt; insecure=very<br>&gt; host= <a href="http://sip.sippro.com">sip.sippro.com</a><br>&gt; context=incoming-1111<br>&gt;<br>&gt; [2222]<br>&gt; type=friend
<br>&gt; username=2222<br>&gt; secret=pass<br>&gt; insecure=very<br>&gt; host=<a href="http://sip.sippro.com">sip.sippro.com</a><br>&gt; context=incoming-2222<br>&gt;<br>&gt; Now, from my dialplan I can use them to do outgoing calls, like
<br>&gt; Dial(SIP/9999@1111). That works pretty fine. The problem are incoming calls.<br>&gt; According to [1] asterisk should lookup a match in sip.conf when somebody<br>&gt; (outside <a href="http://sippro.com">sippro.com
</a>) calls 1111 or 2222. For example, a call to 1111 should<br>&gt; look for a extension in context 'incoming-1111'. A call for 2222 should go<br>&gt; to context incoming-2222. But in the above scenario, asterisk always gets a
<br>&gt; match on '2222'. As a result, context 'incoming-2222' is always used.<br>&gt;<br>&gt; How does asterisk search for a match in sip,conf for incoming calls and how<br>&gt; can I get it to use the context specified in the account settings?
<br>&gt;<br>&gt; 1.<br>&gt; <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 &quot;host=&quot; 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&nbsp;&nbsp;;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>