Oops it didn't make it in
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
787822b4c8
commit
eadd6c5509
|
@ -305,9 +305,9 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||||
if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) {
|
if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) {
|
||||||
festivalcommand = "(tts_textasterisk \"%s\" 'file)(quit)\n";
|
festivalcommand = "(tts_textasterisk \"%s\" 'file)(quit)\n";
|
||||||
}
|
}
|
||||||
ast_destroy(cfg);
|
|
||||||
if (!vdata || ast_strlen_zero(vdata)) {
|
if (!vdata || ast_strlen_zero(vdata)) {
|
||||||
ast_log(LOG_WARNING, "festival requires an argument (text)\n");
|
ast_log(LOG_WARNING, "festival requires an argument (text)\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
strncpy(data, vdata, sizeof(data) - 1);
|
strncpy(data, vdata, sizeof(data) - 1);
|
||||||
|
@ -325,6 +325,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
ast_log(LOG_WARNING,"festival_client: can't get socket\n");
|
ast_log(LOG_WARNING,"festival_client: can't get socket\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||||
|
@ -333,6 +334,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||||
serverhost = ast_gethostbyname(host, &ahp);
|
serverhost = ast_gethostbyname(host, &ahp);
|
||||||
if (serverhost == (struct hostent *)0) {
|
if (serverhost == (struct hostent *)0) {
|
||||||
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
|
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
|
memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
|
||||||
|
@ -342,6 +344,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||||
|
|
||||||
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
|
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
|
||||||
ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
|
ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
|
||||||
|
ast_destroy(cfg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,6 +447,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||||
}
|
}
|
||||||
} while (strcmp(ack,"OK\n") != 0);
|
} while (strcmp(ack,"OK\n") != 0);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
ast_destroy(cfg);
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue