76 static const char app[] =
"StreamEcho";
92 ast_log(
LOG_ERROR,
"%s - unable to write frame type '%s' to stream type '%s' at " 158 int request_change = topology !=
NULL;
164 if (request_change) {
287 unsigned int num = 0;
311 " greater than or equal to zero\n",
args.num);
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
int ast_channel_is_multistream(struct ast_channel *chan)
Determine if a channel is multi-stream capable.
struct ast_stream_topology * ast_channel_get_stream_topology(const struct ast_channel *chan)
Retrieve the topology of streams on a channel.
media_type
Media types generate different "dummy answers" for not accepting the offer of a media stream...
static int stream_echo_write(struct ast_channel *chan, struct ast_frame *frame, enum ast_media_type type, int one_to_one)
enum ast_media_type ast_stream_get_type(const struct ast_stream *stream)
Get the media type of a stream.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
const char * ast_codec_media_type2str(enum ast_media_type type)
Conversion function to take a media type and turn it into a string.
enum ast_media_type ast_media_type_from_str(const char *media_type_str)
Conversion function to take a media string and convert it to a media type.
Set when the stream has been removed/declined.
struct ast_frame * ast_read_stream(struct ast_channel *chan)
Reads a frame, but does not filter to just the default streams.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_channel_request_stream_topology_change(struct ast_channel *chan, struct ast_stream_topology *topology, void *change_source)
Request that the stream topology of a channel change.
struct ast_stream * ast_stream_topology_get_stream(const struct ast_stream_topology *topology, unsigned int position)
Get a specific stream from the topology.
int ast_stream_topology_append_stream(struct ast_stream_topology *topology, struct ast_stream *stream)
Append a stream to the topology.
int ast_unregister_application(const char *app)
Unregister an application.
static struct ast_stream_topology * stream_echo_topology_alloc(struct ast_stream_topology *original, unsigned int num, enum ast_media_type type)
int ast_write_stream(struct ast_channel *chan, int stream_num, struct ast_frame *frame)
Write a frame to a stream This function writes the given frame to the indicated stream on the channel...
struct ast_frame_subclass subclass
#define ast_strlen_zero(foo)
General Asterisk PBX channel definitions.
struct ast_stream * ast_channel_get_default_stream(struct ast_channel *chan, enum ast_media_type type)
Retrieve the default stream of a specific media type on a channel.
static int unload_module(void)
Conversion utility functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int stream_echo_write_error(struct ast_channel *chan, struct ast_frame *frame, int pos)
Set when the stream is sending and receiving media.
struct ast_stream_topology * ast_stream_topology_alloc(void)
Create a stream topology.
Set when the stream is sending media only.
static void parse(struct mgcp_request *req)
void ast_stream_set_state(struct ast_stream *stream, enum ast_stream_state state)
Set the state of a stream.
int ast_str_to_uint(const char *str, unsigned int *res)
Convert the given string to an unsigned integer.
int ast_stream_topology_get_count(const struct ast_stream_topology *topology)
Get the number of streams in a topology.
static int stream_echo_perform(struct ast_channel *chan, struct ast_stream_topology *topology, enum ast_media_type type)
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.
void ast_stream_free(struct ast_stream *stream)
Destroy a media stream representation.
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
struct ast_stream * ast_stream_clone(const struct ast_stream *stream, const char *name)
Create a deep clone of an existing stream.
static int stream_echo_exec(struct ast_channel *chan, const char *data)
const char * ast_channel_name(const struct ast_channel *chan)
Data structure associated with a single frame of data.
ast_media_type
Types of media.
enum ast_frame_type frametype
struct ast_format * format
void ast_stream_topology_free(struct ast_stream_topology *topology)
Unreference and destroy a stream topology.
int ast_stream_get_position(const struct ast_stream *stream)
Get the position of the stream in the topology.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int load_module(void)
enum ast_stream_state ast_stream_get_state(const struct ast_stream *stream)
Get the current state of a stream.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
#define AST_APP_ARG(name)
Define an application argument.