25#ifndef _ASTERISK_FRAME_H 
   26#define _ASTERISK_FRAME_H 
   28#if defined(__cplusplus) || defined(c_plusplus) 
  139#define AST_FRAME_DTMF AST_FRAME_DTMF_END 
  183    union { 
void *ptr; uint32_t uint32; 
char pad[8]; } 
data;
 
 
  208#define AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen) \ 
  210    (fr)->data.ptr = (char *)_base + (_ofs);    \ 
  211    (fr)->offset = (_ofs);          \ 
  212    (fr)->datalen = (_datalen);     \ 
   208#define AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen) \ …   229#define AST_FRIENDLY_OFFSET     64 
  230#define AST_MIN_OFFSET      32   
  233#define AST_MALLOCD_HDR     (1 << 0) 
  235#define AST_MALLOCD_DATA    (1 << 1) 
  237#define AST_MALLOCD_SRC     (1 << 2) 
  241#define AST_MODEM_T38       1 
  243#define AST_MODEM_V150      2 
  247#define AST_HTML_URL        1 
  249#define AST_HTML_DATA       2 
  251#define AST_HTML_BEGIN      4 
  253#define AST_HTML_END        8 
  255#define AST_HTML_LDCOMPLETE 16 
  257#define AST_HTML_NOSUPPORT  17 
  259#define AST_HTML_LINKURL    18 
  261#define AST_HTML_UNLINK     19 
  263#define AST_HTML_LINKREJECT 20 
  426#define AST_OPTION_FLAG_REQUEST     0 
  427#define AST_OPTION_FLAG_ACCEPT      1 
  428#define AST_OPTION_FLAG_REJECT      2 
  429#define AST_OPTION_FLAG_QUERY       4 
  430#define AST_OPTION_FLAG_ANSWER      5 
  431#define AST_OPTION_FLAG_WTF     6 
  436#define AST_OPTION_TONE_VERIFY      1 
  440#define AST_OPTION_TDD          2 
  444#define AST_OPTION_RELAXDTMF        3 
  448#define AST_OPTION_AUDIO_MODE       4 
  453#define AST_OPTION_TXGAIN       5 
  458#define AST_OPTION_RXGAIN       6 
  464#define AST_OPTION_OPRMODE      7 
  476#define AST_OPTION_ECHOCAN      8 
  484#define AST_OPTION_CHANNEL_WRITE 9 
  490#define AST_OPTION_T38_STATE        10 
  494#define AST_OPTION_FORMAT_READ          11 
  498#define AST_OPTION_FORMAT_WRITE         12 
  504#define AST_OPTION_MAKE_COMPATIBLE      13 
  508#define AST_OPTION_DIGIT_DETECT     14 
  512#define AST_OPTION_FAX_DETECT       15 
  516#define AST_OPTION_DEVICE_NAME      16 
  520#define AST_OPTION_CC_AGENT_TYPE    17 
  524#define AST_OPTION_SECURE_SIGNALING        18 
  525#define AST_OPTION_SECURE_MEDIA            19 
  534#if __BYTE_ORDER == __BIG_ENDIAN 
  538#if __BYTE_ORDER == __LITTLE_ENDIAN 
  542#error Byte order not defined 
 
  566#define ast_frfree(fr) ast_frame_free(fr, 1) 
  587#define ast_frisolate(fr) __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) 
  595#define ast_frdup(fr) __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) 
  602#if __BYTE_ORDER == __LITTLE_ENDIAN 
  603#define ast_frame_byteswap_le(fr) do { ; } while(0) 
  604#define ast_frame_byteswap_be(fr) do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data.ptr, __f->data.ptr, __f->samples); } while(0) 
  606#define ast_frame_byteswap_le(fr) do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data.ptr, __f->data.ptr, __f->samples); } while(0) 
  607#define ast_frame_byteswap_be(fr) do { ; } while(0) 
  671#if defined(__cplusplus) || defined(c_plusplus) 
