mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Merge james's patch (bug #7)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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
|
/* Synchronously or asynchronously make an outbound call and send it to a
|
||||||
particular application with given extension */
|
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 */
|
/* Functions for returning values from structures */
|
||||||
char *ast_get_context_name(struct ast_context *con);
|
char *ast_get_context_name(struct ast_context *con);
|
||||||
|
@@ -435,7 +435,7 @@ static int action_originate(struct mansession *s, struct message *m)
|
|||||||
*data = '\0';
|
*data = '\0';
|
||||||
data++;
|
data++;
|
||||||
if (strlen(app)) {
|
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 {
|
} else {
|
||||||
res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
|
res = ast_pbx_outgoing_exten(tech, AST_FORMAT_SLINEAR, data, to, context, exten, pi, &reason, 0, strlen(callerid) ? callerid : NULL, NULL );
|
||||||
}
|
}
|
||||||
|
7
pbx.c
7
pbx.c
@@ -3855,17 +3855,22 @@ static void *ast_pbx_run_app(void *data)
|
|||||||
return NULL;
|
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 ast_channel *chan;
|
||||||
struct async_stat *as;
|
struct async_stat *as;
|
||||||
struct app_tmp *tmp;
|
struct app_tmp *tmp;
|
||||||
|
char *var, *vartmp;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
if (!app || !strlen(app))
|
if (!app || !strlen(app))
|
||||||
return -1;
|
return -1;
|
||||||
if (sync) {
|
if (sync) {
|
||||||
chan = ast_request_and_dial(type, format, data, timeout, reason, callerid);
|
chan = ast_request_and_dial(type, format, data, timeout, reason, callerid);
|
||||||
if (chan) {
|
if (chan) {
|
||||||
|
vartmp = variable;
|
||||||
|
while( (var = strtok_r(NULL, "|", &vartmp)) ) {
|
||||||
|
pbx_builtin_setvar( chan, var );
|
||||||
|
}
|
||||||
if (chan->_state == AST_STATE_UP) {
|
if (chan->_state == AST_STATE_UP) {
|
||||||
res = 0;
|
res = 0;
|
||||||
if (option_verbose > 3)
|
if (option_verbose > 3)
|
||||||
|
@@ -185,7 +185,7 @@ static void *attempt_thread(void *data)
|
|||||||
if (strlen(o->app)) {
|
if (strlen(o->app)) {
|
||||||
if (option_verbose > 2)
|
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);
|
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 {
|
} else {
|
||||||
if (option_verbose > 2)
|
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);
|
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);
|
||||||
|
Reference in New Issue
Block a user