aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-13 20:33:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-13 20:33:47 +0000
commitc00ef9ca0bb3142d1e816587a724de6c18db440c (patch)
treede4dfab0a31159d0f01605e5ae661258c44356e7 /channels
parent886c85d18ece145a1091f5317b0c860dd0a4bf74 (diff)
document dahdichanname option in doc/asterisk-conf.txt
make chan_dahdi read its configuration from zapata.conf if dahdichanname has been set to 'no' git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@137527 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index b85e0ab38..33a0ccef7 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -11470,16 +11470,23 @@ static int setup_dahdi(int reload)
#endif
#ifdef HAVE_ZAPTEL
- if (!(cfg = ast_config_load("zapata.conf"))) {
- ast_log(LOG_ERROR, "Unable to load zapata.conf\n");
- return 0;
- }
+ int load_from_zapata_conf = 1;
#else
- if (!(cfg = ast_config_load("chan_dahdi.conf"))) {
- ast_log(LOG_ERROR, "Unable to load chan_dahdi.conf\n");
- return 0;
- }
+ int load_from_zapata_conf = (dahdi_chan_mode == CHAN_ZAP_MODE);
#endif
+
+ if (load_from_zapata_conf) {
+ if (!(cfg = ast_config_load("zapata.conf"))) {
+ ast_log(LOG_ERROR, "Unable to load zapata.conf\n");
+ return 0;
+ }
+ } else {
+ if (!(cfg = ast_config_load("chan_dahdi.conf"))) {
+ ast_log(LOG_ERROR, "Unable to load chan_dahdi.conf\n");
+ return 0;
+ }
+ }
+
/* It's a little silly to lock it, but we mind as well just to be sure */
ast_mutex_lock(&iflock);
#ifdef HAVE_PRI