Asterisk architecture endianess compatibility definitions.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static char prefix[MAX_PREFIX]
int ast_frame_clear(struct ast_frame *frame)
Clear all audio samples from an ast_frame. The frame must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR.
@ AST_T38_REQUEST_TERMINATE
@ AST_T38_REQUEST_NEGOTIATE
struct ast_frame * __ast_frdup(const struct ast_frame *fr, const char *file, int line, const char *func)
struct ast_frame * ast_frame_enqueue(struct ast_frame *head, struct ast_frame *f, int maxlen, int dupe)
Appends a frame to the end of a list of frames, truncating the maximum length of the list.
ast_frame_read_action
Actions to indicate to, and be handled on channel read.
@ AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO
@ AST_FRAME_READ_ACTION_SEND_TEXT
@ AST_FRAME_READ_ACTION_SEND_TEXT_DATA
void ast_frame_dtor(struct ast_frame *frame)
NULL-safe wrapper for ast_frfree, good for RAII_VAR.
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
void ast_frame_free(struct ast_frame *frame, int cache)
Frees a frame or list of frames.
char * ast_frame_type2str(enum ast_frame_type frame_type, char *ftype, size_t len)
Copy the discription of a frame type into the provided string.
@ AST_FRFLAG_HAS_SEQUENCE_NUMBER
@ AST_FRFLAG_HAS_TIMING_INFO
@ AST_TRANSFER_UNAVAILABLE
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
char * ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, char *moreinfo, size_t mlen)
Copy the discription of a frame's subclass into the provided string.
ast_control_t38_rate_management
@ AST_T38_RATE_MANAGEMENT_LOCAL_TCF
@ AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF
struct ast_frame * __ast_frisolate(struct ast_frame *fr, const char *file, int line, const char *func)
'isolates' a frame by duplicating non-malloc'ed components (header, src, data). On return all compone...
int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2)
Sums two frames of audio samples.
int ast_frame_adjust_volume_float(struct ast_frame *f, float adjustment)
Adjusts the volume of the audio samples contained in a frame.
void ast_swapcopy_samples(void *dst, const void *src, int samples)
ast_frame_type
Frame types.
@ AST_FRAME_BRIDGE_ACTION_SYNC
@ AST_FRAME_BRIDGE_ACTION
ast_control_frame_type
Internal control frame subtype field values.
@ AST_CONTROL_RECORD_CANCEL
@ AST_CONTROL_STREAM_TOPOLOGY_SOURCE_CHANGED
@ AST_CONTROL_STREAM_RESTART
@ AST_CONTROL_STREAM_SUSPEND
@ AST_CONTROL_RADIO_UNKEY
@ AST_CONTROL_STREAM_TOPOLOGY_REQUEST_CHANGE
@ AST_CONTROL_STREAM_REVERSE
@ AST_CONTROL_REDIRECTING
@ AST_CONTROL_TAKEOFFHOOK
@ AST_CONTROL_T38_PARAMETERS
@ AST_CONTROL_READ_ACTION
@ AST_CONTROL_RECORD_STOP
@ AST_CONTROL_PLAYBACK_BEGIN
@ AST_CONTROL_RECORD_MUTE
@ AST_CONTROL_STREAM_STOP
@ AST_CONTROL_STREAM_TOPOLOGY_CHANGED
@ AST_CONTROL_CONNECTED_LINE
@ AST_CONTROL_STREAM_FORWARD
@ AST_CONTROL_RECORD_SUSPEND
@ AST_CONTROL_MASQUERADE_NOTIFY
@ AST_CONTROL_PVT_CAUSE_CODE
@ AST_CONTROL_UPDATE_RTP_PEER
struct ast_frame ast_null_frame
A set of macros to manage forward-linked lists.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
struct ao2_container * cache
Main Channel structure associated with a channel.
unsigned int emulate_sip_cause
unsigned int cause_extended
char chan_name[AST_CHANNEL_NAME]
enum ast_frame_read_action action
unsigned int transcoding_jbig
enum ast_control_t38_rate rate
unsigned int transcoding_mmr
enum ast_control_t38_rate_management rate_management
enum ast_control_t38 request_response
unsigned int fill_bit_removal
struct ast_stream_topology * topology
unsigned int frame_ending
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
union ast_frame::@239 data
struct ast_frame::@240 frame_list
struct ast_channel * peer