58 .
type =
"MulticastRTP",
59 .description =
"Multicast RTP Paging Channel Driver",
70 .description =
"Unicast RTP Media Channel Driver",
157 ast_log(
LOG_ERROR,
"A multicast type and destination must be given to the 'MulticastRTP' channel\n");
169 ast_log(
LOG_ERROR,
"Destination is required for the 'MulticastRTP' channel\n");
186 if (!mcast_options) {
208 "Could not create '%s' multicast RTP instance for sending media to '%s'\n",
214 requestor, 0,
"MulticastRTP/%p", instance);
278 const char *engine_name;
287 ast_log(
LOG_ERROR,
"Destination is required for the 'UnicastRTP' channel\n");
294 ast_log(
LOG_ERROR,
"Destination is required for the 'UnicastRTP' channel\n");
329 opt_args[OPT_ARG_RTP_CODEC],
args.destination);
358 "Could not create %s RTP instance for sending media to '%s'\n",
359 S_OR(engine_name,
"default"),
args.destination);
364 requestor, 0,
"UnicastRTP/%s-%p",
args.destination, instance);
450 .requires =
"res_rtp_multicast",
static char * ast_sockaddr_stringify_addr(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return an address only.
int ast_rtp_instance_activate(struct ast_rtp_instance *instance)
Indicate to the RTP engine that packets are now expected to be sent/received on the RTP instance...
Main Channel structure associated with a channel.
static struct ast_format * derive_format_from_cap(struct ast_format_cap *cap)
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_channel_tech multicast_rtp_tech
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
void ast_rtp_instance_set_channel_id(struct ast_rtp_instance *instance, const char *uniqueid)
Set the channel that owns this RTP instance.
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define ast_test_flag(p, flag)
static int rtp_hangup(struct ast_channel *ast)
Function called when we should hang the channel up.
static void ast_sockaddr_copy(struct ast_sockaddr *dst, const struct ast_sockaddr *src)
Copies the data from one ast_sockaddr to another.
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
static int unload_module(void)
Function called when our module is unloaded.
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
Structure to pass both assignedid values to channel drivers.
int ast_dns_resolve_ipv6_and_ipv4(struct ast_sockaddr *address, const char *host, const char *port)
Synchronously resolves host to an AAAA or A record.
struct ast_format * ast_multicast_rtp_options_get_format(struct ast_multicast_rtp_options *mcast_options)
Get format specified in multicast options.
int ast_channel_register(const struct ast_channel_tech *tech)
Register a channel technology (a new channel driver) Called by a channel module to register the kind ...
Socket address structure.
static void ast_sockaddr_setnull(struct ast_sockaddr *addr)
Sets address addr to null.
#define ast_strlen_zero(foo)
#define AST_APP_OPTIONS(holder, options...)
Declares an array of options for an application.
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
static char * ast_sockaddr_stringify_port(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return a port only.
struct ast_multicast_rtp_options * ast_multicast_rtp_create_options(const char *type, const char *options)
Create multicast RTP options.
int ast_ouraddrfor(const struct ast_sockaddr *them, struct ast_sockaddr *us)
Get our local IP address when contacting a remote host.
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
int ast_sockaddr_split_hostport(char *str, char **host, char **port, int flags)
Splits a string into its host and port components.
General Asterisk PBX channel definitions.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
Access Control of various sorts.
static int rtp_call(struct ast_channel *ast, const char *dest, int timeout)
Function called when we should actually call the destination.
#define ao2_ref(o, delta)
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
#define ast_strdupa(s)
duplicate a string in memory from the stack
static const struct ast_app_option unicast_rtp_options[128]
static int rtp_write(struct ast_channel *ast, struct ast_frame *f)
Function called when we should write a frame to the channel.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
int ast_channel_fdno(const struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
#define AST_CAUSE_FAILURE
#define AST_APP_OPTION_ARG(option, flagno, argno)
Declares an application option that accepts an argument.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
#define ast_rtp_instance_set_remote_address(instance, address)
Set the address of the remote endpoint that we are sending RTP to.
static int load_module(void)
Function called when our module is loaded.
struct ast_format_cap * capabilities
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp)
Get the file descriptor for an RTP session (or RTCP)
Module has failed to load, may be in an inconsistent state.
static struct ast_frame * rtp_read(struct ast_channel *ast)
Function called when we should read a frame from the channel.
void ast_rtp_instance_get_local_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address)
Get the local address that we are expecting RTP on.
Structure used to handle boolean flags.
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
struct ast_frame ast_null_frame
static struct ast_channel_tech unicast_rtp_tech
void ast_multicast_rtp_free_options(struct ast_multicast_rtp_options *mcast_options)
Free multicast RTP options.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
static struct ast_channel * unicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
Function called when we should prepare to call the unicast destination.
Data structure associated with a single frame of data.
Internal Asterisk hangup causes.
struct ast_rtp_instance * ast_rtp_instance_new(const char *engine_name, struct ast_sched_context *sched, const struct ast_sockaddr *sa, void *data)
Create a new RTP instance.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Pluggable RTP Architecture.
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
Asterisk module definitions.
static struct ast_channel * multicast_rtp_request(const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause)
Function called when we should prepare to call the multicast destination.
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
#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...
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
#define AST_APP_ARG(name)
Define an application argument.