summaryrefslogtreecommitdiff
path: root/main/features_config.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2016-01-14 14:42:57 -0600
committerKevin Harwell <kharwell@digium.com>2016-01-15 17:45:51 -0600
commit660fedecb7fb723b5fcab8aa9e3f29c0c788e988 (patch)
treebba01634fe9905c757f6da05b3184161b46047e9 /main/features_config.c
parent236896f39172e3f97d69f0a8ab2593ac259d745f (diff)
bridge_basic: don't cache xferfailsound during an attended transfer
The xferfailsound was read from the channel at the beginning of the transfer, and that value is "cached" for the duration of the transfer. Therefore, changing the xferfailsound on the channel using the FEATURE() dialplan function does nothing once the transfer is under way. This makes it so the transfer code instead gets the xferfailsound configuration options from the channel when it is actually going to be used. This patch also fixes a potential memory leak of the props object as well as making sure the condition variable gets initialized before being destroyed. ASTERISK-25696 #close Change-Id: Ic726b0f54ef588bd9c9c67f4b0e4d787934f85e4
Diffstat (limited to 'main/features_config.c')
-rw-r--r--main/features_config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/features_config.c b/main/features_config.c
index 9fed53b32..9126a86c7 100644
--- a/main/features_config.c
+++ b/main/features_config.c
@@ -1158,6 +1158,21 @@ struct ast_features_xfer_config *ast_get_chan_features_xfer_config(struct ast_ch
return cfg->global->xfer;
}
+char *ast_get_chan_features_xferfailsound(struct ast_channel *chan)
+{
+ char *res;
+ struct ast_features_xfer_config *cfg = ast_get_chan_features_xfer_config(chan);
+
+ if (!cfg) {
+ return NULL;
+ }
+
+ res = ast_strdup(cfg->xferfailsound);
+ ao2_ref(cfg, -1);
+
+ return res;
+}
+
struct ast_features_pickup_config *ast_get_chan_features_pickup_config(struct ast_channel *chan)
{
RAII_VAR(struct features_config *, cfg, NULL, ao2_cleanup);