Wed Apr 6 11:29:48 2011

Asterisk developer's documentation


ais.h File Reference

Usage of the SAForum AIS (Application Interface Specification). More...

#include <saAis.h>
#include <saClm.h>
#include <saEvt.h>

Go to the source code of this file.

Functions

const char * ais_err2str (SaAisErrorT error)
int ast_ais_clm_load_module (void)
int ast_ais_clm_unload_module (void)
int ast_ais_evt_load_module (void)
int ast_ais_evt_unload_module (void)

Variables

SaVersionT ais_version
SaClmHandleT clm_handle
SaEvtHandleT evt_handle


Detailed Description

Usage of the SAForum AIS (Application Interface Specification).

Author:
Russell Bryant <russell@digium.com>

Definition in file ais.h.


Function Documentation

const char* ais_err2str ( SaAisErrorT  error  ) 

Definition at line 102 of file res_ais.c.

References ais_errors, ARRAY_LEN, and ais_error::desc.

Referenced by add_subscribe_event(), ast_ais_clm_load_module(), ast_ais_clm_unload_module(), ast_ais_evt_load_module(), ast_ais_evt_unload_module(), ast_event_cb(), build_event_channel(), event_channel_destroy(), evt_event_deliver_cb(), and subscribe_event_destroy().

00103 {
00104    int x;
00105 
00106    for (x = 0; x < ARRAY_LEN(ais_errors); x++) {
00107       if (ais_errors[x].error == error)
00108          return ais_errors[x].desc;
00109    }
00110 
00111    return "Unknown";
00112 }

int ast_ais_clm_load_module ( void   ) 

Definition at line 136 of file clm.c.

References ais_cli, ais_err2str(), ais_version, ARRAY_LEN, ast_cli_register_multiple(), ast_log(), clm_callbacks, clm_handle, clm_init_res, and LOG_ERROR.

Referenced by load_module().

00137 {
00138    clm_init_res = saClmInitialize(&clm_handle, &clm_callbacks, &ais_version);
00139    if (clm_init_res != SA_AIS_OK) {
00140       ast_log(LOG_ERROR, "Could not initialize cluster membership service: %s\n",
00141          ais_err2str(clm_init_res));
00142       return -1;
00143    }
00144 
00145    ast_cli_register_multiple(ais_cli, ARRAY_LEN(ais_cli));
00146 
00147    return 0;
00148 }

int ast_ais_clm_unload_module ( void   ) 

Definition at line 150 of file clm.c.

References ais_cli, ais_err2str(), ARRAY_LEN, ast_cli_unregister_multiple(), ast_log(), clm_handle, clm_init_res, and LOG_ERROR.

Referenced by load_module(), and unload_module().

00151 {
00152    SaAisErrorT ais_res;
00153 
00154    if (clm_init_res != SA_AIS_OK) {
00155       return 0;
00156    }
00157 
00158    ast_cli_unregister_multiple(ais_cli, ARRAY_LEN(ais_cli));
00159 
00160    ais_res = saClmFinalize(clm_handle);
00161    if (ais_res != SA_AIS_OK) {
00162       ast_log(LOG_ERROR, "Problem stopping cluster membership service: %s\n",
00163          ais_err2str(ais_res));
00164       return -1;
00165    }
00166 
00167    return 0;
00168 }

int ast_ais_evt_load_module ( void   ) 

Definition at line 542 of file evt.c.

References ais_cli, ais_err2str(), ais_version, ARRAY_LEN, ast_cli_register_multiple(), ast_log(), evt_callbacks, evt_handle, evt_init_res, load_config(), and LOG_ERROR.

Referenced by load_module().

00543 {
00544    evt_init_res = saEvtInitialize(&evt_handle, &evt_callbacks, &ais_version);
00545    if (evt_init_res != SA_AIS_OK) {
00546       ast_log(LOG_ERROR, "Could not initialize eventing service: %s\n",
00547          ais_err2str(evt_init_res));
00548       return -1;
00549    }
00550 
00551    load_config();
00552 
00553    ast_cli_register_multiple(ais_cli, ARRAY_LEN(ais_cli));
00554 
00555    return 0;
00556 }

int ast_ais_evt_unload_module ( void   ) 

Definition at line 558 of file evt.c.

References ais_err2str(), ast_log(), destroy_event_channels(), evt_handle, evt_init_res, and LOG_ERROR.

Referenced by load_module(), and unload_module().

00559 {
00560    SaAisErrorT ais_res;
00561 
00562    if (evt_init_res != SA_AIS_OK) {
00563       return 0;
00564    }
00565 
00566    destroy_event_channels();
00567 
00568    ais_res = saEvtFinalize(evt_handle);
00569    if (ais_res != SA_AIS_OK) {
00570       ast_log(LOG_ERROR, "Problem stopping eventing service: %s\n",
00571          ais_err2str(ais_res));
00572       return -1;
00573    }
00574 
00575    return 0;
00576 }


Variable Documentation

SaVersionT ais_version

Definition at line 67 of file res_ais.c.

Referenced by ast_ais_clm_load_module(), and ast_ais_evt_load_module().

SaClmHandleT clm_handle

Definition at line 48 of file clm.c.

Referenced by ais_clm_show_members(), ast_ais_clm_load_module(), ast_ais_clm_unload_module(), ast_event_cb(), and dispatch_thread_handler().

SaEvtHandleT evt_handle

Definition at line 57 of file evt.c.

Referenced by ast_ais_evt_load_module(), ast_ais_evt_unload_module(), build_event_channel(), and dispatch_thread_handler().


Generated on Wed Apr 6 11:29:48 2011 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7