You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
#include "agi_c.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
int define_variable( char *variable, char *value );
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv){
|
|
|
|
|
|
|
|
// fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK);
|
|
|
|
|
|
|
|
s_agi_parameter *param_agi = NULL;
|
|
|
|
|
|
|
|
param_agi = ast_agi();
|
|
|
|
|
|
|
|
agi_verbose_all_param(param_agi);
|
|
|
|
|
|
|
|
define_variable( "utterance", "-1");
|
|
|
|
define_variable( "confidence", "-1");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int define_variable( char *variable, char *value ){
|
|
|
|
|
|
|
|
char v[100];
|
|
|
|
snprintf(v, 100, "SET VARIABLE %s %s \n", variable, value);
|
|
|
|
|
|
|
|
s_agi_return *response = NULL;
|
|
|
|
response = agi_command(v);
|
|
|
|
|
|
|
|
if(response){
|
|
|
|
if(response->code != 200){
|
|
|
|
agi_command("VERBOSE \"erro para definir uma variavel dialplan\"\n");
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
agi_command("VERBOSE \"erro para definir uma variavel dialplan\"\n");
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
agi_clear_response( response );
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|