<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'>I'm slowly, but surely converting a 1.4.x dial-plan to an Asterisk 10.3.1 dial-plan, while also converting from mysql to func_odbc.&nbsp; The part of my dial plan that handles the blacklisting of phone numbers reads as:<br><br>[tele_query]<br><br>exten =&gt; s,1,Set(torture.calls=0)<br>exten =&gt; s,n,Set(ARRAY(torture.phone,torture.calls,torture.name)=${ODBC_TORTURE_QUERY(${CALLERID(number)})})<br>exten =&gt; s,n,Set(torture.calls=${IF($[ ${torture.calls} = 1]?2:1)})<br>exten =&gt; s,n,Return()<br><br>The problem line is the 3rd Set.&nbsp; What this line does (At least under 1.4.x) is, if the variable ${torture.calls} = 1, then change it to 2, if it has any other value, then change it to 1.<br><br>I initialize the torture.calls at the beginning of the subroutine, but when the query runs and there is no database entry, it returns null.<br><br>At that point, it fails.<br><br>Any suggestions on how to get func_odbc to either leave the initial value alone or is there a better way of handling this?<br><br>func_odbc.conf entry:<br><br>[TORTURE_QUERY]<br>dsn=MySQL-torture<br>readsql=SELECT phone, calls, name FROM TMP WHERE phone = ${ARG1}<br><br>Thanks!<br><br>Doug<br><br>-- <br><div><span name="x"></span>Ben Franklin quote:<br><br>"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."<span name="x"></span><br></div></div></body></html>