Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
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. More...
 
int(*const answer_with_stream_topology )(struct ast_channel *chan, struct ast_stream_topology *topology)
 Answer the channel with topology. More...
 
int(*const call )(struct ast_channel *chan, const char *addr, int timeout)
 Make a call. More...
 
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. More...
 
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) More...
 
struct ast_frame *(*const exception )(struct ast_channel *chan)
 Handle an exception, reading a frame. More...
 
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. More...
 
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. More...
 
int(* func_channel_write )(struct ast_channel *chan, const char *function, char *data, const char *value)
 Provide additional write items for CHANNEL() dialplan function. More...
 
const char *(* get_pvt_uniqueid )(struct ast_channel *chan)
 Get the unique identifier for the PVT, i.e. SIP call-ID for SIP. More...
 
int(*const hangup )(struct ast_channel *chan)
 Hangup (and possibly destroy) the channel. More...
 
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. More...
 
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. More...
 
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. More...
 
struct ast_frame *(*const read )(struct ast_channel *chan)
 Read a frame (or chain of frames from the same stream), in standard format (see frame.h) More...
 
struct ast_frame *(*const read_stream )(struct ast_channel *chan)
 Read a frame (or chain of frames from the same stream), in standard format (see frame.h), with stream num. More...
 
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) More...
 
struct ast_channel *(*const requester_with_stream_topology )(const char *type, struct ast_stream_topology *topology, 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) with stream topology. More...
 
int(*const send_digit_begin )(struct ast_channel *chan, char digit)
 Start sending a literal DTMF digit. More...
 
int(*const send_digit_end )(struct ast_channel *chan, char digit, unsigned int duration)
 Stop sending a literal DTMF digit. More...
 
int(*const send_html )(struct ast_channel *chan, int subclass, const char *data, int len)
 Send HTML data. More...
 
int(*const send_image )(struct ast_channel *chan, struct ast_frame *frame)
 Display or send an image. More...
 
int(*const send_text )(struct ast_channel *chan, const char *text)
 Display or transmit text. More...
 
int(*const send_text_data )(struct ast_channel *chan, struct ast_msg_data *data)
 Display or transmit text with data. More...
 
int(*const setoption )(struct ast_channel *chan, int option, void *data, int datalen)
 Set a given option. Called with chan locked. More...
 
