mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-21 04:03:28 +00:00
More changes to change return values from load_module functions.
(issue #11096) Patches: codec_adpcm.c.patch uploaded by moy (license 222) codec_alaw.c.patch uploaded by moy (license 222) codec_a_mu.c.patch uploaded by moy (license 222) codec_g722.c.patch uploaded by moy (license 222) codec_g726.c.diff uploaded by moy (license 222) codec_gsm.c.patch uploaded by moy (license 222) codec_ilbc.c.patch uploaded by moy (license 222) codec_lpc10.c.patch uploaded by moy (license 222) codec_speex.c.patch uploaded by moy (license 222) codec_ulaw.c.patch uploaded by moy (license 222) codec_zap.c.patch uploaded by moy (license 222) format_g723.c.patch uploaded by moy (license 222) format_g726.c.patch uploaded by moy (license 222) format_g729.c.patch uploaded by moy (license 222) format_gsm.c.patch uploaded by moy (license 222) format_h263.c.patch uploaded by moy (license 222) format_h264.c.patch uploaded by moy (license 222) format_ilbc.c.patch uploaded by moy (license 222) format_jpeg.c.patch uploaded by moy (license 222) format_ogg_vorbis.c.patch uploaded by moy (license 222) format_pcm.c.patch uploaded by moy (license 222) format_sln.c.patch uploaded by moy (license 222) format_vox.c.patch uploaded by moy (license 222) format_wav.c.patch uploaded by moy (license 222) format_wav_gsm.c.patch uploaded by moy (license 222) res_adsi.c.patch uploaded by eliel (license 64) res_ael_share.c.patch uploaded by eliel (license 64) res_clioriginate.c.patch uploaded by eliel (license 64) res_convert.c.patch uploaded by eliel (license 64) res_indications.c.patch uploaded by eliel (license 64) res_musiconhold.c.patch uploaded by eliel (license 64) res_smdi.c.patch uploaded by eliel (license 64) res_speech.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -161,8 +161,9 @@ static int load_module(void)
|
||||
res = ast_register_translator(&ulawtoalaw);
|
||||
else
|
||||
ast_unregister_translator(&alawtoulaw);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "A-law and Mulaw direct Coder/Decoder");
|
||||
|
@@ -350,13 +350,15 @@ static struct ast_translator lintoadpcm = {
|
||||
.buf_size = BUFFER_SAMPLES/ 2, /* 2 samples per byte */
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
struct ast_variable *var;
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -364,13 +366,15 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief standard module glue */
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -387,14 +391,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res = ast_register_translator(&adpcmtolin);
|
||||
if (!res)
|
||||
res = ast_register_translator(&lintoadpcm);
|
||||
else
|
||||
ast_unregister_translator(&adpcmtolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Adaptive Differential PCM Coder/Decoder",
|
||||
|
@@ -134,13 +134,15 @@ static struct ast_translator lintoalaw = {
|
||||
.buf_size = BUFFER_SAMPLES,
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
alawtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -148,14 +150,16 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief standard module stuff */
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -172,14 +176,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res = ast_register_translator(&alawtolin);
|
||||
if (!res)
|
||||
res = ast_register_translator(&lintoalaw);
|
||||
else
|
||||
ast_unregister_translator(&alawtolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "A-law Coder/Decoder",
|
||||
|
@@ -164,14 +164,16 @@ static struct ast_translator lintog722 = {
|
||||
.buf_size = BUFFER_SAMPLES,
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
g722tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -180,13 +182,14 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -204,15 +207,18 @@ static int load_module(void)
|
||||
int res = 0;
|
||||
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
|
||||
res |= ast_register_translator(&g722tolin);
|
||||
res |= ast_register_translator(&lintog722);
|
||||
|
||||
if (res)
|
||||
if (res) {
|
||||
unload_module();
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
|
||||
return res;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.722-64kbps G722 Transcoder",
|
||||
|
@@ -894,14 +894,16 @@ static struct ast_translator g726aal2tog726 = {
|
||||
.buf_size = BUFFER_SAMPLES,
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
g726tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -910,13 +912,14 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -940,7 +943,8 @@ static int load_module(void)
|
||||
int res = 0;
|
||||
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
|
||||
res |= ast_register_translator(&g726tolin);
|
||||
res |= ast_register_translator(&lintog726);
|
||||
@@ -951,10 +955,12 @@ static int load_module(void)
|
||||
res |= ast_register_translator(&g726aal2tog726);
|
||||
res |= ast_register_translator(&g726tog726aal2);
|
||||
|
||||
if (res)
|
||||
if (res) {
|
||||
unload_module();
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
|
||||
return res;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.726-32kbps G726 Transcoder",
|
||||
|
@@ -235,13 +235,15 @@ static struct ast_translator lintogsm = {
|
||||
};
|
||||
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
if (!cfg || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (!cfg)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -249,13 +251,16 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief standard module glue */
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
return 0;
|
||||
if (parse_config(1)) {
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
}
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -273,14 +278,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res = ast_register_translator(&gsmtolin);
|
||||
if (!res)
|
||||
res=ast_register_translator(&lintogsm);
|
||||
else
|
||||
ast_unregister_translator(&gsmtolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "GSM Coder/Decoder",
|
||||
|
@@ -237,8 +237,9 @@ static int load_module(void)
|
||||
res=ast_register_translator(&lintoilbc);
|
||||
else
|
||||
ast_unregister_translator(&ilbctolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "iLBC Coder/Decoder");
|
||||
|
@@ -261,13 +261,15 @@ static struct ast_translator lintolpc10 = {
|
||||
.buf_size = LPC10_BYTES_IN_COMPRESSED_FRAME * (1 + BUFFER_SAMPLES / LPC10_SAMPLES_PER_FRAME),
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -276,13 +278,14 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -300,14 +303,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res = ast_register_translator(&lpc10tolin);
|
||||
if (!res)
|
||||
res = ast_register_translator(&lintolpc10);
|
||||
else
|
||||
ast_unregister_translator(&lpc10tolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "LPC10 2.4kbps Coder/Decoder",
|
||||
|
@@ -375,7 +375,7 @@ static struct ast_translator lintospeex = {
|
||||
.buf_size = BUFFER_SAMPLES * 2, /* XXX maybe a lot less ? */
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
@@ -384,7 +384,9 @@ static void parse_config(int reload)
|
||||
float res_f;
|
||||
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
|
||||
for (var = ast_variable_browse(cfg, "speex"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "quality")) {
|
||||
@@ -467,13 +469,14 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -490,14 +493,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res=ast_register_translator(&speextolin);
|
||||
if (!res)
|
||||
res=ast_register_translator(&lintospeex);
|
||||
else
|
||||
ast_unregister_translator(&speextolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Speex Coder/Decoder",
|
||||
|
@@ -147,13 +147,15 @@ static struct ast_translator lintoulaw = {
|
||||
.buffer_samples = BUFFER_SAMPLES,
|
||||
};
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (cfg == NULL)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
@@ -161,13 +163,14 @@ static void parse_config(int reload)
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
parse_config(1);
|
||||
|
||||
return 0;
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -184,14 +187,16 @@ static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
res = ast_register_translator(&ulawtolin);
|
||||
if (!res)
|
||||
res = ast_register_translator(&lintoulaw);
|
||||
else
|
||||
ast_unregister_translator(&ulawtolin);
|
||||
|
||||
return res;
|
||||
if (res)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "mu-Law Coder/Decoder",
|
||||
|
@@ -380,14 +380,16 @@ static void unregister_translators(void)
|
||||
AST_LIST_UNLOCK(&translators);
|
||||
}
|
||||
|
||||
static void parse_config(int reload)
|
||||
static int parse_config(int reload)
|
||||
{
|
||||
struct ast_variable *var;
|
||||
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
|
||||
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
|
||||
|
||||
if (!cfg || cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return;
|
||||
if (!cfg)
|
||||
return -1;
|
||||
if (cfg == CONFIG_STATUS_FILEUNCHANGED)
|
||||
return 0;
|
||||
|
||||
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
||||
if (!strcasecmp(var->name, "genericplc")) {
|
||||
@@ -396,8 +398,8 @@ static void parse_config(int reload)
|
||||
global_useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
|
||||
@@ -456,14 +458,15 @@ static int reload(void)
|
||||
{
|
||||
struct translator *cur;
|
||||
|
||||
parse_config(1);
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
|
||||
AST_LIST_LOCK(&translators);
|
||||
AST_LIST_TRAVERSE(&translators, cur, entry)
|
||||
cur->t.useplc = global_useplc;
|
||||
AST_LIST_UNLOCK(&translators);
|
||||
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
@@ -476,11 +479,11 @@ static int unload_module(void)
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
parse_config(0);
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
find_transcoders();
|
||||
ast_cli_register_multiple(cli, sizeof(cli) / sizeof(cli[0]));
|
||||
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic Zaptel Transcoder Codec Translator",
|
||||
|
@@ -152,7 +152,9 @@ static const struct ast_format g723_1_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&g723_1_f);
|
||||
if (ast_format_register(&g723_1_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -255,10 +255,10 @@ static int load_module(void)
|
||||
for (i = 0; f[i].format ; i++) {
|
||||
if (ast_format_register(&f[i])) { /* errors are fatal */
|
||||
ast_log(LOG_WARNING, "Failed to register format %s.\n", f[i].name);
|
||||
return -1;
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -148,7 +148,9 @@ static const struct ast_format g729_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&g729_f);
|
||||
if (ast_format_register(&g729_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -170,7 +170,9 @@ static const struct ast_format gsm_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&gsm_f);
|
||||
if (ast_format_register(&gsm_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -186,7 +186,9 @@ static const struct ast_format h263_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&h263_f);
|
||||
if (ast_format_register(&h263_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -175,7 +175,9 @@ static const struct ast_format h264_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&h264_f);
|
||||
if (ast_format_register(&h264_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -146,7 +146,9 @@ static const struct ast_format ilbc_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&ilbc_f);
|
||||
if (ast_format_register(&ilbc_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -114,7 +114,9 @@ static struct ast_imager jpeg_format = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_image_register(&jpeg_format);
|
||||
if (ast_image_register(&jpeg_format))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -553,7 +553,9 @@ static const struct ast_format vorbis_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&vorbis_f);
|
||||
if (ast_format_register(&vorbis_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -479,10 +479,12 @@ static int load_module(void)
|
||||
for (index = 0; index < (sizeof(alaw_silence) / sizeof(alaw_silence[0])); index++)
|
||||
alaw_silence[index] = AST_LIN2A(0);
|
||||
|
||||
return ast_format_register(&pcm_f)
|
||||
if ( ast_format_register(&pcm_f)
|
||||
|| ast_format_register(&alaw_f)
|
||||
|| ast_format_register(&au_f)
|
||||
|| ast_format_register(&g722_f);
|
||||
|| ast_format_register(&g722_f) )
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -130,7 +130,9 @@ static const struct ast_format slin_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&slin_f);
|
||||
if (ast_format_register(&slin_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -135,7 +135,9 @@ static const struct ast_format vox_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&vox_f);
|
||||
if (ast_format_register(&vox_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -491,7 +491,9 @@ static const struct ast_format wav_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&wav_f);
|
||||
if (ast_format_register(&wav_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -559,7 +559,9 @@ static const struct ast_format wav49_f = {
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return ast_format_register(&wav49_f);
|
||||
if (ast_format_register(&wav49_f))
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -1106,7 +1106,7 @@ static int load_module(void)
|
||||
ast_adsi_input_control = _ast_adsi_input_control;
|
||||
ast_adsi_input_format = _ast_adsi_input_format;
|
||||
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -52,7 +52,7 @@ static int unload_module(void)
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "share-able code for AEL",
|
||||
|
@@ -190,7 +190,7 @@ static int unload_module(void)
|
||||
static int load_module(void)
|
||||
{
|
||||
ast_cli_register_multiple(cli_cliorig, sizeof(cli_cliorig) / sizeof(struct ast_cli_entry));
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call origination from the CLI");
|
||||
|
@@ -159,7 +159,7 @@ static int unload_module(void)
|
||||
static int load_module(void)
|
||||
{
|
||||
ast_cli_register_multiple(cli_convert, sizeof(cli_convert) / sizeof(struct ast_cli_entry));
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "File format conversion CLI command");
|
||||
|
@@ -410,7 +410,7 @@ static int load_module(void)
|
||||
ast_register_application("PlayTones", handle_playtones, "Play a tone list", playtones_desc);
|
||||
ast_register_application("StopPlayTones", handle_stopplaytones, "Stop playing a tone list","Stop playing a tone list");
|
||||
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
/*! \brief Reload indications module */
|
||||
|
@@ -1322,7 +1322,7 @@ static int load_module(void)
|
||||
ast_install_music_functions(local_ast_moh_start, local_ast_moh_stop, local_ast_moh_cleanup);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
|
@@ -715,7 +715,7 @@ static int load_module(void)
|
||||
ast_log(LOG_WARNING, "No SMDI interfaces are available to listen on, not starting SMDI listener.\n");
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
} else
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -341,7 +341,7 @@ static int unload_module(void)
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
return 0;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Generic Speech Recognition API",
|
||||
|
Reference in New Issue
Block a user