[asterisk-commits] file: trunk r40033 - in /trunk: ./ apps/ doc/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Aug 16 09:22:14 MST 2006
Author: file
Date: Wed Aug 16 11:22:13 2006
New Revision: 40033
URL: http://svn.digium.com/view/asterisk?rev=40033&view=rev
Log:
Remove the old ODBC_STORAGE and make EXTENDED_ODBC_STORAGE the one to use. This means that if you're using this and upgrade to the revision where this was committed, you will need to update your table to the schema provided in doc/odbcstorage.txt
Modified:
trunk/UPGRADE.txt
trunk/apps/app_voicemail.c
trunk/doc/odbcstorage.txt
Modified: trunk/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/trunk/UPGRADE.txt?rev=40033&r1=40032&r2=40033&view=diff
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Wed Aug 16 11:22:13 2006
@@ -197,6 +197,10 @@
exit code, the AGISTATUS variable will be set to "FAILURE" as opposed to
"SUCCESS".
+* app_voicemail: The ODBC_STORAGE capability now requires the extended table format
+ previously used only by EXTENDED_ODBC_STORAGE. This means that you will need to update
+ your table format using the schema provided in doc/odbcstorage.txt
+
Manager:
* After executing the 'status' manager action, the "Status" manager events
Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=40033&r1=40032&r2=40033&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Aug 16 11:22:13 2006
@@ -31,10 +31,6 @@
/*** MAKEOPTS
<category name="MENUSELECT_OPTS_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" remove_on_change="apps/app_voicemail.o">
<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
- <depend>unixodbc</depend>
- <defaultenabled>no</defaultenabled>
- </member>
- <member name="EXTENDED_ODBC_STORAGE" displayname="Storage of Voicemail using ODBC (extended)">
<depend>unixodbc</depend>
<defaultenabled>no</defaultenabled>
</member>
@@ -1330,11 +1326,7 @@
odbc_release_obj(obj);
goto yuck;
}
-#ifdef EXTENDED_ODBC_STORAGE
snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, context, macrocontext, callerid, origtime, duration, recording, mailboxuser, mailboxcontext) SELECT ?,?,context,macrocontext,callerid,origtime,duration,recording,?,? FROM %s WHERE dir=? AND msgnum=?",odbc_table,odbc_table);
-#else
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, context, macrocontext, callerid, origtime, duration, recording) SELECT ?,?,context,macrocontext,callerid,origtime,duration,recording FROM %s WHERE dir=? AND msgnum=?",odbc_table,odbc_table);
-#endif
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1344,15 +1336,10 @@
}
SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(ddir), 0, (void *)ddir, 0, NULL);
SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnumd), 0, (void *)msgnumd, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dmailboxuser), 0, (void *)dmailboxuser, 0, NULL);
SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dmailboxcontext), 0, (void *)dmailboxcontext, 0, NULL);
SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#else
- SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
- SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#endif
res = odbc_smart_execute(obj, stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s] (You probably don't have MySQL 4.1 or later installed)\n\n", sql);
@@ -1441,17 +1428,9 @@
goto yuck;
}
if (!ast_strlen_zero(category))
-#ifdef EXTENDED_ODBC_STORAGE
snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,category) VALUES (?,?,?,?,?,?,?,?,?,?,?)",odbc_table);
-#else
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,category) VALUES (?,?,?,?,?,?,?,?,?)",odbc_table);
-#endif
else
-#ifdef EXTENDED_ODBC_STORAGE
snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext) VALUES (?,?,?,?,?,?,?,?,?,?)",odbc_table);
-#else
- snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration) VALUES (?,?,?,?,?,?,?,?)",odbc_table);
-#endif
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1468,15 +1447,10 @@
SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(callerid), 0, (void *)callerid, 0, NULL);
SQLBindParameter(stmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(origtime), 0, (void *)origtime, 0, NULL);
SQLBindParameter(stmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(duration), 0, (void *)duration, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
SQLBindParameter(stmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxuser), 0, (void *)mailboxuser, 0, NULL);
SQLBindParameter(stmt, 10, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxcontext), 0, (void *)mailboxcontext, 0, NULL);
if (!ast_strlen_zero(category))
SQLBindParameter(stmt, 11, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(category), 0, (void *)category, 0, NULL);
-#else
- if (!ast_strlen_zero(category))
- SQLBindParameter(stmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(category), 0, (void *)category, 0, NULL);
-#endif
res = odbc_smart_execute(obj, stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -1518,11 +1492,7 @@
odbc_release_obj(obj);
goto yuck;
}
-#ifdef EXTENDED_ODBC_STORAGE
snprintf(sql, sizeof(sql), "UPDATE %s SET dir=?, msgnum=?, mailboxuser=?, mailboxcontext=? WHERE dir=? AND msgnum=?",odbc_table);
-#else
- snprintf(sql, sizeof(sql), "UPDATE %s SET dir=?, msgnum=? WHERE dir=? AND msgnum=?",odbc_table);
-#endif
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1532,15 +1502,10 @@
}
SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(ddir), 0, (void *)ddir, 0, NULL);
SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnumd), 0, (void *)msgnumd, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxuser), 0, (void *)mailboxuser, 0, NULL);
SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxcontext), 0, (void *)mailboxcontext, 0, NULL);
SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#else
- SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
- SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#endif
res = odbc_smart_execute(obj, stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -7407,13 +7372,6 @@
ast_install_vm_functions(has_voicemail, inboxcount, messagecount);
-#if defined(ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
- ast_log(LOG_WARNING, "The current ODBC storage table format will be changed soon."
- "Please update your tables as per the README and edit the apps/Makefile "
- "and uncomment the line containing EXTENDED_ODBC_STORAGE to enable the "
- "new table format.\n");
-#endif
-
return res;
}
Modified: trunk/doc/odbcstorage.txt
URL: http://svn.digium.com/view/asterisk/trunk/doc/odbcstorage.txt?rev=40033&r1=40032&r2=40033&view=diff
==============================================================================
--- trunk/doc/odbcstorage.txt (original)
+++ trunk/doc/odbcstorage.txt Wed Aug 16 11:22:13 2006
@@ -16,13 +16,10 @@
| callerid | varchar(40) | YES | | NULL | |
| origtime | varchar(40) | YES | | NULL | |
| duration | varchar(20) | YES | | NULL | |
-| mailboxuser | varchar(80) | YES | | NULL | |*
-| mailboxcontext | varchar(80) | YES | | NULL | |*
+| mailboxuser | varchar(80) | YES | | NULL | |
+| mailboxcontext | varchar(80) | YES | | NULL | |
| recording | longblob | YES | | NULL | |
+----------------+-------------+------+-----+---------+-------+
-
-*=Denotes new fieldnames, define EXTENDED_ODBC_STORAGE in
-apps/Makefile to enable the functionality.
The database name (from /etc/asterisk/res_odbc.conf) is in the
"odbcstorage" variable in the general section of voicemail.conf.
More information about the asterisk-commits
mailing list