summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-04-24 15:59:44 +0000
committerJoshua Colp <jcolp@digium.com>2017-04-27 10:39:46 +0000
commit2b22c3c84b8894c5663fec8655b0670b6bca4078 (patch)
tree119cd5ee07ec1d1ca60ff7c5765f6fd21cce1a28 /apps
parentdc6654d969224129bdd7b4080eda6e027c6454b9 (diff)
channel: Add ability to request an outgoing channel with stream topology.
This change extends the ast_request functionality by adding another function and callback to create an outgoing channel with a requested stream topology. Fallback is provided by either converting the requested stream topology into a format capabilities structure if the channel driver does not support streams or by converting the requested format capabilities into a stream topology if the channel driver does support streams. The Dial application has also been updated to request an outgoing channel with the stream topology of the calling channel. ASTERISK-26959 Change-Id: Ifa9037a672ac21d42dd7125aa09816dc879a70e6
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index c8fcf4696..79e2a9b0b 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -66,6 +66,7 @@
#include "asterisk/bridge_after.h"
#include "asterisk/features_config.h"
#include "asterisk/max_forwards.h"
+#include "asterisk/stream.h"
/*** DOCUMENTATION
<application name="Dial" language="en_US">
@@ -970,16 +971,16 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
- struct ast_format_cap *nativeformats;
+ struct ast_stream_topology *topology;
ast_channel_lock(in);
- nativeformats = ao2_bump(ast_channel_nativeformats(in));
+ topology = ast_stream_topology_clone(ast_channel_get_stream_topology(in));
ast_channel_unlock(in);
/* Setup parameters */
- c = o->chan = ast_request(tech, nativeformats, NULL, in, stuff, &cause);
+ c = o->chan = ast_request_with_stream_topology(tech, topology, NULL, in, stuff, &cause);
- ao2_cleanup(nativeformats);
+ ast_stream_topology_free(topology);
if (c) {
if (single && !caller_entertained) {
@@ -2444,7 +2445,7 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
char *tech = strsep(&number, "/");
size_t tech_len;
size_t number_len;
- struct ast_format_cap *nativeformats;
+ struct ast_stream_topology *topology;
num_dialed++;
if (ast_strlen_zero(number)) {
@@ -2496,13 +2497,13 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
*/
ast_party_connected_line_copy(&tmp->connected, ast_channel_connected(chan));
- nativeformats = ao2_bump(ast_channel_nativeformats(chan));
+ topology = ast_stream_topology_clone(ast_channel_get_stream_topology(chan));
ast_channel_unlock(chan);
- tc = ast_request(tmp->tech, nativeformats, NULL, chan, tmp->number, &cause);
+ tc = ast_request_with_stream_topology(tmp->tech, topology, NULL, chan, tmp->number, &cause);
- ao2_cleanup(nativeformats);
+ ast_stream_topology_free(topology);
if (!tc) {
/* If we can't, just go on to the next call */