[asterisk-commits] mmichelson: branch mmichelson/trunk-digiumphones r365123 - /team/mmichelson/t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 2 14:31:08 CDT 2012


Author: mmichelson
Date: Wed May  2 14:31:04 2012
New Revision: 365123

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=365123
Log:
Fix some errors when trying to store voicemails in ODBC.

I was setting an incorrect variable, and I also did not update the INSERT statement.


Modified:
    team/mmichelson/trunk-digiumphones/apps/app_voicemail.c

Modified: team/mmichelson/trunk-digiumphones/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/trunk-digiumphones/apps/app_voicemail.c?view=diff&rev=365123&r1=365122&r2=365123
==============================================================================
--- team/mmichelson/trunk-digiumphones/apps/app_voicemail.c (original)
+++ team/mmichelson/trunk-digiumphones/apps/app_voicemail.c Wed May  2 14:31:04 2012
@@ -3981,8 +3981,8 @@
 			if (!(idata.flag = ast_variable_retrieve(cfg, "message", "flag"))) {
 				idata.flag = "";
 			}
-			if (!(idata.flag = ast_variable_retrieve(cfg, "message", "msg_id"))) {
-				idata.flag = "";
+			if (!(idata.msg_id = ast_variable_retrieve(cfg, "message", "msg_id"))) {
+				idata.msg_id = "";
 			}
 		}
 		fdlen = lseek(fd, 0, SEEK_END);
@@ -4001,9 +4001,9 @@
 		idata.datalen = idata.indlen = fdlen;
 
 		if (!ast_strlen_zero(idata.category)) 
-			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table); 
+			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id,category) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table); 
 		else
-			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag) VALUES (?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
+			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
 
 		if ((stmt = ast_odbc_direct_execute(obj, insert_data_cb, &idata))) {
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);




More information about the asterisk-commits mailing list