aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-30 19:36:20 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-30 19:36:20 +0000
commit63100fa285e9bab86130b4493b18643ee0603b87 (patch)
tree3343177b648c5852e2f26afb93d692ae4a333d66
parent75d34a25ec28dec0258632d391f506c0dc8e932c (diff)
Properly terminate AMI JabberSend response messages.
The response message (either Error or Success) needs an extra trailing \r\n after the fields to inform the client that the message is complete. (closes issue #14876) Reported by: srt Patches: 05302009_1.4_res_jabber.c.diff uploaded by seanbright (license 71) asterisk_14876.patch uploaded by srt (license 378) trunk-14876-2.diff uploaded by phsultan (license 73) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@198370 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_jabber.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 0079ee9ff..d1729f179 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -2423,16 +2423,16 @@ static int manager_jabber_send(struct mansession *s, const struct message *m)
astman_send_error(s, m, "Could not find Sender");
return 0;
}
- if (strchr(screenname, '@') && message){
- ast_aji_send(client, screenname, message);
- if (!ast_strlen_zero(id))
- astman_append(s, "ActionID: %s\r\n",id);
+ if (strchr(screenname, '@') && message) {
+ ast_aji_send(client, screenname, message);
astman_append(s, "Response: Success\r\n");
- return 0;
+ } else {
+ astman_append(s, "Response: Failure\r\n");
+ }
+ if (!ast_strlen_zero(id)) {
+ astman_append(s, "ActionID: %s\r\n", id);
}
- if (!ast_strlen_zero(id))
- astman_append(s, "ActionID: %s\r\n",id);
- astman_append(s, "Response: Failure\r\n");
+ astman_append(s, "\r\n");
return 0;
}