humm, i am not very sure what is the problem then. Can you try below and reply me with result?<div><br></div><div>1. Enable SQL query log on db server side, and see what SQL FS sends to the server? An ODBC trace file may also help.</div>
<div><br></div><div>2. Why are you defining both column name and custom SQLs? Typically you use only one of them, not both at the same time, so comment out one of them and test.</div><div><br></div><div>3. The custom SQL you are using has back-quotes, though these are permitted by ANSI SQL, but may create problem for other languages, i.e. the SQL you specify is in an XML file, which is interpreted by C++, which is then send to ODBC and then send to actual db server. Any of these interfaces may misinterpret them (Step 1 will give you clear clue on this).<br>
<div><br></div><div>Thank you.<br><div><br><br><div class="gmail_quote">On Tue, Mar 5, 2013 at 5:11 PM, Shahzad Bhatti <span dir="ltr"><<a href="mailto:shahzad.bhatti@g-r-v.com" target="_blank">shahzad.bhatti@g-r-v.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>thanks Mr. Muhammad Shahzad for the reply but issue is that when i use to access database on console there it works fine but when i use in dialplan here it not works</div>
<div><br></div><div>
here is my console output</div><div><div><b>[root@localhost includes]# isql -v freeswitch</b></div><div><b>+---------------------------------------+</b></div><div><b>| Connected! |</b></div>
<div><b>| |</b></div><div><b>| sql-statement |</b></div><div><b>| help [tablename] |</b></div><div><b>| quit |</b></div>
<div><b>| |</b></div><div><b>+---------------------------------------+</b></div><div><b>SQL> use test;</b></div><div><b>SQLRowCount returns 0</b></div><div><b>SQL> select * from tb_accounts;</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>| id | name | cash |</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>| 1 | shahzad | 10 |</b></div>
<div><b>| 2 | saeed | 50 |</b></div>
<div><b>| 3 | usman | 10 |</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>SQLRowCount returns 3</b></div><div><b>3 rows fetched</b></div><div><b>SQL> update tb_accounts set cash = cash -1 where id =1;</b></div><div><b>SQLRowCount returns 1</b></div><div><b>SQL> select * from tb_accounts;</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>| id | name | cash |</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>| 1 | shahzad | 9 |</b></div>
<div><b>| 2 | saeed | 50 |</b></div>
<div><b>| 3 | usman | 10 |</b></div>
<div><b>+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+</b></div>
<div><b>SQLRowCount returns 3</b></div><div><b>3 rows fetched</b></div><div>here u can see that update is also working, and here is my dialplan xml</div><div><b> <document type="freeswitch/xml"></b></div>
<div><b> <section name="dialplan" description="RE Dial Plan For FreeSwitch"></b></div><div><b> <context name="public"></b></div><div><b> <extension name="checkBalance"></b></div>
<div><b> <condition field="destination_number" expression="^126$"></b></div><div><b> <action application="set" data="nibble_rate=0.03"/></b></div>
<div><b> <action application="set" data="nibble_account=1"/></b></div>
<div><b> <action application="answer"/></b></div><div><b> <action application="hangup"/></b></div><div><b> </condition></b></div>
<div><b> </extension></b></div><div><b> </context></b></div>
<div><b> </section></b></div><div><b> </document><br></b></div></div><div><br></div><div>i also check that the user and password and database is also correct.</div><div><br></div><div>
any help is appreciated</div><div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Shahzad Bhatti</div><br></font></span><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">---------- Forwarded message ----------<br>
From: Muhammad Shahzad <<a href="mailto:shaheryarkh@gmail.com" target="_blank">shaheryarkh@gmail.com</a>><br>To: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>><br>
Cc: <br>Date: Fri, 1 Mar 2013 17:07:39 +0100<br>Subject: Re: [Freeswitch-users] Error! Failed to log to database using nibblebill<br>Problem is with SELECT query, most likely db connection parameters are missing/invalid OR the db user configured does not have enough permissions to execute SELECT,<div>
<br></div></div><div><div class="im"><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">2013</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">-03</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">-01</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace"> </span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">22</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">29</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">52.293493</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace"> </span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">[</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">ERR</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">]</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace"> mod_nibblebill.c:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">380</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace"> Error running this query: </span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">[</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">SELECT `cash` AS nibble_balance FROM `tb_accounts` WHERE `id`=</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">1</span><span style="color:rgb(51,51,51);font-size:11px;font-family:'Courier New',Courier,monospace">]</span><br>
<div><br></div><div>Login db server from FS machine with same db user as configured in FS configs and run above query, it would give you hint on what is actually wrong.</div><div><br></div><div>Thank you.</div></div><div>
<br><br>
<div class="gmail_quote"><div class="im">On Fri, Mar 1, 2013 at 1:42 PM, Shahzad Bhatti <span dir="ltr"><<a href="mailto:shahzad.bhatti@g-r-v.com" target="_blank">shahzad.bhatti@g-r-v.com</a>></span> wrote:<br></div>
<div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">hi<div>i am using a nibblebill the call cost but have some problem in it. my nibblebill.conf.xml file is as<div><br></div><div><div><a href="http://pastebin.freeswitch.org/20650" target="_blank">http://pastebin.freeswitch.org/20650</a><br>
</div><div><br></div></div></div><div>and console log is <br></div><div><br></div><div><a href="http://pastebin.freeswitch.org/20651" target="_blank">http://pastebin.freeswitch.org/20651</a><br></div><div><br></div><div>
i got Error <b>Failed to log to database! </b>Doing update query </div>
<div><br></div><div>reply me about the issue </div><div><br></div><div>Regards</div><span><font color="#888888"><div><br></div><div>Shahzad Bhatti</div></font></span></div></blockquote></div></div></div></div></div></blockquote>
</div>
</blockquote></div></div></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Muhammad Shahzad</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">------------------------------</span><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">-----</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Rich Media Communication Specialist (CRMCS)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">CISCO Certified Network Associate (CCNA)</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cell: +49 176 99 83 10 85</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MSN: </span><a href="mailto:shari_786pk@hotmail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shari_786pk@hotmail.com</a><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: </span><a href="mailto:shaheryarkh@googlemail.com" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">shaheryarkh@googlemail.com</a>
</div></div></div>