[Serusers] How to check the username if it is registered or not

Tung Tran tr.tung at gmail.com
Thu Sep 13 13:03:34 CEST 2007


Hi all,

I am trying to do radius_proxy_authenticate for INVITE message, but I got new trouble:
- Radius server reply with Access-Accept.
- But SER always understands the authentication is false and do proxy_challeng all the time (althrough all the debug I see  on the debug   >>radius_authorize_sterman(): Success..)

Please tell me what I am wrong ( I am using SER 0.8). 

Thanks in advance, Tung

Here is my conf for radius_proxy_authenticate.
				if (method == "INVITE" && (uri=~"^sip:00"))		
          		{

 			 				if (!radius_proxy_authorize(""))
							 {
					     		xlog("L_INFO", "Radius proxy authorized false, Challenging .. \n");
					     		proxy_challenge("", "0"); 
					     		break; 
							 };

							 xlog("L_INFO", "Radius proxy authorized OK, process call routing .. \n");
							 consume_credentials();						 		
							 
							 log (1, "************* PC2Phone Using AsteriskB2UBA, Rewriting the host:port **************");
							 rewritehostport ("x.x.x.x:5071");
							 use_media_proxy();
              						 t_on_reply("1");
							.............

			}

And here is the debug on SER

0(2828)  method:  <INVITE>
 0(2828)  uri:     <sip:0012127773456 at sip3.thequocte.com:5060>
 0(2828)  version: <SIP/2.0>
 0(2828) parse_headers: flags=1
 0(2828) Found param type 235, <rport> = <n/a>; state=6
 0(2828) Found param type 232, <branch> = <z9hG4bKPjdc616205bf324ab996179b219e5986b9>; state=16
 0(2828) end of header reached, state=5
 0(2828) parse_headers: Via found, flags=1
 0(2828) parse_headers: this is the first via
 0(2828) After parse_msg...
 0(2828) preparing to run routing scripts...
 0(2828) DEBUG : is_maxfwd_present: searching for max_forwards header
 0(2828) parse_headers: flags=128
 0(2828) DEBUG: is_maxfwd_present: value = 70 
 0(2828) parse_headers: flags=8
 0(2828) DEBUG: add_param: tag=e9d3c1dcadf44089b4bd19407187c6dc
 0(2828) end of header reached, state=29
 0(2828) parse_headers: flags=256
 0(2828) end of header reached, state=8
 0(2828) DEBUG: get_hdr_field: <To> [38]; uri=[sip:0012127773456 at sip3.xxxxx.com] 
 0(2828) DEBUG: to body [sip:0012127773456 at sip3.xxxxx.com
]
 0(2828) get_hdr_field: cseq <CSeq>: <2> <INVITE>
 0(2828) DEBUG: get_hdr_body : content_length=405
 0(2828) found end of header
 0(2828) find_first_route(): No Route headers found
 0(2828) loose_route(): There is no Route HF
 0(2828) parse_headers: flags=64
 0(2828) parse_headers: flags=64
 0(2828) parse_headers: flags=33554432
 0(2828) check_nonce(): comparing [46e97a6ac3463940efca3302e91c79bea2a80448] and [46e97a6ac3463940efca3302e91c79bea2a80448]
 0(2828) to: 0012127773456
 0(2828) radius_authorize_sterman(): Success
 0(2828) XLOG: xl_print_log: final buffer length 47
 0(2828) Radius proxy authorized false, Challenging .. 
 0(2828) build_auth_hf(): 'Proxy-Authenticate: Digest realm="xxxxxxx", nonce="46e97a6ac3463940efca3302e91c79bea2a80448"





> Hello,
>
> I also want to do the same thing as Tung -- I want to know if the
> caller URI is registered.
>
> My current ser.cfg (based on the SER 2.0 RC1 sample ser.cfg), calls
> a proxy_authenticate for every message.  This means the every
> message (other than register) is sent twice, once without auth
> headers and a 2nd time with auth headers.
>
> An easier approach would be send the auth challenge during a
> register message and simply check if the caller is registered in
> subsequent messages.  If the caller did not re-register within the
> expiration interval, their request would be rejected.
>
> Is there a method to check of the caller (from) URI is registered?
>
> Thanks,
>
> - Ravin
>
>
>> From: serusers-bounces at lists.iptel.org [mailto:serusers-
>> bounces at lists.iptel.org] On Behalf Of Tung Tran
>> Sent: Thursday, September 13, 2007 1:24 AM
>> To: Michal Matyska
>> Cc: serusers at lists.iptel.org
>> Subject: Re: [Serusers] How to check the username if it is
>> registered or not
>>
>>
>> Hi,
>>
>> I got this in iptel doc:
>>
>> registered(domain)
>> The function returns true if the AOR in the Request-URI is
>> registered, false otherwise. The function does not modify the
>> message being process, it neither rewrites the Request-URI if a
>> contact is found not append branches.
>>
>> But I want to check the from user if it is registered or not, any
>> command can do this?
>>
>> Thank you
>> Tung
>>
>>
>>> if (registered("location")) {
>>> ..
>>> }
>>>
>>> M.
>>>
>>> On Thu, 2007-09-13 at 00:12 +0700, Tung Tran wrote:
>>>
>>>> Hi all,
>>>>
>>>> Should anyone please help how to check the from user in
>>>> INVITE request is already registered?
>>>>
>>>> Thanks you very much.
>>>>
>>>> Tung



More information about the sr-users mailing list