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); \
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
352 AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO,
353 AST_FRAME_READ_ACTION_SEND_TEXT,
354 AST_FRAME_READ_ACTION_SEND_TEXT_DATA,
367 unsigned char payload[0];
379 enum ast_control_t38_rate {
380 AST_T38_RATE_2400 = 1,
389 AST_T38_RATE_14400 = 0,
392 enum ast_control_t38_rate_management {
393 AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF = 0,
394 AST_T38_RATE_MANAGEMENT_LOCAL_TCF,
401 enum ast_control_t38_rate rate;
402 enum ast_control_t38_rate_management rate_management;
403 unsigned int fill_bit_removal:1;
404 unsigned int transcoding_mmr:1;
405 unsigned int transcoding_jbig:1;
415 unsigned int emulate_sip_cause:1;
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
471 #define AST_OPTION_ECHOCAN 8
479 #define AST_OPTION_CHANNEL_WRITE 9
485 #define AST_OPTION_T38_STATE 10
489 #define AST_OPTION_FORMAT_READ 11
493 #define AST_OPTION_FORMAT_WRITE 12
499 #define AST_OPTION_MAKE_COMPATIBLE 13
503 #define AST_OPTION_DIGIT_DETECT 14
507 #define AST_OPTION_FAX_DETECT 15
511 #define AST_OPTION_DEVICE_NAME 16
515 #define AST_OPTION_CC_AGENT_TYPE 17
519 #define AST_OPTION_SECURE_SIGNALING 18
520 #define AST_OPTION_SECURE_MEDIA 19
529 #if __BYTE_ORDER == __BIG_ENDIAN
533 #if __BYTE_ORDER == __LITTLE_ENDIAN
537 #error Byte order not defined
550 struct ast_frame *ast_fralloc(
char *source,
int len);
561 #define ast_frfree(fr) ast_frame_free(fr, 1)
582 #define ast_frisolate(fr) __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
590 #define ast_frdup(fr) __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
591 struct ast_frame *__ast_frdup(
const struct ast_frame *fr,
const char *file,
int line,
const char *func);
593 void ast_swapcopy_samples(
void *dst,
const void *src,
int samples);
597 #if __BYTE_ORDER == __LITTLE_ENDIAN
598 #define ast_frame_byteswap_le(fr) do { ; } while(0)
599 #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)
601 #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)
602 #define ast_frame_byteswap_be(fr) do { ; } while(0)
666 #if defined(__cplusplus) || defined(c_plusplus)
Main Channel structure associated with a channel.
int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2)
Sums two frames of audio samples.
void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
ast_control_frame_type
Internal control frame subtype field values.
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.
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.
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.
union ast_frame::@224 data
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_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.
Data structure associated with a single frame of data.
enum ast_frame_type frametype
int ast_frame_adjust_volume(struct ast_frame *f, int adjustment)
Adjusts the volume of the audio samples contained in a frame.
static struct sorcery_test_caching cache
Global scope caching structure for testing.
struct ast_format * format
ast_frame_read_action
Actions to indicate to, and be handled on channel read.
struct ast_stream_topology * topology
void ast_frame_free(struct ast_frame *frame, int cache)
Frees a frame or list of frames.