diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-31 21:58:26 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-31 21:58:26 +0000 |
commit | 85b4942553deee4b864bbb2fd206b72eccf5480b (patch) | |
tree | b2c3e813c1260fd0eb60b1a12ccc5e2518c3ebec /main/manager.c | |
parent | 9afaadfdb0107999cd3ae91272fb5ac102c01aa3 (diff) |
Merged revisions 134980 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r134980 | tilghman | 2008-07-31 16:55:42 -0500 (Thu, 31 Jul 2008) | 16 lines
Blocked revisions 134976 via svnmerge
........
r134976 | tilghman | 2008-07-31 16:53:19 -0500 (Thu, 31 Jul 2008) | 9 lines
Specify codecs in callfiles and manager, to allow video calls to be set up
from callfiles and AMI.
(closes issue #9531)
Reported by: Geisj
Patches:
20080715__bug9531__1.4.diff.txt uploaded by Corydon76 (license 14)
20080715__bug9531__1.6.0.diff.txt uploaded by Corydon76 (license 14)
Tested by: Corydon76
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@134981 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/main/manager.c b/main/manager.c index 3713c6d1d..0cd863dcb 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2037,11 +2037,12 @@ static int action_command(struct mansession *s, const struct message *m) return 0; } -/* helper function for originate */ +/*! \brief helper function for originate */ struct fast_originate_helper { char tech[AST_MAX_EXTENSION]; char data[AST_MAX_EXTENSION]; int timeout; + int format; /*!< Codecs used for a call */ char app[AST_MAX_APP]; char appdata[AST_MAX_EXTENSION]; char cid_name[AST_MAX_EXTENSION]; @@ -2063,12 +2064,12 @@ static void *fast_originate(void *data) char requested_channel[AST_CHANNEL_NAME]; if (!ast_strlen_zero(in->app)) { - res = ast_pbx_outgoing_app(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->app, in->appdata, &reason, 1, + res = ast_pbx_outgoing_app(in->tech, in->format, in->data, in->timeout, in->app, in->appdata, &reason, 1, S_OR(in->cid_num, NULL), S_OR(in->cid_name, NULL), in->vars, in->account, &chan); } else { - res = ast_pbx_outgoing_exten(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->context, in->exten, in->priority, &reason, 1, + res = ast_pbx_outgoing_exten(in->tech, in->format, in->data, in->timeout, in->context, in->exten, in->priority, &reason, 1, S_OR(in->cid_num, NULL), S_OR(in->cid_name, NULL), in->vars, in->account, &chan); @@ -2129,6 +2130,7 @@ static int action_originate(struct mansession *s, const struct message *m) const char *appdata = astman_get_header(m, "Data"); const char *async = astman_get_header(m, "Async"); const char *id = astman_get_header(m, "ActionID"); + const char *codecs = astman_get_header(m, "Codecs"); struct ast_variable *vars = astman_get_variables(m); char *tech, *data; char *l = NULL, *n = NULL; @@ -2138,6 +2140,7 @@ static int action_originate(struct mansession *s, const struct message *m) int reason = 0; char tmp[256]; char tmp2[256]; + int format = AST_FORMAT_SLINEAR; pthread_t th; if (!name) { @@ -2173,6 +2176,10 @@ static int action_originate(struct mansession *s, const struct message *m) if (ast_strlen_zero(l)) l = NULL; } + if (!ast_strlen_zero(codecs)) { + format = 0; + ast_parse_allow_disallow(NULL, &format, codecs, 1); + } if (ast_true(async)) { struct fast_originate_helper *fast = ast_calloc(1, sizeof(*fast)); if (!fast) { @@ -2192,6 +2199,7 @@ static int action_originate(struct mansession *s, const struct message *m) ast_copy_string(fast->context, context, sizeof(fast->context)); ast_copy_string(fast->exten, exten, sizeof(fast->exten)); ast_copy_string(fast->account, account, sizeof(fast->account)); + fast->format = format; fast->timeout = to; fast->priority = pi; if (ast_pthread_create_detached(&th, NULL, fast_originate, fast)) { @@ -2217,10 +2225,10 @@ static int action_originate(struct mansession *s, const struct message *m) astman_send_error(s, m, "Originate with certain 'Application' arguments requires the additional System privilege, which you do not have."); return 0; } - res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL); + res = ast_pbx_outgoing_app(tech, format, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL); } else { if (exten && context && pi) - res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 1, l, n, vars, account, NULL); + res = ast_pbx_outgoing_exten(tech, format, data, to, context, exten, pi, &reason, 1, l, n, vars, account, NULL); else { astman_send_error(s, m, "Originate with 'Exten' requires 'Context' and 'Priority'"); return 0; |