ast_channel_tech Struct Reference

Structure to describe a channel "technology", ie a channel driver See for examples:. More...

#include <channel.h>

Collaboration diagram for ast_channel_tech:

Collaboration graph
[legend]

Data Fields

int(*const answer )(struct ast_channel *chan)
 Answer the channel.
int(*const call )(struct ast_channel *chan, const char *addr, int timeout)
 Make a call.
struct ast_format_capcapabilities
int(* cc_callback )(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback)
 Call a function with cc parameters as a function parameter.
const char *const description
int(*const devicestate )(const char *device_number)
enum ast_bridge_result(*const early_bridge )(struct ast_channel *c0, struct ast_channel *c1)
 Bridge two channels of the same type together (early).
struct ast_frame *(*const exception )(struct ast_channel *chan)
 Handle an exception, reading a frame.
int(*const fixup )(struct ast_channel *oldchan, struct ast_channel *newchan)
 Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links.
int(* func_channel_read )(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)
 Provide additional read items for CHANNEL() dialplan function.
int(* func_channel_write )(struct ast_channel *chan, const char *function, char *data, const char *value)
 Provide additional write items for CHANNEL() dialplan function.
const char *(* get_pvt_uniqueid )(struct ast_channel *chan)
 Get the unique identifier for the PVT, i.e. SIP call-ID for SIP.
int(*const hangup )(struct ast_channel *chan)
 Hangup (and possibly destroy) the channel.
int(*const indicate )(struct ast_channel *c, int condition, const void *data, size_t datalen)
 Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTION.
int(* pre_call )(struct ast_channel *chan, const char *sub_args)
 Execute a Gosub call on the channel in a technology specific way before a call is placed.
int(*const presencestate )(const char *presence_provider, char **subtype, char **message)
int properties
int(*const queryoption )(struct ast_channel *chan, int option, void *data, int *datalen)
 Query a given option. Called with chan locked.
struct ast_frame *(*const read )(struct ast_channel *chan)
 Read a frame, in standard format (see frame.h).
