Here's the excerpt of the script (I replaced the selects
with '@' by '$sel()', and added a dump_attrs()) :
xlog("L_INFO", "from.uri.host :
$sel(from.uri.host)\n");
xlog("L_INFO", "ruri.host : $sel(ruri.host)\n");
lookup_domain("$fd", "$sel(from.uri.host)");
lookup_domain("$td", "$sel(ruri.host)");
xlog("L_INFO", "fd : $avp(fd.did)\n");
dump_attrs();
if (strempty($avp(fd.did)) &&
strempty($avp(td.did))) {
# Neither the calling nor the called domain
is local
# This is a relaying attempt which should be
forbidden
sl_reply("403", "Relaying Forbidden");
drop;
}
And as a result :
0(22008) INFO: <script>: from.uri.host :
ext.test.r3load.voip
0(22008) INFO: <script>: ruri.host :
ext.test.r3load.voip
0(22008) INFO: <script>: fd : <null>
0(22008) INFO: avp [avp.c:573]: class=GLOBAL
0(22008) INFO: avp [avp.c:575]: INFO: No AVP present
0(22008) INFO: avp [avp.c:583]: track=FROM class=DOMAIN
0(22008) INFO: avp [avp.c:585]: INFO: No AVP present
0(22008) INFO: avp [avp.c:593]: track=TO class=DOMAIN
0(22008) INFO: avp [avp.c:595]: INFO: No AVP present
0(22008) INFO: avp [avp.c:603]: track=FROM class=USER
0(22008) INFO: avp [avp.c:605]: INFO: No AVP present
0(22008) INFO: avp [avp.c:613]: track=TO class=USER
0(22008) INFO: avp [avp.c:615]: INFO: No AVP present
0(22008) INFO: avp [avp.c:623]: track=FROM class=URI
0(22008) INFO: avp [avp.c:625]: INFO: No AVP present
0(22008) INFO: avp [avp.c:633]: track=TO class=URI
0(22008) INFO: avp [avp.c:635]: INFO: No AVP present
In the db :
+----+----------------------+----------------------+-------+
| id | did | domain | flags |
+----+----------------------+----------------------+-------+
| 1 | ext.test.r3load.voip | ext.test.r3load.voip | 0 |
+----+----------------------+----------------------+-------+
Thanks again!
Philippe