diff options
author | Jonathan Rose <jrose@digium.com> | 2013-08-05 20:18:54 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2013-08-05 20:18:54 +0000 |
commit | 3797639e84a319671ff167306f371394ba9b629a (patch) | |
tree | 1ccc3d73d873ff5478a2d72e93520c07682cbffa /main/bridge_basic.c | |
parent | 80c9ad102e9d42f4918a4c33a712e60c24d89507 (diff) |
bridge features: Dial and Queue add features instead of replace them.
Dial and Queue would previously apply a new set of features whenever
bridging. These options would be based purely on the options supplied
to the dial/queue applications. This patch changes the function those
applications use to bridge calls so that the features will be added
to the set of existing features for each channel rather than having
them override the existing features.
(closes issue ASTERISK-22209)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2713/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/bridge_basic.c')
-rw-r--r-- | main/bridge_basic.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/main/bridge_basic.c b/main/bridge_basic.c index 10c4efb57..35782de28 100644 --- a/main/bridge_basic.c +++ b/main/bridge_basic.c @@ -220,7 +220,7 @@ int ast_bridge_features_ds_get_string(struct ast_channel *chan, char *buffer, si return dtmf_features_flags_to_string(&held_copy, buffer, buf_size); } -int ast_bridge_features_ds_set(struct ast_channel *chan, struct ast_flags *flags) +static int bridge_features_ds_set_full(struct ast_channel *chan, struct ast_flags *flags, int replace) { struct ast_datastore *datastore; struct ast_flags *ds_flags; @@ -228,7 +228,12 @@ int ast_bridge_features_ds_set(struct ast_channel *chan, struct ast_flags *flags datastore = ast_channel_datastore_find(chan, &dtmf_features_info, NULL); if (datastore) { ds_flags = datastore->data; - *ds_flags = *flags; + if (replace) { + *ds_flags = *flags; + } else { + flags->flags = flags->flags | ds_flags->flags; + *ds_flags = *flags; + } return 0; } @@ -249,6 +254,16 @@ int ast_bridge_features_ds_set(struct ast_channel *chan, struct ast_flags *flags return 0; } +int ast_bridge_features_ds_set(struct ast_channel *chan, struct ast_flags *flags) +{ + return bridge_features_ds_set_full(chan, flags, 1); +} + +int ast_bridge_features_ds_append(struct ast_channel *chan, struct ast_flags *flags) +{ + return bridge_features_ds_set_full(chan, flags, 0); +} + struct ast_flags *ast_bridge_features_ds_get(struct ast_channel *chan) { struct ast_datastore *datastore; |