Index: pbx.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx.c,v retrieving revision 1.41 diff -u -r1.41 pbx.c --- pbx.c 24 Aug 2003 20:08:55 -0000 1.41 +++ pbx.c 25 Aug 2003 19:50:19 -0000 @@ -3855,17 +3855,22 @@ 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) Index: manager.c =================================================================== RCS file: /usr/cvsroot/asterisk/manager.c,v retrieving revision 1.18 diff -u -r1.18 manager.c --- manager.c 18 Aug 2003 06:03:16 -0000 1.18 +++ manager.c 25 Aug 2003 19:50:19 -0000 @@ -435,7 +435,7 @@ *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 ); } Index: include/asterisk/pbx.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/pbx.h,v retrieving revision 1.8 diff -u -r1.8 pbx.h --- include/asterisk/pbx.h 14 Jul 2003 17:16:47 -0000 1.8 +++ include/asterisk/pbx.h 25 Aug 2003 19:50:19 -0000 @@ -484,7 +484,7 @@ /* 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); Index: pbx/pbx_spool.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx/pbx_spool.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 pbx_spool.c --- pbx/pbx_spool.c 12 Feb 2003 13:59:15 -0000 1.1.1.1 +++ pbx/pbx_spool.c 25 Aug 2003 19:50:20 -0000 @@ -185,7 +185,7 @@ 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);