mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +00:00
Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -228,8 +228,8 @@ static struct ast_generator gen =
|
|||||||
|
|
||||||
static void ast_eivr_getvariable(struct ast_channel *chan, char *data, char *outbuf, int outbuflen)
|
static void ast_eivr_getvariable(struct ast_channel *chan, char *data, char *outbuf, int outbuflen)
|
||||||
{
|
{
|
||||||
// original input data: "G,var1,var2,"
|
/* original input data: "G,var1,var2," */
|
||||||
// data passed as "data": "var1,var2"
|
/* data passed as "data": "var1,var2" */
|
||||||
char *inbuf, *variable;
|
char *inbuf, *variable;
|
||||||
|
|
||||||
const char *value;
|
const char *value;
|
||||||
@@ -272,7 +272,7 @@ static void ast_eivr_setvariable(struct ast_channel *chan, char *data)
|
|||||||
variable = strtok_r(inbuf, ",", &saveptr);
|
variable = strtok_r(inbuf, ",", &saveptr);
|
||||||
ast_chan_log(LOG_DEBUG, chan, "Setting up a variable: %s\n", variable);
|
ast_chan_log(LOG_DEBUG, chan, "Setting up a variable: %s\n", variable);
|
||||||
if(variable) {
|
if(variable) {
|
||||||
//variable contains "varname=value"
|
/* variable contains "varname=value" */
|
||||||
strncpy(buf, variable, sizeof(buf));
|
strncpy(buf, variable, sizeof(buf));
|
||||||
value = strchr(buf, '=');
|
value = strchr(buf, '=');
|
||||||
if(!value)
|
if(!value)
|
||||||
@@ -335,7 +335,7 @@ static int app_exec(struct ast_channel *chan, void *data)
|
|||||||
buf = ast_strdupa(data);
|
buf = ast_strdupa(data);
|
||||||
AST_STANDARD_APP_ARGS(args, buf);
|
AST_STANDARD_APP_ARGS(args, buf);
|
||||||
|
|
||||||
//copy args and replace commas with pipes
|
/* copy args and replace commas with pipes */
|
||||||
pipe_delim_argbuf = ast_strdupa(data);
|
pipe_delim_argbuf = ast_strdupa(data);
|
||||||
while((pdargbuf_ptr = strchr(pipe_delim_argbuf, ',')) != NULL)
|
while((pdargbuf_ptr = strchr(pipe_delim_argbuf, ',')) != NULL)
|
||||||
pdargbuf_ptr[0] = '|';
|
pdargbuf_ptr[0] = '|';
|
||||||
@@ -580,20 +580,21 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
|
|||||||
AST_LIST_UNLOCK(&u->playlist);
|
AST_LIST_UNLOCK(&u->playlist);
|
||||||
}
|
}
|
||||||
} else if (input[0] == 'G') {
|
} else if (input[0] == 'G') {
|
||||||
// A get variable message: "G,variable1,variable2,..."
|
/* A get variable message: "G,variable1,variable2,..." */
|
||||||
char response[2048];
|
char response[2048];
|
||||||
|
|
||||||
ast_chan_log(LOG_NOTICE, chan, "Getting a Variable out of the channel: %s\n", &input[2]);
|
ast_chan_log(LOG_NOTICE, chan, "Getting a Variable out of the channel: %s\n", &input[2]);
|
||||||
ast_eivr_getvariable(chan, &input[2], response, sizeof(response));
|
ast_eivr_getvariable(chan, &input[2], response, sizeof(response));
|
||||||
send_eivr_event(eivr_events, 'G', response, chan);
|
send_eivr_event(eivr_events, 'G', response, chan);
|
||||||
} else if (input[0] == 'V') {
|
} else if (input[0] == 'V') {
|
||||||
// A set variable message: "V,variablename=foo"
|
/* A set variable message: "V,variablename=foo" */
|
||||||
ast_chan_log(LOG_NOTICE, chan, "Setting a Variable up: %s\n", &input[2]);
|
ast_chan_log(LOG_NOTICE, chan, "Setting a Variable up: %s\n", &input[2]);
|
||||||
ast_eivr_setvariable(chan, &input[2]);
|
ast_eivr_setvariable(chan, &input[2]);
|
||||||
} else if (input[0] == 'L') {
|
} else if (input[0] == 'L') {
|
||||||
ast_chan_log(LOG_NOTICE, chan, "Log message from EIVR: %s\n", &input[2]);
|
ast_chan_log(LOG_NOTICE, chan, "Log message from EIVR: %s\n", &input[2]);
|
||||||
} else if (input[0] == 'X') {
|
} else if (input[0] == 'X') {
|
||||||
ast_chan_log(LOG_NOTICE, chan, "Exiting ExternalIVR: %s\n", &input[2]);
|
ast_chan_log(LOG_NOTICE, chan, "Exiting ExternalIVR: %s\n", &input[2]);
|
||||||
//TODO: add deprecation debug message for X command here
|
/*! \todo add deprecation debug message for X command here */
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
} else if (input[0] == 'E') {
|
} else if (input[0] == 'E') {
|
||||||
|
@@ -406,6 +406,7 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
|
|||||||
the channel is hung up anyways */
|
the channel is hung up anyways */
|
||||||
return AGI_RESULT_FAILURE;
|
return AGI_RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handlers will get the pipe write fd and we read the AGI responses
|
/* handlers will get the pipe write fd and we read the AGI responses
|
||||||
from the pipe read fd */
|
from the pipe read fd */
|
||||||
async_agi.fd = fds[1];
|
async_agi.fd = fds[1];
|
||||||
@@ -982,7 +983,7 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char
|
|||||||
return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
|
return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get option - really similar to the handle_streamfile, but with a timeout */
|
/*! \brief get option - really similar to the handle_streamfile, but with a timeout */
|
||||||
static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
|
static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int res, vres;
|
int res, vres;
|
||||||
@@ -1050,7 +1051,7 @@ static int handle_getoption(struct ast_channel *chan, AGI *agi, int argc, char *
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*--- handle_saynumber: Say number in various language syntaxes ---*/
|
/*! \brief Say number in various language syntaxes */
|
||||||
/* While waiting, we're sending a NULL. */
|
/* While waiting, we're sending a NULL. */
|
||||||
static int handle_saynumber(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
|
static int handle_saynumber(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user