if (restartnow)
execvp(_argv[0], _argv);
/* XXX This could deadlock XXX */
if (restartnow)
execvp(_argv[0], _argv);
/* XXX This could deadlock XXX */
+ ast_module_reload(NULL);
}
static void child_handler(int sig)
}
static void child_handler(int sig)
+ 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);
/* Check hook state */
if (p->subs[SUB_REAL].zfd > -1)
res = ioctl(p->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &par);
}
if (res) {
ast_log(LOG_WARNING, "Unable to check hook state on channel %d\n", p->channel);
}
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
/* 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
if (par.rxisoffhook)
return 1;
else
static int handle_reload(int fd, int argc, char *argv[])
{
static int handle_reload(int fd, int argc, char *argv[])
{
+ if (argc > 1) {
+ for (x=1;x<argc;x++)
+ ast_module_reload(argv[x]);
+ } else
+ ast_module_reload(NULL);
* 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.
*/
* 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));
int ast_register_atexit(void (*func)(void));
void ast_unregister_atexit(void (*func)(void));
- * 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
*
* This program is free software, distributed under the terms of
* the GNU General Public License
-void ast_module_reload(void)
+void ast_module_reload(const char *name)
ast_mutex_lock(&modlock);
m = module_list;
while(m) {
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();
+ }