Hello List,
i solved this with an "simple" if statement.
For me surprising i tried this without success:
#!define NEWDOMAIN "some.domain.example"
$avp(newdomain) = NEWDOMAIN;
if ($avp(newdomain) == $rd) ...
and this dont match. Also i tried "" around all vars.
And copied into $avp and {s.tolower} all of them.
Nothing works.
avp_print() shows both avps as the same.
Anyway ---
My now working example is that one with avp_check.
Was hard to find the meaning of g/G and i/I in the module.
In the wiki i found an example description of tha avp_check flags.
if (allow_source_address(FLT_IVR)) {
# OLD vs NEW - domain routing...
$avp(newdomain) = NEWDOMAIN;
$avp(pathinfo) = "outbound";
# avp_check flags / avpops
# g/G - use all values of the checked AVP (first parameter)
# i/I - if strings are checked, do it case insensitive
if ( avp_check("$rd", "eq/$avp(newdomain)/gi") ) {
xlog("L_INFO", "go to new-gw\n");
$avp(routing_target) = FLT_FSNODE;
}
else {
xlog("L_INFO", "go to old-gw\n");
$avp(routing_target) = FLT_OLDSBC;
}
xlog("L_INFO", "[$avp(pathinfo)] comes from IVR <$si> to <$ruri> \n");
route(DISPATCH);
exit;
}
Kind Regards
...