<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&gt; use test;</b></div><div><b>SQLRowCount returns 0</b></div><div><b>SQL&gt; 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&gt; update tb_accounts set cash = cash -1 where id =1;</b></div><div><b>SQLRowCount returns 1</b></div><div><b>SQL&gt; 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>        &lt;document type=&quot;freeswitch/xml&quot;&gt;</b></div>


<div><b>               &lt;section name=&quot;dialplan&quot; description=&quot;RE Dial Plan For FreeSwitch&quot;&gt;</b></div><div><b>                     &lt;context name=&quot;public&quot;&gt;</b></div><div><b>                          &lt;extension name=&quot;checkBalance&quot;&gt;</b></div>


<div><b>                                &lt;condition field=&quot;destination_number&quot; expression=&quot;^126$&quot;&gt;</b></div><div><b>                                     &lt;action application=&quot;set&quot; data=&quot;nibble_rate=0.03&quot;/&gt;</b></div>

<div><b>                                     &lt;action application=&quot;set&quot; data=&quot;nibble_account=1&quot;/&gt;</b></div>
<div><b>                                     &lt;action application=&quot;answer&quot;/&gt;</b></div><div><b>                                     &lt;action application=&quot;hangup&quot;/&gt;</b></div><div><b>                                &lt;/condition&gt;</b></div>

<div><b>                          &lt;/extension&gt;</b></div><div><b>                     &lt;/context&gt;</b></div>
<div><b>               &lt;/section&gt;</b></div><div><b>        &lt;/document&gt;<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><div><br></div><div>Shahzad Bhatti</div><br><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">---------- Forwarded message ----------<br>


From: Muhammad Shahzad &lt;<a href="mailto:shaheryarkh@gmail.com" target="_blank">shaheryarkh@gmail.com</a>&gt;<br>To: FreeSWITCH Users Help &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<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><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">2013</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">-03</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">-01</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace"> </span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">22</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">29</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">52.293493</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace"> </span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">[</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">ERR</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">]</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace"> mod_nibblebill.c:</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">380</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace"> Error running this query: </span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,Courier,monospace">[</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,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:&#39;Courier New&#39;,Courier,monospace">1</span><span style="color:rgb(51,51,51);font-size:11px;font-family:&#39;Courier New&#39;,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><br><br>






<div class="gmail_quote">On Fri, Mar 1, 2013 at 1:42 PM, Shahzad Bhatti <span dir="ltr">&lt;<a href="mailto:shahzad.bhatti@g-r-v.com" target="_blank">shahzad.bhatti@g-r-v.com</a>&gt;</span> wrote:<br><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></blockquote></div>


</blockquote></div></div></div>