<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">

                                                                <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-16">
<META HTTP-EQUIV="EXPIRES" CONTENT="0">
<META HTTP-EQUIV="EXPIRESABSOLUTE" CONTENT="Tue, 01 Jun 1999 12:00:00 GMT">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PRIVATE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<TITLE></TITLE>

<META content="MSHTML 6.00.2900.2838" name=GENERATOR></HEAD>
                                                        <BODY >
                                                                <DIV><!-- Converted from text/plain format -->
<P><FONT size=2><BR>Thanks,<BR><BR>That configuration is accepted but now my 
"registered" client is denied at both following lines:<BR><BR>if 
(!lookup_user("From")) {<BR>if ((!avp_equals_xl("$registered_host", "%si") || 
!avp_equals_xl("$registered_port", "%sp"))) {<BR><BR>How can I print 
$registered_host to log ?<BR>I can print %si with 
xlog().<BR><BR>Thanks,<BR>ilker<BR><BR><BR>-----Original Message-----<BR>From: 
Miklos Tirpak [<A 
href="mailto:miklos@iptel.org">mailto:miklos@iptel.org</A>]<BR>Sent: Wednesday, 
July 12, 2006 4:01 PM<BR>To: &#304;lker Aktuna (Ko&#231;.net)<BR>Cc: 
serusers@iptel.org<BR>Subject: Re: [Serusers] prevent INVITE without 
REGISTERing<BR><BR>&#304;lker Aktuna (Ko&#231;.net) wrote:<BR>&gt;<BR>&gt;<BR>&gt; Thanks 
Miklos,<BR>&gt;<BR>&gt; I think this is just what I'm looking for.<BR>&gt; But I 
get some errors for this line:<BR>&gt; if ((src_ip != @ruri.host) || (src_port 
!= @ruri.port)) {<BR><BR>You can access src_ip and src_port via 
xl_lib:<BR><BR>$registered_host = @ruri.host;<BR>$registered_port = 
@ruri.port;<BR><BR>if ((!avp_equals_xl("$registered_host", "%si"))<BR>|| 
(!avp_equals_xl("$registered_port", "%sp"))) 
{<BR>...<BR><BR>Miklos<BR><BR>&gt;<BR>&gt;&nbsp; 0(30074) parse error 
(175,16-17): syntax error<BR>&gt;&nbsp; 0(30074) parse error (175,16-17): ip 
address or hostname expected<BR>&gt;&nbsp; 0(30074) parse error (175,16-17): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,21-22): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,21-22): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,26-27): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,26-27): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,28-30): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,31-32): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,32-40): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,41-43): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,44-45): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,49-50): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,49-50): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,54-55): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,54-55): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,55-56): bad 
command<BR>&gt;&nbsp; 0(30074) parse error (175,57-58): bad 
command<BR>&gt;<BR>&gt; Any idea why ?<BR>&gt;<BR>&gt; Thanks,<BR>&gt; 
ilker<BR>&gt;<BR>&gt; -----Original Message-----<BR>&gt; From: Miklos Tirpak [<A 
href="mailto:miklos@iptel.org">mailto:miklos@iptel.org</A>]<BR>&gt; Sent: 
Wednesday, July 12, 2006 11:58 AM<BR>&gt; To: &#304;lker Aktuna (Ko&#231;.net)<BR>&gt; Cc: 
serusers@iptel.org<BR>&gt; Subject: Re: [Serusers] prevent INVITE without 
REGISTERing<BR>&gt;<BR>&gt; Hi Ilker,<BR>&gt;<BR>&gt; just my first idea, not 
tested:<BR>&gt;<BR>&gt;<BR>&gt; 1. lookup the From HF<BR>&gt;<BR>&gt; if 
(!lookup_user("From")) {<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# reject the INVITE<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
...<BR>&gt; }<BR>&gt;<BR>&gt; 2. save original To UID and Request 
URI<BR>&gt;<BR>&gt; $orig_to_uid = $tu.uid;<BR>&gt; $orig_req_uri = 
@ruri;<BR>&gt;<BR>&gt; 3. set To UID -- registrar module will use this in the 
lookup<BR>&gt;<BR>&gt; $tu.uid = $fu.uid;<BR>&gt;<BR>&gt; 4. lookup >From HF and 
compare the source address of the INVITE with<BR>&gt; the source address of the 
REGISTER message<BR>&gt;<BR>&gt; if (lookup("location")) 
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((src_ip != 
@ruri.host) || (src_port != @ruri.port)) 
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# reject the 
INVITE<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
...<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # restore original To 
UID and Request URI<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$tu.uid = $orig_to_uid;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
attr2uri("$orig_req_uri");<BR>&gt; } else 
{<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reject the 
INVITE<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>&gt; 
}<BR>&gt;<BR>&gt; Note, that the above solution is a bit ugly, you can get into 
troubles<BR>&gt; when the user registers multiple contact addresses. It is 
better to<BR>&gt; disable branches (see append_branches parameter in registrar 
module),<BR>&gt; but you loose some functionality.<BR>&gt;<BR>&gt; 
Regards,<BR>&gt; Miklos<BR>&gt;<BR>&gt; &#304;lker Aktuna (Ko&#231;.net) 
wrote:<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; Hi everyone,<BR>&gt;&nbsp; 
&gt;<BR>&gt;&nbsp; &gt; I am still trying to find a solution to this problem. 
(but couldn't&nbsp;<BR>&gt; &gt; find&nbsp; &gt; yet)&nbsp; &gt; Victor was 
trying to help me but I think he's not<BR>&gt; able to reply these 
days.<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; Is there any idea to achieve what I 
need.<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; Thanks,<BR>&gt;&nbsp; &gt; 
ilker<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt;<BR>&gt; 
----------------------------------------------------------------------<BR>&gt;&nbsp; 
&gt; --<BR>&gt;&nbsp; &gt; *From:* serusers-bounces@lists.iptel.org&nbsp; 
&gt;<BR>&gt; [<A 
href="mailto:serusers-bounces@lists.iptel.org">mailto:serusers-bounces@lists.iptel.org</A>] 
*On Behalf Of *&#304;lker Aktuna&nbsp;<BR>&gt; &gt; (Ko&#231;.net)&nbsp; &gt; *Sent:* 
Tuesday, July 11, 2006 1:41 PM&nbsp; &gt; *To:* Victor<BR>&gt; Stanescu&nbsp; 
&gt; *Cc:* serusers@iptel.org&nbsp; &gt; *Subject:* RE: [Serusers]<BR>&gt; 
prevent INVITE without REGISTERing&nbsp; &gt;&nbsp; &gt; Hi,&nbsp; &gt;&nbsp; 
&gt; What if my proxy<BR>&gt; does not handle authenticating INVITE messages 
?<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; In that case I think the best way is to 
lookup location table for<BR>&gt; the&nbsp; &gt; source URI.<BR>&gt;&nbsp; &gt; 
If the source URI location matches the location in that table then<BR>&gt; 
we&nbsp; &gt; must permit INVITE message.<BR>&gt;&nbsp; &gt; How can I configure 
this ?<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; Thanks,<BR>&gt;&nbsp; &gt; 
ilker<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; -----Original 
Message-----<BR>&gt;&nbsp; &gt; From: serusers-bounces@lists.iptel.org&nbsp; 
&gt;<BR>&gt; [<A 
href="mailto:serusers-bounces@lists.iptel.org">mailto:serusers-bounces@lists.iptel.org</A>] 
On Behalf Of Victor Stanescu&nbsp;<BR>&gt; &gt; Sent: Monday, July 10, 2006 1:49 
PM&nbsp; &gt; Cc: serusers@iptel.org&nbsp; &gt;<BR>&gt; Subject: Re: [Serusers] 
prevent INVITE without REGISTERing&nbsp; &gt;&nbsp; &gt;<BR>&gt; Please read 
"domain" instead of "gtstelecom.ro":<BR>&gt;&nbsp; &gt; 
www_authorize("domain",<BR>&gt;&nbsp; &gt; "subscriber") and 
proxy_authorize("domain", "subscriber"),<BR>&gt; otherwise&nbsp; &gt; the code 
fragment will not be correct. I forgot to<BR>&gt; replace with a generic 
name.<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt; Victor Stanescu wrote:<BR>&gt;&nbsp; 
&gt;&nbsp; &gt; I think it is easier to force him to authenticate the INVITE. 
If<BR>&gt; he&nbsp; &gt; is&nbsp; &gt; able to authenticate the INVITE, why do 
you care if he is&nbsp;<BR>&gt; &gt; registered&nbsp; &gt; or not?<BR>&gt;&nbsp; 
&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt; if (method=="REGISTER") 
{<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; if(!src_ip=="other") 
{<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (!www_authorize("gtstelecom.ro", "subscriber")) {<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
www_challenge("domain", "0");<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
save("location");<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log("Replicating 
REGISTER\n");<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_replicate("other", 
"5060");<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; } else 
{<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
save("location");<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&gt;&nbsp; 
&gt;&nbsp; &gt; } else {<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; # 
this is an INVITE<BR>&gt;&nbsp; &gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; if 
(!proxy_authorize("gtstelecom.ro", "subscriber")) {<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_challenge("domain", 
"1");<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&gt;&nbsp; 
&gt;&nbsp; &gt;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp; # route the call<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&nbsp;&nbsp;&nbsp;&nbsp; ...<BR>&gt;&nbsp; &gt;&nbsp; &gt; };<BR>&gt;&nbsp; 
&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt; &#304;lker Aktuna (Ko&#231;.net) 
wrote:<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt; Hi 
all,<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt; Is it 
possible to prevent any user calling without registering ?<BR>&gt;&nbsp; &gt; 
What&nbsp; &gt;&gt; is the best way to do this ?<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&gt; I guess I'll have to check if the source URI exists in location<BR>&gt; 
table.<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt; What is the easiest way to do this 
?<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt; If there 
is a more robust way to do it, please suggest...<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&gt;<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt; Thanks,<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&gt; ilker<BR>&gt;&nbsp; &gt;&nbsp; &gt;&gt;<BR>&gt;&nbsp; &gt;&nbsp; 
&gt;&gt;<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; &gt;<BR>&gt;&nbsp; 
&gt;<BR><BR></FONT></P>
<!--445D5241795C-->
<br><br><a href="http://387555.sigclick.mailinfo.com/sigclick/00090507/060D4E00/00010A4E/0113122382.jpg"><img src="http://387555.signature1.mailinfo.com/confirm2.6/00090507/060D4E00/00010A4E/0113122382.jpg" border="0" nosend="1"></a><!--445D5241795C//--></DIV>
                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">
                                                                        <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">
                                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">_____________________________________________________________________________________________________________________________________________</DIV>
                                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">Bu e-posta mesaji kisiye ozel olup, gizli bilgiler iceriyor olabilir. Eger bu e-posta mesaji size yanlislikla ulasmissa,&nbsp; icerigini hic bir sekilde kullanmayiniz ve ekli dosyalari acmayiniz. Bu durumda lutfen e-posta mesajini kullaniciya hemen geri gonderiniz&nbsp; ve&nbsp; tum kopyalarini mesaj kutunuzdan siliniz. Bu e-posta mesaji, hic bir sekilde, herhangi bir amac icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz.&nbsp; Bu e-posta mesaji viruslere karsi anti-virus sistemleri tarafindan taranmistir. Ancak yollayici, bu e-posta mesajinin - virus koruma sistemleri ile kontrol ediliyor olsa bile - virus icermedigini garanti etmez ve meydana gelebilecek zararlardan dogacak hicbir sorumlulugu kabul etmez. </DIV>
                                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">This message is intended solely for the use of the individual or entity to whom it is addressed , and may contain confidential&nbsp; information. If you are not the intended recipient of this message or you receive this mail in error, you should refrain from making any use of the contents and from opening any attachment. In that case, please notify the sender immediately and return the message to the sender, then, delete and destroy all copies. This e-mail message, can not be copied, published or sold for any reason. This e-mail message has been swept by anti-virus systems for the presence of computer viruses. In doing so, however,&nbsp; sender&nbsp; cannot warrant that virus or other forms of data corruption may not be present and do not take any responsibility in any occurrence.</DIV>
                                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana">_____________________________________________________________________________________________________________________________________________</DIV>
                                                                                <DIV STYLE="FONT-SIZE: 7pt; COLOR: gray; FONT-FAMILY: verdana" ALIGN="justify">
</DIV>
</DIV>
</DIV></BODY></HTML>