Restore Dial, Queue, and FollowMe 'I' option support.
[asterisk/asterisk.git] / res / parking / parking_bridge_features.c
index 5ad0538..0e5e05d 100644 (file)
@@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/stasis.h"
 #include "asterisk/module.h"
 #include "asterisk/core_local.h"
 #include "asterisk/stasis.h"
 #include "asterisk/module.h"
 #include "asterisk/core_local.h"
+#include "asterisk/causes.h"
 
 struct parked_subscription_datastore {
        struct stasis_subscription *parked_subscription;
 
 struct parked_subscription_datastore {
        struct stasis_subscription *parked_subscription;
@@ -315,7 +316,8 @@ static int parking_blind_transfer_park(struct ast_bridge_channel *bridge_channel
                        return -1;
                }
 
                        return -1;
                }
 
-               if (ast_bridge_impart(bridge_channel->bridge, transfer_chan, NULL, NULL, 1)) {
+               if (ast_bridge_impart(bridge_channel->bridge, transfer_chan, NULL, NULL,
+                       AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
                        ast_hangup(transfer_chan);
                        return -1;
                }
                        ast_hangup(transfer_chan);
                        return -1;
                }
@@ -483,7 +485,8 @@ static int parking_duration_callback(struct ast_bridge_channel *bridge_channel,
        user->resolution = PARK_TIMEOUT;
        ao2_unlock(user);
 
        user->resolution = PARK_TIMEOUT;
        ao2_unlock(user);
 
-       ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE);
+       ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE,
+               AST_CAUSE_NORMAL_CLEARING);
 
        /* Set parking timeout channel variables */
        snprintf(parking_space, sizeof(parking_space), "%d", user->parking_space);
 
        /* Set parking timeout channel variables */
        snprintf(parking_space, sizeof(parking_space), "%d", user->parking_space);
@@ -571,14 +574,17 @@ void say_parking_space(struct ast_bridge_channel *bridge_channel, const char *pa
        if (sscanf(payload, "%u %u", &hangup_after, &numeric_value) != 2) {
                /* If say_parking_space is called with a non-numeric string, we have a problem. */
                ast_assert(0);
        if (sscanf(payload, "%u %u", &hangup_after, &numeric_value) != 2) {
                /* If say_parking_space is called with a non-numeric string, we have a problem. */
                ast_assert(0);
-               ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE);
+               ast_bridge_channel_leave_bridge(bridge_channel,
+                       BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, AST_CAUSE_NORMAL_CLEARING);
                return;
        }
 
                return;
        }
 
-       ast_say_digits(bridge_channel->chan, numeric_value, "", ast_channel_language(bridge_channel->chan));
+       ast_say_digits(bridge_channel->chan, numeric_value, "",
+               ast_channel_language(bridge_channel->chan));
 
        if (hangup_after) {
 
        if (hangup_after) {
-               ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE);
+               ast_bridge_channel_leave_bridge(bridge_channel,
+                       BRIDGE_CHANNEL_STATE_END_NO_DISSOLVE, AST_CAUSE_NORMAL_CLEARING);
        }
 }
 
        }
 }