diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-15 23:24:51 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-15 23:24:51 +0000 |
commit | 195245925855327e6d12be2293c8e9fcc57662cd (patch) | |
tree | 1d145d53531c453391f74d30f64b85c38318a447 /channel.c | |
parent | ff15e0fa53156b9994da3f726bfe91232de6195a (diff) |
Allow manager originate to specifiy more than one variable to be set.
Allow manager originate and spool files to set writable dialplan functions,
including those that use the pipe symbol to seperate arguments.
Allow CDR dialplan function to be able to set the account code and userfield.
This deprecates the use of the Account header in manager originate and spool
files, as well as the SetAccount and SetCDRUserField applications.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6147 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-x | channel.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -2031,20 +2031,8 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d chan = ast_request(type, format, data, &cause); if (chan) { if (oh) { - char *tmp, *var; - /* JDG chanvar */ - if (oh->variable) - variable = ast_strdupa(oh->variable); - else - variable = NULL; - tmp = variable; - /* FIXME replace this call with strsep NOT*/ - while( (var = strtok_r(NULL, "|", &tmp)) ) { - pbx_builtin_setvar( chan, var ); - } /* /JDG */ + ast_set_variables(chan, oh->vars); ast_set_callerid(chan, oh->cid_num, oh->cid_name, oh->cid_num); - if (oh->account && *oh->account) - ast_cdr_setaccount(chan, oh->account); } ast_set_callerid(chan, cid_num, cid_name, cid_num); @@ -2107,7 +2095,8 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d ast_copy_string(chan->context, oh->context, sizeof(chan->context)); if (oh->exten && *oh->exten) ast_copy_string(chan->exten, oh->exten, sizeof(chan->exten)); - chan->priority = oh->priority; + if (oh->priority) + chan->priority = oh->priority; } if (chan->_state == AST_STATE_UP) state = AST_CONTROL_ANSWER; @@ -3450,3 +3439,11 @@ char *ast_print_group(char *buf, int buflen, ast_group_t group) } return(buf); } + +void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars) +{ + struct ast_variable *cur; + + for (cur = vars; cur; cur = cur->next) + pbx_builtin_setvar_helper(chan, cur->name, cur->value); +} |