Hello,

I am trying to use the dialplan module but I am having this problem:

First of all, I pull the "dpid" value from the two first digits of the dnis:

$var(dialplan_vendor) = $(rU{s.substr,0,2});

Then

if(!dp_translate("$var(dialplan_vendor)","$dlg_var(servicio)/$var(ani_dialplan)")) {
xlog("L_NOTICE","Error al seleccionar el dialplan\n");
sl_send_reply("403", "Not allowed");
drop;
}

But when I test everything I get:

ERROR: dialplan [dialplan.c:233]: dp_get_ivalue(): no AVP, XAVP or SCRIPTVAR found (error in scripts)

I think the problem is related to variable $var(dialplan_vendor). It is set up as string due to the transformation and dialplan need a integer.

If I set up the variable this way for testing: $var(dialplan_vendor) = 18, it works correctly.

Question, how can I transform the sting into a integer?

Thank you

Nelson.