struct ast_channel *(*const requester )(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
 Requester - to set up call data structures (pvt's).
int(*const send_digit_begin )(struct ast_channel *chan, char digit)
 Start sending a literal DTMF digit.
int(*const send_digit_end )(struct ast_channel *chan, char digit, unsigned int duration)
 Stop sending a literal DTMF digit.
int(*const send_html )(struct ast_channel *chan, int subclass, const char *data, int len)
 Send HTML data.
int(*const send_image )(struct ast_channel *chan, struct ast_frame *frame)
 Display or send an image.
int(*const send_text )(struct ast_channel *chan, const char *text)
 Display or transmit text.
int(*const setoption )(struct ast_channel *chan, int option, void *data, int datalen)
 Set a given option. Called with chan locked.
int(*const transfer )(struct ast_channel *chan, const char *newdest)
 Blind transfer other side (see app_transfer.c and ast_transfer().
const char *const type
int(*const write )(struct ast_channel *chan, struct ast_frame *frame)
 Write a frame, in standard format (see frame.h).
int(*const write_text )(struct ast_channel *chan, struct ast_frame *frame)
 Write a text frame, in standard format.
int(*const write_video )(struct ast_channel *chan, struct ast_frame *frame)
 Write a frame, in standard format.

Detailed Description

Structure to describe a channel "technology", ie a channel driver See for examples:.

If you develop your own channel driver, this is where you tell the PBX at registration of your driver what properties this driver supports and where different callbacks are implemented.

Definition at line 606 of file channel.h.


Field Documentation

int(* const answer)(struct ast_channel *chan)

Answer the channel.

Referenced by ast_raw_answer().

int(* const call)(struct ast_channel *chan, const char *addr, int timeout)

Make a call.

Note:
The channel is locked when called.
Parameters:
chan which channel to make the call on
addr destination of the call
timeout time to wait on for connect (Doesn't seem to be used.)
Return values:
0 on success
-1 on failure

Referenced by ast_call().

struct ast_format_cap* capabilities [read]

int(* cc_callback)(struct ast_channel *inbound, const char *dest, ast_cc_callback_fn callback)

Call a function with cc parameters as a function parameter.

This is a highly specialized callback that is not likely to be needed in many channel drivers. When dealing with a busy channel, for instance, most channel drivers will successfully return a channel to the requester. Once called, the channel can then queue a busy frame when it receives an appropriate message from the far end. In such a case, the channel driver has the opportunity to also queue a CC frame. The parameters for the CC channel can be retrieved from the channel structure.

For other channel drivers, notably those that deal with "dumb" phones, the channel driver will not return a channel when one is requested. In such a scenario, there is never an opportunity for the channel driver to queue a CC frame since the channel is never called. Furthermore, it is not possible to retrieve the CC configuration parameters for the desired channel because no channel is ever allocated or returned to the requester. In such a case, call completion may still be a viable option. What we do is pass the same string that the requester used originally to request the channel to the channel driver. The channel driver can then find any potential channels/devices that match the input and return call the designated callback with the device's call completion parameters as a parameter.

Referenced by ast_cc_callback().

const char* const description

Definition at line 608 of file channel.h.

Referenced by ast_var_channel_types_table(), load_module(), and register_channel_tech().

int(* const devicestate)(const char *device_number)

Devicestate call back

Referenced by _ast_device_state(), and ast_var_channel_types_table().

enum ast_bridge_result(* const early_bridge)(struct ast_channel *c0, struct ast_channel *c1)

Bridge two channels of the same type together (early).

Referenced by ast_channel_early_bridge().

struct ast_frame*(* const exception)(struct ast_channel *chan) [read]

Handle an exception, reading a frame.

Referenced by __ast_read().

int(* const fixup)(struct ast_channel *oldchan, struct ast_channel *newchan)

Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links.

int(* func_channel_read)(struct ast_channel *chan, const char *function, char *data, char *buf, size_t len)

Provide additional read items for CHANNEL() dialplan function.

Note:
data should be treated as a const char *.

int(* func_channel_write)(struct ast_channel *chan, const char *function, char *data, const char *value)

Provide additional write items for CHANNEL() dialplan function.

Note:
data should be treated as a const char *.

const char*(* get_pvt_uniqueid)(struct ast_channel *chan)

Get the unique identifier for the PVT, i.e. SIP call-ID for SIP.

int(* const hangup)(struct ast_channel *chan)

Hangup (and possibly destroy) the channel.

Referenced by ast_hangup().

int(* const indicate)(struct ast_channel *c, int condition, const void *data, size_t datalen)

Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTION.

Referenced by ast_indicate_data(), ast_var_channel_types_table(), and ast_write().

int(* pre_call)(struct ast_channel *chan, const char *sub_args)

Execute a Gosub call on the channel in a technology specific way before a call is placed.

Since:
11.0
Parameters:
chan Channel to execute Gosub in a tech specific way.
sub_args Gosub application parameter string.
Note:
The chan is locked before calling.
Return values:
0 on success.
-1 on error.

Referenced by ast_pre_call().

int(* const presencestate)(const char *presence_provider, char **subtype, char **message)

Presencestate callback

Referenced by ast_presence_state_helper().

Technology Properties

Definition at line 612 of file channel.h.

Referenced by ast_channel_snapshot_create(), and ast_jb_do_usecheck().

int(* const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen)

Query a given option. Called with chan locked.

Referenced by ast_channel_queryoption().

struct ast_frame*(* const read)(struct ast_channel *chan) [read]

Read a frame, in standard format (see frame.h).

Referenced by __ast_read().

struct ast_channel*(* const requester)(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause) [read]

Requester - to set up call data structures (pvt's).

Parameters:
type type of channel to request
cap Format capabilities for requested channel
assignedid Unique ID string to assign to channel
requestor channel asking for data
addr destination of the call
cause Cause of failure
Request a channel of a given type, with addr as optional information used by the low level module

Return values:
NULL failure
non-NULL channel on success

int(* const send_digit_begin)(struct ast_channel *chan, char digit)

Start sending a literal DTMF digit.

Note:
The channel is not locked when this function gets called.

Referenced by load_module().

int(* const send_digit_end)(struct ast_channel *chan, char digit, unsigned int duration)

Stop sending a literal DTMF digit.

Note:
The channel is not locked when this function gets called.

Referenced by ast_senddigit_end().

int(* const send_html)(struct ast_channel *chan, int subclass, const char *data, int len)

Send HTML data.

Referenced by ast_channel_sendhtml(), and ast_write().

int(* const send_image)(struct ast_channel *chan, struct ast_frame *frame)

Display or send an image.

Referenced by ast_send_image().

int(* const send_text)(struct ast_channel *chan, const char *text)

Display or transmit text.

Referenced by ast_sendtext(), and ast_write().

int(* const setoption)(struct ast_channel *chan, int option, void *data, int datalen)

Set a given option. Called with chan locked.

Referenced by ast_channel_setoption().

int(* const transfer)(struct ast_channel *chan, const char *newdest)

Blind transfer other side (see app_transfer.c and ast_transfer().

Referenced by ast_transfer(), and ast_var_channel_types_table().

const char* const type

int(* const write)(struct ast_channel *chan, struct ast_frame *frame)

Write a frame, in standard format (see frame.h).

Referenced by ast_write().

int(* const write_text)(struct ast_channel *chan, struct ast_frame *frame)

Write a text frame, in standard format.

Referenced by ast_sendtext(), and ast_write().

int(* const write_video)(struct ast_channel *chan, struct ast_frame *frame)

Write a frame, in standard format.

Referenced by ast_write().


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

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