[Serusers] lookup_contacts() error after sd_lookup() from the speeddial module- latest cvs ottendorf
Michal Matyska
michal at iptel.org
Thu Feb 15 15:30:07 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;
}
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