[Home]

Summary:ASTERISK-02305: res_config_odbc, all selects fail
Reporter:jcrowly (jcrowly)Labels:
Date Opened:2004-08-31 09:02:21Date Closed:2011-06-07 14:05:12
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_features
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:From the lastes version check out the CVS, when pull config from the database all select's fail.  I dug into the further and discovered that res_config_odbc calls fetch_odbc_obj and performs SQL requested with the returned structure without ever calling odbc_obj_connect.  Thus all selects fail as obj is not connected to the database.

****** ADDITIONAL INFORMATION ******

Patch that makes it work.
--- res/res_config_odbc.c       (revision 5)
+++ res/res_config_odbc.c       (working copy)
@@ -85,6 +85,8 @@
       if (!obj)
               return NULL;
 
+       odbc_obj_connect(obj);
+
       res = SQLAllocHandle (SQL_HANDLE_STMT, obj->con, &stmt);
 
       SQLBindCol (stmt, 1, SQL_C_ULONG, &id, sizeof (id), &err);
Comments:By: Brian West (bkw918) 2004-08-31 09:14:46

GO look at how res_odbc.c and res_config_odbc.c interact.. you'll notice that you're 100% WRONG!  The object is all res_config_odbc needs since its already pre-connected and we pass around the OBJ(which is really just the silly db handle)

It works flawless here... you must have it setup wrong.. whats your email address?

By: Brian West (bkw918) 2004-08-31 09:19:40

In modules.conf at the very top put load => res_odbc.so then below that put load => res_config_odbc.so

bkw

By: Brian West (bkw918) 2004-08-31 09:20:12

asterisk*CLI> odbc show
asterisk*CLI>



Name: mysql1
DSN: MySQL-asterisk
Connected: yes

By: Brian West (bkw918) 2004-08-31 09:27:20

something else was recently changed.. that broke this.. because its not working like it was a few days ago before I updated..... I think I know what it is.

By: Brian West (bkw918) 2004-08-31 09:35:41

Nope its user error on my end...


asterisk*CLI> load app_queue.so
Loaded /usr/lib/asterisk/modules/app_queue.so => (True Call Queueing)
 == Registered application 'Queue'
 == Manager registered action Queues
 == Manager registered action QueueStatus
 == Manager registered action QueueAdd
 == Manager registered action QueueRemove
 == Registered application 'AddQueueMember'
 == Registered application 'RemoveQueueMember'
Aug 31 09:33:38 NOTICE[278544]: config.c:758 __ast_load: Loading Config queues.conf via odbc engine
 == Parsing '/etc/asterisk/res_config_odbc.conf': Found

By: Mark Spencer (markster) 2004-08-31 09:48:02

What's the story here?

By: Brian West (bkw918) 2004-08-31 10:09:11

Its not a bug.. its a config issue on the users end.. I'll double check it in a few. I'm still dealing with drama.

By: Brian West (bkw918) 2004-08-31 10:23:40

asterisk*CLI> load app_queue.so
Loaded /usr/lib/asterisk/modules/app_queue.so => (True Call Queueing)
 == Registered application 'Queue'
 == Manager registered action Queues
 == Manager registered action QueueStatus
 == Manager registered action QueueAdd
 == Manager registered action QueueRemove
 == Registered application 'AddQueueMember'
 == Registered application 'RemoveQueueMember'
 == Parsing '/etc/asterisk/res_config_odbc.conf': Found

Works with todays CVS without issues.. this is a user error.  Find me on IRC

By: Brian West (bkw918) 2004-08-31 10:48:39

Not a bug find me on IRC I can give you the document that covers this that I will be using at Astricon during our advanced tutorial talk.

Thanks,
Brian