mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix ENUM to live w/out config file, and fix internationalization
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -147,8 +147,6 @@ static int load_config(void)
|
|||||||
struct ast_config *cfg;
|
struct ast_config *cfg;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
ast_log(LOG_WARNING, "reading enum config\n");
|
|
||||||
|
|
||||||
cfg = ast_load(ENUM_CONFIG);
|
cfg = ast_load(ENUM_CONFIG);
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
if (!(s=ast_variable_retrieve(cfg, "general", "h323driver"))) {
|
if (!(s=ast_variable_retrieve(cfg, "general", "h323driver"))) {
|
||||||
@@ -159,8 +157,8 @@ static int load_config(void)
|
|||||||
ast_destroy(cfg);
|
ast_destroy(cfg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ast_log(LOG_WARNING, "Error reading enum config\n");
|
ast_log(LOG_NOTICE, "No ENUM Config file, using defaults\n");
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
17
file.c
17
file.c
@@ -419,21 +419,24 @@ struct ast_filestream *ast_openstream(struct ast_channel *chan, char *filename,
|
|||||||
*/
|
*/
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
int fmts = -1;
|
int fmts = -1;
|
||||||
char filename2[256];
|
char filename2[256]="";
|
||||||
char lang2[MAX_LANGUAGE];
|
char filename3[256]="";
|
||||||
|
char *endpart;
|
||||||
int res;
|
int res;
|
||||||
ast_stopstream(chan);
|
ast_stopstream(chan);
|
||||||
/* do this first, otherwise we detect the wrong writeformat */
|
/* do this first, otherwise we detect the wrong writeformat */
|
||||||
if (chan->generator)
|
if (chan->generator)
|
||||||
ast_deactivate_generator(chan);
|
ast_deactivate_generator(chan);
|
||||||
if (preflang && strlen(preflang)) {
|
if (preflang && strlen(preflang)) {
|
||||||
|
strncpy(filename3, filename, sizeof(filename3) - 1);
|
||||||
|
endpart = strrchr(filename3, '/');
|
||||||
|
if (endpart) {
|
||||||
|
*endpart = '\0';
|
||||||
|
endpart++;
|
||||||
|
snprintf(filename2, sizeof(filename2), "%s/%s/%s", filename3, preflang, endpart);
|
||||||
|
} else
|
||||||
snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename);
|
snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename);
|
||||||
fmts = ast_fileexists(filename2, NULL, NULL);
|
fmts = ast_fileexists(filename2, NULL, NULL);
|
||||||
if (fmts < 1) {
|
|
||||||
strncpy(lang2, preflang, sizeof(lang2)-1);
|
|
||||||
snprintf(filename2, sizeof(filename2), "%s/%s", lang2, filename);
|
|
||||||
fmts = ast_fileexists(filename2, NULL, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (fmts < 1) {
|
if (fmts < 1) {
|
||||||
strncpy(filename2, filename, sizeof(filename2)-1);
|
strncpy(filename2, filename, sizeof(filename2)-1);
|
||||||
|
Reference in New Issue
Block a user