<div dir="ltr"><div>ok, some more info:</div><div><br></div><div><br></div><div style>/etc/odbc.ini</div><div style><br></div><div style><div>cat /etc/odbc.ini </div><div>[freeswitch]</div><div>Driver = /usr/lib/odbc/libmyodbc.so</div>
<div>SERVER = localhost</div><div>PORT = 3306</div><div>DATABASE = freeswitch </div><div>OPTION = 67108864</div><div>USER = root </div><div>PASSWORD = dv092171</div>
<div><br></div><div>[mydb]<br></div></div><div><div>Driver = /usr/lib/odbc/libmyodbc.so</div><div>SERVER = localhost</div><div>PORT = 3306</div><div>DATABASE = viking</div><div>OPTION = 67108864</div>
<div>USER = root </div><div>PASSWORD = mypass</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div style>switch.conf.xml</div><div style><br></div><div style>
<div> <param name="core-db-dsn" value="freeswitch:root:mypass" /></div><div><br></div></div><div><br></div><div><br></div><div><br></div><div style>nibblebill:</div><div style><br></div><div style>
<div><?xml version="1.0" encoding="UTF-8" standalone="no"?></div><div><br></div><div><document type="freeswitch/xml"></div><div> <section name="configuration"></div>
<div> <configuration name="nibblebill.conf" description="Nibble Billing"></div><div> <settings></div><div> <param name="db_username" value="root"></param></div>
<div> <param name="db_password" value="mypass"></param></div><div> <param name="db_dsn" value="mydb"></param></div><div> <param name="db_table" value="sip_users"></param></div>
<div> <param name="db_column_cash" value="balance"></param></div><div> <param name="db_column_account" value="id"></param></div>
<div> <param name="global_heartbeat" value="10"></param></div><div> <param name="lowbal_amt" value="0"></param></div><div> <param name="lowbal_action" value="play ding"></param></div>
<div> <param name="nobal_amt" value="0"></param></div><div> <param name="nobal_action" value="hangup"></param></div><div> <param name="percall_max_amt" value="100"></param></div>
<div> <param name="percall_action" value="hangup"></param></div><div> </settings></div><div> </configuration></div><div> </section></div>
<div></document></div></div><div><br></div><div><br></div><div><br></div><div>dialplan:</div><div><br></div><div><br></div><div><br></div><div><?xml version="1.0" encoding="UTF-8" standalone="no"?></div>
<div><br></div><div><document type="freeswitch/xml"></div><div> <section name="dialplan"></div><div> <context name="gold"></div><div> <extension name="dynamic_extension"></div>
<div> <condition field="destination_number" expression="^001.*"></div><div> <action application="set" data="continue_on_fail=NO_ROUTE_DESTINATION,UNALLOCATED_NUMBER,407"></action></div>
<div> <action application="set" data="sip_from_user=1002"></action></div><div> <action application="set" data="sip_auth_username=1002"></action></div>
<div> <action application="set" data="sip_req_user=1002"></action></div><div> <action application="set" data="hangup_after_bridge=true"></action></div>
<div> <action application="set" data="nibble_rate=0.0500"></action></div><div> <action application="set" data="nibble_account=1"></action></div>
<div> <action application="set" data="gw=${distributor(TEST_ROUTE)}"></action></div><div> <action application="bridge" data="sofia/gateway/${gw}/0013058883456"></action><br>
</div><div> </condition></div><div> </extension></div><div> </context></div><div> </section></div><div></document></div><div><br></div><div><br></div><div>
<br></div><div><br></div><div><br></div><div style>call goes out fine... no billing though:</div><div style><br></div><div style><br></div><div style><div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:504 22 seconds passed since last bill time of 2013-02-12 19:21:27</div>
<div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:521 Billing $0.018983 to 1 (Call: d442dc6b-a3a7-423a-8450-598d17ca43b3 / 0.000000 so far)</div><div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query</div>
<div>[UPDATE sip_users SET balance=balance-0.018983 WHERE ='1']</div><div>2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database!</div><div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query</div>
<div>[SELECT balance AS nibble_balance FROM sip_users WHERE ='1']</div><div>2013-02-12 19:21:49.844277 [ERR] mod_nibblebill.c:380 Error running this query: [SELECT balance AS nibble_balance FROM sip_users WHERE ='1']</div>
<div><br></div><div><br></div><div style>the select go fine if executed "by hand"</div><div style><br></div><div style><br></div><div style><br></div><div style>Thanks for your help!</div><div style><br></div><div style>
<br></div><div style>David</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 8:33 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.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">Hello,<div><br></div><div>Is uncommenting the "custom sql" lines mandatory?? it doesn't seem so, i do see nibblebill trying to do it's job:</div>
<div><br></div><div><div>2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:351 Doing update query</div>
<div>[UPDATE sip_users SET balance=balance-0.027683 WHERE id='1']</div><div>2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database!</div><div>2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:378 Doing lookup query</div>
<div>[SELECT balance AS nibble_balance FROM sip_users WHERE id='1']</div><div>2013-02-12 19:32:07.784156 [ERR] mod_nibblebill.c:380 Error running this query: [SELECT balance AS nibble_balance FROM sip_users WHERE id='1']</div>
</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 8:23 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.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">No, there's nothing related to db:<div><br></div><div><div>2013-02-12 19:23:04.823909 [CONSOLE] switch_loadable_module.c:1348 Successfully Loaded [mod_nibblebill]</div>
<div>2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:254 Adding Application 'nibblebill'</div>
<div>2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function 'nibblebill'</div></div><div><br></div><div><br></div></div><div><div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Feb 12, 2013 at 8:04 PM, Avi Marcus <span dir="ltr"><<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</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">Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log.<div>
<span><font color="#888888"><br clear="all"><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi</span></div>
</div></font></span><div><div><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.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">Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...</div>
<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <span dir="ltr"><<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</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">All modules that touch the DB (I think!) have their own configuration that allows you pick the database.<div>
mod_nibblebill does indeed has a <span style="background-color:rgb(249,249,249);line-height:1.1em">param name="db_dsn"</span> option so yes, it will honor that.</div>
<div><br></div><div><span style="font-family:Verdana,Arial,Helvetica,sans-serif">-Avi</span><br><br><div class="gmail_quote"><div><div>On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hello guys,<div><br></div><div>I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever").</div>
<div>Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??</div>
<div><br></div><div>thanks</div><span><font color="#888888"><div><br></div><div>David</div></font></span></div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>