<div dir="ltr">Resolved,<div><br></div><div>Need to add the: {<a href="http://s.int">s.int</a>}<br><div><br></div><div>$var(dialplan_vendor) = $(rU{s.substr,0,2}{<a href="http://s.int">s.int</a>});<br></div></div><div><br></div><div>Regards,</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-24 11:51 GMT+02:00 Nelson Migliaro <span dir="ltr"><<a href="mailto:eng.migliaro@gmail.com" target="_blank">eng.migliaro@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,</div><div><br></div><div>I am trying to use the dialplan module but I am having this problem:</div><div><br></div><div>First of all, I pull the "dpid" value from the two first digits of the dnis:</div><div><br></div><div><span style="white-space:pre-wrap">  </span>$var(dialplan_vendor) = $(rU{s.substr,0,2});</div><div><br></div><div>Then</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if(!dp_translate("$var(<wbr>dialplan_vendor)","$dlg_var(<wbr>servicio)/$var(ani_dialplan)")<wbr>) {</div><div><span style="white-space:pre-wrap">                </span>xlog("L_NOTICE","Error al seleccionar el dialplan\n");<span style="white-space:pre-wrap">              </span></div><div><span style="white-space:pre-wrap">         </span>sl_send_reply("403", "Not allowed");<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">         </span>drop;</div><div><span style="white-space:pre-wrap">    </span>}</div><div><br></div><div>But when I test everything I get:</div><div><br></div><div><span style="white-space:pre-wrap">      </span>ERROR: dialplan [dialplan.c:233]: dp_get_ivalue(): no AVP, XAVP or SCRIPTVAR found (error in scripts)</div><div><br></div><div>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.</div><div><br></div><div>If I set up the variable this way for testing: $var(dialplan_vendor) = 18, it works correctly.</div><div><br></div><div>Question, how can I transform the sting into a integer?</div><div><br></div><div>Thank you</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nelson.</div></font></span></div></div>
</blockquote></div><br></div>