mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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 ........ Merged revisions 424691 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1260,7 +1260,7 @@ static int action_messagesend(struct mansession *s, const struct message *m)
|
||||
|
||||
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 @@ static int action_messagesend(struct mansession *s, const struct message *m)
|
||||
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 @@ static int action_messagesend(struct mansession *s, const struct message *m)
|
||||
} 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)
|
||||
|
Reference in New Issue
Block a user