int(*const transfer )(struct ast_channel *chan, const char *newdest)
 Blind transfer other side (see app_transfer.c and ast_transfer() More...
 
const char *const type
 
int(*const write )(struct ast_channel *chan, struct ast_frame *frame)
 Write a frame, in standard format (see frame.h) More...
 
int(*const write_stream )(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
 Write a frame on a specific stream, in standard format (see frame.h) More...
 
int(*const write_text )(struct ast_channel *chan, struct ast_frame *frame)
 Write a text frame, in standard format. More...
 
int(*const write_video )(struct ast_channel *chan, struct ast_frame *frame)
 Write a frame, in standard format. More...
 

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 629 of file channel.h.

Field Documentation

◆ answer

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

Answer the channel.

Definition at line 708 of file channel.h.

Referenced by ast_raw_answer_with_stream_topology().

◆ answer_with_stream_topology

int(* const answer_with_stream_topology) (struct ast_channel *chan, struct ast_stream_topology *topology)

Answer the channel with topology.

Since
18.0.0
Parameters
chanThe channel to answer
topologyThe topology to use, probably the peer's.
Note
The topology may be NULL when the peer doesn't support streams or, in the case where transcoding is in effect, when this channel should use its existing topology.

Definition at line 721 of file channel.h.

Referenced by ast_raw_answer_with_stream_topology().

◆ call

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

Make a call.

Note
The channel is locked when called.
Parameters
chanwhich channel to make the call on
addrdestination of the call
timeouttime to wait on for connect (Doesn't seem to be used.)
Return values
0on success
-1on failure

Definition at line 702 of file channel.h.

Referenced by ast_call().

◆ capabilities

struct ast_format_cap* capabilities

◆ cc_callback

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.

Definition at line 828 of file channel.h.

Referenced by ast_cc_callback().

◆ description

const char* const description

◆ devicestate

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

Devicestate call back

Definition at line 676 of file channel.h.

Referenced by _ast_device_state(), and ast_var_channel_types_table().

◆ early_bridge

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

Bridge two channels of the same type together (early)

Definition at line 769 of file channel.h.

Referenced by ast_channel_early_bridge().

◆ exception

struct ast_frame*(* const exception) (struct ast_channel *chan)

Handle an exception, reading a frame.

Definition at line 766 of file channel.h.

Referenced by __ast_read().

◆ fixup

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.

Definition at line 775 of file channel.h.

◆ func_channel_read

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 *.

Definition at line 796 of file channel.h.

◆ func_channel_write

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 *.

Definition at line 802 of file channel.h.

◆ get_pvt_uniqueid

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

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

Definition at line 805 of file channel.h.

◆ hangup

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

Hangup (and possibly destroy) the channel.

Definition at line 705 of file channel.h.

Referenced by ast_hangup().

◆ indicate

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.

Definition at line 772 of file channel.h.

Referenced by ast_channel_request_stream_topology_change(), ast_channel_stream_topology_changed(), ast_var_channel_types_table(), and indicate_data_internal().

◆ pre_call

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
chanChannel to execute Gosub in a tech specific way.
sub_argsGosub application parameter string.
Note
The chan is locked before calling.
Return values
0on success.
-1on error.

Definition at line 842 of file channel.h.

Referenced by ast_pre_call().

◆ presencestate

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

Presencestate callback

Definition at line 677 of file channel.h.

Referenced by ast_presence_state_helper().

◆ properties

int properties

Technology Properties

Definition at line 635 of file channel.h.

Referenced by ast_jb_do_usecheck(), channel_snapshot_base_create(), create_msg_q_chan(), and Model::has_properties().

◆ queryoption

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

Query a given option. Called with chan locked.

Definition at line 781 of file channel.h.

Referenced by ast_channel_queryoption().

◆ read

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

Read a frame (or chain of frames from the same stream), in standard format (see frame.h)

Parameters
chanchannel to read frames from
Return values
non-NULLon success
NULLon failure
Note
Each media frame from this callback will have the stream_num of it changed to the default stream num based on the type of media returned. As a result a multistream capable channel should not implement this callback.

Definition at line 735 of file channel.h.

Referenced by __ast_read(), and AST_TEST_DEFINE().

◆ read_stream

struct ast_frame*(* const read_stream) (struct ast_channel *chan)

Read a frame (or chain of frames from the same stream), in standard format (see frame.h), with stream num.

Parameters
chanchannel to read frames from
Return values
non-NULLon success
NULLon failure
Note
Each media frame from this callback should contain a stream_num value which is set to the stream that the media frame originated from.

Definition at line 748 of file channel.h.

Referenced by __ast_read(), ast_channel_is_multistream(), ast_channel_tech_set(), AST_TEST_DEFINE(), make_channel(), and read_test().

◆ requester

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)

Parameters
typetype of channel to request
capFormat capabilities for requested channel
assignedidUnique ID string to assign to channel
requestorchannel asking for data
addrdestination of the call
causeCause of failure

Request a channel of a given type, with addr as optional information used by the low level module

Return values
NULLfailure
non-NULLchannel on success

Definition at line 654 of file channel.h.

◆ requester_with_stream_topology

struct ast_channel*(* const requester_with_stream_topology) (const char *type, struct ast_stream_topology *topology, 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) with stream topology.

Parameters
typetype of channel to request
topologyStream topology for requested channel
assignedidUnique ID string to assign to channel
requestorchannel asking for data
addrdestination of the call
causeCause of failure

Request a channel of a given type, with addr as optional information used by the low level module

Return values
NULLfailure
non-NULLchannel on success

Definition at line 673 of file channel.h.

◆ send_digit_begin

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.

Definition at line 684 of file channel.h.

Referenced by load_module().

◆ send_digit_end

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.

Definition at line 691 of file channel.h.

Referenced by ast_senddigit_end().

◆ send_html

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

Send HTML data.

Definition at line 763 of file channel.h.

Referenced by ast_channel_sendhtml(), and ast_write_stream().

◆ send_image

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

Display or send an image.

Definition at line 760 of file channel.h.

Referenced by ast_send_image().

◆ send_text

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

Display or transmit text.

Definition at line 757 of file channel.h.

Referenced by ast_sendtext_data(), and ast_write_stream().

◆ send_text_data

int(* const send_text_data) (struct ast_channel *chan, struct ast_msg_data *data)

Display or transmit text with data.

Definition at line 845 of file channel.h.

Referenced by ast_sendtext_data().

◆ setoption

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

Set a given option. Called with chan locked.

Definition at line 778 of file channel.h.

Referenced by ast_channel_setoption().

◆ transfer

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

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

Definition at line 784 of file channel.h.

Referenced by ast_transfer_protocol(), and ast_var_channel_types_table().

◆ type

const char* const type

◆ write

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

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

Definition at line 751 of file channel.h.

Referenced by AST_TEST_DEFINE(), ast_write_stream(), tech_write(), and MultiOrderedConfigParser::write().

◆ write_stream

int(* const write_stream) (struct ast_channel *chan, int stream_num, struct ast_frame *frame)

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

Definition at line 754 of file channel.h.

Referenced by ast_channel_is_multistream(), ast_channel_tech_set(), ast_write_stream(), and tech_write().

◆ write_text

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

Write a text frame, in standard format.

Definition at line 790 of file channel.h.

Referenced by ast_sendtext_data(), and ast_write_stream().

◆ write_video

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

Write a frame, in standard format.

Definition at line 787 of file channel.h.

Referenced by ast_write_stream().


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