aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xasterisk.c2
-rwxr-xr-xchannels/chan_zap.c10
-rwxr-xr-xcli.c9
-rwxr-xr-xinclude/asterisk/module.h2
-rwxr-xr-xloader.c16
5 files changed, 25 insertions, 14 deletions
diff --git a/asterisk.c b/asterisk.c
index fc1d2363c..f84a738e4 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -446,7 +446,7 @@ static void hup_handler(int num)
if (restartnow)
execvp(_argv[0], _argv);
/* XXX This could deadlock XXX */
- ast_module_reload();
+ ast_module_reload(NULL);
}
static void child_handler(int sig)
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index cafe99e14..660c59c48 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -6291,6 +6291,8 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
#endif
if (!p->radio)
{
+ if (!p->sig || (p->sig == SIG_FXSLS))
+ return 1;
/* Check hook state */
if (p->subs[SUB_REAL].zfd > -1)
res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &par);
@@ -6301,10 +6303,12 @@ static inline int available(struct zt_pvt *p, int channelmatch, int groupmatch,
}
if (res) {
ast_log(LOG_WARNING, "Unable to check hook state on channel %d\n", p->channel);
- } else if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS) ||
- (p->sig == SIG_FXSGS) || !p->sig) {
+ } else if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSGS)) {
/* When "onhook" that means no battery on the line, and thus
- it is out of service... */
+ it is out of service..., if it's on a TDM card... If it's a channel
+ bank, there is no telling... */
+ if (par.rxbits > -1)
+ return 1;
if (par.rxisoffhook)
return 1;
else
diff --git a/cli.c b/cli.c
index 898c95555..0aaf0d2d6 100755
--- a/cli.c
+++ b/cli.c
@@ -109,9 +109,14 @@ static int handle_load(int fd, int argc, char *argv[])
static int handle_reload(int fd, int argc, char *argv[])
{
- if (argc != 1)
+ int x;
+ if (argc < 1)
return RESULT_SHOWUSAGE;
- ast_module_reload();
+ if (argc > 1) {
+ for (x=1;x<argc;x++)
+ ast_module_reload(argv[x]);
+ } else
+ ast_module_reload(NULL);
return RESULT_SUCCESS;
}
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index 83f44ebe9..87aa590f9 100755
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -138,7 +138,7 @@ int ast_loader_unregister(int (*updater)(void));
* This reloads all modules set to load in asterisk. It does NOT run the unload
* routine and then loads them again, it runs the given reload routine.
*/
-void ast_module_reload(void);
+void ast_module_reload(const char *name);
int ast_register_atexit(void (*func)(void));
void ast_unregister_atexit(void (*func)(void));
diff --git a/loader.c b/loader.c
index c6a0ca24d..d09514c81 100755
--- a/loader.c
+++ b/loader.c
@@ -3,9 +3,9 @@
*
* Module Loader
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -147,7 +147,7 @@ int ast_unload_resource(char *resource_name, int force)
return res;
}
-void ast_module_reload(void)
+void ast_module_reload(const char *name)
{
struct module *m;
@@ -166,10 +166,12 @@ void ast_module_reload(void)
ast_mutex_lock(&modlock);
m = module_list;
while(m) {
- if (m->reload) {
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", m->resource, m->description());
- m->reload();
+ if (!name || !strcasecmp(name, m->resource)) {
+ if (m->reload) {
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", m->resource, m->description());
+ m->reload();
+ }
}
m = m->next;
}