Hi all,
We ran into an issue with dialplan in regex mode when we leave the repl_exp empty. Consider this scenario:
if(dp_translate("1", "$rU/$var(out)") { # translation successful $rU = $var(out); }
If the dialplan entry has match_exp="^999" and subst_exp="^999" and repl_exp="" and my $rU is "999123", I'd expect $var(out) to be "123", because an empty replacement part is perfectly valid for a regex. The result however is that $var(out) is untouched, so whatever $var(out) was before the function call, will end up in $rU in this case. That's not what I'd expect if dp_translate returns success.
It should be fairly easy to fix and we can provide a patch for that, I'd just want to get some feedback if you agree on changing dp_translate behavior in such a case, as it might break existing scripts if you rely on the current way of working.
Comments?
Andreas