提交 26fe1dcb authored 作者: Tristan Mahé's avatar Tristan Mahé

stream_file OK, still waiting for FSCORE-455 to get return values

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15040 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 725b42df
...@@ -47,7 +47,7 @@ static void *esl2agi_thread(void *data) { ...@@ -47,7 +47,7 @@ static void *esl2agi_thread(void *data) {
esl_handle_t eslC = {{0}}; esl_handle_t eslC = {{0}};
char script_path[1024] = "\0"; char script_path[1024] = "\0";
const char *buf; char *buf;
int pid; int pid;
int thread_running; int thread_running;
...@@ -94,6 +94,7 @@ static void *esl2agi_thread(void *data) { ...@@ -94,6 +94,7 @@ static void *esl2agi_thread(void *data) {
close(pipes.socket[1]); close(pipes.socket[1]);
close(pipes.script[0]); close(pipes.script[0]);
close(esl_req.client_sock); close(esl_req.client_sock);
close(STDERR_FILENO);
dup2(pipes.socket[0], STDIN_FILENO); dup2(pipes.socket[0], STDIN_FILENO);
dup2(pipes.script[1], STDOUT_FILENO); dup2(pipes.script[1], STDOUT_FILENO);
...@@ -114,19 +115,16 @@ static void *esl2agi_thread(void *data) { ...@@ -114,19 +115,16 @@ static void *esl2agi_thread(void *data) {
signal(SIGCHLD, SIG_IGN); signal(SIGCHLD, SIG_IGN);
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
// fprintf(stderr,"New call, handling setup...\n");
handle_setup_env(pipes.socket[1],&eslC); handle_setup_env(pipes.socket[1],&eslC);
/* TODO: check status */ /* TODO: check status */
status = esl_send(&eslC,"myevents"); status = esl_send(&eslC,"myevents");
eslC.async_execute = 0; eslC.async_execute = 1;
while ( eslC.connected && thread_running) { while ( eslC.connected && thread_running) {
int r , nfds = 0; int r , nfds = 0;
fd_set rd; fd_set rd;
/* As we are in sync mode, we should NOT care about socket there,
* there is a binding of esl_execute to find command results
*/
FD_ZERO(&rd); FD_ZERO(&rd);
FD_SET(pipes.script[0], &rd); FD_SET(pipes.script[0], &rd);
nfds = MAX(nfds,pipes.script[0]); nfds = MAX(nfds,pipes.script[0]);
...@@ -135,13 +133,13 @@ static void *esl2agi_thread(void *data) { ...@@ -135,13 +133,13 @@ static void *esl2agi_thread(void *data) {
if (r == -1 ) if (r == -1 )
break; break;
else if (FD_ISSET(pipes.script[0],&rd) ) { /* AGI has something to say */ else if (FD_ISSET(pipes.script[0],&rd) ) { /* AGI has something to say */
bzero(&sbuf,2047);
r = read(pipes.script[0],&sbuf,2047); r = read(pipes.script[0],&sbuf,2047);
if (r<0) if (r<0)
goto end; goto end;
else { else {
/*TODO: correct ugly hack to remove final \n */ /*TODO: correct ugly hack to remove final \n */
sbuf[r-1] = '\0'; sbuf[r-1] = '\0';
// fprintf(stderr,"Treating: '%s'\n",sbuf);
if ( find_and_exec_command(&eslC,pipes.socket[1],(char *) &sbuf) < 0 ) if ( find_and_exec_command(&eslC,pipes.socket[1],(char *) &sbuf) < 0 )
goto end; goto end;
} }
...@@ -199,7 +197,7 @@ int main(int argc, char *argv[]) ...@@ -199,7 +197,7 @@ int main(int argc, char *argv[])
} }
if (!(ip && port)) { if (!(ip && port)) {
fprintf(stderr, "Usage %s -h <host> -p <port>\n", argv[0]); // fprintf(stderr, "Usage %s -h <host> -p <port>\n", argv[0]);
return -1; return -1;
} }
...@@ -210,175 +208,134 @@ int main(int argc, char *argv[]) ...@@ -210,175 +208,134 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
static int safe_int_snprintf_buffer(char **buf,const char *format, int ret) {
int size;
size = 2 + strlen(format); // Max 2 digits in int
if (*buf != NULL)
*buf = realloc(*buf,size+1);
else
*buf = malloc(size +1);
memset(*buf,0,size+1);
size = snprintf(*buf,size+1,format,ret);
return size;
}
/*
* Return malloc'd buf containing header value specified with %format
*/
static int fill_buffer_from_header(esl_event_t *event,char **buf,char *header,const char *format) {
int size=0;
char *sbuf;
sbuf = esl_event_get_header(event, header);
if (sbuf) {
size = strlen(sbuf) + strlen(format);
if (*buf == NULL)
*buf = malloc(size+1);
else
*buf = realloc(*buf,size+1);
memset(*buf,0,size+1);
size = snprintf(*buf,size,format,sbuf);
}
return size;
}
/* Setup env /* Setup env
* TODO: - correct parameters * TODO: - check size, if no header found we should not block
* - add a generic routine instead of blindly repeating code
*/ */
static int handle_setup_env(int fd,esl_handle_t *eslC) { static int handle_setup_env(int fd,esl_handle_t *eslC) {
char buf[1024]; char *sbuf=NULL;
char *sbuf; int size;
/* Setup Env for AGI scripts */ /* Setup Env for AGI scripts */
if ( (sbuf = esl_event_get_header(eslC->info_event, "variable_ivr_path")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"variable_ivr_path","agi_request: %s\n") ) > 0) {
sprintf(buf,"agi_request: %s\n",sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else else
return -1; return -1;
if ( (sbuf = esl_event_get_header(eslC->info_event, "variable_channel_name")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"variable_channel_name","agi_channel: %s\n") ) > 0) {
sprintf(buf,"agi_channel: %s\n",sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else else
return -1; return -1;
if ( write(fd, "agi_language: en\n",18) < 0 ) if ( write(fd, "agi_language: en\n",strlen("agi_language: en\n") ) < 0 )
return -1; return -1;
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Source")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Source","agi_type: %s\n") ) > 0) {
sprintf(buf, "agi_type: %s\n", sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else else
return -1;
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Unique-ID")) ) {
sprintf(buf, "agi_uniqueid: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
else
return -1;
/* ANI/DNIS */ if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Unique-ID","agi_uniqueid: %s\n") ) > 0) {
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Caller-ID-Number")) ) { if ( write(fd,sbuf,size) < 0)
sprintf(buf, "agi_callerid: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
else {
sprintf(buf, "agi_callerid: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Caller-ID-Name")) ) {
sprintf(buf, "agi_calleridname: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_calleridname: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Screen-Bit")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Caller-ID-Number","agi_callerid: %s\n") ) > 0) {
sprintf(buf, "agi_callingpres: %s\n", sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_callingpres: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
/* TODO */
if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Caller-ID-Number")) ) {
sprintf(buf, "agi_callingani2: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
else {
sprintf(buf, "agi_callingani2: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
/* TODO */
if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Caller-ID-Number")) ) {
sprintf(buf, "agi_callington: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
else {
sprintf(buf, "agi_callington: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) {
sprintf(buf, "agi_dnid: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1;
}
else {
sprintf(buf, "agi_dnid: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
/* TODO */ if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Caller-ID-Name","agi_calleridname: %s\n") ) > 0) {
if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) { if ( write(fd,sbuf,size) < 0)
sprintf(buf, "agi_callingtns: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_callingtns: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
/* TODO: correct info */ if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Screen-Bit","agi_callingpres: %s\n") ) > 0) {
if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) { if ( write(fd,sbuf,size) < 0)
sprintf(buf, "agi_rdnis: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_rdnis: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Context")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Caller-Destination-Number","agi_dnid: %s\n") ) > 0) {
sprintf(buf, "agi_context: %s\n", sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_context: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Destination-Number")) ) { if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Context","agi_context: %s\n") ) > 0) {
sprintf(buf, "agi_extension: %s\n", sbuf); if ( write(fd,sbuf,size) < 0)
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_extension: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
/* TODO: correct info */ if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Destination-Number","agi_extension: %s\n") ) > 0) {
if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-State-Number")) ) { if ( write(fd,sbuf,size) < 0)
sprintf(buf, "agi_priority: %s\n", sbuf);
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
} }
else { else
sprintf(buf, "agi_priority: %s\n", "unknown");
if ( write(fd, buf,strlen(buf) ) < 0)
return -1; return -1;
}
if ( write(fd, "agi_enhanced: 0.0\n", 19) < 0 ) /* TODO
* agi_callingani2
* agi_callington
* agi_callingtns
* agi_rdnis
* agi_priority
*/
if ( write(fd, "agi_enhanced: 0.0\n", strlen("agi_enhanced: 0.0\n") ) < 0 )
return -1;
if ( write(fd, "agi_accountcode: \n", strlen("agi_accountcode: \n") ) < 0 )
return -1; return -1;
if ( write(fd, "agi_accountcode: \n\n", 21) < 0 )
if ( write(fd, "\n\n", 2 ) < 0 )
return -1; return -1;
return 0; return 0;
} }
...@@ -393,7 +350,7 @@ static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_eve ...@@ -393,7 +350,7 @@ static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_eve
if ( esl_execute(eslC,cmd,args,uuid) != ESL_FAIL) { if ( esl_execute(eslC,cmd,args,uuid) != ESL_FAIL) {
while (!done && eslC->connected) { while (!done && eslC->connected) {
if (esl_recv_event(eslC,1,NULL) == ESL_FAIL) if (esl_recv_event(eslC,1,NULL) == ESL_FAIL)
return -1; return -1; // Maybe point of failure
else if (eslC->last_ievent) { else if (eslC->last_ievent) {
if (eslC->last_ievent->event_id == ESL_EVENT_CHANNEL_EXECUTE_COMPLETE ) { if (eslC->last_ievent->event_id == ESL_EVENT_CHANNEL_EXECUTE_COMPLETE ) {
if (! strcasecmp(cmd,esl_event_get_header(eslC->last_ievent,"Application") ) ) if (! strcasecmp(cmd,esl_event_get_header(eslC->last_ievent,"Application") ) )
...@@ -410,41 +367,51 @@ static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_eve ...@@ -410,41 +367,51 @@ static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_eve
} }
/* /*
* Hangup AGI cmd * Answer AGI cmd
* TODO: - Add arg support to know which channel we want to hangup. * TODO: Why is there an A on the AGI side ?
*/ */
static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[]) { static int handle_answer(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
if (do_execute(eslC,"hangup",NULL,NULL,NULL) < 0 ) { int res;
if ( write(fd,"200 result=-1\n\n",128) < 0 ) int size;
return -1; char *buf=NULL;
} res = do_execute(eslC,"answer",NULL,NULL,NULL);
else {
if ( write(fd,"200 result=0\n\n",128) < 0 ) size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
return -1;
} res = write(fd,buf,size);
return 0; free(buf);
return res;
} }
/* /*
* Answer AGI cmd * Hangup AGI cmd
* TODO: - Add arg support to know which channel we want to hangup.
*/ */
static int handle_answer(esl_handle_t *eslC,int fd,int *argc, char *argv[]) { static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
if (do_execute(eslC,"answer",NULL,NULL,NULL) < 0 ) { int res;
if ( write(fd,"200 result=-1\n\n",128) < 0 ) int size;
return -1; char *buf=NULL;
}
else { res = do_execute(eslC,"hangup",NULL,NULL,NULL);
if ( write(fd,"200 result=0\n\n",128) < 0 )
return -1; size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
}
return 0; res = write(fd,buf,size);
free(buf);
return res;
} }
/*
* STREAM FILE agi cmd
* TODO: rewrites with good string handling :)
*/
static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[]) { static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
char buf[1024]; char *buf;
char *sbuf;
int offset=0; int offset=0;
int dtmf=0; char dtmf[2]={"0"};
int res;
esl_event_t *reply=NULL; esl_event_t *reply=NULL;
if (*argc < 3 || *argc > 5) if (*argc < 3 || *argc > 5)
...@@ -452,49 +419,75 @@ static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[]) ...@@ -452,49 +419,75 @@ static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[])
if (argv[3]) { if (argv[3]) {
/* We should set playback_terminators var there */ /* We should set playback_terminators var there */
sprintf(buf,"playback_terminators=%s",argv[3]); buf = malloc(strlen(argv[3])+22);
memset(buf,0,strlen(argv[3])+22);
snprintf(buf,22,"playback_terminators=%s",argv[3]);
do_execute(eslC,"set",buf,NULL,NULL); do_execute(eslC,"set",buf,NULL,NULL);
free(buf);
} }
bzero(&buf,1023);
if (argv[4]) { if (argv[4]) {
offset = atoi(argv[4]); offset = atoi(argv[4]);
} }
if (offset > 0) buf = malloc(strlen(argv[2]) + 1);
sprintf(buf,"%s@@%d",argv[2],offset); memset(buf,0,strlen(argv[2])+1);
if (offset > 0) {
buf = realloc(buf,strlen(argv[2]) + strlen(argv[4]) + 3);
snprintf(buf,strlen(argv[2]) + strlen(argv[4]) + 3,"%s@@%d",argv[2],offset);
}
else else
sprintf(buf,"%s",argv[2]); snprintf(buf,strlen(argv[2]) + 1,"%s",argv[2]);
offset = 0; offset = 0;
if ( do_execute(eslC,"playback",buf,NULL,&reply) < 0 ) /* We should write about NON success there instead of returning stock */ if ( do_execute(eslC,"playback",buf,NULL,&reply) < 0 ) { /* We should write about NON success there instead of returning stock */
return -1; offset = -1;
fprintf(stderr,"do_execute stream file failed\n");
}
else { else {
bzero(&buf,1023); free(buf);
/* We should check playback_samples var to return offset, sent in the CHANNEL_EXECUTE_COMPLETE and buf=NULL;
variable_playback_terminator_used to get the DTMF we had */
if (reply) { if (reply) {
if (! (sbuf = esl_event_get_header(reply, "variable_playback_samples")) ) res = fill_buffer_from_header(eslC->info_event,&buf,"variable_playback_samples","%d");
offset = -1; if ( res <= 0 )
else { offset = 0;
offset = atoi(sbuf); else
} offset = atoi(buf);
if (! (sbuf = esl_event_get_header(reply, "variable_playback_terminator_used")) )
dtmf = 0; fprintf(stderr,"Offset is %d, res is %d, buf is %s\n",offset,res,buf);
else {
dtmf = atoi(sbuf); res = fill_buffer_from_header(reply,&buf,"variable_playback_terminator_used","%s");
} // sbuf = esl_event_get_header(reply, "variable_playback_terminator_used");
if (res > 0)
snprintf((char *)&dtmf,1,"%s",buf);
}
else {
fprintf(stderr,"No event reply in stream file\n");
offset=-1;
} }
} }
if (buf != NULL)
free(buf);
fprintf(stderr,"End stream file %d %s\n",offset,dtmf);
if (offset < 0) { if (offset < 0) {
if ( write(fd,"200 result=-1 endpos=0\n\n",128) < 0 ) if ( write(fd,"200 result=-1 endpos=0\n\n",128) < 0 ) {
fprintf(stderr,"Write failed\n");
return -1; return -1;
}
} }
else { else {
sprintf(buf,"200 result=%d endpos=%d\n\n",dtmf,offset); buf=malloc(65);
if ( write(fd,buf,128) < 0 ) memset(buf,0,65);
snprintf(buf,64,"200 result=%s endpos=%d\n\n",dtmf,offset);
if ( write(fd,buf,64) < 0 ) {
free(buf);
fprintf(stderr,"Write failed\n");
return -1; return -1;
}
free(buf);
} }
return 0; return 0;
} }
...@@ -594,4 +587,3 @@ static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf) { ...@@ -594,4 +587,3 @@ static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf) {
} }
return r; return r;
} }
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#define ESL_A_TO_VOID(v) ((void*)(v)) #define ESL_A_TO_VOID(v) ((void*)(v))
#define VOID_TO_ESL_A(p) ((esl_accept_t*)(p)) #define VOID_TO_ESL_A(p) ((esl_accept_t*)(p))
#define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MAX(x,y) ((x) > (y) ? (x) : (y))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
/* /*
* Struct Section * Struct Section
...@@ -88,49 +89,37 @@ static void esl2agi(esl_socket_t server_sock, esl_socket_t client_sock, struct s ...@@ -88,49 +89,37 @@ static void esl2agi(esl_socket_t server_sock, esl_socket_t client_sock, struct s
static void *esl2agi_thread(void *data); static void *esl2agi_thread(void *data);
/*
* - EXEC application OPTIONS
* - GET DATA filetoplay timeout maxdigits
* - GET VARIABLE variablename
* - HANGUP 'channelname'
* - RECORD FILE filename format escapedigits timeout offsetsamples BEEP s=silence
* - SAY DIGITS
* - set autohangup time
* - set music on|off class
* - set variable
* - stream file filename <escape digits> [sample offset]
* - wait for digit timeout
*/
static int handle_setup_env(int fd,esl_handle_t *eslC); static int handle_setup_env(int fd,esl_handle_t *eslC);
static void parse_args(char *buf,int *argc,char *argv[_MAX_CMD_ARGS]); static void parse_args(char *buf,int *argc,char *argv[_MAX_CMD_ARGS]);
static command_binding_t *find_binding(char *cmd[]); static command_binding_t *find_binding(char *cmd[]);
static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
static int handle_answer(esl_handle_t *eslC,int fd, int *argc, char *argv[_MAX_CMD_ARGS]);
static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf); static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf);
/* static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_event_t **save_reply);
static int handle_exec(esl_handle_t *eslC,int fd,char *args);
static int handle_getdata(esl_handle_t *eslC,int fd,char *args);
static int handle_getvar(esl_handle_t *eslC,int fd,char *args);
static int handle_record(esl_handle_t *eslC,int fd,char *args); /*
* ported agi commands
*/
static int handle_say(esl_handle_t *eslC,int fd,char *args); static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
static int handle_setvar(esl_handle_t *eslC,int fd,char *args); static int handle_answer(esl_handle_t *eslC,int fd, int *argc, char *argv[_MAX_CMD_ARGS]);
static int handle_set(esl_handle_t *eslC,int fd,char *args); static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
static int handle_streamfile(esl_handle_t *eslC,int fd,char *args);
static int handle_waitdigits(esl_handle_t *eslC,int fd,char *args); /* TODO
*/ * - EXEC application OPTIONS
* - GET DATA filetoplay timeout maxdigits
* - GET VARIABLE variablename
* - HANGUP 'channelname'
* - RECORD FILE filename format escapedigits timeout offsetsamples BEEP s=silence
* - SAY DIGITS
* - set autohangup time
* - set music on|off class
* - set variable
* - stream file filename <escape digits> [sample offset]
* - wait for digit timeout
*/
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论