Judah Heinanen writes:
can someone provide an explanation for this? what
should the expected
behavior be, when subst_exp and repl_exp are empty?
in dialplan.c/dp_update function i found this:
no_change = ((!repl->s) || (!repl->len)) && (src->type == dest->type)
&& ((src->type == PVT_RURI) || (src->type == PVT_RURI_USERNAME));
that is, if repl_exp is empty, no replacement is done if src/dest is
$ru/$ru or $rU/$rU.
dp_repl.c/rule_translate function returns immediately if repl_exp is
empty:
if(!repl_comp){
LM_INFO("null replacement\n");
return 0;
}
it does that even if subst_exp is not empty, because the above test is
before this test:
if(subst_comp){
does anyone object if i change the no_change assignment to
no_change = (!repl->s) || (!repl->len);
that is, dest is left as is when repl_exp is empty no matter what kind
of pv dest is?
-- juha