<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><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 <<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><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><br><br>
<div class="gmail_quote">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><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>