[svn-commits] mjordan: branch 11 r424690 - /branches/11/main/message.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Oct 6 13:36:57 CDT 2014
Author: mjordan
Date: Mon Oct 6 13:36:48 2014
New Revision: 424690
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424690
Log:
message: Don't close an AMI connection on SendMessage action error
If SendMessage encounters an error (such as incorrect input provided to the
action), it will currently return -1. Actions should only return -1 if the
connection to the AMI client should be closed. In this case, SendMessage
causing the client to disconnect is inappropriate.
This patch causes the action to return 0, which simply causes the action to
fail.
Review: https://reviewboard.asterisk.org/r/4024
ASTERISK-24354 #close
Reported by: Peter Katzmann
patches:
sendMessage.patch uploaded by Peter Katzmann (License 5968)
Modified:
branches/11/main/message.c
Modified: branches/11/main/message.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/message.c?view=diff&rev=424690&r1=424689&r2=424690
==============================================================================
--- branches/11/main/message.c (original)
+++ branches/11/main/message.c Mon Oct 6 13:36:48 2014
@@ -1189,7 +1189,7 @@
if (ast_strlen_zero(to)) {
astman_send_error(s, m, "No 'To' address specified.");
- return -1;
+ return 0;
}
if (!ast_strlen_zero(base64body)) {
@@ -1204,13 +1204,13 @@
if (!tech_holder) {
astman_send_error(s, m, "Message technology not found.");
- return -1;
+ return 0;
}
if (!(msg = ast_msg_alloc())) {
ao2_ref(tech_holder, -1);
astman_send_error(s, m, "Internal failure\n");
- return -1;
+ return 0;
}
data = astman_get_variables(m);
@@ -1235,7 +1235,7 @@
} else {
astman_send_ack(s, m, "Message successfully sent");
}
- return res;
+ return 0;
}
int ast_msg_send(struct ast_msg *msg, const char *to, const char *from)
More information about the svn-commits
mailing list