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@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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy(a)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@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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy(a)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@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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: route[INBOUND]: load_attrs($tu,@ruri) <INVITE>
<sip:hellboy@voip.touk.pl>
Feb 15 14:15:23 rd ser[14469]: route[INBOUND]: load_attrs($tr,@ruri) <INVITE>
<sip:hellboy@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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["email"]="tzl(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]: AVP["uid"]="hellboy(a)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(a)voip.touk.pl"
Feb 15 14:15:23 rd ser[14469]:
AVP["forward_blindd"]="sip:evn@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@voip.touk.pl>
Bests
-tomasz