Hello guys, I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core?? thanks David
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that. -Avi On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something... On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
It is strange, core is connecting perfectly, but nibblebill, either with the db used by core or the one i want doesn't seem to be connecting... Is there anyway to check whether it is? Thanks for your help Avi David On Tue, Feb 12, 2013 at 8:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log. -Avi On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No, there's nothing related to db: 2013-02-12 19:23:04.823909 [CONSOLE] switch_loadable_module.c:1348 Successfully Loaded [mod_nibblebill] 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:254 Adding Application 'nibblebill' 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function 'nibblebill' On Tue, Feb 12, 2013 at 8:04 PM, Avi Marcus <avi@avimarcus.net> wrote:
Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log.
-Avi
On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hello, Is uncommenting the "custom sql" lines mandatory?? it doesn't seem so, i do see nibblebill trying to do it's job: 2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.027683 WHERE id='1'] 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] 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'] On Tue, Feb 12, 2013 at 8:23 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
No, there's nothing related to db:
2013-02-12 19:23:04.823909 [CONSOLE] switch_loadable_module.c:1348 Successfully Loaded [mod_nibblebill] 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:254 Adding Application 'nibblebill' 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function 'nibblebill'
On Tue, Feb 12, 2013 at 8:04 PM, Avi Marcus <avi@avimarcus.net> wrote:
Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log.
-Avi
On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
ok, some more info: dialplan: On Tue, Feb 12, 2013 at 8:33 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello,
Is uncommenting the "custom sql" lines mandatory?? it doesn't seem so, i do see nibblebill trying to do it's job:
2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.027683 WHERE id='1'] 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] 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']
On Tue, Feb 12, 2013 at 8:23 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
No, there's nothing related to db:
2013-02-12 19:23:04.823909 [CONSOLE] switch_loadable_module.c:1348 Successfully Loaded [mod_nibblebill] 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:254 Adding Application 'nibblebill' 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function 'nibblebill'
On Tue, Feb 12, 2013 at 8:04 PM, Avi Marcus <avi@avimarcus.net> wrote:
Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log.
-Avi
On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
ok, some more info: /etc/odbc.ini cat /etc/odbc.ini [freeswitch] Driver = /usr/lib/odbc/libmyodbc.so SERVER = localhost PORT = 3306 DATABASE = freeswitch OPTION = 67108864 USER = root PASSWORD = dv092171 [mydb] Driver = /usr/lib/odbc/libmyodbc.so SERVER = localhost PORT = 3306 DATABASE = viking OPTION = 67108864 USER = root PASSWORD = mypass switch.conf.xml <param name="core-db-dsn" value="freeswitch:root:mypass" /> nibblebill: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="freeswitch/xml"> <section name="configuration"> <configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <param name="db_username" value="root"></param> <param name="db_password" value="mypass"></param> <param name="db_dsn" value="mydb"></param> <param name="db_table" value="sip_users"></param> <param name="db_column_cash" value="balance"></param> <param name="db_column_account" value="id"></param> <param name="global_heartbeat" value="10"></param> <param name="lowbal_amt" value="0"></param> <param name="lowbal_action" value="play ding"></param> <param name="nobal_amt" value="0"></param> <param name="nobal_action" value="hangup"></param> <param name="percall_max_amt" value="100"></param> <param name="percall_action" value="hangup"></param> </settings> </configuration> </section> </document> dialplan: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="freeswitch/xml"> <section name="dialplan"> <context name="gold"> <extension name="dynamic_extension"> <condition field="destination_number" expression="^001.*"> <action application="set" data="continue_on_fail=NO_ROUTE_DESTINATION,UNALLOCATED_NUMBER,407"></action> <action application="set" data="sip_from_user=1002"></action> <action application="set" data="sip_auth_username=1002"></action> <action application="set" data="sip_req_user=1002"></action> <action application="set" data="hangup_after_bridge=true"></action> <action application="set" data="nibble_rate=0.0500"></action> <action application="set" data="nibble_account=1"></action> <action application="set" data="gw=${distributor(TEST_ROUTE)}"></action> <action application="bridge" data="sofia/gateway/${gw}/0013058883456"></action> </condition> </extension> </context> </section> </document> call goes out fine... no billing though: 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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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'] the select go fine if executed "by hand" Thanks for your help! David On Tue, Feb 12, 2013 at 8:33 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello,
Is uncommenting the "custom sql" lines mandatory?? it doesn't seem so, i do see nibblebill trying to do it's job:
2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.027683 WHERE id='1'] 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:32:07.784156 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] 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']
On Tue, Feb 12, 2013 at 8:23 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
No, there's nothing related to db:
2013-02-12 19:23:04.823909 [CONSOLE] switch_loadable_module.c:1348 Successfully Loaded [mod_nibblebill] 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:254 Adding Application 'nibblebill' 2013-02-12 19:23:04.823909 [NOTICE] switch_loadable_module.c:298 Adding API Function 'nibblebill'
On Tue, Feb 12, 2013 at 8:04 PM, Avi Marcus <avi@avimarcus.net> wrote:
Last I saw, if you load/reload mod_nibblebill, it logs which DSN it's using to fs_cli / freeswitch.log.
-Avi
On Tue, Feb 12, 2013 at 9:00 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yes, it does have the option, but it doesn't seem to be using a different one... I must've missed something...
On Tue, Feb 12, 2013 at 7:53 PM, Avi Marcus <avi@avimarcus.net> wrote:
All modules that touch the DB (I think!) have their own configuration that allows you pick the database. mod_nibblebill does indeed has a param name="db_dsn" option so yes, it will honor that.
-Avi
On Tue, Feb 12, 2013 at 8:11 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello guys,
I have created 2 dsns, one for freeswitch core "freeswitch" and one for nibblebill ("whatever"). Is it possible to use different dsns in core and nibblebill? or does nibblebill uses the same dsn as the core??
thanks
David
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason. -- -Rupa
Hello Rupa, the query if ok, the user is there: mysql> select * from sip_users; +----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels | +----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 | +----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec) and the actual sql executed by nibblebill: mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec) so that's ok.. any othe ideas? Thanks a lot for your help! David On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Your logs showed the queries run were: UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1' You just tried now.. "WHERE *id*='1' " -- they are not the same query... -Avi On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
hello Avi, that's right, but nevermind that, that's the output when I was trying something else: 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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'] On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
How are you setting the DSN? The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect. -Steve On 13 February 2013 15:33, David Villasmil <david.villasmil.work@gmail.com>wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened. But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn. This is a configuration breaking behaviour, which doesn't seem to have been documented! At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment. -Steve On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil <david.villasmil.work@gmail.com
wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
call goes out fine... no billing though:
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 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) 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] 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']
the select go fine if executed "by hand"
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface. http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810 -Steve On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote:
On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
> call goes out fine... no billing though: > > > 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 > 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) > 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update > query > [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] > 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log > to database! > 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup > query > [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] > 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'] > > > the select go fine if executed "by hand" >
None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason.
-- -Rupa
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
http://jira.freeswitch.org/browse/FS-5100 On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote:
> > On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < > david.villasmil.work@gmail.com> wrote: > >> call goes out fine... no billing though: >> >> >> 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 >> 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) >> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >> update query >> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to >> log to database! >> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >> lookup query >> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >> 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'] >> >> >> the select go fine if executed "by hand" >> > > None of those SQL statements are valid. (hint: WHERE = '1' is no > good). Been a while since I hacked/worked with nibblebill, but I'm > pretty sure the 'id' field isn't not being filled in the sql for some > reason. > > > -- > -Rupa > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > FreeSWITCH-users mailing list > FreeSWITCH-users@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE: > http://lists.freeswitch.org/mailman/options/freeswitch-users > http://www.freeswitch.org > >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
And i can connect from the cli: root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> strange... On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com> wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
> Hello Rupa, > > the query if ok, the user is there: > > mysql> select * from sip_users; > > +----+----------+----------+----------------+------------+--------------+--------------+ > | id | username | password | rateplan | balance | domain > | max_channels | > > +----+----------+----------+----------------+------------+--------------+--------------+ > | 1 | 1002 | 1234 | retail_default | 100.000000 | > 192.168.1.44 | 1 | > > +----+----------+----------+----------------+------------+--------------+--------------+ > 1 row in set (0.00 sec) > > > and the actual sql executed by nibblebill: > > mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; > +----------------+ > | nibble_balance | > +----------------+ > | 100.000000 | > +----------------+ > 1 row in set (0.00 sec) > > > so that's ok.. > > > any othe ideas? > > Thanks a lot for your help! > > > David > > > > On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: > >> >> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >> david.villasmil.work@gmail.com> wrote: >> >>> call goes out fine... no billing though: >>> >>> >>> 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 >>> 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) >>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>> update query >>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to >>> log to database! >>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>> lookup query >>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>> 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'] >>> >>> >>> the select go fine if executed "by hand" >>> >> >> None of those SQL statements are valid. (hint: WHERE = '1' is no >> good). Been a while since I hacked/worked with nibblebill, but I'm >> pretty sure the 'id' field isn't not being filled in the sql for some >> reason. >> >> >> -- >> -Rupa >> >> >> _________________________________________________________________________ >> Professional FreeSWITCH Consulting Services: >> consulting@freeswitch.org >> http://www.freeswitchsolutions.com >> >> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >> http://www.cudatel.com >> >> Official FreeSWITCH Sites >> http://www.freeswitch.org >> http://wiki.freeswitch.org >> http://www.cluecon.com >> >> FreeSWITCH-users mailing list >> FreeSWITCH-users@lists.freeswitch.org >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >> UNSUBSCRIBE: >> http://lists.freeswitch.org/mailman/options/freeswitch-users >> http://www.freeswitch.org >> >> > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > FreeSWITCH-users mailing list > FreeSWITCH-users@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE: > http://lists.freeswitch.org/mailman/options/freeswitch-users > http://www.freeswitch.org > >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Do the SQL queries work ok within isql? On 13 February 2013 17:51, David Villasmil <david.villasmil.work@gmail.com>wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com> wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote:
> Your logs showed the queries run were: > > UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' > SELECT balance AS nibble_balance FROM sip_users WHERE ='1' > > You just tried now.. "WHERE *id*='1' " -- they are not the same > query... > > -Avi > > > > On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < > david.villasmil.work@gmail.com> wrote: > >> Hello Rupa, >> >> the query if ok, the user is there: >> >> mysql> select * from sip_users; >> >> +----+----------+----------+----------------+------------+--------------+--------------+ >> | id | username | password | rateplan | balance | domain >> | max_channels | >> >> +----+----------+----------+----------------+------------+--------------+--------------+ >> | 1 | 1002 | 1234 | retail_default | 100.000000 | >> 192.168.1.44 | 1 | >> >> +----+----------+----------+----------------+------------+--------------+--------------+ >> 1 row in set (0.00 sec) >> >> >> and the actual sql executed by nibblebill: >> >> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; >> +----------------+ >> | nibble_balance | >> +----------------+ >> | 100.000000 | >> +----------------+ >> 1 row in set (0.00 sec) >> >> >> so that's ok.. >> >> >> any othe ideas? >> >> Thanks a lot for your help! >> >> >> David >> >> >> >> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: >> >>> >>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >>> david.villasmil.work@gmail.com> wrote: >>> >>>> call goes out fine... no billing though: >>>> >>>> >>>> 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 >>>> 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) >>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>>> update query >>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to >>>> log to database! >>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>>> lookup query >>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>> 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'] >>>> >>>> >>>> the select go fine if executed "by hand" >>>> >>> >>> None of those SQL statements are valid. (hint: WHERE = '1' is no >>> good). Been a while since I hacked/worked with nibblebill, but I'm >>> pretty sure the 'id' field isn't not being filled in the sql for some >>> reason. >>> >>> >>> -- >>> -Rupa >>> >>> >>> _________________________________________________________________________ >>> Professional FreeSWITCH Consulting Services: >>> consulting@freeswitch.org >>> http://www.freeswitchsolutions.com >>> >>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>> http://www.cudatel.com >>> >>> Official FreeSWITCH Sites >>> http://www.freeswitch.org >>> http://wiki.freeswitch.org >>> http://www.cluecon.com >>> >>> FreeSWITCH-users mailing list >>> FreeSWITCH-users@lists.freeswitch.org >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>> UNSUBSCRIBE: >>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>> http://www.freeswitch.org >>> >>> >> >> >> _________________________________________________________________________ >> Professional FreeSWITCH Consulting Services: >> consulting@freeswitch.org >> http://www.freeswitchsolutions.com >> >> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >> http://www.cudatel.com >> >> Official FreeSWITCH Sites >> http://www.freeswitch.org >> http://wiki.freeswitch.org >> http://www.cluecon.com >> >> FreeSWITCH-users mailing list >> FreeSWITCH-users@lists.freeswitch.org >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >> UNSUBSCRIBE: >> http://lists.freeswitch.org/mailman/options/freeswitch-users >> http://www.freeswitch.org >> >> > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > FreeSWITCH-users mailing list > FreeSWITCH-users@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE: > http://lists.freeswitch.org/mailman/options/freeswitch-users > http://www.freeswitch.org > >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yeah, everything works within isql: root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 100.000000 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> UPDATE sip_users SET balance=balance-0.044817 WHERE id='1' SQLRowCount returns 1 SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 99.955183 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> and freeswitch core is also using odbc (although a differen dsn) David On Wed, Feb 13, 2013 at 7:07 PM, Steven Ayre <steveayre@gmail.com> wrote:
Do the SQL queries work ok within isql?
On 13 February 2013 17:51, David Villasmil <david.villasmil.work@gmail.com
wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com> wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
> hello Avi, > > that's right, but nevermind that, that's the output when I was > trying something else: > > 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new > billing on 58e6762b-c049-470e-84f7-519a815ab6f0 > 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log > to database! > 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'] > > > On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote: > >> Your logs showed the queries run were: >> >> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' >> SELECT balance AS nibble_balance FROM sip_users WHERE ='1' >> >> You just tried now.. "WHERE *id*='1' " -- they are not the same >> query... >> >> -Avi >> >> >> >> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < >> david.villasmil.work@gmail.com> wrote: >> >>> Hello Rupa, >>> >>> the query if ok, the user is there: >>> >>> mysql> select * from sip_users; >>> >>> +----+----------+----------+----------------+------------+--------------+--------------+ >>> | id | username | password | rateplan | balance | domain >>> | max_channels | >>> >>> +----+----------+----------+----------------+------------+--------------+--------------+ >>> | 1 | 1002 | 1234 | retail_default | 100.000000 | >>> 192.168.1.44 | 1 | >>> >>> +----+----------+----------+----------------+------------+--------------+--------------+ >>> 1 row in set (0.00 sec) >>> >>> >>> and the actual sql executed by nibblebill: >>> >>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE >>> id='1'; >>> +----------------+ >>> | nibble_balance | >>> +----------------+ >>> | 100.000000 | >>> +----------------+ >>> 1 row in set (0.00 sec) >>> >>> >>> so that's ok.. >>> >>> >>> any othe ideas? >>> >>> Thanks a lot for your help! >>> >>> >>> David >>> >>> >>> >>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: >>> >>>> >>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >>>> david.villasmil.work@gmail.com> wrote: >>>> >>>>> call goes out fine... no billing though: >>>>> >>>>> >>>>> 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 >>>>> 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) >>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>>>> update query >>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to >>>>> log to database! >>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>>>> lookup query >>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>>> 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'] >>>>> >>>>> >>>>> the select go fine if executed "by hand" >>>>> >>>> >>>> None of those SQL statements are valid. (hint: WHERE = '1' is no >>>> good). Been a while since I hacked/worked with nibblebill, but I'm >>>> pretty sure the 'id' field isn't not being filled in the sql for some >>>> reason. >>>> >>>> >>>> -- >>>> -Rupa >>>> >>>> >>>> _________________________________________________________________________ >>>> Professional FreeSWITCH Consulting Services: >>>> consulting@freeswitch.org >>>> http://www.freeswitchsolutions.com >>>> >>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>> http://www.cudatel.com >>>> >>>> Official FreeSWITCH Sites >>>> http://www.freeswitch.org >>>> http://wiki.freeswitch.org >>>> http://www.cluecon.com >>>> >>>> FreeSWITCH-users mailing list >>>> FreeSWITCH-users@lists.freeswitch.org >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE: >>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>>> >>> >>> >>> _________________________________________________________________________ >>> Professional FreeSWITCH Consulting Services: >>> consulting@freeswitch.org >>> http://www.freeswitchsolutions.com >>> >>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>> http://www.cudatel.com >>> >>> Official FreeSWITCH Sites >>> http://www.freeswitch.org >>> http://wiki.freeswitch.org >>> http://www.cluecon.com >>> >>> FreeSWITCH-users mailing list >>> FreeSWITCH-users@lists.freeswitch.org >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>> UNSUBSCRIBE: >>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>> http://www.freeswitch.org >>> >>> >> >> >> _________________________________________________________________________ >> Professional FreeSWITCH Consulting Services: >> consulting@freeswitch.org >> http://www.freeswitchsolutions.com >> >> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >> http://www.cudatel.com >> >> Official FreeSWITCH Sites >> http://www.freeswitch.org >> http://wiki.freeswitch.org >> http://www.cluecon.com >> >> FreeSWITCH-users mailing list >> FreeSWITCH-users@lists.freeswitch.org >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >> UNSUBSCRIBE: >> http://lists.freeswitch.org/mailman/options/freeswitch-users >> http://www.freeswitch.org >> >> > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > FreeSWITCH-users mailing list > FreeSWITCH-users@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE: > http://lists.freeswitch.org/mailman/options/freeswitch-users > http://www.freeswitch.org > >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Is "viking" the actual DSN you're using? If so that format won't work any longer since the generalized interface was implemented. name:user:pass still works but plain name no longer works*.* See http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn You're best off updating it to odbc://viking -Steve On 13 February 2013 19:07, David Villasmil <david.villasmil.work@gmail.com>wrote:
Yeah, everything works within isql:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 100.000000 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> UPDATE sip_users SET balance=balance-0.044817 WHERE id='1' SQLRowCount returns 1 SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 99.955183 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL>
and freeswitch core is also using odbc (although a differen dsn)
David
On Wed, Feb 13, 2013 at 7:07 PM, Steven Ayre <steveayre@gmail.com> wrote:
Do the SQL queries work ok within isql?
On 13 February 2013 17:51, David Villasmil < david.villasmil.work@gmail.com> wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com>wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
> How are you setting the DSN? > > The param name mentioned earlier is wrong. Reading the source the > correct parameter is "odbc-dsn". Looks like the wiki documentation is > incorrect. > > -Steve > > > > > On 13 February 2013 15:33, David Villasmil < > david.villasmil.work@gmail.com> wrote: > >> hello Avi, >> >> that's right, but nevermind that, that's the output when I was >> trying something else: >> >> 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning >> new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 >> 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to >> log to database! >> 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'] >> >> >> On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote: >> >>> Your logs showed the queries run were: >>> >>> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' >>> SELECT balance AS nibble_balance FROM sip_users WHERE ='1' >>> >>> You just tried now.. "WHERE *id*='1' " -- they are not the same >>> query... >>> >>> -Avi >>> >>> >>> >>> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < >>> david.villasmil.work@gmail.com> wrote: >>> >>>> Hello Rupa, >>>> >>>> the query if ok, the user is there: >>>> >>>> mysql> select * from sip_users; >>>> >>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>> | id | username | password | rateplan | balance | domain >>>> | max_channels | >>>> >>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>> | 1 | 1002 | 1234 | retail_default | 100.000000 | >>>> 192.168.1.44 | 1 | >>>> >>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>> 1 row in set (0.00 sec) >>>> >>>> >>>> and the actual sql executed by nibblebill: >>>> >>>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE >>>> id='1'; >>>> +----------------+ >>>> | nibble_balance | >>>> +----------------+ >>>> | 100.000000 | >>>> +----------------+ >>>> 1 row in set (0.00 sec) >>>> >>>> >>>> so that's ok.. >>>> >>>> >>>> any othe ideas? >>>> >>>> Thanks a lot for your help! >>>> >>>> >>>> David >>>> >>>> >>>> >>>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: >>>> >>>>> >>>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >>>>> david.villasmil.work@gmail.com> wrote: >>>>> >>>>>> call goes out fine... no billing though: >>>>>> >>>>>> >>>>>> 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 >>>>>> 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) >>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>>>>> update query >>>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed >>>>>> to log to database! >>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>>>>> lookup query >>>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>>>> 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'] >>>>>> >>>>>> >>>>>> the select go fine if executed "by hand" >>>>>> >>>>> >>>>> None of those SQL statements are valid. (hint: WHERE = '1' is >>>>> no good). Been a while since I hacked/worked with nibblebill, but I'm >>>>> pretty sure the 'id' field isn't not being filled in the sql for some >>>>> reason. >>>>> >>>>> >>>>> -- >>>>> -Rupa >>>>> >>>>> >>>>> _________________________________________________________________________ >>>>> Professional FreeSWITCH Consulting Services: >>>>> consulting@freeswitch.org >>>>> http://www.freeswitchsolutions.com >>>>> >>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>> http://www.cudatel.com >>>>> >>>>> Official FreeSWITCH Sites >>>>> http://www.freeswitch.org >>>>> http://wiki.freeswitch.org >>>>> http://www.cluecon.com >>>>> >>>>> FreeSWITCH-users mailing list >>>>> FreeSWITCH-users@lists.freeswitch.org >>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>> UNSUBSCRIBE: >>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>> http://www.freeswitch.org >>>>> >>>>> >>>> >>>> >>>> _________________________________________________________________________ >>>> Professional FreeSWITCH Consulting Services: >>>> consulting@freeswitch.org >>>> http://www.freeswitchsolutions.com >>>> >>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>> http://www.cudatel.com >>>> >>>> Official FreeSWITCH Sites >>>> http://www.freeswitch.org >>>> http://wiki.freeswitch.org >>>> http://www.cluecon.com >>>> >>>> FreeSWITCH-users mailing list >>>> FreeSWITCH-users@lists.freeswitch.org >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE: >>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>>> >>> >>> >>> _________________________________________________________________________ >>> Professional FreeSWITCH Consulting Services: >>> consulting@freeswitch.org >>> http://www.freeswitchsolutions.com >>> >>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>> http://www.cudatel.com >>> >>> Official FreeSWITCH Sites >>> http://www.freeswitch.org >>> http://wiki.freeswitch.org >>> http://www.cluecon.com >>> >>> FreeSWITCH-users mailing list >>> FreeSWITCH-users@lists.freeswitch.org >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>> UNSUBSCRIBE: >>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>> http://www.freeswitch.org >>> >>> >> >> >> _________________________________________________________________________ >> Professional FreeSWITCH Consulting Services: >> consulting@freeswitch.org >> http://www.freeswitchsolutions.com >> >> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >> http://www.cudatel.com >> >> Official FreeSWITCH Sites >> http://www.freeswitch.org >> http://wiki.freeswitch.org >> http://www.cluecon.com >> >> FreeSWITCH-users mailing list >> FreeSWITCH-users@lists.freeswitch.org >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >> UNSUBSCRIBE: >> http://lists.freeswitch.org/mailman/options/freeswitch-users >> http://www.freeswitch.org >> >> >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Aha! That must it, i'll test and let you know... David --- David Villasmil On Feb 13, 2013, at 20:35, Steven Ayre <steveayre@gmail.com> wrote:
Is "viking" the actual DSN you're using? If so that format won't work any longer since the generalized interface was implemented. name:user:pass still works but plain name no longer works.
See http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn
You're best off updating it to odbc://viking
-Steve
On 13 February 2013 19:07, David Villasmil <david.villasmil.work@gmail.com> wrote:
Yeah, everything works within isql:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 100.000000 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> UPDATE sip_users SET balance=balance-0.044817 WHERE id='1' SQLRowCount returns 1 SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 99.955183 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL>
and freeswitch core is also using odbc (although a differen dsn)
David
On Wed, Feb 13, 2013 at 7:07 PM, Steven Ayre <steveayre@gmail.com> wrote:
Do the SQL queries work ok within isql?
On 13 February 2013 17:51, David Villasmil <david.villasmil.work@gmail.com> wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com> wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote: > Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened. > > But... > The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. > The HEAD of master understands odbc-dsn but not db_dsn. > > This is a configuration breaking behaviour, which doesn't seem to have been documented! > > At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment. > > -Steve > > > > > > > On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote: >> How are you setting the DSN? >> >> The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect. >> >> -Steve >> >> >> >> >> On 13 February 2013 15:33, David Villasmil <david.villasmil.work@gmail.com> wrote: >>> hello Avi, >>> >>> that's right, but nevermind that, that's the output when I was trying something else: >>> >>> 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 >>> 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! >>> 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'] >>> >>> >>> On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote: >>>> Your logs showed the queries run were: >>>> >>>> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' >>>> SELECT balance AS nibble_balance FROM sip_users WHERE ='1' >>>> >>>> You just tried now.. "WHERE id='1' " -- they are not the same query... >>>> >>>> -Avi >>>> >>>> >>>> >>>> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil <david.villasmil.work@gmail.com> wrote: >>>>> Hello Rupa, >>>>> >>>>> the query if ok, the user is there: >>>>> >>>>> mysql> select * from sip_users; >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> | id | username | password | rateplan | balance | domain | max_channels | >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 | >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> 1 row in set (0.00 sec) >>>>> >>>>> >>>>> and the actual sql executed by nibblebill: >>>>> >>>>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; >>>>> +----------------+ >>>>> | nibble_balance | >>>>> +----------------+ >>>>> | 100.000000 | >>>>> +----------------+ >>>>> 1 row in set (0.00 sec) >>>>> >>>>> >>>>> so that's ok.. >>>>> >>>>> >>>>> any othe ideas? >>>>> >>>>> Thanks a lot for your help! >>>>> >>>>> >>>>> David >>>>> >>>>> >>>>> >>>>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com> wrote: >>>>>> >>>>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil <david.villasmil.work@gmail.com> wrote: >>>>>>> call goes out fine... no billing though: >>>>>>> >>>>>>> >>>>>>> 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 >>>>>>> 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) >>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query >>>>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database! >>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query >>>>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>>>>> 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'] >>>>>>> >>>>>>> >>>>>>> the select go fine if executed "by hand" >>>>>> >>>>>> None of those SQL statements are valid. (hint: WHERE = '1' is no good). Been a while since I hacked/worked with nibblebill, but I'm pretty sure the 'id' field isn't not being filled in the sql for some reason. >>>>>> >>>>>> >>>>>> -- >>>>>> -Rupa >>>>>> >>>>>> _________________________________________________________________________ >>>>>> Professional FreeSWITCH Consulting Services: >>>>>> consulting@freeswitch.org >>>>>> http://www.freeswitchsolutions.com >>>>>> >>>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>>> http://www.cudatel.com >>>>>> >>>>>> Official FreeSWITCH Sites >>>>>> http://www.freeswitch.org >>>>>> http://wiki.freeswitch.org >>>>>> http://www.cluecon.com >>>>>> >>>>>> FreeSWITCH-users mailing list >>>>>> FreeSWITCH-users@lists.freeswitch.org >>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>>> http://www.freeswitch.org >>>>>> >>>>> >>>>> >>>>> _________________________________________________________________________ >>>>> Professional FreeSWITCH Consulting Services: >>>>> consulting@freeswitch.org >>>>> http://www.freeswitchsolutions.com >>>>> >>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>> http://www.cudatel.com >>>>> >>>>> Official FreeSWITCH Sites >>>>> http://www.freeswitch.org >>>>> http://wiki.freeswitch.org >>>>> http://www.cluecon.com >>>>> >>>>> FreeSWITCH-users mailing list >>>>> FreeSWITCH-users@lists.freeswitch.org >>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>> http://www.freeswitch.org >>>>> >>>> >>>> >>>> _________________________________________________________________________ >>>> Professional FreeSWITCH Consulting Services: >>>> consulting@freeswitch.org >>>> http://www.freeswitchsolutions.com >>>> >>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>> http://www.cudatel.com >>>> >>>> Official FreeSWITCH Sites >>>> http://www.freeswitch.org >>>> http://wiki.freeswitch.org >>>> http://www.cluecon.com >>>> >>>> FreeSWITCH-users mailing list >>>> FreeSWITCH-users@lists.freeswitch.org >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>> >>> >>> _________________________________________________________________________ >>> Professional FreeSWITCH Consulting Services: >>> consulting@freeswitch.org >>> http://www.freeswitchsolutions.com >>> >>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>> http://www.cudatel.com >>> >>> Official FreeSWITCH Sites >>> http://www.freeswitch.org >>> http://wiki.freeswitch.org >>> http://www.cluecon.com >>> >>> FreeSWITCH-users mailing list >>> FreeSWITCH-users@lists.freeswitch.org >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users >>> http://www.freeswitch.org >>> >> >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
It worked! finally! That happend when one doesn't read the release notes :( it updated the balance, BUT I still got and error, balance was 100: 2013-02-13 19:55:09.903784 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.022267 WHERE id='1'] 2013-02-13 19:55:09.903784 [CRIT] mod_nibblebill.c:535 Failed to log to database! <----- error? 2013-02-13 19:55:09.903784 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] 2013-02-13 19:55:09.923320 [DEBUG] mod_nibblebill.c:386 Retrieved current balance for account 1 (balance = 99.977733) So it did the update fine, but stil got errors somehow... On Wed, Feb 13, 2013 at 8:49 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Aha!
That must it, i'll test and let you know...
David
---
David Villasmil
On Feb 13, 2013, at 20:35, Steven Ayre <steveayre@gmail.com> wrote:
Is "viking" the actual DSN you're using? If so that format won't work any longer since the generalized interface was implemented. name:user:pass still works but plain name no longer works*.*
See http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn
You're best off updating it to odbc://viking
-Steve
On 13 February 2013 19:07, David Villasmil <david.villasmil.work@gmail.com
wrote:
Yeah, everything works within isql:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 100.000000 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> UPDATE sip_users SET balance=balance-0.044817 WHERE id='1' SQLRowCount returns 1 SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 99.955183 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL>
and freeswitch core is also using odbc (although a differen dsn)
David
On Wed, Feb 13, 2013 at 7:07 PM, Steven Ayre <steveayre@gmail.com> wrote:
Do the SQL queries work ok within isql?
On 13 February 2013 17:51, David Villasmil < david.villasmil.work@gmail.com> wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com>wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
> Looks like this difference is brought in by the modifications to > support the generalised DSN interface. odbc-dsn would be consistent with > all other modules, so I guess that's why it's happened. > > But... > The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. > The HEAD of master understands odbc-dsn but not db_dsn. > > This is a configuration breaking behaviour, which doesn't seem to > have been documented! > > At the very least it'd make sense for the master branch to > understand both odbc-dsn and db_dsn for backwards compatibility. I'll file > a Jira with a patch (it's a trivial fix) in a moment. > > -Steve > > > > > > > On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote: > >> How are you setting the DSN? >> >> The param name mentioned earlier is wrong. Reading the source the >> correct parameter is "odbc-dsn". Looks like the wiki documentation is >> incorrect. >> >> -Steve >> >> >> >> >> On 13 February 2013 15:33, David Villasmil < >> david.villasmil.work@gmail.com> wrote: >> >>> hello Avi, >>> >>> that's right, but nevermind that, that's the output when I was >>> trying something else: >>> >>> 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning >>> new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 >>> 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to >>> log to database! >>> 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'] >>> >>> >>> On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote: >>> >>>> Your logs showed the queries run were: >>>> >>>> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' >>>> SELECT balance AS nibble_balance FROM sip_users WHERE ='1' >>>> >>>> You just tried now.. "WHERE *id*='1' " -- they are not the same >>>> query... >>>> >>>> -Avi >>>> >>>> >>>> >>>> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < >>>> david.villasmil.work@gmail.com> wrote: >>>> >>>>> Hello Rupa, >>>>> >>>>> the query if ok, the user is there: >>>>> >>>>> mysql> select * from sip_users; >>>>> >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> | id | username | password | rateplan | balance | >>>>> domain | max_channels | >>>>> >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> | 1 | 1002 | 1234 | retail_default | 100.000000 | >>>>> 192.168.1.44 | 1 | >>>>> >>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>> 1 row in set (0.00 sec) >>>>> >>>>> >>>>> and the actual sql executed by nibblebill: >>>>> >>>>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE >>>>> id='1'; >>>>> +----------------+ >>>>> | nibble_balance | >>>>> +----------------+ >>>>> | 100.000000 | >>>>> +----------------+ >>>>> 1 row in set (0.00 sec) >>>>> >>>>> >>>>> so that's ok.. >>>>> >>>>> >>>>> any othe ideas? >>>>> >>>>> Thanks a lot for your help! >>>>> >>>>> >>>>> David >>>>> >>>>> >>>>> >>>>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: >>>>> >>>>>> >>>>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >>>>>> david.villasmil.work@gmail.com> wrote: >>>>>> >>>>>>> call goes out fine... no billing though: >>>>>>> >>>>>>> >>>>>>> 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 >>>>>>> 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) >>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>>>>>> update query >>>>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed >>>>>>> to log to database! >>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>>>>>> lookup query >>>>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>>>>> 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'] >>>>>>> >>>>>>> >>>>>>> the select go fine if executed "by hand" >>>>>>> >>>>>> >>>>>> None of those SQL statements are valid. (hint: WHERE = '1' is >>>>>> no good). Been a while since I hacked/worked with nibblebill, but I'm >>>>>> pretty sure the 'id' field isn't not being filled in the sql for some >>>>>> reason. >>>>>> >>>>>> >>>>>> -- >>>>>> -Rupa >>>>>> >>>>>> >>>>>> _________________________________________________________________________ >>>>>> Professional FreeSWITCH Consulting Services: >>>>>> consulting@freeswitch.org >>>>>> http://www.freeswitchsolutions.com >>>>>> >>>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>>> http://www.cudatel.com >>>>>> >>>>>> Official FreeSWITCH Sites >>>>>> http://www.freeswitch.org >>>>>> http://wiki.freeswitch.org >>>>>> http://www.cluecon.com >>>>>> >>>>>> FreeSWITCH-users mailing list >>>>>> FreeSWITCH-users@lists.freeswitch.org >>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>>> UNSUBSCRIBE: >>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>>> http://www.freeswitch.org >>>>>> >>>>>> >>>>> >>>>> >>>>> _________________________________________________________________________ >>>>> Professional FreeSWITCH Consulting Services: >>>>> consulting@freeswitch.org >>>>> http://www.freeswitchsolutions.com >>>>> >>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>> http://www.cudatel.com >>>>> >>>>> Official FreeSWITCH Sites >>>>> http://www.freeswitch.org >>>>> http://wiki.freeswitch.org >>>>> http://www.cluecon.com >>>>> >>>>> FreeSWITCH-users mailing list >>>>> FreeSWITCH-users@lists.freeswitch.org >>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>> UNSUBSCRIBE: >>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>> http://www.freeswitch.org >>>>> >>>>> >>>> >>>> >>>> _________________________________________________________________________ >>>> Professional FreeSWITCH Consulting Services: >>>> consulting@freeswitch.org >>>> http://www.freeswitchsolutions.com >>>> >>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>> http://www.cudatel.com >>>> >>>> Official FreeSWITCH Sites >>>> http://www.freeswitch.org >>>> http://wiki.freeswitch.org >>>> http://www.cluecon.com >>>> >>>> FreeSWITCH-users mailing list >>>> FreeSWITCH-users@lists.freeswitch.org >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE: >>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>>> >>> >>> >>> _________________________________________________________________________ >>> Professional FreeSWITCH Consulting Services: >>> consulting@freeswitch.org >>> http://www.freeswitchsolutions.com >>> >>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>> http://www.cudatel.com >>> >>> Official FreeSWITCH Sites >>> http://www.freeswitch.org >>> http://wiki.freeswitch.org >>> http://www.cluecon.com >>> >>> FreeSWITCH-users mailing list >>> FreeSWITCH-users@lists.freeswitch.org >>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>> UNSUBSCRIBE: >>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>> http://www.freeswitch.org >>> >>> >> >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
It's probably not a very well known page. I created it when the odbc-dsn change broke my own system on an upgrade (I too store user/password in odbc.ini not the DSN). It lacks any earlier breaking changes, but seemed a good idea to add now we have a stable branch.e It's linked to on the Wiki front page and the download & install guide, but if people are used to upgrading from the CLI they probably never even read the Wiki each time they update. :o) There's also http://wiki.freeswitch.org/wiki/Changelog_Summary, but the Release Notes page is a nice place to highlight changes that might actually break stuff. The odsn-dsn change is rather innocuously mentioned in the changelog as merely 'core: Add Postgres core db support (r:0c1180d5)'. -Steve On 13 February 2013 19:57, David Villasmil <david.villasmil.work@gmail.com>wrote:
It worked! finally! That happend when one doesn't read the release notes :(
it updated the balance, BUT I still got and error, balance was 100:
2013-02-13 19:55:09.903784 [DEBUG] mod_nibblebill.c:351 Doing update query [UPDATE sip_users SET balance=balance-0.022267 WHERE id='1'] 2013-02-13 19:55:09.903784 [CRIT] mod_nibblebill.c:535 Failed to log to database! <----- error? 2013-02-13 19:55:09.903784 [DEBUG] mod_nibblebill.c:378 Doing lookup query [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] 2013-02-13 19:55:09.923320 [DEBUG] mod_nibblebill.c:386 Retrieved current balance for account 1 (balance = 99.977733)
So it did the update fine, but stil got errors somehow...
On Wed, Feb 13, 2013 at 8:49 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Aha!
That must it, i'll test and let you know...
David
---
David Villasmil
On Feb 13, 2013, at 20:35, Steven Ayre <steveayre@gmail.com> wrote:
Is "viking" the actual DSN you're using? If so that format won't work any longer since the generalized interface was implemented. name:user:pass still works but plain name no longer works*.*
See http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn
You're best off updating it to odbc://viking
-Steve
On 13 February 2013 19:07, David Villasmil < david.villasmil.work@gmail.com> wrote:
Yeah, everything works within isql:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 100.000000 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL> UPDATE sip_users SET balance=balance-0.044817 WHERE id='1' SQLRowCount returns 1 SQL> SELECT balance AS nibble_balance FROM sip_users WHERE id='1' +---------------+ | nibble_balance| +---------------+ | 99.955183 | +---------------+ SQLRowCount returns 1 1 rows fetched SQL>
and freeswitch core is also using odbc (although a differen dsn)
David
On Wed, Feb 13, 2013 at 7:07 PM, Steven Ayre <steveayre@gmail.com>wrote:
Do the SQL queries work ok within isql?
On 13 February 2013 17:51, David Villasmil < david.villasmil.work@gmail.com> wrote:
And i can connect from the cli:
root@lamp ~# isql viking +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
strange...
On Wed, Feb 13, 2013 at 6:46 PM, Steven Ayre <steveayre@gmail.com>wrote:
http://jira.freeswitch.org/browse/FS-5100
On 13 February 2013 17:40, Steven Ayre <steveayre@gmail.com> wrote:
> Specifically it's introduced by commit 5c176e8 which was resolving > FS-4810, which is indeed adding support for the the generalised DSN > interface. > > > http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... > http://jira.freeswitch.org/browse/FS-4810 > > -Steve > > > > On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote: > >> Looks like this difference is brought in by the modifications to >> support the generalised DSN interface. odbc-dsn would be consistent with >> all other modules, so I guess that's why it's happened. >> >> But... >> The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. >> The HEAD of master understands odbc-dsn but not db_dsn. >> >> This is a configuration breaking behaviour, which doesn't seem to >> have been documented! >> >> At the very least it'd make sense for the master branch to >> understand both odbc-dsn and db_dsn for backwards compatibility. I'll file >> a Jira with a patch (it's a trivial fix) in a moment. >> >> -Steve >> >> >> >> >> >> >> On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote: >> >>> How are you setting the DSN? >>> >>> The param name mentioned earlier is wrong. Reading the source the >>> correct parameter is "odbc-dsn". Looks like the wiki documentation is >>> incorrect. >>> >>> -Steve >>> >>> >>> >>> >>> On 13 February 2013 15:33, David Villasmil < >>> david.villasmil.work@gmail.com> wrote: >>> >>>> hello Avi, >>>> >>>> that's right, but nevermind that, that's the output when I was >>>> trying something else: >>>> >>>> 2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning >>>> new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 >>>> 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to >>>> log to database! >>>> 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'] >>>> >>>> >>>> On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net>wrote: >>>> >>>>> Your logs showed the queries run were: >>>>> >>>>> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' >>>>> SELECT balance AS nibble_balance FROM sip_users WHERE ='1' >>>>> >>>>> You just tried now.. "WHERE *id*='1' " -- they are not the >>>>> same query... >>>>> >>>>> -Avi >>>>> >>>>> >>>>> >>>>> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < >>>>> david.villasmil.work@gmail.com> wrote: >>>>> >>>>>> Hello Rupa, >>>>>> >>>>>> the query if ok, the user is there: >>>>>> >>>>>> mysql> select * from sip_users; >>>>>> >>>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>>> | id | username | password | rateplan | balance | >>>>>> domain | max_channels | >>>>>> >>>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>>> | 1 | 1002 | 1234 | retail_default | 100.000000 | >>>>>> 192.168.1.44 | 1 | >>>>>> >>>>>> +----+----------+----------+----------------+------------+--------------+--------------+ >>>>>> 1 row in set (0.00 sec) >>>>>> >>>>>> >>>>>> and the actual sql executed by nibblebill: >>>>>> >>>>>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE >>>>>> id='1'; >>>>>> +----------------+ >>>>>> | nibble_balance | >>>>>> +----------------+ >>>>>> | 100.000000 | >>>>>> +----------------+ >>>>>> 1 row in set (0.00 sec) >>>>>> >>>>>> >>>>>> so that's ok.. >>>>>> >>>>>> >>>>>> any othe ideas? >>>>>> >>>>>> Thanks a lot for your help! >>>>>> >>>>>> >>>>>> David >>>>>> >>>>>> >>>>>> >>>>>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote: >>>>>> >>>>>>> >>>>>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < >>>>>>> david.villasmil.work@gmail.com> wrote: >>>>>>> >>>>>>>> call goes out fine... no billing though: >>>>>>>> >>>>>>>> >>>>>>>> 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 >>>>>>>> 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) >>>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >>>>>>>> update query >>>>>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >>>>>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed >>>>>>>> to log to database! >>>>>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >>>>>>>> lookup query >>>>>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >>>>>>>> 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'] >>>>>>>> >>>>>>>> >>>>>>>> the select go fine if executed "by hand" >>>>>>>> >>>>>>> >>>>>>> None of those SQL statements are valid. (hint: WHERE = '1' is >>>>>>> no good). Been a while since I hacked/worked with nibblebill, but I'm >>>>>>> pretty sure the 'id' field isn't not being filled in the sql for some >>>>>>> reason. >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> -Rupa >>>>>>> >>>>>>> >>>>>>> _________________________________________________________________________ >>>>>>> Professional FreeSWITCH Consulting Services: >>>>>>> consulting@freeswitch.org >>>>>>> http://www.freeswitchsolutions.com >>>>>>> >>>>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>>>> http://www.cudatel.com >>>>>>> >>>>>>> Official FreeSWITCH Sites >>>>>>> http://www.freeswitch.org >>>>>>> http://wiki.freeswitch.org >>>>>>> http://www.cluecon.com >>>>>>> >>>>>>> FreeSWITCH-users mailing list >>>>>>> FreeSWITCH-users@lists.freeswitch.org >>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>>>> UNSUBSCRIBE: >>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>>>> http://www.freeswitch.org >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> _________________________________________________________________________ >>>>>> Professional FreeSWITCH Consulting Services: >>>>>> consulting@freeswitch.org >>>>>> http://www.freeswitchsolutions.com >>>>>> >>>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>>> http://www.cudatel.com >>>>>> >>>>>> Official FreeSWITCH Sites >>>>>> http://www.freeswitch.org >>>>>> http://wiki.freeswitch.org >>>>>> http://www.cluecon.com >>>>>> >>>>>> FreeSWITCH-users mailing list >>>>>> FreeSWITCH-users@lists.freeswitch.org >>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>>> UNSUBSCRIBE: >>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>>> http://www.freeswitch.org >>>>>> >>>>>> >>>>> >>>>> >>>>> _________________________________________________________________________ >>>>> Professional FreeSWITCH Consulting Services: >>>>> consulting@freeswitch.org >>>>> http://www.freeswitchsolutions.com >>>>> >>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>>> http://www.cudatel.com >>>>> >>>>> Official FreeSWITCH Sites >>>>> http://www.freeswitch.org >>>>> http://wiki.freeswitch.org >>>>> http://www.cluecon.com >>>>> >>>>> FreeSWITCH-users mailing list >>>>> FreeSWITCH-users@lists.freeswitch.org >>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>>> UNSUBSCRIBE: >>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>>> http://www.freeswitch.org >>>>> >>>>> >>>> >>>> >>>> _________________________________________________________________________ >>>> Professional FreeSWITCH Consulting Services: >>>> consulting@freeswitch.org >>>> http://www.freeswitchsolutions.com >>>> >>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server >>>> http://www.cudatel.com >>>> >>>> Official FreeSWITCH Sites >>>> http://www.freeswitch.org >>>> http://wiki.freeswitch.org >>>> http://www.cluecon.com >>>> >>>> FreeSWITCH-users mailing list >>>> FreeSWITCH-users@lists.freeswitch.org >>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users >>>> UNSUBSCRIBE: >>>> http://lists.freeswitch.org/mailman/options/freeswitch-users >>>> http://www.freeswitch.org >>>> >>>> >>> >> >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hello Steven, Great! At least I now see it took the dsn when loading: 2013-02-13 17:44:47.623905 [INFO] mod_nibblebill.c:197 odbc_dsn is viking 2013-02-13 17:44:47.623905 [DEBUG] mod_nibblebill.c:242 dsn is "viking" I don't know whether it actually makes the connection, because I am still seeing an error, it complaints the table doesn't exists, though it does: 2013-02-13 17:45:56.903600 [INFO] mod_nibblebill.c:498 Beginning new billing on 214e85c3-6286-4aa1-a8bc-5dda6ad0fd44 2013-02-13 17:45:56.903600 [ERR] switch_core_sqldb.c:1124 SQL ERR: [UPDATE sip_users SET balance=balance-0.044817 WHERE id='1'] no such table: sip_users 2013-02-13 17:45:56.903600 [CRIT] mod_nibblebill.c:535 Failed to log to database! 2013-02-13 17:45:56.903600 [ERR] switch_core_sqldb.c:1124 SQL ERR: [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] no such table: sip_users 2013-02-13 17:45:56.903600 [ERR] mod_nibblebill.c:380 Error running this query: [SELECT balance AS nibble_balance FROM sip_users WHERE id='1'] On Wed, Feb 13, 2013 at 6:40 PM, Steven Ayre <steveayre@gmail.com> wrote:
Specifically it's introduced by commit 5c176e8 which was resolving FS-4810, which is indeed adding support for the the generalised DSN interface.
http://fisheye.freeswitch.org/changelog/freeswitch.git?showid=5c176e889d8cc2... http://jira.freeswitch.org/browse/FS-4810
-Steve
On 13 February 2013 17:37, Steven Ayre <steveayre@gmail.com> wrote:
Looks like this difference is brought in by the modifications to support the generalised DSN interface. odbc-dsn would be consistent with all other modules, so I guess that's why it's happened.
But... The HEAD of v1.2.stable understands db_dsn but not odbc-dsn. The HEAD of master understands odbc-dsn but not db_dsn.
This is a configuration breaking behaviour, which doesn't seem to have been documented!
At the very least it'd make sense for the master branch to understand both odbc-dsn and db_dsn for backwards compatibility. I'll file a Jira with a patch (it's a trivial fix) in a moment.
-Steve
On 13 February 2013 17:33, Steven Ayre <steveayre@gmail.com> wrote:
How are you setting the DSN?
The param name mentioned earlier is wrong. Reading the source the correct parameter is "odbc-dsn". Looks like the wiki documentation is incorrect.
-Steve
On 13 February 2013 15:33, David Villasmil < david.villasmil.work@gmail.com> wrote:
hello Avi,
that's right, but nevermind that, that's the output when I was trying something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0 2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database! 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']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi@avimarcus.net> wrote:
Your logs showed the queries run were:
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1' SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
You just tried now.. "WHERE *id*='1' " -- they are not the same query...
-Avi
On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil < david.villasmil.work@gmail.com> wrote:
Hello Rupa,
the query if ok, the user is there:
mysql> select * from sip_users;
+----+----------+----------+----------------+------------+--------------+--------------+ | id | username | password | rateplan | balance | domain | max_channels |
+----+----------+----------+----------------+------------+--------------+--------------+ | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |
+----+----------+----------+----------------+------------+--------------+--------------+ 1 row in set (0.00 sec)
and the actual sql executed by nibblebill:
mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1'; +----------------+ | nibble_balance | +----------------+ | 100.000000 | +----------------+ 1 row in set (0.00 sec)
so that's ok..
any othe ideas?
Thanks a lot for your help!
David
On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa@rupa.com>wrote:
> > On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil < > david.villasmil.work@gmail.com> wrote: > >> call goes out fine... no billing though: >> >> >> 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 >> 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) >> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing >> update query >> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'] >> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to >> log to database! >> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing >> lookup query >> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1'] >> 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'] >> >> >> the select go fine if executed "by hand" >> > > None of those SQL statements are valid. (hint: WHERE = '1' is no > good). Been a while since I hacked/worked with nibblebill, but I'm > pretty sure the 'id' field isn't not being filled in the sql for some > reason. > > > -- > -Rupa > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > FreeSWITCH-users mailing list > FreeSWITCH-users@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE: > http://lists.freeswitch.org/mailman/options/freeswitch-users > http://www.freeswitch.org > >
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Avi Marcus
-
David Villasmil
-
Rupa Schomaker
-
Steven Ayre