Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Fields
ast_cc_agent_callbacks Struct Reference

#include <ccss.h>

Data Fields

int(* callee_available )(struct ast_cc_agent *agent)
 Alert the caller that it is time to try recalling. More...
 
void(* destructor )(struct ast_cc_agent *agent)
 Destroy private data on the agent. More...
 
int(* init )(struct ast_cc_agent *agent, struct ast_channel *chan)
 CC agent initialization. More...
 
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 because he is either busy or there is congestion on his line. More...
 
void(* respond )(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
 Respond to a CC request. More...
 
int(* start_monitoring )(struct ast_cc_agent *agent)
 Begin monitoring a busy device. More...
 
int(* start_offer_timer )(struct ast_cc_agent *agent)
 Start the offer timer. More...
 
int(* status_request )(struct ast_cc_agent *agent)
 Request the status of the agent's device. More...
 
int(* stop_offer_timer )(struct ast_cc_agent *agent)
 Stop the offer timer. More...
 
int(* stop_ringing )(struct ast_cc_agent *agent)
 Request for an agent's phone to stop ringing. More...
 
const char * type
 Type of agent the callbacks belong to. More...
 

Detailed Description

Definition at line 850 of file ccss.h.

Field Documentation

◆ callee_available

int(* callee_available) (struct ast_cc_agent *agent)

Alert the caller that it is time to try recalling.

Parameters
agentCC core agent control.

The core will call this function when it receives notice that a monitored party has become available.

The agent's job is to send a message to the caller to notify it of such a change. If the agent is able to discern that the caller is currently unavailable, then the agent should react by calling the ast_cc_caller_unavailable function.

Return values
0on success.
-1on error.

Definition at line 1021 of file ccss.h.

Referenced by cc_callee_ready().

◆ destructor

void(* destructor) (struct ast_cc_agent *agent)

Destroy private data on the agent.

Parameters
agentCC core agent control.

The core will call this function upon completion or failure of CC.

Note
The agent private_data pointer may be NULL if the agent constructor failed.

Definition at line 1035 of file ccss.h.

Referenced by agent_destroy().

◆ init

int(* init) (struct ast_cc_agent *agent, struct ast_channel *chan)

CC agent initialization.

Parameters
agentCC core agent control.
chanOriginal channel the agent will attempt to recall.

This callback is called when the CC core is initialized. Agents should allocate any private data necessary for the call and assign it to the private_data on the agent. Additionally, if any ast_cc_agent_flags are pertinent to the specific agent type, they should be set in this function as well.

Return values
0on success.
-1on error.

Definition at line 876 of file ccss.h.

Referenced by cc_agent_init().

◆ party_b_free

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 because he is either busy or there is congestion on his line.

Parameters
agentCC core agent control.

This is something that really only affects a scenario where a phone places a call over ISDN PTMP to Asterisk, who then connects over PTMP again to the ISDN network. For most agent types, there is no need to implement this callback at all because they don't really need to actually do anything in this situation. If you're having trouble understanding what the purpose of this callback is, then you can be safe simply not implementing it.

Return values
0on success.
-1on error.

Definition at line 986 of file ccss.h.

Referenced by cc_party_b_free().

◆ respond

void(* respond) (struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)

Respond to a CC request.

Parameters
agentCC core agent control.
reasonCC request response status.

When the core receives knowledge that a called party has accepted a CC request, it will call this callback. The core may also call this if there is some error when attempting to process the incoming CC request.

The duty of this is to issue a propper response to a CC request from the caller by acknowledging receipt of that request or rejecting it.

Definition at line 928 of file ccss.h.

Referenced by cc_active(), cc_caller_requested(), and cc_do_state_change().

◆ start_monitoring

int(* start_monitoring) (struct ast_cc_agent *agent)

Begin monitoring a busy device.

Parameters
agentCC core agent control.

The core will call this callback if the callee becomes available but the caller has reported that he is busy. The agent should begin monitoring the caller's device. When the caller becomes available again, the agent should call ast_cc_agent_caller_available.

Return values
0on success.
-1on error.

Definition at line 1002 of file ccss.h.

Referenced by cc_caller_busy().

◆ start_offer_timer

int(* start_offer_timer) (struct ast_cc_agent *agent)

Start the offer timer.

Parameters
agentCC core agent control.

This is called by the core when the caller hangs up after a call for which CC may be requested. The agent should begin the timer as configured.

The primary reason why this functionality is left to the specific agent implementations is due to the differing use of schedulers throughout the code. Some channel drivers may already have a scheduler context they wish to use, and amongst those, some may use the ast_sched API while others may use the ast_sched_thread API, which are incompatible.

Return values
0on success.
-1on error.

Definition at line 897 of file ccss.h.

Referenced by cc_caller_offered().

◆ status_request

int(* status_request) (struct ast_cc_agent *agent)

Request the status of the agent's device.

Parameters
agentCC core agent control.

Asynchronous request for the status of any caller which may be a valid caller for the CC transaction. Status responses should be made using the ast_cc_status_response function.

Return values
0on success.
-1on error.

Definition at line 943 of file ccss.h.

Referenced by cc_status_request().

◆ stop_offer_timer

int(* stop_offer_timer) (struct ast_cc_agent *agent)

Stop the offer timer.

Parameters
agentCC core agent control.

This callback is called by the CC core when the caller has requested CC.

Return values
0on success.
-1on error.

Definition at line 910 of file ccss.h.

Referenced by cc_caller_requested().

◆ stop_ringing

int(* stop_ringing) (struct ast_cc_agent *agent)

Request for an agent's phone to stop ringing.

Parameters
agentCC core agent control.

The usefulness of this is quite limited. The only specific known case for this is if Asterisk requests CC over an ISDN PTMP link as the TE side. If other phones are in the same recall group as the Asterisk server, and one of those phones picks up the recall notice, then Asterisk will receive a "stop ringing" notification from the NT side of the PTMP link. This indication needs to be passed to the phone on the other side of the Asterisk server which originally placed the call so that it will stop ringing. Since the phone may be of any type, it is necessary to have a callback that the core can know about.

Return values
0on success.
-1on error.

Definition at line 965 of file ccss.h.

Referenced by cc_stop_ringing().

◆ type

const char* type

Type of agent the callbacks belong to.

Note
Examples are "SIP" "ISDN" and "generic"

Definition at line 857 of file ccss.h.

Referenced by cc_agent_callback_helper(), cc_do_state_change(), cccancel_exec(), ccreq_exec(), ccss_device_state(), find_agent_callbacks(), and Property::load().


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