From 66a57e51e328a0c0b855184c15096758401c0dac Mon Sep 17 00:00:00 2001 From: Matteo Brancaleoni Date: Wed, 12 Mar 2003 06:00:18 +0000 Subject: Wed Mar 12 07:00:01 CET 2003 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@641 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/frame.h | 2 ++ include/asterisk/rtp.h | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index 1916a714b..e971a6d03 100755 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -291,6 +291,8 @@ extern void ast_smoother_reset(struct ast_smoother *s, int bytes); extern int ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f); extern struct ast_frame *ast_smoother_read(struct ast_smoother *s); +extern void ast_frame_dump(char *name, struct ast_frame *f, char *prefix); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/include/asterisk/rtp.h b/include/asterisk/rtp.h index d9530a7db..7a00d27c4 100755 --- a/include/asterisk/rtp.h +++ b/include/asterisk/rtp.h @@ -25,6 +25,14 @@ extern "C" { #endif +/* Codes for RTP-specific data - not defined by our AST_FORMAT codes */ +/*! DTMF (RFC2833) */ +#define AST_RTP_DTMF (1 << 0) +/*! 'Comfort Noise' (RFC3389) */ +#define AST_RTP_CN (1 << 1) +/*! Maximum RTP-specific code */ +#define AST_RTP_MAX AST_RTP_CN + struct ast_rtp_protocol { struct ast_rtp *(*get_rtp_info)(struct ast_channel *chan); /* Get RTP struct, or NULL if unwilling to transfer */ int (*set_rtp_peer)(struct ast_channel *chan, struct ast_rtp *peer); /* Set RTP peer */ @@ -61,13 +69,23 @@ int ast_rtp_senddigit(struct ast_rtp *rtp, char digit); int ast_rtp_settos(struct ast_rtp *rtp, int tos); -void ast_rtp_setnat(struct ast_rtp *rtp, int nat); +// Setting RTP payload types from lines in a SDP description: +void rtp_pt_init(struct ast_rtp* rtp); +void rtp_set_m_type(struct ast_rtp* rtp, int pt); +void rtp_set_rtpmap_type(struct ast_rtp* rtp, int pt, + char* mimeType, char* mimeSubtype); -int ast2rtp(int id); +// Mapping between RTP payload format codes and Asterisk codes: +struct rtpPayloadType rtp_lookup_pt(struct ast_rtp* rtp, int pt); +int rtp_lookup_code(struct ast_rtp* rtp, int isAstFormat, int code); -int rtp2ast(int id); +void rtp_get_current_formats(struct ast_rtp* rtp, + int* astFormats, int* nonAstFormats); -char *ast2rtpn(int id); +// Mapping an Asterisk code into a MIME subtype (string): +char* rtp_lookup_mime_subtype(int isAstFormat, int code); + +void ast_rtp_setnat(struct ast_rtp *rtp, int nat); int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc); -- cgit v1.2.3