<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff size=2>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):</FONT></SPAN></DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2>[incoming_sipgate]</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=000122215-20072006>exten
=> 1111,1,Answer</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=000122215-20072006>exten
=> 1111,2,Dial(SIP/ciscophone,12)</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=000122215-20072006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=000122215-20072006>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=000122215-20072006>exten
=> 2222,1,Answer</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=000122215-20072006>exten
=> 2222,2,Dial(SIP/pcsoftphone,12)</SPAN></FONT></DIV></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff size=2>Also,
</FONT></SPAN><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2>in the sip.conf, each peer has context=incoming_sipgate in
it.</FONT></SPAN></DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2>HTH,</FONT></SPAN></DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=000122215-20072006><FONT face=Arial color=#0000ff
size=2>Mat</FONT></SPAN></DIV>
<DIV><SPAN class=000122215-20072006></SPAN><FONT face=Tahoma><FONT size=2><SPAN
class=000122215-20072006><FONT face=Arial
color=#0000ff> </FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=000122215-20072006> </SPAN>-----Original Message-----<BR><B>From:</B>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <B>On Behalf Of </B>Benjamin
Stocker<BR><B>Sent:</B> 20 July 2006 16:05<BR><B>To:</B> Asterisk Users Mailing
List<BR><B>Subject:</B> [asterisk-users] Two phone numbers, one SIP
provider<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">Hi<BR><BR>I
have two phone numbers from my SIP provider <A
href="http://sippro.com">sippro.com</A>, say 1111 and 2222. 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
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 <A href="http://sippro.com">sippro.com</A>) 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. <BR><BR>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?<BR><BR>1. <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>
<P><FONT size=2>--<BR>No virus found in this incoming message.<BR>Checked by
AVG Free Edition.<BR>Version: 7.1.394 / Virus Database: 268.10.2/393 - Release
Date: 19/07/2006<BR></FONT></P>
<P><FONT face=Arial size=2></FONT></P></BLOCKQUOTE></BODY></HTML>