diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-05-24 20:44:07 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-05-24 20:44:07 +0000 |
commit | 06be8463b683333c79845402d55168ef1b582fa9 (patch) | |
tree | 2fe0871cfec4d5edf3aae763541ff7efa32a444a /res/res_xmpp.c | |
parent | c1b51fd2654736fd7c614d1571f904e236006651 (diff) |
Migrate a large number of AMI events over to Stasis-Core
This patch moves a number of AMI events over to the Stasis-Core message bus.
This includes:
* ChanSpyStart/Stop
* MonitorStart/Stop
* MusicOnHoldStart/Stop
* FullyBooted/Reload
* All Voicemail/MWI related events
In addition, it adds some Stasis-Core and AMI support for generic AMI messages,
refactors the message router in AMI to use a single router with topic
forwarding for the topics that AMI cares about, and refactors MWI message
types and topics to be more name compliant.
Review: https://reviewboard.asterisk.org/r/2532
(closes issue ASTERISK-21462)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_xmpp.c')
-rw-r--r-- | res/res_xmpp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/res/res_xmpp.c b/res/res_xmpp.c index dea837204..89eb45d18 100644 --- a/res/res_xmpp.c +++ b/res/res_xmpp.c @@ -1324,9 +1324,9 @@ static void xmpp_pubsub_mwi_cb(void *data, struct stasis_subscription *sub, stru struct ast_xmpp_client *client = data; const char *mailbox, *context; char oldmsgs[10], newmsgs[10]; - struct stasis_mwi_state *mwi_state; + struct ast_mwi_state *mwi_state; - if (!stasis_subscription_is_subscribed(sub) || stasis_mwi_state_type() != stasis_message_type(msg)) { + if (!stasis_subscription_is_subscribed(sub) || ast_mwi_state_type() != stasis_message_type(msg)) { return; } @@ -1484,7 +1484,7 @@ static int xmpp_pubsub_handle_event(void *data, ikspak *pak) sscanf(iks_find_cdata(item_content, "OLDMSGS"), "%10d", &oldmsgs); sscanf(iks_find_cdata(item_content, "NEWMSGS"), "%10d", &newmsgs); - stasis_publish_mwi_state_full(item_id, context, newmsgs, oldmsgs, &pubsub_eid); + ast_publish_mwi_state_full(item_id, context, newmsgs, oldmsgs, NULL, &pubsub_eid); return IKS_FILTER_EAT; } else { @@ -1596,7 +1596,7 @@ static void xmpp_init_event_distribution(struct ast_xmpp_client *client) xmpp_pubsub_unsubscribe(client, "device_state"); xmpp_pubsub_unsubscribe(client, "message_waiting"); - if (!(client->mwi_sub = stasis_subscribe(stasis_mwi_topic_all(), xmpp_pubsub_mwi_cb, client))) { + if (!(client->mwi_sub = stasis_subscribe(ast_mwi_topic_all(), xmpp_pubsub_mwi_cb, client))) { return; } @@ -2546,10 +2546,6 @@ static void xmpp_log_hook(void *data, const char *xmpp, size_t size, int incomin RAII_VAR(struct ast_xmpp_client_config *, clientcfg, NULL, ao2_cleanup); struct ast_xmpp_client *client = data; - if (!ast_strlen_zero(xmpp)) { - manager_event(EVENT_FLAG_USER, "JabberEvent", "Account: %s\r\nPacket: %s\r\n", client->name, xmpp); - } - if (!debug && (!cfg || !cfg->clients || !(clientcfg = xmpp_config_find(cfg->clients, client->name)) || !ast_test_flag(&clientcfg->flags, XMPP_DEBUG))) { return; } |