23#ifndef _ASTERISK_AUDIOHOOK_H
24#define _ASTERISK_AUDIOHOOK_H
26#if defined(__cplusplus) || defined(c_plusplus)
313#define ast_audiohook_lock(ah) ast_mutex_lock(&(ah)->lock)
318#define ast_audiohook_unlock(ah) ast_mutex_unlock(&(ah)->lock)
371#if defined(__cplusplus) || defined(c_plusplus)
@ AST_AUDIOHOOK_MANIPULATE_ALL_RATES
struct ast_frame * ast_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
Pass a frame off to be handled by the audiohook core.
struct ast_frame * ast_audiohook_read_frame_all(struct ast_audiohook *audiohook, size_t samples, struct ast_format *format, struct ast_frame **read_frame, struct ast_frame **write_frame)
Reads a frame in from the audiohook structure in mixed audio mode and copies read and write frame dat...
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source, enum ast_audiohook_init_flags flags)
Initialize an audiohook structure.
struct ast_frame * ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, struct ast_format *format)
Reads a frame in from the audiohook structure.
int ast_audiohook_set_mute(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear)
Mute frames read from or written to a channel.
int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohook_direction direction, struct ast_frame *frame)
Writes a frame into the audiohook structure.
int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook)
Remove an audiohook from a specified channel.
@ AST_AUDIOHOOK_DIRECTION_READ
@ AST_AUDIOHOOK_DIRECTION_WRITE
@ AST_AUDIOHOOK_DIRECTION_BOTH
int ast_audiohook_detach_source(struct ast_channel *chan, const char *source)
Detach specified source audiohook from channel.
int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direction direction)
Retrieve the volume adjustment value on frames read from or written to a channel.
int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
Determine if a audiohook_list is empty or not.
void ast_audiohook_trigger_wait(struct ast_audiohook *audiohook)
Wait for audiohook trigger to be triggered.
int(* ast_audiohook_manipulate_callback)(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
Callback function for manipulate audiohook type.
void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
Detach audiohooks from list and destroy said list.
void ast_audiohook_update_status(struct ast_audiohook *audiohook, enum ast_audiohook_status status)
Update audiohook's status.
int ast_audiohook_set_mute_all(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear)
Mute frames read from or written for all audiohooks on a channel.
@ AST_AUDIOHOOK_COMPATIBLE
@ AST_AUDIOHOOK_WANTS_DTMF
@ AST_AUDIOHOOK_TRIGGER_MODE
@ AST_AUDIOHOOK_MUTE_READ
@ AST_AUDIOHOOK_MUTE_WRITE
@ AST_AUDIOHOOK_SUBSTITUTE_SILENCE
@ AST_AUDIOHOOK_SMALL_QUEUE
@ AST_AUDIOHOOK_TRIGGER_READ
@ AST_AUDIOHOOK_TRIGGER_WRITE
@ AST_AUDIOHOOK_TRIGGER_SYNC
int ast_channel_audiohook_count_by_source(struct ast_channel *chan, const char *source, enum ast_audiohook_type type)
Find out how many audiohooks from a certain source exist on a given channel, regardless of status.
int ast_audiohook_detach(struct ast_audiohook *audiohook)
Detach audiohook from channel.
int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audiohook)
Attach audiohook to channel.
int ast_channel_audiohook_count_by_source_running(struct ast_channel *chan, const char *source, enum ast_audiohook_type type)
Find out how many spies of a certain type exist on a given channel, and are in state running.
int ast_audiohook_destroy(struct ast_audiohook *audiohook)
Destroys an audiohook structure.
@ AST_AUDIOHOOK_TYPE_MANIPULATE
@ AST_AUDIOHOOK_TYPE_WHISPER
@ AST_AUDIOHOOK_STATUS_DONE
@ AST_AUDIOHOOK_STATUS_NEW
@ AST_AUDIOHOOK_STATUS_RUNNING
@ AST_AUDIOHOOK_STATUS_SHUTDOWN
int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
Adjust the volume on frames read from or written to a channel.
int ast_audiohook_set_frame_feed_direction(struct ast_audiohook *audiohook, enum ast_audiohook_direction direction)
Sets direction on audiohook.
int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
Adjust the volume on frames read from or written to a channel.
void ast_audiohook_move_by_source(struct ast_channel *old_chan, struct ast_channel *new_chan, const char *source)
Move an audiohook from one channel to a new one.
void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *new_chan)
Move all audiohooks from one channel to another.
static struct ast_frame * read_frame(struct ast_filestream *s, int *whennext)
A set of macros to manage forward-linked lists.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
Asterisk locking-related definitions:
pthread_cond_t ast_cond_t
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
struct timeval write_time
enum ast_audiohook_type type
ast_audiohook_manipulate_callback manipulate_callback
unsigned int hook_internal_samp_rate
struct ast_audiohook::@187 list
struct ast_slinfactory read_factory
struct ast_trans_pvt * trans_pvt
struct ast_audiohook_options options
enum ast_audiohook_init_flags init_flags
enum ast_audiohook_status status
enum ast_audiohook_direction direction
struct ast_format * format
struct ast_slinfactory write_factory
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
Structure for mutex and tracking information.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...