| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
#include "asterisk.h" |
| 44 |
|
| 45 |
#include <sys/socket.h> |
| 46 |
#include <netdb.h> |
| 47 |
#include <netinet/in.h> |
| 48 |
#include <arpa/inet.h> |
| 49 |
#include <signal.h> |
| 50 |
#include <fcntl.h> |
| 51 |
#include <ctype.h> |
| 52 |
#include <errno.h> |
| 53 |
|
| 54 |
#include "asterisk/file.h" |
| 55 |
#include "asterisk/channel.h" |
| 56 |
#include "asterisk/pbx.h" |
| 57 |
#include "asterisk/module.h" |
| 58 |
#include "asterisk/md5.h" |
| 59 |
#include "asterisk/config.h" |
| 60 |
#include "asterisk/utils.h" |
| 61 |
#include "asterisk/lock.h" |
| 62 |
#include "asterisk/app.h" |
| 63 |
#include "asterisk/endian.h" |
| 64 |
#include "asterisk/format_cache.h" |
| 65 |
|
| 66 |
#define FESTIVAL_CONFIG "festival.conf" |
| 67 |
#define MAXLEN 180 |
| 68 |
#define MAXFESTLEN 2048 |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
static char *app = "Festival"; |
| 91 |
|
| 92 |
static char *socket_receive_file_to_buff(int fd, int *size) |
| 93 |
{ |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
static char *file_stuff_key = "ft_StUfF_key"; |
| 100 |
char *buff, *tmp; |
| 101 |
int bufflen; |
| 102 |
int n,k,i; |
| 103 |
char c; |
| 104 |
|
| 105 |
bufflen = 1024; |
| 106 |
if (!(buff = ast_malloc(bufflen))) |
| 107 |
return NULL; |
| 108 |
*size = 0; |
| 109 |
|
| 110 |
for (k = 0; file_stuff_key[k] != '\0';) { |
| 111 |
n = read(fd, &c, 1); |
| 112 |
if (n == 0) |
| 113 |
break; |
| 114 |
if ((*size) + k + 1 >= bufflen) { |
| 115 |
|
| 116 |
bufflen += bufflen / 4; |
| 117 |
if (!(tmp = ast_realloc(buff, bufflen))) { |
| 118 |
ast_free(buff); |
| 119 |
return NULL; |
| 120 |
} |
| 121 |
buff = tmp; |
| 122 |
} |
| 123 |
if (file_stuff_key[k] == c) |
| 124 |
k++; |
| 125 |
else if ((c == 'X') && (file_stuff_key[k+1] == '\0')) { |
| 126 |
|
| 127 |
for (i = 0; i < k; i++, (*size)++) |
| 128 |
buff[*size] = file_stuff_key[i]; |
| 129 |
k = 0; |
| 130 |
|
| 131 |
} else { |
| 132 |
for (i = 0; i < k; i++, (*size)++) |
| 133 |
buff[*size] = file_stuff_key[i]; |
| 134 |
k = 0; |
| 135 |
buff[*size] = c; |
| 136 |
(*size)++; |
| 137 |
} |
| 138 |
} |
| 139 |
|
| 140 |
return buff; |
| 141 |
} |
| 142 |
|
| 143 |
static int send_waveform_to_fd(char *waveform, int length, int fd) |
| 144 |
{ |
| 145 |
int res; |
| 146 |
#if __BYTE_ORDER == __BIG_ENDIAN |
| 147 |
int x; |
| 148 |
char c; |
| 149 |
#endif |
| 150 |
|
| 151 |
res = ast_safe_fork(0); |
| 152 |
if (res < 0) |
| 153 |
ast_log(LOG_WARNING, "Fork failed\n"); |
| 154 |
if (res) { |
| 155 |
return res; |
| 156 |
} |
| 157 |
dup2(fd, 0); |
| 158 |
ast_close_fds_above_n(0); |
| 159 |
if (ast_opt_high_priority) |
| 160 |
ast_set_priority(0); |
| 161 |
#if __BYTE_ORDER == __BIG_ENDIAN |
| 162 |
for (x = 0; x < length; x += 2) { |
| 163 |
c = *(waveform + x + 1); |
| 164 |
*(waveform + x + 1) = *(waveform + x); |
| 165 |
*(waveform + x) = c; |
| 166 |
} |
| 167 |
#endif |
| 168 |
|
| 169 |
if (write(0, waveform, length) < 0) { |
| 170 |
|
| 171 |
} |
| 172 |
|
| 173 |
close(fd); |
| 174 |
_exit(0); |
| 175 |
} |
| 176 |
|
| 177 |
static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, int length, char *intkeys) |
| 178 |
{ |
| 179 |
int res = 0; |
| 180 |
int fds[2]; |
| 181 |
int needed = 0; |
| 182 |
struct ast_format *owriteformat; |
| 183 |
struct ast_frame *f; |
| 184 |
struct myframe { |
| 185 |
struct ast_frame f; |
| 186 |
char offset[AST_FRIENDLY_OFFSET]; |
| 187 |
char frdata[2048]; |
| 188 |
} myf = { |
| 189 |
.f = { 0, }, |
| 190 |
}; |
| 191 |
|
| 192 |
if (pipe(fds)) { |
| 193 |
ast_log(LOG_WARNING, "Unable to create pipe\n"); |
| 194 |
return -1; |
| 195 |
} |
| 196 |
|
| 197 |
|
| 198 |
if (ast_channel_state(chan) != AST_STATE_UP) |
| 199 |
ast_answer(chan); |
| 200 |
ast_stopstream(chan); |
| 201 |
ast_indicate(chan, -1); |
| 202 |
|
| 203 |
owriteformat = ao2_bump(ast_channel_writeformat(chan)); |
| 204 |
res = ast_set_write_format(chan, ast_format_slin); |
| 205 |
if (res < 0) { |
| 206 |
ast_log(LOG_WARNING, "Unable to set write format to signed linear\n"); |
| 207 |
ao2_cleanup(owriteformat); |
| 208 |
return -1; |
| 209 |
} |
| 210 |
|
| 211 |
myf.f.frametype = AST_FRAME_VOICE; |
| 212 |
myf.f.subclass.format = ast_format_slin; |
| 213 |
myf.f.offset = AST_FRIENDLY_OFFSET; |
| 214 |
myf.f.src = __PRETTY_FUNCTION__; |
| 215 |
myf.f.data.ptr = myf.frdata; |
| 216 |
|
| 217 |
res = send_waveform_to_fd(waveform, length, fds[1]); |
| 218 |
if (res >= 0) { |
| 219 |
|
| 220 |
|
| 221 |
for (;;) { |
| 222 |
res = ast_waitfor(chan, 1000); |
| 223 |
if (res < 1) { |
| 224 |
res = -1; |
| 225 |
break; |
| 226 |
} |
| 227 |
f = ast_read(chan); |
| 228 |
if (!f) { |
| 229 |
ast_log(LOG_WARNING, "Null frame == hangup() detected\n"); |
| 230 |
res = -1; |
| 231 |
break; |
| 232 |
} |
| 233 |
if (f->frametype == AST_FRAME_DTMF) { |
| 234 |
ast_debug(1, "User pressed a key\n"); |
| 235 |
if (intkeys && strchr(intkeys, f->subclass.integer)) { |
| 236 |
res = f->subclass.integer; |
| 237 |
ast_frfree(f); |
| 238 |
break; |
| 239 |
} |
| 240 |
} |
| 241 |
if (f->frametype == AST_FRAME_VOICE) { |
| 242 |
|
| 243 |
needed = f->samples * 2; |
| 244 |
if (needed > sizeof(myf.frdata)) { |
| 245 |
ast_log(LOG_WARNING, "Only able to deliver %d of %d requested samples\n", |
| 246 |
(int)sizeof(myf.frdata) / 2, needed/2); |
| 247 |
needed = sizeof(myf.frdata); |
| 248 |
} |
| 249 |
res = read(fds[0], myf.frdata, needed); |
| 250 |
if (res > 0) { |
| 251 |
myf.f.datalen = res; |
| 252 |
myf.f.samples = res / 2; |
| 253 |
if (ast_write(chan, &myf.f) < 0) { |
| 254 |
res = -1; |
| 255 |
ast_frfree(f); |
| 256 |
break; |
| 257 |
} |
| 258 |
if (res < needed) { |
| 259 |
ast_debug(1, "Last frame\n"); |
| 260 |
res = 0; |
| 261 |
ast_frfree(f); |
| 262 |
break; |
| 263 |
} |
| 264 |
} else { |
| 265 |
ast_debug(1, "No more waveform\n"); |
| 266 |
res = 0; |
| 267 |
} |
| 268 |
} |
| 269 |
ast_frfree(f); |
| 270 |
} |
| 271 |
} |
| 272 |
close(fds[0]); |
| 273 |
close(fds[1]); |
| 274 |
|
| 275 |
if (!res && owriteformat) |
| 276 |
ast_set_write_format(chan, owriteformat); |
| 277 |
ao2_cleanup(owriteformat); |
| 278 |
|
| 279 |
return res; |
| 280 |
} |
| 281 |
|
| 282 |
static int festival_exec(struct ast_channel *chan, const char *vdata) |
| 283 |
{ |
| 284 |
int usecache; |
| 285 |
int res = 0; |
| 286 |
struct sockaddr_in serv_addr; |
| 287 |
int fd; |
| 288 |
FILE *fs; |
| 289 |
const char *host; |
| 290 |
const char *cachedir; |
| 291 |
const char *temp; |
| 292 |
const char *festivalcommand; |
| 293 |
int port = 1314; |
| 294 |
int n; |
| 295 |
char ack[4]; |
| 296 |
char *waveform; |
| 297 |
int filesize; |
| 298 |
char bigstring[MAXFESTLEN]; |
| 299 |
int i; |
| 300 |
struct MD5Context md5ctx; |
| 301 |
unsigned char MD5Res[16]; |
| 302 |
char MD5Hex[33] = ""; |
| 303 |
char koko[4] = ""; |
| 304 |
char cachefile[MAXFESTLEN]=""; |
| 305 |
int readcache = 0; |
| 306 |
int writecache = 0; |
| 307 |
int strln; |
| 308 |
int fdesc = -1; |
| 309 |
char buffer[16384]; |
| 310 |
int seekpos = 0; |
| 311 |
char *data; |
| 312 |
struct ast_config *cfg; |
| 313 |
char *newfestivalcommand; |
| 314 |
struct ast_flags config_flags = { 0 }; |
| 315 |
AST_DECLARE_APP_ARGS(args, |
| 316 |
AST_APP_ARG(text); |
| 317 |
AST_APP_ARG(interrupt); |
| 318 |
); |
| 319 |
|
| 320 |
if (ast_strlen_zero(vdata)) { |
| 321 |
ast_log(LOG_WARNING, "festival requires an argument (text)\n"); |
| 322 |
return -1; |
| 323 |
} |
| 324 |
|
| 325 |
cfg = ast_config_load(FESTIVAL_CONFIG, config_flags); |
| 326 |
if (!cfg) { |
| 327 |
ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG); |
| 328 |
return -1; |
| 329 |
} else if (cfg == CONFIG_STATUS_FILEINVALID) { |
| 330 |
ast_log(LOG_ERROR, "Config file " FESTIVAL_CONFIG " is in an invalid format. Aborting.\n"); |
| 331 |
return -1; |
| 332 |
} |
| 333 |
|
| 334 |
if (!(host = ast_variable_retrieve(cfg, "general", "host"))) { |
| 335 |
host = "localhost"; |
| 336 |
} |
| 337 |
if (!(temp = ast_variable_retrieve(cfg, "general", "port"))) { |
| 338 |
port = 1314; |
| 339 |
} else { |
| 340 |
port = atoi(temp); |
| 341 |
} |
| 342 |
if (!(temp = ast_variable_retrieve(cfg, "general", "usecache"))) { |
| 343 |
usecache = 0; |
| 344 |
} else { |
| 345 |
usecache = ast_true(temp); |
| 346 |
} |
| 347 |
if (!(cachedir = ast_variable_retrieve(cfg, "general", "cachedir"))) { |
| 348 |
cachedir = "/tmp/"; |
| 349 |
} |
| 350 |
|
| 351 |
data = ast_strdupa(vdata); |
| 352 |
AST_STANDARD_APP_ARGS(args, data); |
| 353 |
|
| 354 |
if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) { |
| 355 |
const char *startcmd = "(tts_textasterisk \""; |
| 356 |
const char *endcmd = "\" 'file)(quit)\n"; |
| 357 |
|
| 358 |
strln = strlen(startcmd) + strlen(args.text) + strlen(endcmd) + 1; |
| 359 |
newfestivalcommand = ast_alloca(strln); |
| 360 |
snprintf(newfestivalcommand, strln, "%s%s%s", startcmd, args.text, endcmd); |
| 361 |
festivalcommand = newfestivalcommand; |
| 362 |
} else { |
| 363 |
int x, j; |
| 364 |
newfestivalcommand = ast_alloca(strlen(festivalcommand) + strlen(args.text) + 1); |
| 365 |
|
| 366 |
for (x = 0, j = 0; x < strlen(festivalcommand); x++) { |
| 367 |
if (festivalcommand[x] == '\\' && festivalcommand[x + 1] == 'n') { |
| 368 |
newfestivalcommand[j++] = '\n'; |
| 369 |
x++; |
| 370 |
} else if (festivalcommand[x] == '\\') { |
| 371 |
newfestivalcommand[j++] = festivalcommand[x + 1]; |
| 372 |
x++; |
| 373 |
} else if (festivalcommand[x] == '%' && festivalcommand[x + 1] == 's') { |
| 374 |
sprintf(&newfestivalcommand[j], "%s", args.text); |
| 375 |
j += strlen(args.text); |
| 376 |
x++; |
| 377 |
} else |
| 378 |
newfestivalcommand[j++] = festivalcommand[x]; |
| 379 |
} |
| 380 |
newfestivalcommand[j] = '\0'; |
| 381 |
festivalcommand = newfestivalcommand; |
| 382 |
} |
| 383 |
|
| 384 |
if (args.interrupt && !strcasecmp(args.interrupt, "any")) |
| 385 |
args.interrupt = AST_DIGIT_ANY; |
| 386 |
|
| 387 |
ast_debug(1, "Text passed to festival server : %s\n", args.text); |
| 388 |
|
| 389 |
|
| 390 |
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); |
| 391 |
|
| 392 |
if (fd < 0) { |
| 393 |
ast_log(LOG_WARNING, "festival_client: can't get socket\n"); |
| 394 |
ast_config_destroy(cfg); |
| 395 |
return -1; |
| 396 |
} |
| 397 |
|
| 398 |
memset(&serv_addr, 0, sizeof(serv_addr)); |
| 399 |
|
| 400 |
if ((serv_addr.sin_addr.s_addr = inet_addr(host)) == -1) { |
| 401 |
|
| 402 |
struct ast_sockaddr addr = { {0,} }; |
| 403 |
|
| 404 |
if (ast_sockaddr_resolve_first_af(&addr, host, PARSE_PORT_FORBID, AF_INET)) { |
| 405 |
ast_log(LOG_WARNING, "festival_client: ast_sockaddr_resolve_first_af() failed\n"); |
| 406 |
ast_config_destroy(cfg); |
| 407 |
close(fd); |
| 408 |
return -1; |
| 409 |
} |
| 410 |
|
| 411 |
|
| 412 |
ast_sockaddr_to_sin(&addr, &serv_addr); |
| 413 |
} |
| 414 |
|
| 415 |
serv_addr.sin_family = AF_INET; |
| 416 |
serv_addr.sin_port = htons(port); |
| 417 |
|
| 418 |
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) { |
| 419 |
ast_log(LOG_WARNING, "festival_client: connect to server failed\n"); |
| 420 |
ast_config_destroy(cfg); |
| 421 |
close(fd); |
| 422 |
return -1; |
| 423 |
} |
| 424 |
|
| 425 |
|
| 426 |
MD5Init(&md5ctx); |
| 427 |
MD5Update(&md5ctx, (unsigned char *)args.text, strlen(args.text)); |
| 428 |
MD5Final(MD5Res, &md5ctx); |
| 429 |
MD5Hex[0] = '\0'; |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
for (i = 0; i < 16; i++) { |
| 434 |
snprintf(koko, sizeof(koko), "%X", (unsigned)MD5Res[i]); |
| 435 |
strncat(MD5Hex, koko, sizeof(MD5Hex) - strlen(MD5Hex) - 1); |
| 436 |
} |
| 437 |
readcache = 0; |
| 438 |
writecache = 0; |
| 439 |
if (strlen(cachedir) + sizeof(MD5Hex) + 1 <= MAXFESTLEN && (usecache == -1)) { |
| 440 |
snprintf(cachefile, sizeof(cachefile), "%s/%s", cachedir, MD5Hex); |
| 441 |
fdesc = open(cachefile, O_RDWR); |
| 442 |
if (fdesc == -1) { |
| 443 |
fdesc = open(cachefile, O_CREAT | O_RDWR, AST_FILE_MODE); |
| 444 |
if (fdesc != -1) { |
| 445 |
writecache = 1; |
| 446 |
strln = strlen(args.text); |
| 447 |
ast_debug(1, "line length : %d\n", strln); |
| 448 |
if (write(fdesc,&strln,sizeof(int)) < 0) { |
| 449 |
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); |
| 450 |
} |
| 451 |
if (write(fdesc,data,strln) < 0) { |
| 452 |
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); |
| 453 |
} |
| 454 |
seekpos = lseek(fdesc, 0, SEEK_CUR); |
| 455 |
ast_debug(1, "Seek position : %d\n", seekpos); |
| 456 |
} |
| 457 |
} else { |
| 458 |
if (read(fdesc,&strln,sizeof(int)) != sizeof(int)) { |
| 459 |
ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno)); |
| 460 |
} |
| 461 |
ast_debug(1, "Cache file exists, strln=%d, strlen=%d\n", strln, (int)strlen(args.text)); |
| 462 |
if (strlen(args.text) == strln) { |
| 463 |
ast_debug(1, "Size OK\n"); |
| 464 |
if (read(fdesc,&bigstring,strln) != strln) { |
| 465 |
ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno)); |
| 466 |
} |
| 467 |
bigstring[strln] = 0; |
| 468 |
if (strcmp(bigstring, args.text) == 0) { |
| 469 |
readcache = 1; |
| 470 |
} else { |
| 471 |
ast_log(LOG_WARNING, "Strings do not match\n"); |
| 472 |
} |
| 473 |
} else { |
| 474 |
ast_log(LOG_WARNING, "Size mismatch\n"); |
| 475 |
} |
| 476 |
} |
| 477 |
} |
| 478 |
|
| 479 |
if (readcache == 1) { |
| 480 |
close(fd); |
| 481 |
fd = fdesc; |
| 482 |
ast_debug(1, "Reading from cache...\n"); |
| 483 |
} else { |
| 484 |
ast_debug(1, "Passing text to festival...\n"); |
| 485 |
fs = fdopen(dup(fd), "wb"); |
| 486 |
|
| 487 |
fprintf(fs, "%s", festivalcommand); |
| 488 |
fflush(fs); |
| 489 |
fclose(fs); |
| 490 |
} |
| 491 |
|
| 492 |
|
| 493 |
if (writecache == 1) { |
| 494 |
ast_debug(1, "Writing result to cache...\n"); |
| 495 |
while ((strln = read(fd, buffer, 16384)) != 0) { |
| 496 |
if (write(fdesc,buffer,strln) < 0) { |
| 497 |
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno)); |
| 498 |
} |
| 499 |
} |
| 500 |
close(fd); |
| 501 |
close(fdesc); |
| 502 |
fd = open(cachefile, O_RDWR); |
| 503 |
lseek(fd, seekpos, SEEK_SET); |
| 504 |
} |
| 505 |
|
| 506 |
ast_debug(1, "Passing data to channel...\n"); |
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
do { |
| 511 |
int read_data; |
| 512 |
for (n = 0; n < 3; ) { |
| 513 |
read_data = read(fd, ack + n, 3 - n); |
| 514 |
|
| 515 |
|
| 516 |
|
| 517 |
if (read_data == -1) { |
| 518 |
ast_log(LOG_WARNING, "Unable to read from cache/festival fd\n"); |
| 519 |
close(fd); |
| 520 |
ast_config_destroy(cfg); |
| 521 |
return -1; |
| 522 |
} |
| 523 |
n += read_data; |
| 524 |
} |
| 525 |
ack[3] = '\0'; |
| 526 |
if (strcmp(ack, "WV\n") == 0) { |
| 527 |
ast_debug(1, "Festival WV command\n"); |
| 528 |
if ((waveform = socket_receive_file_to_buff(fd, &filesize))) { |
| 529 |
res = send_waveform_to_channel(chan, waveform, filesize, args.interrupt); |
| 530 |
ast_free(waveform); |
| 531 |
} |
| 532 |
break; |
| 533 |
} else if (strcmp(ack, "LP\n") == 0) { |
| 534 |
ast_debug(1, "Festival LP command\n"); |
| 535 |
if ((waveform = socket_receive_file_to_buff(fd, &filesize))) { |
| 536 |
waveform[filesize] = '\0'; |
| 537 |
ast_log(LOG_WARNING, "Festival returned LP : %s\n", waveform); |
| 538 |
ast_free(waveform); |
| 539 |
} |
| 540 |
} else if (strcmp(ack, "ER\n") == 0) { |
| 541 |
ast_log(LOG_WARNING, "Festival returned ER\n"); |
| 542 |
res = -1; |
| 543 |
break; |
| 544 |
} |
| 545 |
} while (strcmp(ack, "OK\n") != 0); |
| 546 |
close(fd); |
| 547 |
ast_config_destroy(cfg); |
| 548 |
return res; |
| 549 |
} |
| 550 |
|
| 551 |
static int unload_module(void) |
| 552 |
{ |
| 553 |
return ast_unregister_application(app); |
| 554 |
} |
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
|
| 566 |
static int load_module(void) |
| 567 |
{ |
| 568 |
struct ast_flags config_flags = { 0 }; |
| 569 |
struct ast_config *cfg = ast_config_load(FESTIVAL_CONFIG, config_flags); |
| 570 |
if (!cfg) { |
| 571 |
ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG); |
| 572 |
return AST_MODULE_LOAD_DECLINE; |
| 573 |
} else if (cfg == CONFIG_STATUS_FILEINVALID) { |
| 574 |
ast_log(LOG_ERROR, "Config file " FESTIVAL_CONFIG " is in an invalid format. Aborting.\n"); |
| 575 |
return AST_MODULE_LOAD_DECLINE; |
| 576 |
} |
| 577 |
ast_config_destroy(cfg); |
| 578 |
return ast_register_application_xml(app, festival_exec); |
| 579 |
} |
| 580 |
|
| 581 |
AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Simple Festival Interface"); |