aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 12:32:57 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-14 12:32:57 +0000
commit8890616992e83d3aebd3e6b20ac5e9cf5313e006 (patch)
tree33fa7c9bc63426c37001a6a915951427181aa96e /pbx
parenta4a204165fafb31eb80082d7a96e7687cf9445d5 (diff)
Add support for codec settings in originate via call file and manager.
This is to enable video and text in originated calls. Development sponsored by Omnitor AB, Sweden. (http://www.omnitor.se) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116229 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_spool.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index b297e9a02..793ccde55 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -66,6 +66,7 @@ struct outgoing {
int retrytime; /*!< How long to wait between retries (in seconds) */
int waittime; /*!< How long to wait for an answer */
long callingpid; /*!< PID which is currently calling */
+ int format; /*!< Formats (codecs) for this call */
char tech[256]; /*!< Which channel driver to use for outgoing call */
char dest[256]; /*!< Which device/line to use for outgoing call */
@@ -94,6 +95,7 @@ static void init_outgoing(struct outgoing *o)
o->priority = 1;
o->retrytime = 300;
o->waittime = 45;
+ o->format = AST_FORMAT_SLINEAR;
ast_set_flag(&o->options, SPOOL_FLAG_ALWAYS_DELETE);
}
@@ -165,6 +167,8 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn);
o->maxretries = 0;
}
+ } else if (!strcasecmp(buf, "codecs")) {
+ ast_parse_allow_disallow(NULL, &o->format, c, 1);
} else if (!strcasecmp(buf, "context")) {
ast_copy_string(o->context, c, sizeof(o->context));
} else if (!strcasecmp(buf, "extension")) {
@@ -310,10 +314,10 @@ static void *attempt_thread(void *data)
int res, reason;
if (!ast_strlen_zero(o->app)) {
ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
- res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+ res = ast_pbx_outgoing_app(o->tech, o->format, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
} else {
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, AST_FORMAT_SLINEAR, 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);
+ res = ast_pbx_outgoing_exten(o->tech, o->format, 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);
}
if (res) {
ast_log(LOG_NOTICE, "Call failed to go through, reason (%d) %s\n", reason, ast_channel_reason2str(reason));