Thu Apr 16 06:48:31 2015

Asterisk developer's documentation


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.
void(* destructor )(struct ast_cc_agent *agent)
 Destroy private data on the agent.
int(* init )(struct ast_cc_agent *agent, struct ast_channel *chan)
 CC agent initialization.
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.
void(* respond )(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason)
 Respond to a CC request.
int(* start_monitoring )(struct ast_cc_agent *agent)
 Begin monitoring a busy device.
int(* start_offer_timer )(struct ast_cc_agent *agent)
 Start the offer timer.
int(* status_request )(struct ast_cc_agent *agent)
 Request the status of the agent's device.
int(* stop_offer_timer )(struct ast_cc_agent *agent)
 Stop the offer timer.
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.


Detailed Description

Definition at line 870 of file ccss.h.


Field Documentation

int(* callee_available)(struct ast_cc_agent *agent)

Alert the caller that it is time to try recalling.

Parameters:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_callee_ready(), and check_callback_sanity().

void(* destructor)(struct ast_cc_agent *agent)

Destroy private data on the agent.

Parameters:
agent CC 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.

Referenced by agent_destroy(), and check_callback_sanity().

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

CC agent initialization.

Parameters:
agent CC core agent control.
chan Original 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:
0 on success.
-1 on error.

Referenced by cc_agent_init(), and check_callback_sanity().

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:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_party_b_free().

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

Respond to a CC request.

Parameters:
agent CC core agent control.
reason CC 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.

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

int(* start_monitoring)(struct ast_cc_agent *agent)

Begin monitoring a busy device.

Parameters:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_caller_busy(), and check_callback_sanity().

int(* start_offer_timer)(struct ast_cc_agent *agent)

Start the offer timer.

Parameters:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_caller_offered(), and check_callback_sanity().

int(* status_request)(struct ast_cc_agent *agent)

Request the status of the agent's device.

Parameters:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_status_request(), and check_callback_sanity().

int(* stop_offer_timer)(struct ast_cc_agent *agent)

Stop the offer timer.

Parameters:
agent CC core agent control.
This callback is called by the CC core when the caller has requested CC.

Return values:
0 on success.
-1 on error.

Referenced by cc_caller_requested(), and check_callback_sanity().

int(* stop_ringing)(struct ast_cc_agent *agent)

Request for an agent's phone to stop ringing.

Parameters:
agent CC 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:
0 on success.
-1 on error.

Referenced by cc_stop_ringing().

const char* type

Type of agent the callbacks belong to.

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

Definition at line 877 of file ccss.h.

Referenced by cc_agent_callback_helper(), cccancel_exec(), ccreq_exec(), and find_agent_callbacks().


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