From 20eef6a35a7df43a8b63353f4c1b69785a25201d Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Thu, 15 Nov 2012 10:37:50 +0000 Subject: [PATCH] Refuse to reload on active channels. --- CHANGES | 1 + chan_capi.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 86b880e..b5ec08d 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ CHANGES HEAD ------------------ +- refuse to reload on active channels chan_capi-1.1.6 diff --git a/chan_capi.c b/chan_capi.c index 28b0e0c..4b3c836 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -9021,12 +9021,16 @@ int load_module(void) #ifdef CC_AST_HAS_VERSION_1_4 static int reload(void) { - int ret; + int ret = 0; - cc_verbose(1, 0, VERBOSE_PREFIX_1 "config reload\n"); + if (usecnt) { + cc_verbose(1, 0, VERBOSE_PREFIX_1 "chan_capi refused reload because of active channels\n"); + } else { + cc_verbose(1, 0, VERBOSE_PREFIX_1 "chan_capi reload\n"); - unload_module(); - ret = load_module(); + unload_module(); + ret = load_module(); + } return ret; }