summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/main/features.c b/main/features.c
index 971fb4a02..4acd8aab2 100644
--- a/main/features.c
+++ b/main/features.c
@@ -78,6 +78,7 @@ ASTERISK_REGISTER_FILE()
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/features_config.h"
+#include "asterisk/max_forwards.h"
/*** DOCUMENTATION
<application name="Bridge" language="en_US">
@@ -420,22 +421,6 @@ static void add_features_datastores(struct ast_channel *caller, struct ast_chann
add_features_datastore(callee, &config->features_callee, &config->features_caller);
}
-static void clear_dialed_interfaces(struct ast_channel *chan)
-{
- struct ast_datastore *di_datastore;
-
- ast_channel_lock(chan);
- if ((di_datastore = ast_channel_datastore_find(chan, &dialed_interface_info, NULL))) {
- if (option_debug) {
- ast_log(LOG_DEBUG, "Removing dialed interfaces datastore on %s since we're bridging\n", ast_channel_name(chan));
- }
- if (!ast_channel_datastore_remove(chan, di_datastore)) {
- ast_datastore_free(di_datastore);
- }
- }
- ast_channel_unlock(chan);
-}
-
static void bridge_config_set_limits_warning_values(struct ast_bridge_config *config, struct ast_bridge_features_limits *limits)
{
if (config->end_sound) {
@@ -572,20 +557,13 @@ static int pre_bridge_setup(struct ast_channel *chan, struct ast_channel *peer,
ast_channel_log("Pre-bridge PEER Channel info", peer);
#endif
- /*
- * If we are bridging a call, stop worrying about forwarding
- * loops. We presume that if a call is being bridged, that the
- * humans in charge know what they're doing. If they don't,
- * well, what can we do about that?
- */
- clear_dialed_interfaces(chan);
- clear_dialed_interfaces(peer);
-
res = 0;
ast_channel_lock(chan);
+ ast_max_forwards_reset(chan);
res |= ast_bridge_features_ds_append(chan, &config->features_caller);
ast_channel_unlock(chan);
ast_channel_lock(peer);
+ ast_max_forwards_reset(peer);
res |= ast_bridge_features_ds_append(peer, &config->features_callee);
ast_channel_unlock(peer);