Hello, I've been trying to move some of my static configs into a MySQL database. I have been trying with sip.conf and voicemail.conf, can't seem to get it to work although it says it is loading the config via res_odbc fine. Here's what I did, if someone can't point out my error, I would be grateful. Setup up UnixODBC, verified I could connect to my database through it, with the test application, all worked fine. I then setup res_odbc.conf in /etc/asterisk, like so [mysql] dsn => MySQL-voicemail username => dbuser password => dbpass pre-connect => yes I setup /etc/asterisk/extconfig.conf with the following info. [settings] ; file.conf => driver,database[,table] sip.conf => odbc,accounting,sipusers I removed sip.conf from /etc/asterisk I setup my database called accounting, with data in the table sipusers sipusers table layout name | host | context | ipaddr | port | regseconds | callerid | username | md5secret Then I start up asterisk with asterisk -vvvv and see the following Oct 15 15:18:54 NOTICE[1077037376]: config.c:556 ast_config_register: Registered Config Engine odbc == Parsing '/etc/asterisk/extconfig.conf': Found == Binding sip.conf to mysql/accounting/sipusers res_config_odbc loaded. Which looks good I think, until the end, and chan_sip.so fails to load and sip doesn't run. [chan_sip.so] => (Session Initiation Protocol (SIP)) == Parsing '/etc/asterisk/sip.conf': Not found (No such file or directory) Oct 15 15:23:21 NOTICE[1077037376]: chan_sip.c:8432 reload_config: Unable to load config sip.conf, SIP disabled I tried setting up voicemail.conf with similar errors, both voicemail and sip work fine when accessed from flatfiles. Regards Michael Baird
You must still have a sip.conf with the [general] section. bkw> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Michael Baird > Sent: Friday, October 15, 2004 2:30 PM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] res_odbc app_realtime > > Hello, I've been trying to move some of my static configs into a MySQL > database. I have been trying with sip.conf and voicemail.conf, can't > seem to get it to work although it says it is loading the config via > res_odbc fine. Here's what I did, if someone can't point out my error, I > would be grateful. > > Setup up UnixODBC, verified I could connect to my database through it, > with the test application, all worked fine. > > I then setup res_odbc.conf in /etc/asterisk, like so > [mysql] > dsn => MySQL-voicemail > username => dbuser > password => dbpass > pre-connect => yes > > I setup /etc/asterisk/extconfig.conf with the following info. > [settings] > ; file.conf => driver,database[,table] > sip.conf => odbc,accounting,sipusers > > I removed sip.conf from /etc/asterisk > > I setup my database called accounting, with data in the table sipusers > > sipusers table layout > > name | host | context | ipaddr | port | regseconds | callerid | username > | md5secret > > Then I start up asterisk with asterisk -vvvv and see the following > > Oct 15 15:18:54 NOTICE[1077037376]: config.c:556 ast_config_register: > Registered Config Engine odbc > == Parsing '/etc/asterisk/extconfig.conf': Found > == Binding sip.conf to mysql/accounting/sipusers > res_config_odbc loaded. > > Which looks good I think, until the end, and chan_sip.so fails to load > and sip doesn't run. > > [chan_sip.so] => (Session Initiation Protocol (SIP)) > == Parsing '/etc/asterisk/sip.conf': Not found (No such file or > directory) > Oct 15 15:23:21 NOTICE[1077037376]: chan_sip.c:8432 reload_config: > Unable to load config sip.conf, SIP disabled > > I tried setting up voicemail.conf with similar errors, both voicemail > and sip work fine when accessed from flatfiles. > > Regards > Michael Baird > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
>From what I have seen, that is the wrong table layout for using res_odbc andstoring *.conf files. Should be more like this: http://www.voip-info.org/wiki-Asterisk+res_config If you want to use RealTime and MySQL, I have developed (the only) a native RealTime driver for MySQL. It bypasses ODBC and makes calls directly to mysql. http://bugs.digium.com/bug_view_page.php?bug_id=0002613 It should be noted that RealTime is currently in development and not recommened for prod servers. Matthew ----- Original Message ----- From: "Michael Baird" <mike@tc3net.com> To: <asterisk-users@lists.digium.com> Sent: Friday, October 15, 2004 2:29 PM Subject: [Asterisk-Users] res_odbc app_realtime> Hello, I've been trying to move some of my static configs into a MySQL > database. I have been trying with sip.conf and voicemail.conf, can't > seem to get it to work although it says it is loading the config via > res_odbc fine. Here's what I did, if someone can't point out my error, I > would be grateful. > > Setup up UnixODBC, verified I could connect to my database through it, > with the test application, all worked fine. > > I then setup res_odbc.conf in /etc/asterisk, like so > [mysql] > dsn => MySQL-voicemail > username => dbuser > password => dbpass > pre-connect => yes > > I setup /etc/asterisk/extconfig.conf with the following info. > [settings] > ; file.conf => driver,database[,table] > sip.conf => odbc,accounting,sipusers > > I removed sip.conf from /etc/asterisk > > I setup my database called accounting, with data in the table sipusers > > sipusers table layout > > name | host | context | ipaddr | port | regseconds | callerid | username > | md5secret > > Then I start up asterisk with asterisk -vvvv and see the following > > Oct 15 15:18:54 NOTICE[1077037376]: config.c:556 ast_config_register: > Registered Config Engine odbc > == Parsing '/etc/asterisk/extconfig.conf': Found > == Binding sip.conf to mysql/accounting/sipusers > res_config_odbc loaded. > > Which looks good I think, until the end, and chan_sip.so fails to load > and sip doesn't run. > > [chan_sip.so] => (Session Initiation Protocol (SIP)) > == Parsing '/etc/asterisk/sip.conf': Not found (No such file or > directory) > Oct 15 15:23:21 NOTICE[1077037376]: chan_sip.c:8432 reload_config: > Unable to load config sip.conf, SIP disabled > > I tried setting up voicemail.conf with similar errors, both voicemail > and sip work fine when accessed from flatfiles. > > Regards > Michael Baird > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Hmmm, I have been working on similar. I thought that while some of the SIP information is in the database there are still parameters Asterisk is looking for in the sip.conf. Looking at the code just now chan_sip.c first looks to the sip.conf to obtain settings. Once Asterisk sip channel has opened sip.conf and is reading things the code then turns to the DB to read items. The DB reads are sprinkled around the file. Bad Example: /*--- find_user: Locate user by name */ static struct sip_user *find_user(char *name) { struct sip_user *u = NULL; u = userl.users; while(u) { if (!strcasecmp(u->name, name)) { break; } u = u->next; } #ifdef MYSQL_USERS if (!u) { u = mysql_user(name); } #endif /* MYSQL_USERS */ return(u); } So, if sip.conf is not there, Asterisk will not read the DB tables, because the code to read the DB tables is inside the code to read the sip.conf information. I hope this helps. If you need code changes, please let me know. My fees are reasonable and I like doing very small, 4-40 hour, projects. Race Vanderdecken -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Michael Baird Sent: 15 October 2004 15:30 To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] res_odbc app_realtime Hello, I've been trying to move some of my static configs into a MySQL database. I have been trying with sip.conf and voicemail.conf, can't seem to get it to work although it says it is loading the config via res_odbc fine. Here's what I did, if someone can't point out my error, I would be grateful. Setup up UnixODBC, verified I could connect to my database through it, with the test application, all worked fine. I then setup res_odbc.conf in /etc/asterisk, like so [mysql] dsn => MySQL-voicemail username => dbuser password => dbpass pre-connect => yes I setup /etc/asterisk/extconfig.conf with the following info. [settings] ; file.conf => driver,database[,table] sip.conf => odbc,accounting,sipusers I removed sip.conf from /etc/asterisk I setup my database called accounting, with data in the table sipusers sipusers table layout name | host | context | ipaddr | port | regseconds | callerid | username | md5secret Then I start up asterisk with asterisk -vvvv and see the following Oct 15 15:18:54 NOTICE[1077037376]: config.c:556 ast_config_register: Registered Config Engine odbc == Parsing '/etc/asterisk/extconfig.conf': Found == Binding sip.conf to mysql/accounting/sipusers res_config_odbc loaded. Which looks good I think, until the end, and chan_sip.so fails to load and sip doesn't run. [chan_sip.so] => (Session Initiation Protocol (SIP)) == Parsing '/etc/asterisk/sip.conf': Not found (No such file or directory) Oct 15 15:23:21 NOTICE[1077037376]: chan_sip.c:8432 reload_config: Unable to load config sip.conf, SIP disabled I tried setting up voicemail.conf with similar errors, both voicemail and sip work fine when accessed from flatfiles. Regards Michael Baird _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Race Vanderdecken wrote:> Hmmm, > > I have been working on similar. I thought that while some of the SIP > information is in the database there are still parameters Asterisk is > looking for in the sip.conf....but with res_config, sip.conf may be loaded from a database. Do not mix res_config database static config with realtime peer/user storage. We desperately need to doc this, continue what Matt started. /O