Thu Apr 16 06:48:31 2015

Asterisk developer's documentation


ast_cc_monitor_callbacks Struct Reference

Callbacks defined by CC monitors. More...

#include <ccss.h>


Data Fields

int(* cancel_available_timer )(struct ast_cc_monitor *monitor, int *sched_id)
 Cancel the running available timer.
void(* destructor )(void *private_data)
 Destroy private data on the monitor.
int(* request_cc )(struct ast_cc_monitor *monitor, int *available_timer_id)
 Request CCSS.
int(* status_response )(struct ast_cc_monitor *monitor, enum ast_device_state devstate)
 Status response to an ast_cc_monitor_status_request().
int(* suspend )(struct ast_cc_monitor *monitor)
 Suspend monitoring.
const char * type
 Type of monitor the callbacks belong to.
int(* unsuspend )(struct ast_cc_monitor *monitor)
 Unsuspend monitoring.


Detailed Description

Callbacks defined by CC monitors.

Note:
Every callback is called with the list of monitors locked. There are several public API calls that also will try to lock this lock. These public functions have a note in their doxygen stating so. As such, pay attention to the lock order you establish in these callbacks to ensure that you do not violate the lock order when calling the functions in this file with lock order notices.

Definition at line 559 of file ccss.h.


Field Documentation

int(* cancel_available_timer)(struct ast_cc_monitor *monitor, int *sched_id)

Cancel the running available timer.

Parameters:
monitor CC core monitor control.
sched_id Available timer scheduler id to cancel. Will never be NULL for a device monitor.
In most cases, this function will likely consist of just a call to AST_SCHED_DEL. It might have been possible to do this within the core, but unfortunately the mixture of sched_thread and sched usage in Asterisk prevents such usage.

Return values:
0 on success
-1 on failure.

Referenced by cancel_available_timer(), cc_interface_tree_destroy(), and cc_monitor_failed().

void(* destructor)(void *private_data)

Destroy private data on the monitor.

Parameters:
private_data The private data pointer from the monitor.
Implementers of this callback are responsible for destroying all heap-allocated data in the monitor's private_data pointer, including the private_data itself.

Referenced by call_destructor_with_no_monitor(), and cc_monitor_destroy().

int(* request_cc)(struct ast_cc_monitor *monitor, int *available_timer_id)

Request CCSS.

Parameters:
monitor CC core monitor control.
available_timer_id The scheduler ID for the available timer. Will never be NULL for a device monitor.
Perform whatever steps are necessary in order to request CC. In addition, the monitor implementation is responsible for starting the available timer in this callback.

Return values:
0 on success
-1 on failure.

Referenced by request_cc().

int(* status_response)(struct ast_cc_monitor *monitor, enum ast_device_state devstate)

Status response to an ast_cc_monitor_status_request().

Parameters:
monitor CC core monitor control.
devstate Current status of a Party A device.
Alert a monitor as to the status of the agent for which the monitor had previously requested a status request.

Note:
Zero or more responses may come as a result.
Return values:
0 on success
-1 on failure.

Referenced by cc_status_response().

int(* suspend)(struct ast_cc_monitor *monitor)

Suspend monitoring.

Parameters:
monitor CC core monitor control.
Implementers must perform the necessary steps to suspend monitoring.

Return values:
0 on success
-1 on failure.

Referenced by suspend().

const char* type

Type of monitor the callbacks belong to.

Note:
Examples include "generic" and "SIP"

Definition at line 566 of file ccss.h.

Referenced by find_monitor_callbacks().

int(* unsuspend)(struct ast_cc_monitor *monitor)

Unsuspend monitoring.

Parameters:
monitor CC core monitor control.
Perform the necessary steps to unsuspend monitoring.

Return values:
0 on success
-1 on failure.

Referenced by unsuspend().


The documentation for this struct was generated from the following file:

Generated on Thu Apr 16 06:48:31 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6