[Asterisk-code-review] app voicemail: Fix data-type mismatch between app voicemail ... (asterisk[13])

Joshua Colp asteriskteam at digium.com
Mon May 21 09:05:38 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/8681 )

Change subject: app_voicemail: Fix data-type mismatch between app_voicemail and database
......................................................................

app_voicemail: Fix data-type mismatch between app_voicemail and database

Fix data-type mismatch between app_voicemail and database columns
exposed by new version of MariaDB

ASTERISK-27760

Change-Id: I8543ad480a08c98be78bde1ee870e6e6c84b2c5b
---
M apps/app_voicemail.c
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Richard Mudgett: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved



diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 86f2873..f5d4b65 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4412,6 +4412,14 @@
 		else
 			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,flag,msg_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)", odbc_table);
 
+		if (ast_strlen_zero(idata.origtime)) {
+			idata.origtime = "0";
+		}
+
+		if (ast_strlen_zero(idata.duration)) {
+			idata.duration = "0";
+		}
+
 		if ((stmt = ast_odbc_direct_execute(obj, insert_data_cb, &idata))) {
 			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
 		} else {

-- 
To view, visit https://gerrit.asterisk.org/8681
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I8543ad480a08c98be78bde1ee870e6e6c84b2c5b
Gerrit-Change-Number: 8681
Gerrit-PatchSet: 6
Gerrit-Owner: Nic Colledge <nic at njcolledge.net>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Nic Colledge <nic at njcolledge.net>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180521/d6b9b48b/attachment.html>


More information about the asterisk-code-review mailing list