diff options
author | Mark Michelson <mmichelson@digium.com> | 2012-08-08 22:39:40 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2012-08-08 22:39:40 +0000 |
commit | eb9e645a27d0aa4ea300912c22c764b238bc4e47 (patch) | |
tree | 49b34c7ea6006b34278d2a16afb705111f922fa3 /main/channel.c | |
parent | ee849b461f034f2f19d800542cc3d563b17872a7 (diff) |
Allow support for early media on AMI originates and call files.
This is based on the work done by Olle Johansson on review board.
The idea is that the channel specified in an AMI originate or call
file is typically not connected to the outgoing extension until the
channel has been answered. With this change, an EarlyMedia header can
be specified for AMI originates and an early_media option can
be specified in call files. With this option set, once early media is
received on a channel, it will be connected with the outgoing extension.
(closes issue ASTERISK-18644)
Reported by Olle Johansson
Review: https://reviewboard.asterisk.org/r/1472
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index f7e9d631a..d5f1d31c1 100644 --- a/main/channel.c +++ b/main/channel.c @@ -5620,8 +5620,14 @@ struct ast_channel *__ast_request_and_dial(const char *type, struct ast_format_c ast_channel_hangupcause_hash_set(chan, f->data.ptr, f->datalen); break; - /* Ignore these */ case AST_CONTROL_PROGRESS: + if (oh && oh->connect_on_early_media) { + *outstate = f->subclass.integer; + timeout = 0; /* trick to force exit from the while() */ + break; + } + /* Fallthrough */ + /* Ignore these */ case AST_CONTROL_PROCEEDING: case AST_CONTROL_HOLD: case AST_CONTROL_UNHOLD: |