24#ifndef _ASTERISK_CCSS_H
25#define _ASTERISK_CCSS_H
135#define ast_cc_config_params_init() __ast_cc_config_params_init(__FILE__, __LINE__, __PRETTY_FUNCTION__)
178 char *
buf,
size_t buf_len);
455#define AST_CC_GENERIC_MONITOR_TYPE "generic"
1538 const
char *monitor_type, const
char * const
device_name,
Asterisk main include file. File version handling, generic pbx functions.
int() ao2_callback_fn(void *obj, void *arg, int flags)
Type of a generic callback function.
enum ast_cc_service_type service
unsigned int ast_get_cc_recall_timer(struct ast_cc_config_params *config)
Get the cc_recall_timer.
int ast_cc_available_timer_expire(const void *data)
Scheduler callback for available timer expiration.
int ast_cc_agent_accept_request(int core_id, const char *const debug,...)
Accept inbound CC request.
int ast_set_cc_agent_policy(struct ast_cc_config_params *config, enum ast_cc_agent_policies value)
Set the cc_agent_policy.
int ast_cc_agent_caller_busy(int core_id, const char *const debug,...)
Indicate that the caller is busy.
void ast_cc_call_failed(struct ast_channel *incoming, struct ast_channel *outgoing, const char *const dialstring)
Make CCBS available in the case that ast_call fails.
void ast_set_cc_max_monitors(struct ast_cc_config_params *config, unsigned int value)
Set the cc_max_monitors.
int ast_cc_monitor_party_b_free(int core_id)
Alert a caller that though the callee has become free, the caller himself is not and may not call bac...
struct ast_cc_config_params * __ast_cc_config_params_init(const char *file, int line, const char *function)
Allocate and initialize an ast_cc_config_params structure.
int ast_cc_monitor_register(const struct ast_cc_monitor_callbacks *callbacks)
Register a set of monitor callbacks with the core.
void ast_cc_config_params_destroy(struct ast_cc_config_params *params)
Free memory from CCSS configuration params.
void ast_set_ccbs_available_timer(struct ast_cc_config_params *config, unsigned int value)
Set the ccbs_available_timer.
void ast_ignore_cc(struct ast_channel *chan)
Mark the channel to ignore further CC activity.
int ast_cc_is_recall(struct ast_channel *chan, int *core_id, const char *const monitor_type)
Decide if a call to a particular channel is a CC recall.
void ast_handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data)
Properly react to a CC control frame.
unsigned int ast_get_cc_offer_timer(struct ast_cc_config_params *config)
Get the cc_offer_timer.
void(* ast_cc_callback_fn)(struct ast_channel *chan, struct ast_cc_config_params *cc_params, const char *monitor_type, const char *const device_name, const char *const dialstring, void *private_data)
Callback made from ast_cc_callback for certain channel types.
int ast_cc_monitor_stop_ringing(int core_id)
Alert a caller to stop ringing.
int ast_setup_cc_recall_datastore(struct ast_channel *chan, const int core_id)
Set up a CC recall datastore on a channel.
ast_cc_agent_response_reason
@ AST_CC_AGENT_RESPONSE_FAILURE_INVALID
@ AST_CC_AGENT_RESPONSE_SUCCESS
@ AST_CC_AGENT_RESPONSE_FAILURE_TOO_MANY
int ast_cc_offer(struct ast_channel *caller_chan)
Offer CC to a caller.
void ast_set_cc_callback_sub(struct ast_cc_config_params *config, const char *const value)
Set the callback subroutine name.
void ast_cc_default_config_params(struct ast_cc_config_params *params)
Set the specified CC config params to default values.
int ast_cc_monitor_request_acked(int core_id, const char *const debug,...)
Indicate that an outbound entity has accepted our CC request.
int ast_cc_agent_register(const struct ast_cc_agent_callbacks *callbacks)
Register a set of agent callbacks with the core.
void ast_set_cc_agent_dialstring(struct ast_cc_config_params *config, const char *const value)
Set the cc_agent_dialstring.
int ast_cc_agent_recalling(int core_id, const char *const debug,...)
Tell the CC core that a caller is currently recalling.
void ast_set_cc_offer_timer(struct ast_cc_config_params *config, unsigned int value)
Set the cc_offer_timer.
void ast_cc_copy_config_params(struct ast_cc_config_params *dest, const struct ast_cc_config_params *src)
copy CCSS configuration parameters from one structure to another
void ast_set_cc_max_agents(struct ast_cc_config_params *config, unsigned int value)
Set the cc_max_agents.
int ast_cc_completed(struct ast_channel *chan, const char *const debug,...)
Indicate recall has been acknowledged.
unsigned int ast_get_ccbs_available_timer(struct ast_cc_config_params *config)
Get the ccbs_available_timer.
int ast_cc_monitor_count(const char *const name, const char *const type)
Return the number of outstanding CC requests to a specific device.
unsigned int ast_get_ccnr_available_timer(struct ast_cc_config_params *config)
Get the ccnr_available_timer.
void ast_set_ccnr_available_timer(struct ast_cc_config_params *config, unsigned int value)
Set the ccnr_available_timer.
int ast_cc_monitor_callee_available(const int core_id, const char *const debug,...)
Alert the core that a device being monitored has become available.
unsigned int ast_get_cc_max_agents(struct ast_cc_config_params *config)
Get the cc_max_agents.
void ast_cc_busy_interface(struct ast_channel *inbound, struct ast_cc_config_params *cc_params, const char *monitor_type, const char *const device_name, const char *const dialstring, void *private_data)
Callback made from ast_cc_callback for certain channel types.
int ast_set_cc_monitor_policy(struct ast_cc_config_params *config, enum ast_cc_monitor_policies value)
Set the cc_monitor_policy.
int ast_cc_build_frame(struct ast_channel *chan, struct ast_cc_config_params *cc_params, const char *monitor_type, const char *const device_name, const char *const dialstring, enum ast_cc_service_type service, void *private_data, struct ast_frame *frame)
Create a CC Control frame.
void ast_set_cc_recall_timer(struct ast_cc_config_params *config, unsigned int value)
Set the cc_recall_timer.
int ast_set_cc_interfaces_chanvar(struct ast_channel *chan, const char *const extension)
Set the CC_INTERFACES channel variable for a channel using an.
int ast_cc_monitor_status_request(int core_id)
Request the status of a caller or callers.
enum ast_cc_agent_policies ast_get_cc_agent_policy(struct ast_cc_config_params *config)
Get the cc_agent_policy.
ast_cc_monitor_policies
The various possibilities for cc_monitor_policy values.
struct ast_cc_monitor * ast_cc_get_monitor_by_recall_core_id(const int core_id, const char *const device_name)
Get the associated monitor given the device name and core_id.
ast_cc_agent_policies
The various possibilities for cc_agent_policy values.
const char * ast_get_cc_callback_sub(struct ast_cc_config_params *config)
Get the name of the callback subroutine.
void ast_cc_extension_monitor_add_dialstring(struct ast_channel *incoming, const char *const dialstring, const char *const device_name)
Add a child dialstring to an extension monitor.
void ast_cc_monitor_unregister(const struct ast_cc_monitor_callbacks *callbacks)
Unregister a set of monitor callbacks with the core.
enum ast_cc_monitor_policies ast_get_cc_monitor_policy(struct ast_cc_config_params *config)
Get the cc_monitor_policy.
unsigned int ast_get_cc_max_monitors(struct ast_cc_config_params *config)
Get the cc_max_monitors.
ast_cc_agent_flags
agent flags that can alter core behavior
@ AST_CC_AGENT_SKIP_OFFER
@ AST_CC_EXTENSION_MONITOR
int ast_cc_agent_caller_available(int core_id, const char *const debug,...)
Indicate that a previously unavailable caller has become available.
int ast_cc_get_param(struct ast_cc_config_params *params, const char *const name, char *buf, size_t buf_len)
get a CCSS configuration parameter, given its name
int ast_queue_cc_frame(struct ast_channel *chan, const char *const monitor_type, const char *const dialstring, enum ast_cc_service_type service, void *private_data)
Queue an AST_CONTROL_CC frame.
int ast_cc_agent_set_interfaces_chanvar(struct ast_channel *chan)
Set the first level CC_INTERFACES channel variable for a channel.
int ast_cc_call_init(struct ast_channel *chan, int *ignore_cc)
Start the CC process on a call.
int ast_cc_agent_status_response(int core_id, enum ast_device_state devstate)
Response with a caller's current status.
int ast_cc_monitor_failed(int core_id, const char *const monitor_name, const char *const debug,...)
Indicate that a failure has occurred on a specific monitor.
int ast_cc_failed(int core_id, const char *const debug,...)
Indicate failure has occurred.
void ast_cc_agent_unregister(const struct ast_cc_agent_callbacks *callbacks)
Unregister a set of agent callbacks with the core.
int ast_cc_request_is_within_limits(void)
Check if the incoming CC request is within the bounds set by the cc_max_requests configuration option...
int ast_cc_callback(struct ast_channel *inbound, const char *const tech, const char *const dest, ast_cc_callback_fn callback)
Run a callback for potential matching destinations.
struct ast_cc_agent * ast_cc_agent_callback(int flags, ao2_callback_fn *function, void *arg, const char *const type)
Call a callback on all agents of a specific type.
int ast_cc_get_current_core_id(struct ast_channel *chan)
Get the core id for the current call.
int ast_cc_is_config_param(const char *const name)
Is this a CCSS configuration parameter?
const char * ast_get_cc_agent_dialstring(struct ast_cc_config_params *config)
Get the cc_agent_dialstring.
int ast_cc_set_param(struct ast_cc_config_params *params, const char *const name, const char *value)
set a CCSS configuration parameter, given its name
static const char config[]
ast_device_state
Device States.
A set of macros to manage forward-linked lists.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
static int debug
Global debug status.
int(* party_b_free)(struct ast_cc_agent *agent)
Let the caller know that the callee has become free but that the caller cannot attempt to call back b...
int(* status_request)(struct ast_cc_agent *agent)
Request the status of the agent's device.
int(* stop_ringing)(struct ast_cc_agent *agent)
Request for an agent's phone to stop ringing.
const char * type
Type of agent the callbacks belong to.
int(* start_offer_timer)(struct ast_cc_agent *agent)
Start the offer timer.
int(* start_monitoring)(struct ast_cc_agent *agent)
Begin monitoring a busy device.
void(* respond)(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
Respond to a CC request.
void(* destructor)(struct ast_cc_agent *agent)
Destroy private data on the agent.
int(* stop_offer_timer)(struct ast_cc_agent *agent)
Stop the offer timer.
int(* callee_available)(struct ast_cc_agent *agent)
Alert the caller that it is time to try recalling.
int(* init)(struct ast_cc_agent *agent, struct ast_channel *chan)
CC agent initialization.
const struct ast_cc_agent_callbacks * callbacks
unsigned int flags
Flags for agent operation.
struct ast_cc_config_params * cc_params
Structure with information about an outbound interface.
const char * monitor_type
The type of monitor that should be used for this interface.
enum ast_cc_monitor_class monitor_class
struct ast_cc_config_params * config_params
Callbacks defined by CC monitors.
int(* status_response)(struct ast_cc_monitor *monitor, enum ast_device_state devstate)
Status response to an ast_cc_monitor_status_request().
int(* request_cc)(struct ast_cc_monitor *monitor, int *available_timer_id)
Request CCSS.
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.
const char * type
Type of monitor the callbacks belong to.
int(* unsuspend)(struct ast_cc_monitor *monitor)
Unsuspend monitoring.
int(* suspend)(struct ast_cc_monitor *monitor)
Suspend monitoring.
const struct ast_cc_monitor_callbacks * callbacks
struct ast_cc_interface * interface
struct ast_cc_monitor * next
void * private_data
Data that is private to a monitor technology.
enum ast_cc_service_type service_offered
char * dialstring
Name that should be used to recall specified interface.
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
structure to hold extensions