Wed Jan 8 2020 09:50:23

Asterisk developer's documentation


ast_channel_tech Struct Reference

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

#include <channel.h>

Data Fields

int(*const answer )(struct ast_channel *chan)
 Answer the channel. More...
 
enum ast_bridge_result(*const bridge )(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)
 Bridge two channels of the same type together. More...
 
struct ast_channel *(*const bridged_channel )(struct ast_channel *chan, struct ast_channel *bridge)
 Find bridged channel. More...
 
int(*const call )(struct ast_channel *chan, char *addr, int timeout)
 Call a given phone number (address, etc), but don't take longer than timeout seconds to do so. More...
 
format_t capabilities
 
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 )(void *data)
 
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...
 
struct ast_channel *(* get_base_channel )(struct ast_channel *chan)
 Retrieve base channel (agent and local) 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 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, in standard format (see frame.h) More...
 
struct ast_channel *(*const requester )(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)
 Requester - to set up call data structures (pvt's) 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(* set_base_channel )(struct ast_channel *chan, struct ast_channel *base)
 Set base channel (agent and local) 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_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 507 of file channel.h.

Field Documentation

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

Answer the channel.

Definition at line 548 of file channel.h.

Referenced by ast_raw_answer(), and data_channeltypes_provider_handler().

enum ast_bridge_result(* const bridge)(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)

Bridge two channels of the same type together.

Definition at line 569 of file channel.h.

Referenced by ast_channel_bridge(), ast_channel_make_compatible_helper(), and data_channeltypes_provider_handler().

struct ast_channel*(* const bridged_channel)(struct ast_channel *chan, struct ast_channel *bridge)

Find bridged channel.

Definition at line 597 of file channel.h.

Referenced by ast_bridged_channel(), data_channeltypes_provider_handler(), destroy_conference_bridge(), and play_sound_file().

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

Call a given phone number (address, etc), but don't take longer than timeout seconds to do so.

Note
addr should be treated as const char *.

Definition at line 542 of file channel.h.

Referenced by ast_call(), and data_channeltypes_provider_handler().

format_t capabilities

Bitmap of formats this channel can handle

Definition at line 511 of file channel.h.

Referenced by ast_request(), data_channeltypes_provider_handler(), handle_cli_core_show_channeltype(), and load_module().

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

Referenced by ast_cc_callback(), and data_channeltypes_provider_handler().

int(* const devicestate)(void *data)
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 573 of file channel.h.

Referenced by ast_channel_early_bridge(), and data_channeltypes_provider_handler().

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

Handle an exception, reading a frame.

Definition at line 566 of file channel.h.

Referenced by __ast_read(), and data_channeltypes_provider_handler().

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

Referenced by ast_do_masquerade(), and data_channeltypes_provider_handler().

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.

Definition at line 600 of file channel.h.

Referenced by data_channeltypes_provider_handler(), and func_channel_read().

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

Provide additional write items for CHANNEL() dialplan function.

Definition at line 603 of file channel.h.

Referenced by data_channeltypes_provider_handler(), and func_channel_write_real().

struct ast_channel*(* get_base_channel)(struct ast_channel *chan)

Retrieve base channel (agent and local)

Definition at line 606 of file channel.h.

Referenced by __ast_channel_masquerade(), and data_channeltypes_provider_handler().

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

Referenced by data_channeltypes_provider_handler(), and update_bridge_vars().

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

Hangup (and possibly destroy) the channel.

Definition at line 545 of file channel.h.

Referenced by ast_do_masquerade(), ast_hangup(), and data_channeltypes_provider_handler().

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

Referenced by agent_indicate(), ast_indicate_data(), ast_var_channel_types_table(), ast_write(), data_channeltypes_provider_handler(), handle_cli_core_show_channeltype(), and handle_cli_core_show_channeltypes().

int properties

Technology Properties

Definition at line 513 of file channel.h.

Referenced by ast_jb_do_usecheck(), and schedule_delivery().

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

Query a given option. Called with chan locked.

Definition at line 585 of file channel.h.

Referenced by ast_channel_queryoption(), and data_channeltypes_provider_handler().

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

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

Definition at line 551 of file channel.h.

Referenced by __ast_read(), and data_channeltypes_provider_handler().

struct ast_channel*(* const requester)(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)

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

Note
data should be treated as const char *.

Definition at line 519 of file channel.h.

Referenced by ast_request().

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

Referenced by ast_channel_bridge(), ast_rtp_dtmf_compatible(), ast_senddigit(), ast_senddigit_begin(), data_channeltypes_provider_handler(), handle_cli_core_show_channeltype(), and 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.

Definition at line 535 of file channel.h.

Referenced by ast_senddigit_end(), data_channeltypes_provider_handler(), and handle_cli_core_show_channeltype().

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

Display or send an image.

Definition at line 560 of file channel.h.

Referenced by ast_send_image(), ast_supports_images(), data_channeltypes_provider_handler(), and handle_cli_core_show_channeltype().

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

Display or transmit text.

Definition at line 557 of file channel.h.

Referenced by ast_sendtext(), ast_write(), data_channeltypes_provider_handler(), handle_cli_core_show_channeltype(), and sendtext_exec().

int(* set_base_channel)(struct ast_channel *chan, struct ast_channel *base)

Set base channel (agent and local)

Definition at line 609 of file channel.h.

Referenced by data_channeltypes_provider_handler().

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

Set a given option. Called with chan locked.

Definition at line 582 of file channel.h.

Referenced by ast_channel_setoption(), and data_channeltypes_provider_handler().

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

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

Definition at line 554 of file channel.h.

Referenced by ast_write(), and data_channeltypes_provider_handler().

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

Write a text frame, in standard format.

Definition at line 594 of file channel.h.

Referenced by ast_write(), and data_channeltypes_provider_handler().

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

Write a frame, in standard format.

Definition at line 591 of file channel.h.

Referenced by ast_write(), ast_write_video(), and data_channeltypes_provider_handler().


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