2010-10-19 13:44:06 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
Copyright (c) Dialogic(R), 2010
|
|
|
|
|
|
|
|
*
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
*
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*! \file
|
|
|
|
* \brief Interface to chan_capi
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DIVA_STATUS_IFC_H__
|
|
|
|
#define __DIVA_STATUS_IFC_H__
|
|
|
|
|
|
|
|
typedef enum _diva_status_interface_state {
|
2010-10-22 22:44:50 +00:00
|
|
|
DivaStatusInterfaceStateNotAvailable = 0,
|
|
|
|
DivaStatusInterfaceStateOK = 1,
|
|
|
|
DivaStatusInterfaceStateERROR = -1,
|
2010-10-19 13:44:06 +00:00
|
|
|
} diva_status_interface_state_t;
|
|
|
|
|
2010-10-25 21:21:31 +00:00
|
|
|
typedef enum _diva_status_hardware_state {
|
|
|
|
DivaStatusHardwareStateUnknown = 0, /*! /brief divalog is not running or old version of divalog */
|
|
|
|
DivaStatusHardwareStateOK = 1, /*! /brief hardware status veriefied and OK */
|
|
|
|
DivaStatusHardwareStateERROR = -1 /*! /brief hardware status verified and not OK */
|
|
|
|
} diva_status_hardware_state_t;
|
|
|
|
|
2010-10-22 22:44:50 +00:00
|
|
|
/*!
|
|
|
|
\brief Check if Diva interface is available
|
|
|
|
*/
|
|
|
|
int diva_status_available(void);
|
|
|
|
|
|
|
|
typedef void (*diva_status_changed_cb_proc_t)(int controller, diva_status_interface_state_t state);
|
2010-10-25 21:21:31 +00:00
|
|
|
typedef void (*diva_hwstatus_changed_cb_proc_t)(int controller, diva_status_hardware_state_t hwstate);
|
2010-10-22 22:44:50 +00:00
|
|
|
|
2010-10-19 13:44:06 +00:00
|
|
|
/*!
|
|
|
|
\brief activate event based status notifications
|
2010-10-25 21:21:31 +00:00
|
|
|
|
|
|
|
\param fn called if interface state changes, includes hardware state
|
|
|
|
|
|
|
|
\param hwfn called if hardware status changed, hardware state only, used for processing of IP media streams by resource/chat commands
|
2010-10-19 13:44:06 +00:00
|
|
|
*/
|
2010-10-25 21:21:31 +00:00
|
|
|
diva_status_interface_state_t diva_status_init_interface(int controller,
|
|
|
|
diva_status_hardware_state_t* hwState,
|
|
|
|
diva_status_changed_cb_proc_t fn,
|
|
|
|
diva_hwstatus_changed_cb_proc_t hwfn);
|
2010-10-19 13:44:06 +00:00
|
|
|
/*!
|
|
|
|
\brief deactivate event based status notifications
|
|
|
|
*/
|
2010-10-22 22:44:50 +00:00
|
|
|
void diva_status_cleanup_interface(int controller);
|
2010-10-19 13:44:06 +00:00
|
|
|
/*!
|
|
|
|
\brief retrieve file handle to be used in async
|
|
|
|
I/O operations
|
|
|
|
*/
|
2010-10-22 22:44:50 +00:00
|
|
|
int diva_status_get_waitable_object(void);
|
2010-10-19 13:44:06 +00:00
|
|
|
/*!
|
|
|
|
\brief process status change events
|
|
|
|
*/
|
2010-10-22 22:44:50 +00:00
|
|
|
void diva_status_process_events(void);
|
2010-10-19 13:44:06 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Retrieve state of interface
|
|
|
|
DivaStatusInterfaceStateNotAvailable - ignore state
|
|
|
|
DivaStatusInterfaceStateOK - interface state verified and OK
|
|
|
|
DivaStatusInterfaceStateERROR - interface state verified and
|
|
|
|
can not be used to create calls
|
|
|
|
*/
|
2010-10-22 22:44:50 +00:00
|
|
|
diva_status_interface_state_t diva_status_get_interface_state(int controller);
|
2010-10-19 13:44:06 +00:00
|
|
|
|
2010-10-22 22:44:50 +00:00
|
|
|
const char* diva_status_interface_state_name(diva_status_interface_state_t state);
|
2010-10-25 21:21:31 +00:00
|
|
|
const char* diva_status_hw_state_name(diva_status_hardware_state_t hwState);
|
2010-10-19 13:44:06 +00:00
|
|
|
|
2010-10-26 09:53:16 +00:00
|
|
|
#ifdef CC_AST_HAS_VERSION_1_6
|
|
|
|
char *pbxcli_capi_ifc_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
|
|
|
|
#else
|
|
|
|
int pbxcli_capi_ifc_status(int fd, int argc, char *argv[]);
|
|
|
|
#endif
|
2010-10-19 13:44:06 +00:00
|
|
|
|
2010-10-26 09:53:16 +00:00
|
|
|
#define CC_CLI_TEXT_IFC_STATUSINFO "Show " CC_MESSAGE_BIGNAME " interface info"
|
|
|
|
#ifndef CC_AST_HAS_VERSION_1_6
|
|
|
|
extern char diva_status_ifc_state_usage[];
|
|
|
|
#endif
|
2010-10-19 13:44:06 +00:00
|
|
|
|
|
|
|
#endif
|