<div dir="ltr">Hello,<div><br></div><div style>I was having the same problem, the solution is to use:</div><div style><br></div><div style>&lt;param name=&quot;odbc-dsn&quot; value=&quot;odbc://dsn_name&quot; /&gt;<br></div>

<div style><br></div><div style>where &quot;dsn_name&quot; is obviously the dsn inside the /etc/odbc.ini file previously tested with &quot;isql&quot;</div><div style><br></div><div style><br></div><div style>good luck!</div>

<div style><br></div><div style>David</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 11:25 AM, Sergey Okhapkin <span dir="ltr">&lt;<a href="mailto:sos@sokhapkin.dyndns.org" target="_blank">sos@sokhapkin.dyndns.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> What is the structure of &quot;accounts&quot; table?<br>
<div class="HOEnZb"><div class="h5"><br>
On Friday 02 November 2012 14:42:41 William Alianto wrote:<br>
&gt; Thanks for pointing that out. I think I missed that part when I edited<br>
&gt; the config.<br>
&gt;<br>
&gt; On 11/02/2012 02:22 PM, Evgeniy Movlyan wrote:<br>
&gt; &gt; Seems you need to uncomment custom SQL-queries and rewrite it to<br>
&gt; &gt; according to your needs.<br>
&gt; &gt;<br>
&gt; &gt; 02.11.2012 05:54, William Alianto пишет:<br>
&gt; &gt;&gt; Hi,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; This is my nibblebill.conf.xml<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;configuration name=&quot;nibblebill.conf&quot; description=&quot;Nibble Billing&quot;&gt;<br>
&gt; &gt;&gt; &lt;settings&gt;<br>
&gt; &gt;&gt; &lt;!-- See <a href="http://wiki.freeswitch.org/wiki/Mod_nibblebill" target="_blank">http://wiki.freeswitch.org/wiki/Mod_nibblebill</a> for help with<br>
&gt; &gt;&gt; these options --&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- Information for connecting to your database --&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_username&quot; value=&quot;root&quot;/&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_password&quot; value=&quot;xxxxxxxx&quot;/&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_dsn&quot; value=&quot;billing&quot;/&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- The database table where your CASH column is located --&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_table&quot; value=&quot;accounts&quot;/&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- The column name where we store the value of the account --&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_column_cash&quot; value=&quot;usage&quot;/&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- The column name for the unique ID identifying the account --&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;db_column_account&quot; value=&quot;user&quot;/&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- Custom SQL for loading current balance - overrides column names<br>
&gt; &gt;&gt; channel vars are interpreted.<br>
&gt; &gt;&gt; field nibble_balance is used for balance info<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;custom_sql_lookup&quot; value=&quot;SELECT cash AS nibble_balance<br>
&gt; &gt;&gt; FROM accounts WHERE account_code=&#39;${nibble_account}&#39;&quot;/&gt;<br>
&gt; &gt;&gt; --&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- Custom SQL for loading current balance - overrides column names<br>
&gt; &gt;&gt; channel vars are interpreted.<br>
&gt; &gt;&gt; nibble_increment is the amount to update<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;custom_sql_save&quot; value=&quot;UPDATE accounts SET<br>
&gt; &gt;&gt; cash=cash-${nibble_increment} WHERE account_code=&#39;${nibble_account}&#39;&quot;/&gt;<br>
&gt; &gt;&gt; --&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- Default heartbeat interval. Set to &#39;off&#39; for no heartbeat (i.e.<br>
&gt; &gt;&gt; bill only at end of call) --&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;global_heartbeat&quot; value=&quot;1&quot;/&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- By default, warn a caller when their balance is at $5.00. You can<br>
&gt; &gt;&gt; set this to a negative number. --&gt;<br>
&gt; &gt;&gt; &lt;!--&lt;param name=&quot;lowbal_amt&quot; value=&quot;5&quot;/&gt;--&gt;<br>
&gt; &gt;&gt; &lt;!--&lt;param name=&quot;lowbal_action&quot; value=&quot;play ding&quot;/&gt;--&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- By default, terminate a caller when their balance hits $0.00. You<br>
&gt; &gt;&gt; can set this to a negative number. --&gt;<br>
&gt; &gt;&gt; &lt;!--&lt;param name=&quot;nobal_amt&quot; value=&quot;0&quot;/&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;nobal_action&quot; value=&quot;hangup&quot;/&gt;--&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;!-- If a call goes beyond a certain dollar amount, flag or terminate it<br>
&gt; &gt;&gt; --&gt;<br>
&gt; &gt;&gt; &lt;!--&lt;param name=&quot;percall_max_amt&quot; value=&quot;100&quot;/&gt;<br>
&gt; &gt;&gt; &lt;param name=&quot;percall_action&quot; value=&quot;hangup&quot;/&gt;--&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &lt;/settings&gt;<br>
&gt; &gt;&gt; &lt;/configuration&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On 11/01/2012 02:56 PM, Evgeniy Movlyan wrote:<br>
&gt; &gt;&gt;&gt; Hello.<br>
&gt; &gt;&gt;&gt; Show please your nibblebill.conf.xml.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; 01.11.2012 05:57, William Alianto пишет:<br>
&gt; &gt;&gt;&gt;&gt; Hi,<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; I was trying to use nibblebill as billing control of my FS. I have<br>
&gt; &gt;&gt;&gt;&gt; configured the odbc and the nibblebill configuration. When I tried to<br>
&gt; &gt;&gt;&gt;&gt; call, the query looks ok. But when I hanged up the call, it seems like<br>
&gt; &gt;&gt;&gt;&gt; there is something wrong with the database connection, since it&#39;s not<br>
&gt; &gt;&gt;&gt;&gt; updating the database at all. I got error message on CLI<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [ERR] switch_odbc.c:494 ERR: [UPDATE<br>
&gt; &gt;&gt;&gt;&gt; accounts<br>
&gt; &gt;&gt;&gt;&gt; SET usage=age-0.476000 WHERE user=&#39;1001&#39;]<br>
&gt; &gt;&gt;&gt;&gt; [STATE: 42000 CODE 1064 ERROR: [unixODBC][MySQL][ODBC 5.1<br>
&gt; &gt;&gt;&gt;&gt; Driver][mysqld-5.5.24-0ubuntu0.12.04.1]You have an error in your SQL<br>
&gt; &gt;&gt;&gt;&gt; syntax; check the manual that corresponds to your MySQL server version<br>
&gt; &gt;&gt;&gt;&gt; for the right syntax to use near &#39;usage=age-0.476000 WHERE<br>
&gt; &gt;&gt;&gt;&gt; user=001&#39;&#39; at line 1<br>
&gt; &gt;&gt;&gt;&gt; ]<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [ERR] mod_nibblebill.c:343 ERR: [UPDATE<br>
&gt; &gt;&gt;&gt;&gt; accounts SET usage=age-0.476000 WHERE user=&#39;1001&#39;]<br>
&gt; &gt;&gt;&gt;&gt; []<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [CRIT] mod_nibblebill.c:542 Failed to<br>
&gt; &gt;&gt;&gt;&gt; log to<br>
&gt; &gt;&gt;&gt;&gt; database!<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [DEBUG] mod_nibblebill.c:383 Doing lookup<br>
&gt; &gt;&gt;&gt;&gt; query<br>
&gt; &gt;&gt;&gt;&gt; [SELECT usage AS nibble_balance FROM accounts WHERE user=001&#39;]<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [ERR] mod_nibblebill.c:385 ERR: [SELECT<br>
&gt; &gt;&gt;&gt;&gt; usage<br>
&gt; &gt;&gt;&gt;&gt; AS nibble_balance FROM accounts WHERE user=001&#39;]<br>
&gt; &gt;&gt;&gt;&gt; [STATE: 42000 CODE 1064 ERROR: [unixODBC][MySQL][ODBC 5.1<br>
&gt; &gt;&gt;&gt;&gt; Driver][mysqld-5.5.24-0ubuntu0.12.04.1]You have an error in your SQL<br>
&gt; &gt;&gt;&gt;&gt; syntax; check the manual that corresponds to your MySQL server version<br>
&gt; &gt;&gt;&gt;&gt; for the right syntax to use near &#39;usage AS nibble_balance FROM<br>
&gt; &gt;&gt;&gt;&gt; accounts<br>
&gt; &gt;&gt;&gt;&gt; WHERE user=001&#39;&#39; at line 1<br>
&gt; &gt;&gt;&gt;&gt; ]<br>
&gt; &gt;&gt;&gt;&gt; 2012-11-01 10:51:00.559472 [ERR] mod_nibblebill.c:386 Error running<br>
&gt; &gt;&gt;&gt;&gt; this<br>
&gt; &gt;&gt;&gt;&gt; query: [SELECT usage AS nibble_balance FROM accounts WHERE user=001&#39;]<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Could anybody help me solve this issue?<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Regards<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; _______________________________________________________________________<br>
&gt; &gt;&gt;&gt;&gt; __<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; &gt;&gt;&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; Official FreeSWITCH Sites<br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; &gt;&gt;&gt;&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; FreeSWITCH-users mailing list<br>
&gt; &gt;&gt;&gt;&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; &gt;&gt;&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; &gt;&gt;&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-user" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-user</a><br>
&gt; &gt;&gt;&gt;&gt; s<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt; _________________________________________________________________________<br>
&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt; Official FreeSWITCH Sites<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br></div>