39 #include <sys/signal.h>
56 static const char tdesc[] =
"Multicast RTP Paging Channel Driver";
67 .
type =
"MulticastRTP",
130 if (!(destination = strchr(tmp,
'/'))) {
133 *destination++ =
'\0';
135 if ((control = strchr(destination,
'/'))) {
152 if (!(chan =
ast_channel_alloc(1,
AST_STATE_DOWN,
"",
"",
"",
"",
"", requestor ? requestor->
linkedid :
"", 0,
"MulticastRTP/%p", instance))) {
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...
static int load_module(void)
Function called when our module is loaded.
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
multicast_type
Type of paging to do.
Asterisk main include file. File version handling, generic pbx functions.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame with payload.
struct ast_frame ast_null_frame
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
static struct ast_frame * multicast_rtp_read(struct ast_channel *ast)
Function called when we should read a frame from the channel.
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
Configuration File Parser.
static struct ast_channel_tech multicast_rtp_tech
format_t ast_best_codec(format_t fmts)
Pick the best audio codec.
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 ...
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
I/O Management (derived from Cheops-NG)
const ast_string_field linkedid
Socket address structure.
struct ast_channel * ast_channel_alloc(int needqueue, int state, const char *cid_num, const char *cid_name, const char *acctcode, const char *exten, const char *context, const char *linkedid, const int amaflag, const char *name_fmt,...)
static void ast_sockaddr_setnull(struct ast_sockaddr *addr)
Sets address addr to null.
static struct ast_channel * multicast_rtp_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)
Function called when we should prepare to call the destination.
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Access Control of various sorts.
Scheduler Routines (derived from cheops)
int ast_rtp_instance_set_remote_address(struct ast_rtp_instance *instance, const struct ast_sockaddr *address)
Set the address of the remote endpoint that we are sending RTP to.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
Core PBX routines and definitions.
#define AST_CAUSE_FAILURE
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int multicast_rtp_hangup(struct ast_channel *ast)
Function called when we should hang the channel up.
static int unload_module(void)
Function called when our module is unloaded.
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static const char tdesc[]
static int multicast_rtp_write(struct ast_channel *ast, struct ast_frame *f)
Function called when we should write a frame to the channel.
struct ast_rtp_instance * ast_rtp_instance_new(const char *engine_name, struct sched_context *sched, const struct ast_sockaddr *sa, void *data)
Create a new RTP instance.
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
Standard Command Line Interface.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
static int multicast_rtp_call(struct ast_channel *ast, char *dest, int timeout)
Function called when we should actually call the destination.
Data structure associated with a single frame of data.
Internal Asterisk hangup causes.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Pluggable RTP Architecture.
Asterisk module definitions.
static snd_pcm_format_t format
struct ast_channel_tech * tech
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.