diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-02-28 14:42:40 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-28 14:42:40 -0600 |
commit | acb906fa2f913d972e2f70eed2ff5577f8139056 (patch) | |
tree | c202ba91bdc0ca4153cc093bfe8f24e093558a69 | |
parent | 59a00786e87b675ab6320915b297e98ce52754b5 (diff) | |
parent | eac818801b8d566138791550329326ac5c84fb83 (diff) |
Merge "bridge_native_rtp: Handle case where channel joins already suspended." into 13
-rw-r--r-- | bridges/bridge_native_rtp.c | 6 | ||||
-rw-r--r-- | include/asterisk/bridge_technology.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c index a106d2d5f..a80ef4c5a 100644 --- a/bridges/bridge_native_rtp.c +++ b/bridges/bridge_native_rtp.c @@ -131,7 +131,7 @@ static void native_rtp_bridge_start(struct ast_bridge *bridge, struct ast_channe { struct ast_bridge_channel *bc0 = AST_LIST_FIRST(&bridge->channels); struct ast_bridge_channel *bc1 = AST_LIST_LAST(&bridge->channels); - enum ast_rtp_glue_result native_type; + enum ast_rtp_glue_result native_type = AST_RTP_GLUE_RESULT_FORBID; struct ast_rtp_glue *glue0, *glue1; RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup); RAII_VAR(struct ast_rtp_instance *, instance1, NULL, ao2_cleanup); @@ -147,7 +147,9 @@ static void native_rtp_bridge_start(struct ast_bridge *bridge, struct ast_channe } ast_channel_lock_both(bc0->chan, bc1->chan); - native_type = native_rtp_bridge_get(bc0->chan, bc1->chan, &glue0, &glue1, &instance0, &instance1, &vinstance0, &vinstance1); + if (!bc0->suspended && !bc1->suspended) { + native_type = native_rtp_bridge_get(bc0->chan, bc1->chan, &glue0, &glue1, &instance0, &instance1, &vinstance0, &vinstance1); + } switch (native_type) { case AST_RTP_GLUE_RESULT_LOCAL: diff --git a/include/asterisk/bridge_technology.h b/include/asterisk/bridge_technology.h index 7f5d746f8..402b54e98 100644 --- a/include/asterisk/bridge_technology.h +++ b/include/asterisk/bridge_technology.h @@ -110,6 +110,9 @@ struct ast_bridge_technology { * * \note The bridge technology must tollerate 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. */ int (*join)(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel); /*! |