Re: Re: [Serusers] lookup_contacts() error after sd_lookup() from the speeddial mo dule- latest cvs ottendorf

tzieleniewski tzieleniewski at o2.pl
Fri Feb 16 14:59:36 CET 2007


> Hi,
> 
> seems related to the lookup session we had on beginning of this week.
> sd_lookup puts the uid into TO / USER, which is not working with the
> head version (lookup_contacts need it in TO / URI)
> 
> You can use this workaround:
>    if (uri =~ "sip:[0-9]{2}@.*") {
>       sd_lookup("speed_dial");
>       $tr.uid=$tu.uid;
>    }

Yes it seemed to me too but I just wasn't sure:)
I checked it if it would help and unfortunately nothing changed. I checked it
more deeply to get some more view on this and found strange results.
I did the following:
   
   dump_attrs();
   xlog("L_INFO", " route[INBOUND]: (uri =~ sip:[0-9]{2}@.*) <%rm> <%ru>
\n");
   if (uri =~ "sip:[0-9]{2}@.*") {
      xlog("L_INFO", " route[INBOUND]: sd_lookup(speed_dial) \n");
      sd_lookup("speed_dial");
   };
   dump_attrs();

and result showed that there is no uid put into TO / USER so generally
putting $tr.uid=$tu.uid does nothing, it is visible below in the output:

Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:540: class=GLOBAL
Feb 16 09:14:10 rd ser[16874]: AVP["lang"]="en"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:550: track=FROM class=DOMAIN
Feb 16 09:14:10 rd ser[16874]: AVP["did"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["digest_realm"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:560: track=TO class=DOMAIN
Feb 16 09:14:10 rd ser[16874]: AVP["did"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["digest_realm"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:570: track=FROM class=USER
Feb 16 09:14:10 rd ser[16874]: AVP["uid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["email"]="tzl at touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["lang"]="en"
Feb 16 09:14:10 rd ser[16874]: AVP["tyk"]="tyk"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:580: track=TO class=USER
Feb 16 09:14:10 rd ser[16874]: INFO: No AVP present
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:590: track=FROM class=URI
Feb 16 09:14:10 rd ser[16874]: AVP["authuid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["uid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:600: track=TO class=URI
Feb 16 09:14:10 rd ser[16874]: INFO: No AVP present
Feb 16 09:14:10 rd ser[16874]:  route[INBOUND]: (uri =~ sip:[0-9]{2}@.*)
<INVITE> <sip:01 at voip.touk.pl>
Feb 16 09:14:10 rd ser[16874]:  route[INBOUND]: sd_lookup(speed_dial)
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:540: class=GLOBAL
Feb 16 09:14:10 rd ser[16874]: AVP["lang"]="en"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:550: track=FROM class=DOMAIN
Feb 16 09:14:10 rd ser[16874]: AVP["did"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["digest_realm"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:560: track=TO class=DOMAIN
Feb 16 09:14:10 rd ser[16874]: AVP["did"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["digest_realm"]="voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:570: track=FROM class=USER
Feb 16 09:14:10 rd ser[16874]: AVP["uid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["email"]="tzl at touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["lang"]="en"
Feb 16 09:14:10 rd ser[16874]: AVP["tyk"]="tyk"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:580: track=TO class=USER
Feb 16 09:14:10 rd ser[16874]: INFO: No AVP present
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:590: track=FROM class=URI
Feb 16 09:14:10 rd ser[16874]: AVP["authuid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: AVP["uid"]="hellboy at voip.touk.pl"
Feb 16 09:14:10 rd ser[16874]: INFO: avp.c:600: track=TO class=URI
Feb 16 09:14:10 rd ser[16874]: INFO: No AVP present

And there are still many questions about the lookup_user() function.
When I call a subscriber directly not by speeddial number and I invoke it
this way:

lookup_user("$t.uid", "@ruri");

then the invocation of he lookup_contacts("location") function returns
positive result. Any other form of lookup_user() causes the failure of the
lookup_contacts() function. 
I tried to do $tr.uid = $t.uid as well as $tu.uid = $t.uid after
lookup_user() but it always didn't cause any change and those avp values where always
empty. 

Please share any ideas:)
Cheers
-tomasz

> 
> it will set the AVP in the URI track and should be then reachable.
> 
> Michal
> 
> 
> On Thu, 2007-02-15 at 14:20 +0100, tzieleniewski wrote:
> > Hi!
> > 
> > I have encountered the following situation after I make the translation
from the speeddial number into the proper uri the user cannot be found by the
lookup_contacts() function. Calling a user directly works without any
problem:
> > 
> > My logic is the following:
> > 
> >    dump_attrs();
> >    if (uri =~ "sip:[0-9]{2}@.*") {
> >       sd_lookup("speed_dial");
> >    }
> >    dump_attrs();
> >    if (lookup_user("$t.uid", "@ruri")) {
> >       dump_attrs();
> >       load_attrs("$tu", "@ruri");
> >       load_attrs("$tr", "@ruri");
> >       dump_attrs();
> >       if (lookup_contacts("location")) {
> >          append_hf("P-hint: usrloc applied\r\n");
> >          route(FORWARD);
> >          drop;
> >       } else {
> >          route(CALL_FORWARD_VOICEMAIL);
> >          drop;
> >       }
> >    }
> > 
> > Here is the debug output:
> > 
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: <INVITE>
<sip:01 at voip.touk.pl>
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:540: class=GLOBAL
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:550: track=FROM class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:560: track=TO class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:570: track=FROM class=USER
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl at touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: AVP["tyk"]="tyk"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:580: track=TO class=USER
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:590: track=FROM class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["authuid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:600: track=TO class=URI
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: (uri =~ sip:[0-9]{2}@.*)
<INVITE> <sip:01 at voip.touk.pl>
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: sd_lookup(speed_dial)
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:540: class=GLOBAL
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:550: track=FROM class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:560: track=TO class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:570: track=FROM class=USER
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl at touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: AVP["tyk"]="tyk"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:580: track=TO class=USER
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:590: track=FROM class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["authuid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:600: track=TO class=URI
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: (lookup_user($t.uid,
@ruri)) <INVITE> <sip:hellboy at voip.touk.pl>
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:540: class=GLOBAL
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:550: track=FROM class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:560: track=TO class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:570: track=FROM class=USER
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl at touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: AVP["tyk"]="tyk"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:580: track=TO class=USER
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:590: track=FROM class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["authuid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:600: track=TO class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: load_attrs($tu, at ruri)
<INVITE> <sip:hellboy at voip.touk.pl>
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]: load_attrs($tr, at ruri)
<INVITE> <sip:hellboy at voip.touk.pl>
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:540: class=GLOBAL
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:550: track=FROM class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:560: track=TO class=DOMAIN
> > Feb 15 14:15:23 rd ser[14469]: AVP["did"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["digest_realm"]="voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:570: track=FROM class=USER
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl at touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["lang"]="en"
> > Feb 15 14:15:23 rd ser[14469]: AVP["tyk"]="tyk"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:580: track=TO class=USER
> > Feb 15 14:15:23 rd ser[14469]: INFO: No AVP present
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:590: track=FROM class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["authuid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]: INFO: avp.c:600: track=TO class=URI
> > Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]:
AVP["forward_blindd"]="sip:evn at voip.touk.pl"
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]:
(lookup_contacts(location))
> > Feb 15 14:15:23 rd ser[14469]:  route[INBOUND]:
route(CALL_FORWARD_VOICEMAIL) <INVITE> <sip:hellboy at voip.touk.pl>
> > 
> > Bests
> > -tomasz
> > _______________________________________________
> > Serusers mailing list
> > Serusers at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
> 



More information about the sr-users mailing list