@ -55,6 +55,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$");
# endif
SaEvtHandleT evt_handle ;
static SaAisErrorT evt_init_res ;
void evt_channel_open_cb ( SaInvocationT invocation , SaEvtChannelHandleT channel_handle ,
SaAisErrorT error ) ;
@ -532,19 +533,18 @@ static void destroy_event_channels(void)
struct event_channel * event_channel ;
AST_RWLIST_WRLOCK ( & event_channels ) ;
while ( ( event_channel = AST_RWLIST_REMOVE_HEAD ( & event_channels , entry ) ) )
while ( ( event_channel = AST_RWLIST_REMOVE_HEAD ( & event_channels , entry ) ) ) {
event_channel_destroy ( event_channel ) ;
}
AST_RWLIST_UNLOCK ( & event_channels ) ;
}
int ast_ais_evt_load_module ( void )
{
SaAisErrorT ais_res ;
ais_res = saEvtInitialize ( & evt_handle , & evt_callbacks , & ais_version ) ;
if ( ais_res ! = SA_AIS_OK ) {
evt_init_res = saEvtInitialize ( & evt_handle , & evt_callbacks , & ais_version ) ;
if ( evt_init_res ! = SA_AIS_OK ) {
ast_log ( LOG_ERROR , " Could not initialize eventing service: %s \n " ,
ais_err2str ( ais _res) ) ;
ais_err2str ( evt_init_res ) ) ;
return - 1 ;
}
@ -559,6 +559,10 @@ int ast_ais_evt_unload_module(void)
{
SaAisErrorT ais_res ;
if ( evt_init_res ! = SA_AIS_OK ) {
return 0 ;
}
destroy_event_channels ( ) ;
ais_res = saEvtFinalize ( evt_handle ) ;