summaryrefslogtreecommitdiff
path: root/main/loader.c
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2008-06-12 17:27:55 +0000
committerJeff Peeler <jpeeler@digium.com>2008-06-12 17:27:55 +0000
commitef3b21472889eff8e88f7e83afb2251ef54722ce (patch)
tree4732aea57767a39cd0efe083ba0119911ee976a3 /main/loader.c
parent6ac8ccaba45c9c11fefe853d0c83a92e881c2abf (diff)
Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/main/loader.c b/main/loader.c
index b5a451617..990d2fb85 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -758,6 +758,23 @@ static struct load_order_entry *add_to_load_order(const char *resource, struct l
return order;
}
+
+static int translate_module_name(const char *oldname, char *newname)
+{
+ if (!strcasecmp(oldname, "app_zapbarge.so"))
+ ast_copy_string(newname, "app_dahdibarge.so", 18);
+ else if(!strcasecmp(oldname, "app_zapras.so"))
+ ast_copy_string(newname, "app_dahdiras.so", 16);
+ else if(!strcasecmp(oldname, "app_zapscan.so"))
+ ast_copy_string(newname, "app_dahdiscan.so", 17);
+ else if(!strcasecmp(oldname, "codec_zap.so"))
+ ast_copy_string(newname, "codec_dahdi.so", 16);
+ else
+ return -1; /* no use for newname, oldname is fine */
+
+ return 0;
+}
+
int load_modules(unsigned int preload_only)
{
struct ast_config *cfg;
@@ -769,6 +786,9 @@ int load_modules(unsigned int preload_only)
int res = 0;
struct ast_flags config_flags = { 0 };
int modulecount = 0;
+
+ int translate_status;
+ char newname[18]; /* although this would normally be 80, max length in translate_module_name is 18 */
#ifdef LOADABLE_MODULES
struct dirent *dirent;
DIR *dir;
@@ -796,8 +816,12 @@ int load_modules(unsigned int preload_only)
/* first, find all the modules we have been explicitly requested to load */
for (v = ast_variable_browse(cfg, "modules"); v; v = v->next) {
- if (!strcasecmp(v->name, preload_only ? "preload" : "load"))
- add_to_load_order(v->value, &load_order);
+ if (!strcasecmp(v->name, preload_only ? "preload" : "load")) {
+ translate_status = translate_module_name(v->value, newname);
+ if (!translate_status)
+ ast_log(LOG_WARNING, "Use of old module name %s is deprecated, please use %s instead.\n", v->value, newname);
+ add_to_load_order(translate_status ? v->value : newname, &load_order);
+ }
}
/* check if 'autoload' is on */
@@ -853,7 +877,10 @@ int load_modules(unsigned int preload_only)
continue;
AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) {
- if (!resource_name_match(order->resource, v->value)) {
+ translate_status = translate_module_name(v->value, newname);
+ if (!resource_name_match(order->resource, translate_status ? v->value : newname)) {
+ if (!translate_status)
+ ast_log(LOG_WARNING, "Use of old module name %s is deprecated, please use %s instead.\n", v->value, newname);
AST_LIST_REMOVE_CURRENT(entry);
ast_free(order->resource);
ast_free(order);