dect
/
asterisk
Archived
13
0
Fork 0

Merge james's patch (bug #7)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1432 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2003-08-25 22:40:14 +00:00
parent 78b836de55
commit 49a8ca0696
4 changed files with 9 additions and 4 deletions

View File

@ -484,7 +484,7 @@ int ast_pbx_outgoing_exten(char *type, int format, void *data, int timeout, char
/* Synchronously or asynchronously make an outbound call and send it to a
particular application with given extension */
int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *callerid);
int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *callerid, char *variable);
/* Functions for returning values from structures */
char *ast_get_context_name(struct ast_context *con);

View File

@ -435,7 +435,7 @@ static int action_originate(struct mansession *s, struct message *m)
*data = '\0';
data++;
if (strlen(app)) {
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL );
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
} else {
res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
}

7
pbx.c
View File

@ -3855,17 +3855,22 @@ static void *ast_pbx_run_app(void *data)
return NULL;
}
int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *callerid)
int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *app, char *appdata, int *reason, int sync, char *callerid, char *variable)
{
struct ast_channel *chan;
struct async_stat *as;
struct app_tmp *tmp;
char *var, *vartmp;
int res = -1;
if (!app || !strlen(app))
return -1;
if (sync) {
chan = ast_request_and_dial(type, format, data, timeout, reason, callerid);
if (chan) {
vartmp = variable;
while( (var = strtok_r(NULL, "|", &vartmp)) ) {
pbx_builtin_setvar( chan, var );
}
if (chan->_state == AST_STATE_UP) {
res = 0;
if (option_verbose > 3)

View File

@ -185,7 +185,7 @@ static void *attempt_thread(void *data)
if (strlen(o->app)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_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->callerid);
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->callerid, o->variable);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_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);