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;
185 struct timeval delivery;
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); \ 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 367 unsigned char payload[0];
421 #define AST_OPTION_FLAG_REQUEST 0 422 #define AST_OPTION_FLAG_ACCEPT 1 423 #define AST_OPTION_FLAG_REJECT 2 424 #define AST_OPTION_FLAG_QUERY 4 425 #define AST_OPTION_FLAG_ANSWER 5 426 #define AST_OPTION_FLAG_WTF 6 431 #define AST_OPTION_TONE_VERIFY 1 435 #define AST_OPTION_TDD 2 439 #define AST_OPTION_RELAXDTMF 3 443 #define AST_OPTION_AUDIO_MODE 4 448 #define AST_OPTION_TXGAIN 5 453 #define AST_OPTION_RXGAIN 6 459 #define AST_OPTION_OPRMODE 7 466 #define AST_OPTION_ECHOCAN 8 474 #define AST_OPTION_CHANNEL_WRITE 9 480 #define AST_OPTION_T38_STATE 10 484 #define AST_OPTION_FORMAT_READ 11 488 #define AST_OPTION_FORMAT_WRITE 12 494 #define AST_OPTION_MAKE_COMPATIBLE 13 498 #define AST_OPTION_DIGIT_DETECT 14 502 #define AST_OPTION_FAX_DETECT 15 506 #define AST_OPTION_DEVICE_NAME 16 510 #define AST_OPTION_CC_AGENT_TYPE 17 514 #define AST_OPTION_SECURE_SIGNALING 18 515 #define AST_OPTION_SECURE_MEDIA 19 524 #if __BYTE_ORDER == __BIG_ENDIAN 528 #if __BYTE_ORDER == __LITTLE_ENDIAN 532 #error Byte order not defined 556 #define ast_frfree(fr) ast_frame_free(fr, 1) 577 #define ast_frisolate(fr) __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) 585 #define ast_frdup(fr) __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__) 592 #if __BYTE_ORDER == __LITTLE_ENDIAN 593 #define ast_frame_byteswap_le(fr) do { ; } while(0) 594 #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) 596 #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) 597 #define ast_frame_byteswap_be(fr) do { ; } while(0) 661 #if defined(__cplusplus) || defined(c_plusplus)
Main Channel structure associated with a channel.
struct ast_frame * __ast_frdup(const struct ast_frame *fr, const char *file, int line, const char *func)
int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2)
Sums two frames of audio samples.
void ast_swapcopy_samples(void *dst, const void *src, int samples)
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
ast_control_frame_type
Internal control frame subtype field values.
void ast_frame_free(struct ast_frame *fr, int cache)
Requests a frame to be allocated.
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...
struct ast_frame_subclass subclass
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_frame_dtor(struct ast_frame *frame)
NULL-safe wrapper for ast_frfree, good for RAII_VAR.
unsigned int transcoding_mmr
Asterisk architecture endianess compatibility definitions.
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.
A set of macros to manage forward-linked lists.
ast_frame_type
Frame types.
ast_control_t38_rate_management
unsigned int fill_bit_removal
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
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...
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
unsigned int frame_ending
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.
struct ast_channel * peer
struct ao2_container * cache
unsigned int transcoding_jbig
struct ast_frame ast_null_frame
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.
unsigned int emulate_sip_cause
Data structure associated with a single frame of data.
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
struct ast_format * format
ast_frame_read_action
Actions to indicate to, and be handled on channel read.
struct ast_stream_topology * topology
static char prefix[MAX_PREFIX]