Fix crash from bridge channel hangup race condition in ConfBridge
[asterisk/asterisk.git] / bridges / bridge_builtin_features.c
index 5fdb664..9da02f1 100644 (file)
@@ -123,7 +123,7 @@ static int feature_blind_transfer(struct ast_bridge *bridge, struct ast_bridge_c
        }
 
        /* This is sort of the fun part. We impart the above channel onto the bridge, and have it take our place. */
-       ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL);
+       ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL, 1);
 
        return 0;
 }
@@ -200,7 +200,7 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
        ast_bridge_features_set_flag(&called_features, AST_BRIDGE_FLAG_DISSOLVE);
 
        /* This is how this is going down, we are imparting the channel we called above into this bridge first */
-       ast_bridge_impart(attended_bridge, chan, NULL, &called_features);
+       ast_bridge_impart(attended_bridge, chan, NULL, &called_features, 1);
 
        /* Before we join setup a features structure with the hangup option, just in case they want to use DTMF */
        ast_bridge_features_init(&caller_features);
@@ -222,9 +222,9 @@ static int feature_attended_transfer(struct ast_bridge *bridge, struct ast_bridg
                /* If the user wants to turn this into a threeway transfer then do so, otherwise they take our place */
                if (attended_bridge_result == AST_BRIDGE_CHANNEL_STATE_DEPART) {
                        /* We want to impart them upon the bridge and just have us return to it as normal */
-                       ast_bridge_impart(bridge, chan, NULL, NULL);
+                       ast_bridge_impart(bridge, chan, NULL, NULL, 1);
                } else {
-                       ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL);
+                       ast_bridge_impart(bridge, chan, bridge_channel->chan, NULL, 1);
                }
        } else {
                ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_ANY);