23 #ifndef _ASTERISK_AUDIOHOOK_H
24 #define _ASTERISK_AUDIOHOOK_H
26 #if defined(__cplusplus) || defined(c_plusplus)
76 #define AST_AUDIOHOOK_SYNC_TOLERANCE 100
267 #define ast_audiohook_lock(ah) ast_mutex_lock(&(ah)->lock)
272 #define ast_audiohook_unlock(ah) ast_mutex_unlock(&(ah)->lock)
313 #if defined(__cplusplus) || defined(c_plusplus)
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.
Main Channel structure associated with 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.
struct ast_frame * ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, format_t format)
Reads a frame in from the audiohook structure.
struct ast_slinfactory write_factory
Asterisk locking-related definitions:
enum ast_audiohook_type type
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_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)
determines if a audiohook_list is empty or not.
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source)
Initialize an audiohook structure.
int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook)
Remove an audiohook from a specified channel.
void ast_audiohook_update_status(struct ast_audiohook *audiohook, enum ast_audiohook_status status)
Update audiohook's status.
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_attach(struct ast_channel *chan, struct ast_audiohook *audiohook)
Attach audiohook to channel.
int ast_audiohook_destroy(struct ast_audiohook *audiohook)
Destroys an audiohook structure.
pthread_cond_t ast_cond_t
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.
ast_audiohook_manipulate_callback manipulate_callback
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...
A set of macros to manage forward-linked lists.
struct ast_trans_pvt * trans_pvt
int ast_audiohook_detach_source(struct ast_channel *chan, const char *source)
Detach specified source audiohook from channel.
int ast_audiohook_detach(struct ast_audiohook *audiohook)
Detach audiohook from channel.
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.
Default structure for translators, with the basic fields and buffers, all allocated as part of the sa...
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
struct ast_audiohook::@143 list
A machine to gather up arbitrary frames and convert them to raw slinear on demand.
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.
struct ast_slinfactory read_factory
struct ast_audiohook_options options
struct timeval write_time
Data structure associated with a single frame of data.
enum ast_audiohook_status status
Asterisk internal frame definitions.
int ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
Detach audiohooks from list and destroy said list.
void ast_audiohook_trigger_wait(struct ast_audiohook *audiohook)
Wait for audiohook trigger to be triggered.
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...
Structure for mutex and tracking information.