Fri Nov 12 11:47:53 2010

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>
Include dependency graph for ais.h:
This graph shows which files directly or indirectly include this file:

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 135 of file clm.c.

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

Referenced by load_module().

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

int ast_ais_clm_unload_module ( void   ) 

Definition at line 151 of file clm.c.

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

Referenced by load_module(), and unload_module().

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

int ast_ais_evt_load_module ( void   ) 

Definition at line 540 of file evt.c.

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

Referenced by load_module().

00541 {
00542    SaAisErrorT ais_res;
00543 
00544    ais_res = saEvtInitialize(&evt_handle, &evt_callbacks, &ais_version);
00545    if (ais_res != SA_AIS_OK) {
00546       ast_log(LOG_ERROR, "Could not initialize eventing service: %s\n",
00547          ais_err2str(ais_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, and LOG_ERROR.

Referenced by load_module(), and unload_module().

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


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
SaEvtHandleT evt_handle

Generated by  doxygen 1.6.2