Asterisk - The Open Source Telephony Project GIT-master-2de1a68
Data Fields
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. More...
 
void(* destructor )(void *private_data)
 Destroy private data on the monitor. More...
 
int(* request_cc )(struct ast_cc_monitor *monitor, int *available_timer_id)
 Request CCSS. More...
 
int(* status_response )(struct ast_cc_monitor *monitor, enum ast_device_state devstate)
 Status response to an ast_cc_monitor_status_request(). More...
 
int(* suspend )(struct ast_cc_monitor *monitor)
 Suspend monitoring. More...
 
const char * type
 Type of monitor the callbacks belong to. More...
 
int(* unsuspend )(struct ast_cc_monitor *monitor)
 Unsuspend monitoring. More...
 

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 542 of file ccss.h.

Field Documentation

◆ cancel_available_timer

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

Cancel the running available timer.

Parameters
monitorCC core monitor control.
sched_idAvailable 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
0on success
-1on failure.

Definition at line 623 of file ccss.h.

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

◆ destructor

void(* destructor) (void *private_data)

Destroy private data on the monitor.

Parameters
private_dataThe 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.

Definition at line 634 of file ccss.h.

Referenced by call_destructor_with_no_monitor(), and cc_monitor_destroy().

◆ request_cc

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

Request CCSS.

Parameters
monitorCC core monitor control.
available_timer_idThe 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
0on success
-1on failure.

Definition at line 565 of file ccss.h.

Referenced by request_cc().

◆ status_response

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

Status response to an ast_cc_monitor_status_request().

Parameters
monitorCC core monitor control.
devstateCurrent 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
0on success
-1on failure.

Definition at line 594 of file ccss.h.

Referenced by cc_status_response().

◆ suspend

int(* suspend) (struct ast_cc_monitor *monitor)

Suspend monitoring.

Parameters
monitorCC core monitor control.

Implementers must perform the necessary steps to suspend monitoring.

Return values
0on success
-1on failure.

Definition at line 578 of file ccss.h.

Referenced by suspend().

◆ type

const char* type

Type of monitor the callbacks belong to.

Note
Examples include "generic" and "SIP"

Definition at line 549 of file ccss.h.

Referenced by find_monitor_callbacks(), and Property::load().

◆ unsuspend

int(* unsuspend) (struct ast_cc_monitor *monitor)

Unsuspend monitoring.

Parameters
monitorCC core monitor control.

Perform the necessary steps to unsuspend monitoring.

Return values
0on success
-1on failure.

Definition at line 606 of file ccss.h.

Referenced by unsuspend().


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