From: Alexandr Anikin Date: Wed, 18 Dec 2013 19:10:42 +0000 (+0000) Subject: Implement module reload command for chan_ooh323 X-Git-Tag: 13.0.0-beta1~733 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e23b8d19a49d4ee4faf3dc167ddb7ba7afe36a46;p=thirdparty%2Fasterisk.git Implement module reload command for chan_ooh323 (close issue ASTERISK-22817) Patches: ooh323_module_reload.patch git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404198 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index 56a1b7b683..ff0a030adf 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -3896,6 +3896,22 @@ static int load_module(void) return 0; } +static int reload_module(void) +{ + ast_mutex_lock(&h323_reload_lock); + if (h323_reloading) { + ast_verb(0, "Previous OOH323 reload not yet done\n"); + } else { + h323_reloading = 1; + } + ast_mutex_unlock(&h323_reload_lock); + restart_monitor(); + + if (gH323Debug) + ast_verb(0, "+++ ooh323_reload\n"); + + return 0; +} static void *do_monitor(void *data) { @@ -5180,4 +5196,9 @@ void ast_ooh323c_exit() } #endif -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Objective Systems H323 Channel"); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Objective Systems H323 Channel", + .load = load_module, + .unload = unload_module, + .reload = reload_module, + .load_pri = AST_MODPRI_CHANNEL_DRIVER + );