summaryrefslogtreecommitdiff
path: root/pbx
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2012-08-08 22:39:40 +0000
committerMark Michelson <mmichelson@digium.com>2012-08-08 22:39:40 +0000
commiteb9e645a27d0aa4ea300912c22c764b238bc4e47 (patch)
tree49b34c7ea6006b34278d2a16afb705111f922fa3 /pbx
parentee849b461f034f2f19d800542cc3d563b17872a7 (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 'pbx')
-rw-r--r--pbx/pbx_spool.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 43bac620e..d061f356b 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -67,6 +67,8 @@ enum {
SPOOL_FLAG_ALWAYS_DELETE = (1 << 0),
/* Don't unlink the call file after processing, move in qdonedir */
SPOOL_FLAG_ARCHIVE = (1 << 1),
+ /* Connect the channel with the outgoing extension once early media is received */
+ SPOOL_FLAG_EARLY_MEDIA = (1 << 2),
};
static char qdir[255];
@@ -253,6 +255,8 @@ static int apply_outgoing(struct outgoing *o, const char *fn, FILE *f)
ast_set2_flag(&o->options, ast_true(c), SPOOL_FLAG_ALWAYS_DELETE);
} else if (!strcasecmp(buf, "archive")) {
ast_set2_flag(&o->options, ast_true(c), SPOOL_FLAG_ARCHIVE);
+ } else if (!strcasecmp(buf, "early_media")) {
+ ast_set2_flag(&o->options, ast_true(c), SPOOL_FLAG_EARLY_MEDIA);
} else {
ast_log(LOG_WARNING, "Unknown keyword '%s' at line %d of %s\n", buf, lineno, fn);
}
@@ -357,7 +361,8 @@ static void *attempt_thread(void *data)
ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
res = ast_pbx_outgoing_exten(o->tech, o->capabilities, o->dest,
o->waittime * 1000, o->context, o->exten, o->priority, &reason,
- 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+ 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL,
+ ast_test_flag(&o->options, SPOOL_FLAG_EARLY_MEDIA));
o->vars = NULL;
}
if (res) {