<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>    &lt;param name=&quot;core-db-dsn&quot; value=&quot;freeswitch:root:mypass&quot; /&gt;</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>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</div><div><br></div><div>&lt;document type=&quot;freeswitch/xml&quot;&gt;</div><div>    &lt;section name=&quot;configuration&quot;&gt;</div>

<div>        &lt;configuration name=&quot;nibblebill.conf&quot; description=&quot;Nibble Billing&quot;&gt;</div><div>            &lt;settings&gt;</div><div>                &lt;param name=&quot;db_username&quot; value=&quot;root&quot;&gt;&lt;/param&gt;</div>

<div>                &lt;param name=&quot;db_password&quot; value=&quot;mypass&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;db_dsn&quot; value=&quot;mydb&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;db_table&quot; value=&quot;sip_users&quot;&gt;&lt;/param&gt;</div>

<div>                &lt;param name=&quot;db_column_cash&quot; value=&quot;balance&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;db_column_account&quot; value=&quot;id&quot;&gt;&lt;/param&gt;</div>

<div>                &lt;param name=&quot;global_heartbeat&quot; value=&quot;10&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;lowbal_amt&quot; value=&quot;0&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;lowbal_action&quot; value=&quot;play ding&quot;&gt;&lt;/param&gt;</div>

<div>                &lt;param name=&quot;nobal_amt&quot; value=&quot;0&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;nobal_action&quot; value=&quot;hangup&quot;&gt;&lt;/param&gt;</div><div>                &lt;param name=&quot;percall_max_amt&quot; value=&quot;100&quot;&gt;&lt;/param&gt;</div>

<div>                &lt;param name=&quot;percall_action&quot; value=&quot;hangup&quot;&gt;&lt;/param&gt;</div><div>            &lt;/settings&gt;</div><div>        &lt;/configuration&gt;</div><div>    &lt;/section&gt;</div>

<div>&lt;/document&gt;</div></div><div><br></div><div><br></div><div><br></div><div>dialplan:</div><div><br></div><div><br></div><div><br></div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;</div>

<div><br></div><div>&lt;document type=&quot;freeswitch/xml&quot;&gt;</div><div>    &lt;section name=&quot;dialplan&quot;&gt;</div><div>        &lt;context name=&quot;gold&quot;&gt;</div><div>            &lt;extension name=&quot;dynamic_extension&quot;&gt;</div>

<div>                &lt;condition field=&quot;destination_number&quot; expression=&quot;^001.*&quot;&gt;</div><div>                    &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=NO_ROUTE_DESTINATION,UNALLOCATED_NUMBER,407&quot;&gt;&lt;/action&gt;</div>

<div>                    &lt;action application=&quot;set&quot; data=&quot;sip_from_user=1002&quot;&gt;&lt;/action&gt;</div><div>                    &lt;action application=&quot;set&quot; data=&quot;sip_auth_username=1002&quot;&gt;&lt;/action&gt;</div>

<div>                    &lt;action application=&quot;set&quot; data=&quot;sip_req_user=1002&quot;&gt;&lt;/action&gt;</div><div>                    &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;&gt;&lt;/action&gt;</div>

<div>                    &lt;action application=&quot;set&quot; data=&quot;nibble_rate=0.0500&quot;&gt;&lt;/action&gt;</div><div>                    &lt;action application=&quot;set&quot; data=&quot;nibble_account=1&quot;&gt;&lt;/action&gt;</div>

<div>                    &lt;action application=&quot;set&quot; data=&quot;gw=${distributor(TEST_ROUTE)}&quot;&gt;&lt;/action&gt;</div><div>                    &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/${gw}/0013058883456&quot;&gt;&lt;/action&gt;<br>

</div><div>                &lt;/condition&gt;</div><div>            &lt;/extension&gt;</div><div>        &lt;/context&gt;</div><div>    &lt;/section&gt;</div><div>&lt;/document&gt;</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 =&#39;1&#39;]</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 =&#39;1&#39;]</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 =&#39;1&#39;]</div>

<div><br></div><div><br></div><div style>the select go fine if executed &quot;by hand&quot;</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">&lt;<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>&gt;</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 &quot;custom sql&quot; lines mandatory?? it doesn&#39;t seem so, i do see nibblebill trying to do it&#39;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=&#39;1&#39;]</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=&#39;1&#39;]</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=&#39;1&#39;]</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">&lt;<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>&gt;</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&#39;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 &#39;nibblebill&#39;</div>
<div>2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function &#39;nibblebill&#39;</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">&lt;<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>&gt;</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&#39;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">&lt;<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>&gt;</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&#39;t seem to be using a different one... I must&#39;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">&lt;<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>&gt;</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=&quot;db_dsn&quot;</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">&lt;<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>&gt;</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 &quot;freeswitch&quot; and one for nibblebill (&quot;whatever&quot;).</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>