[OpenSIPS-Users] lookup() not working as documented

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Apr 29 14:58:45 CEST 2013


Hello Stian,

AOR  nnnn0790 at y.y.y.y  and nnnn0790 at domain.no 
<mailto:nnnn0790 at domain.no> are completly different - according to SIP, 
they do not match or so. So you have to use the same AOR when 
registering the user (AOR will be in To hdr) and when calling the user 
(AOR will be in RURI).

Maybe the doc can be misleading a bit when using the terminology of 
"username" - but this has to be interpreted in the context of 
"use_domain" parameter from usrloc:
     http://www.opensips.org/html/docs/modules/1.9.x/usrloc.html#id292895

So, docs are not clear, we will take care of that!

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 04/29/2013 01:28 PM, Stian Øvrevåge wrote:
> Hi list,
>
> I have in my config:
>
> if (!lookup("location","m")) {
> switch ($retcode) {
> case -1: # Not used
> case -3: # User not found, forward
> xlog("DESCISION: 
> <$proto><CallID:$ci><CSeq:$cs><Method:$rm><$si:$sp>to<$Ri:$Rp> To: $tu 
> not found. Route upstream");
> route(upstream);
> exit;
> case -2: # Not used
> sl_send_reply("405", "Method Not Allowed");
> exit;
> }
> }
>
> When I'm getting an incomming call, I see in my log:
>
> /usr/sbin/opensips[11393]: DESCISION: 
> <udp><CallID:x at x.x.x.x><CSeq:11061><Method:INVITE><x.x.x.x:5060>to<y.y.y.y:5060> 
> To: sip:nnnn0790 at y.y.y.y:5060 not found. Route upstream
>
> Ergo, OpenSIPS fails to lookup the subscriber. However, when using 
> opensipsctl the subscriber is clearly registered on the server:
>
> AOR:: nnnn0790 at domain.no <mailto:nnnn0790 at domain.no>
>
> The only difference is that the AOR is registered with the domain and 
> the INVITE is referencing the server IP. According to the 
> documentation [1], this should not be a problem because "The functions 
> extracts username from Request-URI and tries to find all contacts for 
> the username in usrloc.".
>
> As I'm no SIP expert I thought that I might have misunderstood what 
> actually was meant by the "username" part of the R-URI, I assumed it 
> was just the actual phone number, exclusive of host-name. Section 
> 19.1.1 of RFC 3261 (SIP) confirms this 
> "sip:user:password at host:port;uri-parameters?headers".
>
> [1]. 
> http://www.opensips.org/html/docs/modules/devel/registrar.html#id293055
>
> version: opensips 1.9.0-notls (x86_64/linux)
>
> So I can only conclude that either code is broken or documentation is 
> broken, or both.
>
> Brgds,
> Stian Øvrevåge
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130429/25ac6a03/attachment.htm>


More information about the Users mailing list