#include <unistd.h>
#include <setjmp.h>
#include <sys/poll.h>
#include "asterisk/compat.h"
#include "asterisk/frame.h"
#include "asterisk/sched.h"
#include "asterisk/chanvars.h"
#include "asterisk/config.h"
#include "asterisk/lock.h"
#include "asterisk/cdr.h"
#include "asterisk/utils.h"
#include "asterisk/linkedlists.h"
Include dependency graph for channel.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | ast_bridge_config |
struct | ast_callerid |
struct | ast_channel |
struct | ast_channel_tech |
struct | ast_generator |
struct | outgoing_helper |
Defines | |
#define | AST_ADSI_AVAILABLE (1) |
#define | AST_ADSI_OFFHOOKONLY (3) |
#define | AST_ADSI_UNAVAILABLE (2) |
#define | AST_ADSI_UNKNOWN (0) |
#define | AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0) |
#define | AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1) |
#define | AST_BRIDGE_IGNORE_SIGS (1 << 4) |
#define | AST_BRIDGE_REC_CHANNEL_0 (1 << 2) |
#define | AST_BRIDGE_REC_CHANNEL_1 (1 << 3) |
#define | AST_CDR_CALLWAIT (1 << 2) |
#define | AST_CDR_CONFERENCE (1 << 3) |
#define | AST_CDR_FORWARD (1 << 1) |
#define | AST_CDR_TRANSFER (1 << 0) |
#define | AST_CHANNEL_NAME 80 |
#define | AST_FEATURE_ATXFER (1 << 3) |
#define | AST_FEATURE_AUTOMON (1 << 4) |
#define | AST_FEATURE_DISCONNECT (1 << 2) |
#define | AST_FEATURE_FLAG_CALLEE (1 << 1) |
#define | AST_FEATURE_FLAG_CALLER (1 << 2) |
#define | AST_FEATURE_FLAG_NEEDSDTMF (1 << 0) |
#define | AST_FEATURE_PLAY_WARNING (1 << 0) |
#define | AST_FEATURE_REDIRECT (1 << 1) |
#define | AST_MAX_CONTEXT 80 |
#define | AST_MAX_EXTENSION 80 |
#define | AST_MAX_FDS 8 |
#define | AST_SOFTHANGUP_APPUNLOAD (1 << 4) |
#define | AST_SOFTHANGUP_ASYNCGOTO (1 << 1) |
#define | AST_SOFTHANGUP_DEV (1 << 0) |
#define | AST_SOFTHANGUP_EXPLICIT (1 << 5) |
#define | AST_SOFTHANGUP_SHUTDOWN (1 << 2) |
#define | AST_SOFTHANGUP_TIMEOUT (1 << 3) |
#define | AST_SOFTHANGUP_UNBRIDGE (1 << 6) |
#define | AST_STATE_BUSY 7 |
#define | AST_STATE_DIALING 3 |
#define | AST_STATE_DIALING_OFFHOOK 8 |
#define | AST_STATE_DOWN 0 |
#define | AST_STATE_MUTE (1 << 16) |
#define | AST_STATE_OFFHOOK 2 |
#define | AST_STATE_PRERING 9 |
#define | AST_STATE_RESERVED 1 |
#define | AST_STATE_RING 4 |
#define | AST_STATE_RINGING 5 |
#define | AST_STATE_UP 6 |
#define | ast_strdupa(s) |
#define | CHECK_BLOCKING(c) |
#define | CRASH do { } while(0) |
#define | LOAD_OH(oh) |
#define | MAX_LANGUAGE 20 |
#define | MAX_MUSICCLASS 20 |
#define | AST_CHAN_TP_WANTSJITTER (1 << 0) |
#define | AST_FLAG_BLOCKING (1 << 3) |
#define | AST_FLAG_DEFER_DTMF (1 << 1) |
#define | AST_FLAG_EXCEPTION (1 << 5) |
#define | AST_FLAG_IN_AUTOLOOP (1 << 9) |
#define | AST_FLAG_MOH (1 << 6) |
#define | AST_FLAG_NBRIDGE (1 << 8) |
#define | AST_FLAG_SPYING (1 << 7) |
#define | AST_FLAG_WRITE_INT (1 << 2) |
#define | AST_FLAG_ZOMBIE (1 << 4) |
Typedefs | |
typedef unsigned long long | ast_group_t |
Enumerations | |
enum | ast_bridge_result { AST_BRIDGE_COMPLETE = 0, AST_BRIDGE_FAILED = -1, AST_BRIDGE_FAILED_NOWARN = -2, AST_BRIDGE_RETRY = -3 } |
Functions | |
ast_channel * | __ast_request_and_dial (const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname, struct outgoing_helper *oh) |
int | ast_activate_generator (struct ast_channel *chan, struct ast_generator *gen, void *params) |
int | ast_active_channels (void) |
int | ast_answer (struct ast_channel *chan) |
Answer a ringing call. | |
int | ast_autoservice_start (struct ast_channel *chan) |
int | ast_autoservice_stop (struct ast_channel *chan) |
void | ast_begin_shutdown (int hangup) |
int | ast_best_codec (int fmts) |
ast_channel * | ast_bridged_channel (struct ast_channel *chan) |
Find bridged channel. | |
int | ast_call (struct ast_channel *chan, char *addr, int timeout) |
Make a call. | |
void | ast_cancel_shutdown (void) |
const char * | ast_cause2str (int state) |
void | ast_change_name (struct ast_channel *chan, char *newname) |
Change channel name. | |
ast_channel * | ast_channel_alloc (int needalertpipe) |
Create a channel structure. | |
int | ast_channel_bridge (struct ast_channel *c0, struct ast_channel *c1, struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc) |
int | ast_channel_cmpwhentohangup (struct ast_channel *chan, time_t offset) |
Compare a offset with the settings of when to hang a channel up. | |
int | ast_channel_defer_dtmf (struct ast_channel *chan) |
void | ast_channel_free (struct ast_channel *) |
Free a channel structure. | |
void | ast_channel_inherit_variables (const struct ast_channel *parent, struct ast_channel *child) |
Inherits channel variable from parent to child channel. | |
int | ast_channel_make_compatible (struct ast_channel *c0, struct ast_channel *c1) |
int | ast_channel_masquerade (struct ast_channel *original, struct ast_channel *clone) |
ast_frame * | ast_channel_queryoption (struct ast_channel *channel, int option, void *data, int *datalen, int block) |
int | ast_channel_register (const struct ast_channel_tech *tech) |
Register a channel technology (a new channel driver) Called by a channel module to register the kind of channels it supports. | |
int | ast_channel_sendhtml (struct ast_channel *channel, int subclass, const char *data, int datalen) |
int | ast_channel_sendurl (struct ast_channel *channel, const char *url) |
int | ast_channel_setoption (struct ast_channel *channel, int option, void *data, int datalen, int block) |
void | ast_channel_setwhentohangup (struct ast_channel *chan, time_t offset) |
Set when to hang a channel up. | |
ast_silence_generator * | ast_channel_start_silence_generator (struct ast_channel *chan) |
Starts a silence generator on the given channel. | |
void | ast_channel_stop_silence_generator (struct ast_channel *chan, struct ast_silence_generator *state) |
Stops a previously-started silence generator on the given channel. | |
int | ast_channel_supports_html (struct ast_channel *channel) |
void | ast_channel_undefer_dtmf (struct ast_channel *chan) |
void | ast_channel_unregister (const struct ast_channel_tech *tech) |
Unregister a channel technology. | |
ast_channel * | ast_channel_walk_locked (const struct ast_channel *prev) |
int | ast_check_hangup (struct ast_channel *chan) |
Check to see if a channel is needing hang up. | |
void | ast_deactivate_generator (struct ast_channel *chan) |
int | ast_do_masquerade (struct ast_channel *chan) |
Start masquerading a channel XXX This is a seriously wacked out operation. We're essentially putting the guts of the clone channel into the original channel. Start by killing off the original channel's backend. I'm not sure we're going to keep this function, because while the features are nice, the cost is very high in terms of pure nastiness. XXX. | |
ast_channel * | ast_get_channel_by_exten_locked (const char *exten, const char *context) |
ast_channel * | ast_get_channel_by_name_locked (const char *chan) |
ast_channel * | ast_get_channel_by_name_prefix_locked (const char *name, const int namelen) |
ast_channel_tech * | ast_get_channel_tech (const char *name) |
Get a channel technology structure by name. | |
ast_group_t | ast_get_group (char *s) |
int | ast_hangup (struct ast_channel *chan) |
Hang up a channel. | |
int | ast_indicate (struct ast_channel *chan, int condition) |
Indicates condition of channel. | |
char * | ast_print_group (char *buf, int buflen, ast_group_t group) |
int | ast_prod (struct ast_channel *chan) |
int | ast_queue_control (struct ast_channel *chan, int control) |
Queue a control frame. | |
int | ast_queue_frame (struct ast_channel *chan, struct ast_frame *f) |
Queue an outgoing frame. | |
int | ast_queue_hangup (struct ast_channel *chan) |
Queue a hangup frame. | |
ast_frame * | ast_read (struct ast_channel *chan) |
int | ast_readstring (struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders) |
int | ast_readstring_full (struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders, int audiofd, int ctrlfd) |
int | ast_recvchar (struct ast_channel *chan, int timeout) |
char * | ast_recvtext (struct ast_channel *chan, int timeout) |
ast_channel * | ast_request (const char *type, int format, void *data, int *status) |
Requests a channel. | |
ast_channel * | ast_request_and_dial (const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname) |
Request a channel of a given type, with data as optional information used by the low level module and attempt to place a call on it. | |
int | ast_safe_sleep (struct ast_channel *chan, int ms) |
Wait for a specied amount of time, looking for hangups. | |
int | ast_safe_sleep_conditional (struct ast_channel *chan, int ms, int(*cond)(void *), void *data) |
Wait for a specied amount of time, looking for hangups and a condition argument. | |
int | ast_senddigit (struct ast_channel *chan, char digit) |
int | ast_sendtext (struct ast_channel *chan, const char *text) |
void | ast_set_callerid (struct ast_channel *chan, const char *cidnum, const char *cidname, const char *ani) |
int | ast_set_read_format (struct ast_channel *chan, int format) |
void | ast_set_variables (struct ast_channel *chan, struct ast_variable *vars) |
adds a list of channel variables to a channel | |
int | ast_set_write_format (struct ast_channel *chan, int format) |
int | ast_setstate (struct ast_channel *chan, int state) |
Change the state of a channel. | |
int | ast_settimeout (struct ast_channel *c, int samples, int(*func)(void *data), void *data) |
int | ast_shutting_down (void) |
int | ast_softhangup (struct ast_channel *chan, int cause) |
Softly hangup up a channel. | |
int | ast_softhangup_nolock (struct ast_channel *chan, int cause) |
Softly hangup up a channel (no channel lock). | |
char * | ast_state2str (int state) |
int | ast_tonepair (struct ast_channel *chan, int freq1, int freq2, int duration, int vol) |
int | ast_tonepair_start (struct ast_channel *chan, int freq1, int freq2, int duration, int vol) |
void | ast_tonepair_stop (struct ast_channel *chan) |
int | ast_transfer (struct ast_channel *chan, char *dest) |
Transfer a channel (if supported). Returns -1 on error, 0 if not supported and 1 if supported and requested. | |
char * | ast_transfercapability2str (int transfercapability) |
int | ast_waitfor (struct ast_channel *chan, int ms) |
Wait for input on a channel. | |
ast_channel * | ast_waitfor_n (struct ast_channel **chan, int n, int *ms) |
int | ast_waitfor_n_fd (int *fds, int n, int *ms, int *exception) |
ast_channel * | ast_waitfor_nandfds (struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms) |
Waits for activity on a group of channels. | |
int | ast_waitfordigit (struct ast_channel *c, int ms) |
int | ast_waitfordigit_full (struct ast_channel *c, int ms, int audiofd, int ctrlfd) |
ast_channel * | ast_walk_channel_by_name_prefix_locked (struct ast_channel *chan, const char *name, const int namelen) |
int | ast_write (struct ast_channel *chan, struct ast_frame *frame) |
int | ast_write_video (struct ast_channel *chan, struct ast_frame *frame) |
Definition in file channel.h.
#define AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0) |
#define AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1) |
#define AST_BRIDGE_IGNORE_SIGS (1 << 4) |
#define AST_BRIDGE_REC_CHANNEL_0 (1 << 2) |
#define AST_BRIDGE_REC_CHANNEL_1 (1 << 3) |
#define AST_FLAG_DEFER_DTMF (1 << 1) |
#define AST_FLAG_EXCEPTION (1 << 5) |
#define AST_FLAG_IN_AUTOLOOP (1 << 9) |
#define AST_FLAG_MOH (1 << 6) |
#define AST_FLAG_NBRIDGE (1 << 8) |
#define AST_FLAG_SPYING (1 << 7) |
#define AST_FLAG_WRITE_INT (1 << 2) |
#define AST_SOFTHANGUP_ASYNCGOTO (1 << 1) |
int ast_activate_generator | ( | struct ast_channel * | chan, | |
struct ast_generator * | gen, | |||
void * | params | |||
) |
Activate a given generator
int ast_active_channels | ( | void | ) |
Returns number of active/allocated channels
int ast_answer | ( | struct ast_channel * | chan | ) |
Answer a ringing call.
chan | channel to answer This function answers a channel and handles all necessary call setup functions. |
int ast_autoservice_start | ( | struct ast_channel * | chan | ) |
Automatically service a channel for us...
int ast_autoservice_stop | ( | struct ast_channel * | chan | ) |
Stop servicing a channel for us... Returns -1 on error or if channel has been hungup
void ast_begin_shutdown | ( | int | hangup | ) |
Initiate system shutdown -- prevents new channels from being allocated. If "hangup" is non-zero, all existing channels will receive soft hangups
int ast_best_codec | ( | int | fmts | ) |
Pick the best codec
struct ast_channel* ast_bridged_channel | ( | struct ast_channel * | chan | ) |
Find bridged channel.
chan | Current channel |
int ast_call | ( | struct ast_channel * | chan, | |
char * | addr, | |||
int | timeout | |||
) |
Make a call.
chan | which channel to make the call on | |
addr | destination of the call | |
timeout | time to wait on for connect Place a call, take no longer than timeout ms. |
void ast_cancel_shutdown | ( | void | ) |
Cancels an existing shutdown and returns to normal operation
const char* ast_cause2str | ( | int | state | ) |
state | cause to get the description of Give a name to a cause code Returns the text form of the binary cause code given |
struct ast_channel* ast_channel_alloc | ( | int | needalertpipe | ) |
Create a channel structure.
int ast_channel_bridge | ( | struct ast_channel * | c0, | |
struct ast_channel * | c1, | |||
struct ast_bridge_config * | config, | |||
struct ast_frame ** | fo, | |||
struct ast_channel ** | rc | |||
) |
c0 | first channel to bridge | |
c1 | second channel to bridge | |
config | config for the channels | |
fo | destination frame(?) | |
rc | destination channel(?) Bridge two channels (c0 and c1) together. If an important frame occurs, we return that frame in rf (remember, it could be NULL) and which channel (0 or 1) in rc |
int ast_channel_cmpwhentohangup | ( | struct ast_channel * | chan, | |
time_t | offset | |||
) |
Compare a offset with the settings of when to hang a channel up.
chan | channel on which to check for hang up | |
offset | offset in seconds from current time |
int ast_channel_defer_dtmf | ( | struct ast_channel * | chan | ) |
Defer DTMF so that you only read things like hangups and audio. Returns non-zero if channel was already DTMF-deferred or 0 if channel is just now being DTMF-deferred
void ast_channel_inherit_variables | ( | const struct ast_channel * | parent, | |
struct ast_channel * | child | |||
) |
Inherits channel variable from parent to child channel.
parent | Parent channel | |
child | Child channel |
int ast_channel_make_compatible | ( | struct ast_channel * | c0, | |
struct ast_channel * | c1 | |||
) |
c0 | first channel to make compatible | |
c1 | other channel to make compatible Set two channels to compatible formats -- call before ast_channel_bridge in general . Returns 0 on success and -1 if it could not be done |
int ast_channel_masquerade | ( | struct ast_channel * | original, | |
struct ast_channel * | clone | |||
) |
original | channel to make a copy of | |
clone | copy of the original channel This is a very strange and freaky function used primarily for transfer. Suppose that "original" and "clone" are two channels in random situations. This function takes the guts out of "clone" and puts them into the "original" channel, then alerts the channel driver of the change, asking it to fixup any private information (like the p->owner pointer) that is affected by the change. The physical layer of the original channel is hung up. |
struct ast_frame* ast_channel_queryoption | ( | struct ast_channel * | channel, | |
int | option, | |||
void * | data, | |||
int * | datalen, | |||
int | block | |||
) |
Query the value of an option, optionally blocking until a reply is received Works similarly to setoption except only reads the options.
int ast_channel_register | ( | const struct ast_channel_tech * | tech | ) |
Register a channel technology (a new channel driver) Called by a channel module to register the kind of channels it supports.
tech | Structure defining channel technology or "type" |
int ast_channel_sendhtml | ( | struct ast_channel * | channel, | |
int | subclass, | |||
const char * | data, | |||
int | datalen | |||
) |
Send HTML or URL on link. Returns 0 on success or -1 on failure
int ast_channel_sendurl | ( | struct ast_channel * | channel, | |
const char * | url | |||
) |
Send URL on link. Returns 0 on success or -1 on failure
int ast_channel_setoption | ( | struct ast_channel * | channel, | |
int | option, | |||
void * | data, | |||
int | datalen, | |||
int | block | |||
) |
channel | channel to set options on | |
option | option to change | |
data | data specific to option | |
datalen | length of the data | |
block | blocking or not Set an option on a channel (see frame.h), optionally blocking awaiting the reply Returns 0 on success and -1 on failure |
void ast_channel_setwhentohangup | ( | struct ast_channel * | chan, | |
time_t | offset | |||
) |
Set when to hang a channel up.
chan | channel on which to check for hang up | |
offset | offset in seconds from current time of when to hang up This function sets the absolute time out on a channel (when to hang up). |
struct ast_silence_generator* ast_channel_start_silence_generator | ( | struct ast_channel * | chan | ) |
Starts a silence generator on the given channel.
chan | The channel to generate silence on |
The pointer returned by this function must be preserved and passed to ast_channel_stop_silence_generator when you wish to stop the silence generation.
void ast_channel_stop_silence_generator | ( | struct ast_channel * | chan, | |
struct ast_silence_generator * | state | |||
) |
Stops a previously-started silence generator on the given channel.
chan | The channel to operate on | |
state | The ast_silence_generator pointer return by a previous call to ast_channel_start_silence_generator. |
int ast_channel_supports_html | ( | struct ast_channel * | channel | ) |
Returns 0 if channel does not support HTML or non-zero if it does
void ast_channel_undefer_dtmf | ( | struct ast_channel * | chan | ) |
Undo defer. ast_read will return any dtmf characters that were queued
void ast_channel_unregister | ( | const struct ast_channel_tech * | tech | ) |
Unregister a channel technology.
tech | Structure defining channel technology or "type" that was previously registered |
struct ast_channel* ast_channel_walk_locked | ( | const struct ast_channel * | prev | ) |
prev | where you want to start in the channel list Browse the channels currently in use Returns the next channel in the list, NULL on end. If it returns a channel, that channel *has been locked*! |
int ast_check_hangup | ( | struct ast_channel * | chan | ) |
Check to see if a channel is needing hang up.
chan | channel on which to check for hang up This function determines if the channel is being requested to be hung up. |
void ast_deactivate_generator | ( | struct ast_channel * | chan | ) |
Deactive an active generator
int ast_do_masquerade | ( | struct ast_channel * | chan | ) |
Start masquerading a channel XXX This is a seriously wacked out operation. We're essentially putting the guts of the clone channel into the original channel. Start by killing off the original channel's backend. I'm not sure we're going to keep this function, because while the features are nice, the cost is very high in terms of pure nastiness. XXX.
chan | Channel to masquerade |
struct ast_channel* ast_get_channel_by_name_locked | ( | const char * | chan | ) |
Get channel by name (locks channel)
struct ast_channel* ast_get_channel_by_name_prefix_locked | ( | const char * | name, | |
const int | namelen | |||
) |
Get channel by name prefix (locks channel)
struct ast_channel_tech* ast_get_channel_tech | ( | const char * | name | ) |
Get a channel technology structure by name.
name | name of technology to find |
int ast_hangup | ( | struct ast_channel * | chan | ) |
Hang up a channel.
chan | channel to hang up |
int ast_indicate | ( | struct ast_channel * | chan, | |
int | condition | |||
) |
Indicates condition of channel.
chan | channel to change the indication | |
condition | which condition to indicate on the channel |
struct ast_frame* ast_read | ( | struct ast_channel * | chan | ) |
chan | channel to read a frame from Read a frame. Returns a frame, or NULL on error. If it returns NULL, you best just stop reading frames and assume the channel has been disconnected. |
int ast_readstring | ( | struct ast_channel * | c, | |
char * | s, | |||
int | len, | |||
int | timeout, | |||
int | rtimeout, | |||
char * | enders | |||
) |
c | channel to read from | |
s | string to read in to. Must be at least the size of your length | |
len | how many digits to read (maximum) | |
timeout | how long to timeout between digits | |
rtimeout | timeout to wait on the first digit | |
enders | digits to end the string Read in a digit string "s", max length "len", maximum timeout between digits "timeout" (-1 for none), terminated by anything in "enders". Give them rtimeout for the first digit. Returns 0 on normal return, or 1 on a timeout. In the case of a timeout, any digits that were read before the timeout will still be available in s. RETURNS 2 in full version when ctrlfd is available, NOT 1 |
int ast_recvchar | ( | struct ast_channel * | chan, | |
int | timeout | |||
) |
chan | channel to act upon | |
timeout | timeout in milliseconds (0 for infinite wait) Read a char of text from a channel Returns 0 on success, -1 on failure |
char* ast_recvtext | ( | struct ast_channel * | chan, | |
int | timeout | |||
) |
chan | channel to act upon | |
timeout | timeout in milliseconds (0 for infinite wait) |
struct ast_channel* ast_request | ( | const char * | type, | |
int | format, | |||
void * | data, | |||
int * | status | |||
) |
Requests a channel.
type | type of channel to request | |
format | requested channel format | |
data | data to pass to the channel requester | |
status | status Request a channel of a given type, with data as optional information used by the low level module |
struct ast_channel* ast_request_and_dial | ( | const char * | type, | |
int | format, | |||
void * | data, | |||
int | timeout, | |||
int * | reason, | |||
const char * | cidnum, | |||
const char * | cidname | |||
) |
Request a channel of a given type, with data as optional information used by the low level module and attempt to place a call on it.
type | type of channel to request | |
format | requested channel format | |
data | data to pass to the channel requester | |
timeout | maximum amount of time to wait for an answer | |
reason | why unsuccessful (if unsuceessful) | |
cidnum | Caller-ID Number | |
cidname | Caller-ID Name |
int ast_safe_sleep | ( | struct ast_channel * | chan, | |
int | ms | |||
) |
Wait for a specied amount of time, looking for hangups.
chan | channel to wait for | |
ms | length of time in milliseconds to sleep Waits for a specified amount of time, servicing the channel as required. |
int ast_safe_sleep_conditional | ( | struct ast_channel * | chan, | |
int | ms, | |||
int(*)(void *) | cond, | |||
void * | data | |||
) |
Wait for a specied amount of time, looking for hangups and a condition argument.
chan | channel to wait for | |
ms | length of time in milliseconds to sleep | |
cond | a function pointer for testing continue condition | |
data | argument to be passed to the condition test function |
int ast_senddigit | ( | struct ast_channel * | chan, | |
char | digit | |||
) |
chan | channel to act upon | |
digit | the DTMF digit to send, encoded in ASCII Send a DTMF digit to a channel. Returns 0 on success, -1 on failure |
int ast_sendtext | ( | struct ast_channel * | chan, | |
const char * | text | |||
) |
chan | channel to act upon | |
text | string of text to send on the channel Write text to a display on a channel Returns 0 on success, -1 on failure |
int ast_set_read_format | ( | struct ast_channel * | chan, | |
int | format | |||
) |
chan | channel to change | |
format | format to change to Set read format for channel to whichever component of "format" is best. Returns 0 on success, -1 on failure |
void ast_set_variables | ( | struct ast_channel * | chan, | |
struct ast_variable * | vars | |||
) |
adds a list of channel variables to a channel
chan | the channel | |
vars | a linked list of variables |
int ast_set_write_format | ( | struct ast_channel * | chan, | |
int | format | |||
) |
chan | channel to change | |
format | new format for writing Set write format for channel to whichever compoent of "format" is best. Returns 0 on success, -1 on failure |
int ast_shutting_down | ( | void | ) |
Returns non-zero if Asterisk is being shut down
int ast_softhangup | ( | struct ast_channel * | chan, | |
int | cause | |||
) |
Softly hangup up a channel.
chan | channel to be soft-hung-up Call the protocol layer, but don't destroy the channel structure (use this if you are trying to safely hangup a channel managed by another thread. | |
cause | Ast hangupcause for hangup |
int ast_softhangup_nolock | ( | struct ast_channel * | chan, | |
int | cause | |||
) |
Softly hangup up a channel (no channel lock).
chan | channel to be soft-hung-up | |
cause | Ast hangupcause for hangup (see cause.h) |
char* ast_state2str | ( | int | state | ) |
state | state to get the name of Give a name to a state Returns the text form of the binary state given |
int ast_tonepair | ( | struct ast_channel * | chan, | |
int | freq1, | |||
int | freq2, | |||
int | duration, | |||
int | vol | |||
) |
Play a tone pair for a given amount of time
int ast_tonepair_start | ( | struct ast_channel * | chan, | |
int | freq1, | |||
int | freq2, | |||
int | duration, | |||
int | vol | |||
) |
Start a tone going
void ast_tonepair_stop | ( | struct ast_channel * | chan | ) |
Stop a tone from playing
int ast_transfer | ( | struct ast_channel * | chan, | |
char * | dest | |||
) |
Transfer a channel (if supported). Returns -1 on error, 0 if not supported and 1 if supported and requested.
chan | current channel | |
dest | destination extension for transfer |
char* ast_transfercapability2str | ( | int | transfercapability | ) |
transfercapability | transfercapabilty to get the name of Give a name to a transfercapbility See above Returns the text form of the binary transfer capbility |
int ast_waitfor | ( | struct ast_channel * | chan, | |
int | ms | |||
) |
Wait for input on a channel.
chan | channel to wait on | |
ms | length of time to wait on the channel Wait for input on a channel for a given # of milliseconds (<0 for indefinite). |
struct ast_channel* ast_waitfor_n | ( | struct ast_channel ** | chan, | |
int | n, | |||
int * | ms | |||
) |
Wait for input on an array of channels for a given # of milliseconds. Return channel with activity, or NULL if none has activity. time "ms" is modified in-place, if applicable
int ast_waitfor_n_fd | ( | int * | fds, | |
int | n, | |||
int * | ms, | |||
int * | exception | |||
) |
This version works on fd's only. Be careful with it.
struct ast_channel* ast_waitfor_nandfds | ( | struct ast_channel ** | chan, | |
int | n, | |||
int * | fds, | |||
int | nfds, | |||
int * | exception, | |||
int * | outfd, | |||
int * | ms | |||
) |
Waits for activity on a group of channels.
chan | an array of pointers to channels | |
n | number of channels that are to be waited upon | |
fds | an array of fds to wait upon | |
nfds | the number of fds to wait upon | |
exception | exception flag | |
outfd | fd that had activity on it | |
ms | how long the wait was Big momma function here. Wait for activity on any of the n channels, or any of the nfds file descriptors. |
int ast_waitfordigit | ( | struct ast_channel * | c, | |
int | ms | |||
) |
c | channel to wait for a digit on | |
ms | how many milliseconds to wait Wait for a digit. Returns <0 on error, 0 on no entry, and the digit on success. |
struct ast_channel* ast_walk_channel_by_name_prefix_locked | ( | struct ast_channel * | chan, | |
const char * | name, | |||
const int | namelen | |||
) |
Get channel by name prefix (locks channel)
int ast_write | ( | struct ast_channel * | chan, | |
struct ast_frame * | frame | |||
) |
chan | destination channel of the frame | |
frame | frame that will be written This function writes the given frame to the indicated channel. It returns 0 on success, -1 on failure. |
int ast_write_video | ( | struct ast_channel * | chan, | |
struct ast_frame * | frame | |||
) |
chan | destination channel of the frame | |
frame | frame that will be written This function writes the given frame to the indicated channel. It returns 1 on success, 0 if not implemented, and -1 on failure. |