summaryrefslogtreecommitdiff
path: root/res/res_jabber.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2011-06-07 19:17:31 +0000
committerRussell Bryant <russell@russellbryant.com>2011-06-07 19:17:31 +0000
commit87552361935a3b38230a8a4d4691243d56564877 (patch)
tree5df5ff11bf48d2cd994de944a6b347f0b0223369 /res/res_jabber.c
parent5cb2775480b9fa1d20c6e5196388b858720b1cc5 (diff)
Actually check the "sendtodialplan" option setting for xmpp.
(closes issue ASTERISK-17978) Reported by: elguero Patches: stop_messages_going_to_dialplan.patch (license #5026) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r--res/res_jabber.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index ccd5fb2d9..2d0ffcb3a 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -2295,21 +2295,23 @@ static void aji_handle_message(struct aji_client *client, ikspak *pak)
ast_debug(3, "message comes from %s\n", insert->from);
}
- if ((msg = ast_msg_alloc())) {
- int res;
+ if (client->send_to_dialplan) {
+ if ((msg = ast_msg_alloc())) {
+ int res;
- res = ast_msg_set_to(msg, "xmpp:%s", client->user);
- res |= ast_msg_set_from(msg, "xmpp:%s", insert->from);
- res |= ast_msg_set_body(msg, "%s", insert->message);
- res |= ast_msg_set_context(msg, "%s", client->context);
+ res = ast_msg_set_to(msg, "xmpp:%s", client->user);
+ res |= ast_msg_set_from(msg, "xmpp:%s", insert->from);
+ res |= ast_msg_set_body(msg, "%s", insert->message);
+ res |= ast_msg_set_context(msg, "%s", client->context);
- if (res) {
- ast_msg_destroy(msg);
- } else {
- ast_msg_queue(msg);
- }
+ if (res) {
+ ast_msg_destroy(msg);
+ } else {
+ ast_msg_queue(msg);
+ }
- msg = NULL;
+ msg = NULL;
+ }
}
/* remove old messages received from this JID