<p>Your problem originate from the use of insecure option. Using this option, the peer is authenticated using the registration ip and not the user and password.</p>
<p>Leandro</p>
<div class="gmail_quote">Il giorno 26/mar/2012 05:48, &quot;YeungJoe&quot; &lt;<a href="mailto:ma_ch1987@hotmail.com">ma_ch1987@hotmail.com</a>&gt; ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">
<font style="font-size:12pt" face="Times New Roman" size="3">Hello All,<br><br>I am Asterisk user, and right now I have some troubles about Asterisk As Client settings.<br><br>Here are my envrionments:<br><br>Asterisk-1.8.5.0<br>
<br>-----------------------------------------------------------<br>Server Settings(IP:172.16.70.121)<br><br>////////////extensions.conf////////////////<br><br><br>[from-internal-200]<br>exten =&gt; _X.,1,Dial(SIP/${EXTEN})<br>
exten =&gt; _X.,n,Hangup()<br><br>////////////end of extensions.conf/////////<br><br><br>////////////sip.conf///////////////////////<br>[101]<br>type=friend<br>username=101<br>secret=101<br>host=dynamic<br>allow=all<br>context=from-internal-101<br>
<br><br>[102]<br>type=friend<br>username=102<br>secret=102<br>host=dynamic<br>allow=all<br>context=from-internal-102<br><br><br>[200]<br>type=friend<br>username=200<br>secret=200<br>host=dynamic<br>allow=all<br>context=from-internal-200<br>
////////////////////////end of sip.conf///////////<br><br>-----------------------------------------------------------<br>Client Settings(IP:<a href="http://172.16.70.124" target="_blank">172.16.70.124</a>:<br><br>//////////////////////extensions.conf//////////<br>
[from-sip-101]<br>exten =&gt; s,1,Noop(SIP-101)<br><br>[from-sip-102]<br>exten =&gt; s,1,Noop(SIP-102)<br>////////////////////end of extensions.conf/////<br><br><br>/////////////////////sip.conf//////////////////<br>[general]<br>
register =&gt; <a href="mailto:101%3A101@172.16.70.121" target="_blank">101:101@172.16.70.121</a><br>register =&gt; <a href="mailto:102%3A102@172.16.70.121" target="_blank">102:102@172.16.70.121</a><br><br>[101]<br>type=peer<br>
username=101<br>secret=101<br>insecure=invite,port<br>host=172.16.70.121<br>context=from-sip-101<br><br>[102]<br>type=peer<br>username=102<br>secret=102<br>insecure=invite,port<br>host=172.16.70.121<br>context=from-sip-102<br>
//////////////////end of sip.conf/////////////<br>-----------------------------------------------------------<br><br>Right now, I am able to register extensions 101 and 102 to server(172.16.70.121).<br>and I can dial from SIP extension 200 to 101 or 102, if I dial 101, it will be <br>
routed to 101, and 101 is ringing. This is OK. but if I dial 102, it also be routed 101, I don&#39;t know why, because<br>according to my SIP knowledges it should be routed to 102 as they are different contexts.<br><br>BTW, Client peer is also based on Asterisk.<br>
<br>I am a newbie of SIP, if you need more info I will provide.<br>Please help! Thanks!<br></font><br><br>

Joe.Yeung<br><em></em><em><font face="Comic Sans MS"></font><br><font face="Comic Sans MS"></font></em> <br><font face="Comic Sans MS"></font> <br><br>                                               </div></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div>