ast_framehook_attach() must be called with the channel locked.
[asterisk/asterisk.git] / main / bridge_basic.c
index 8d7fbae..6c411fb 100644 (file)
@@ -3088,7 +3088,9 @@ static int attach_framehook(struct attended_transfer_properties *props, struct a
        ao2_ref(props, +1);
        target_interface.data = props;
 
+       ast_channel_lock(channel);
        props->target_framehook_id = ast_framehook_attach(channel, &target_interface);
+       ast_channel_unlock(channel);
        if (props->target_framehook_id == -1) {
                ao2_ref(props, -1);
                return -1;