Newer
Older
*/
static struct ast_translator lintog726 = {
"lintog726",
AST_FORMAT_SLINEAR,
AST_FORMAT_G726,
lintog726_new,
lintog726_framein,
lintog726_frameout,
g726_destroy,
/* NULL */
lintog726_sample
};
Mark Spencer
committed
static void
parse_config(void)
{
struct ast_config *cfg;
struct ast_variable *var;
if ((cfg = ast_config_load("codecs.conf"))) {
if ((var = ast_variable_browse(cfg, "plc"))) {
while (var) {
if (!strcasecmp(var->name, "genericplc")) {
useplc = ast_true(var->value) ? 1 : 0;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n", useplc ? "" : "not ");
Mark Spencer
committed
}
var = var->next;
}
}
Mark Spencer
committed
}
}
int
reload(void)
{
parse_config();
return 0;
}
int
unload_module (void)
{
int res;
ast_mutex_lock (&localuser_lock);
res = ast_unregister_translator (&lintog726);
if (!res)
res = ast_unregister_translator (&g726tolin);
if (localusecnt)
res = -1;
ast_mutex_unlock (&localuser_lock);
return res;
}
int
load_module (void)
{
int res;
Mark Spencer
committed
parse_config();
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
res = ast_register_translator (&g726tolin);
if (!res)
res = ast_register_translator (&lintog726);
else
ast_unregister_translator (&g726tolin);
return res;
}
/*
* Return a description of this module.
*/
char *
description (void)
{
return tdesc;
}
int
usecount (void)
{
int res;
STANDARD_USECOUNT (res);
return res;
}
char *
key ()
{
return ASTERISK_GPL_KEY;
}