diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_dahdi.c | 14 | ||||
-rw-r--r-- | channels/chan_iax2.c | 12 | ||||
-rw-r--r-- | channels/chan_mgcp.c | 14 | ||||
-rw-r--r-- | channels/chan_sip.c | 2 | ||||
-rw-r--r-- | channels/chan_skinny.c | 2 | ||||
-rw-r--r-- | channels/sig_pri.c | 2 |
6 files changed, 17 insertions, 29 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 6958e5be5..953561ce4 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -600,14 +600,6 @@ static int restart_monitor(void); static int dahdi_sendtext(struct ast_channel *c, const char *text); -static void mwi_event_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) -{ - /* This module does not handle MWI in an event-based manner. However, it - * subscribes to MWI for each mailbox that is configured so that the core - * knows that we care about it. Then, chan_dahdi will get the MWI from the - * event cache instead of checking the mailbox directly. */ -} - /*! \brief Avoid the silly dahdi_getevent which ignores a bunch of events */ static inline int dahdi_get_event(int fd) { @@ -12594,7 +12586,11 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, mailbox_specific_topic = ast_mwi_topic(tmp->mailbox); if (mailbox_specific_topic) { - tmp->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, mwi_event_cb, NULL); + /* This module does not handle MWI in an event-based manner. However, it + * subscribes to MWI for each mailbox that is configured so that the core + * knows that we care about it. Then, chan_dahdi will get the MWI from the + * event cache instead of checking the mailbox directly. */ + tmp->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, stasis_subscription_cb_noop, NULL); } } #ifdef HAVE_DAHDI_LINEREVERSE_VMWI diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a5f86e188..dc30d9fe7 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1438,13 +1438,6 @@ static int iax2_is_control_frame_allowed(int subtype) return is_allowed; } -static void mwi_event_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) -{ - /* The MWI subscriptions exist just so the core knows we care about those - * mailboxes. However, we just grab the events out of the cache when it - * is time to send MWI, since it is only sent with a REGACK. */ -} - static void network_change_stasis_subscribe(void) { if (!network_change_sub) { @@ -13029,7 +13022,10 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st mailbox_specific_topic = ast_mwi_topic(peer->mailbox); if (mailbox_specific_topic) { - peer->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, mwi_event_cb, NULL); + /* The MWI subscriptions exist just so the core knows we care about those + * mailboxes. However, we just grab the events out of the cache when it + * is time to send MWI, since it is only sent with a REGACK. */ + peer->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, stasis_subscription_cb_noop, NULL); } } diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 08c4dc2e2..b75cd43af 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -489,14 +489,6 @@ static struct ast_channel_tech mgcp_tech = { .func_channel_read = acf_channel_read, }; -static void mwi_event_cb(void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) -{ - /* This module does not handle MWI in an event-based manner. However, it - * subscribes to MWI for each mailbox that is configured so that the core - * knows that we care about it. Then, chan_mgcp will get the MWI from the - * event cache instead of checking the mailbox directly. */ -} - static int has_voicemail(struct mgcp_endpoint *p) { int new_msgs; @@ -4237,7 +4229,11 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) mailbox_specific_topic = ast_mwi_topic(e->mailbox); if (mailbox_specific_topic) { - e->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, mwi_event_cb, NULL); + /* This module does not handle MWI in an event-based manner. However, it + * subscribes to MWI for each mailbox that is configured so that the core + * knows that we care about it. Then, chan_mgcp will get the MWI from the + * event cache instead of checking the mailbox directly. */ + e->mwi_event_sub = stasis_subscribe_pool(mailbox_specific_topic, stasis_subscription_cb_noop, NULL); } } snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", (unsigned long)ast_random()); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1307a9342..b1fbd6e9b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5004,7 +5004,7 @@ static void register_peer_exten(struct sip_peer *peer, int onoff) static void destroy_mailbox(struct sip_mailbox *mailbox) { if (mailbox->event_sub) { - mailbox->event_sub = stasis_unsubscribe(mailbox->event_sub); + mailbox->event_sub = stasis_unsubscribe_and_join(mailbox->event_sub); } ast_free(mailbox); } diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index ed82c7d1f..be9f9b67e 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -8749,7 +8749,7 @@ static int unload_module(void) skinny_unlocksub(sub); } if (l->mwi_event_sub) { - l->mwi_event_sub = stasis_unsubscribe(l->mwi_event_sub); + l->mwi_event_sub = stasis_unsubscribe_and_join(l->mwi_event_sub); } ast_mutex_unlock(&l->lock); unregister_exten(l); diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 2815dac13..4b9139101 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -8991,7 +8991,7 @@ void sig_pri_stop_pri(struct sig_pri_span *pri) #if defined(HAVE_PRI_MWI) for (idx = 0; idx < ARRAY_LEN(pri->mbox); ++idx) { if (pri->mbox[idx].sub) { - pri->mbox[idx].sub = stasis_unsubscribe(pri->mbox[idx].sub); + pri->mbox[idx].sub = stasis_unsubscribe_and_join(pri->mbox[idx].sub); } } #endif /* defined(HAVE_PRI_MWI) */ |