summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/bridge_native_rtp.c3
-rw-r--r--include/asterisk/bridge_technology.h4
-rw-r--r--main/bridge_channel.c4
-rw-r--r--res/res_pjsip_pubsub.c8
4 files changed, 15 insertions, 4 deletions
diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c
index a16625892..fc9d70105 100644
--- a/bridges/bridge_native_rtp.c
+++ b/bridges/bridge_native_rtp.c
@@ -600,7 +600,8 @@ static int native_rtp_framehook_consume(void *data, enum ast_frame_type type)
*/
static int native_rtp_bridge_capable(struct ast_channel *chan)
{
- return !ast_channel_has_hook_requiring_audio(chan);
+ return !ast_channel_has_hook_requiring_audio(chan)
+ && ast_channel_state(chan) == AST_STATE_UP;
}
/*!
diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h
index fb275c149..8bac1e3ac 100644
--- a/include/asterisk/bridge_technology.h
+++ b/include/asterisk/bridge_technology.h
@@ -108,11 +108,13 @@ struct ast_bridge_technology {
*
* \note On entry, bridge is already locked.
*
- * \note The bridge technology must tollerate a failed to join channel
+ * \note The bridge technology must tolerate a failed to join channel
* until it can be kicked from the bridge.
*
* \note A channel may be in a suspended state already when joining a bridge
* technology. The technology must handle this case.
+ *
+ * \note A channel may not be answered when joining a bridge technology.
*/
int (*join)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel);
/*!
diff --git a/main/bridge_channel.c b/main/bridge_channel.c
index 875d37da7..7ef418ad5 100644
--- a/main/bridge_channel.c
+++ b/main/bridge_channel.c
@@ -2258,6 +2258,10 @@ static void bridge_channel_handle_control(struct ast_bridge_channel *bridge_chan
case AST_CONTROL_ANSWER:
if (ast_channel_state(chan) != AST_STATE_UP) {
ast_answer(chan);
+ ast_bridge_channel_lock_bridge(bridge_channel);
+ bridge_channel->bridge->reconfigured = 1;
+ bridge_reconfigured(bridge_channel->bridge, 0);
+ ast_bridge_unlock(bridge_channel->bridge);
} else {
ast_indicate(chan, -1);
}
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 81b25ac2e..b0365d9d4 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -3524,10 +3524,12 @@ error:
return PJ_TRUE;
}
+static pjsip_media_type simple_message_summary;
+
static pj_bool_t pubsub_on_rx_notify_request(pjsip_rx_data *rdata)
{
- if (pj_stricmp2(&rdata->msg_info.msg->body->content_type.type, "application") == 0 &&
- pj_stricmp2(&rdata->msg_info.msg->body->content_type.subtype, "simple-message-summary") == 0) {
+ if (rdata->msg_info.msg->body &&
+ pjsip_media_type_cmp(&rdata->msg_info.msg->body->content_type, &simple_message_summary, 0) == 0) {
return pubsub_on_rx_mwi_notify_request(rdata);
}
return PJ_FALSE;
@@ -5363,6 +5365,8 @@ static int load_module(void)
return AST_MODULE_LOAD_DECLINE;
}
+ pjsip_media_type_init2(&simple_message_summary, "application", "simple-message-summary");
+
if (ast_sched_start_thread(sched)) {
ast_log(LOG_ERROR, "Could not start scheduler thread for publication expiration\n");
ast_sched_context_destroy(sched);