Author: mjordan
Date: Mon Oct  6 13:37:13 2014
New Revision: 424691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424691
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)
........

Merged revisions 424690 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/main/message.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/main/message.c
URL: 
http://svnview.digium.com/svn/asterisk/branches/12/main/message.c?view=diff&rev=424691&r1=424690&r2=424691
==============================================================================
--- branches/12/main/message.c (original)
+++ branches/12/main/message.c Mon Oct  6 13:37:13 2014
@@ -1260,7 +1260,7 @@
 
        if (ast_strlen_zero(to)) {
                astman_send_error(s, m, "No 'To' address specified.");
-               return -1;
+               return 0;
        }
 
        if (!ast_strlen_zero(base64body)) {
@@ -1282,7 +1282,7 @@
        if (!(msg = ast_msg_alloc())) {
                ast_rwlock_unlock(&msg_techs_lock);
                astman_send_error(s, m, "Internal failure\n");
-               return -1;
+               return 0;
        }
 
        data = astman_get_variables_order(m, ORDER_NATURAL);
@@ -1304,7 +1304,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)


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to