[asterisk-commits] blanchet: branch blanchet/v6 r60450 -
/team/blanchet/v6/include/asterisk/rtp.h
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Apr 6 09:07:11 MST 2007
Author: blanchet
Date: Fri Apr 6 11:07:10 2007
New Revision: 60450
URL: http://svn.digium.com/view/asterisk?view=rev&rev=60450
Log:
- new definitions of ast_virtp routines and definitions for IP version independent routines. vi = version independent.
- see README-IPV6.txt to see the reasoning on why duplicating code and using another namespace: it enables incremental conversion of channels to IPv6. But has drawbacks.
Modified:
team/blanchet/v6/include/asterisk/rtp.h
Modified: team/blanchet/v6/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/team/blanchet/v6/include/asterisk/rtp.h?view=diff&rev=60450&r1=60449&r2=60450
==============================================================================
--- team/blanchet/v6/include/asterisk/rtp.h (original)
+++ team/blanchet/v6/include/asterisk/rtp.h Fri Apr 6 11:07:10 2007
@@ -357,6 +357,136 @@
int ast_virtp_reload(void);
+/* IP version independent (IPv4 and IPv6) version of RTP
+ *
+ * using a new namespace to avoid conflict with current code
+ *
+ * Marc Blanchet, marc.blanchet at viagenie.ca
+ * Copyright (C) 2006, Viagenie, Inc.
+ */
+#include "asterisk/netsock.h"
+
+struct ast_virtp;
+
+struct ast_virtp_protocol {
+ /*! Get RTP struct, or NULL if unwilling to transfer */
+ enum ast_rtp_get_result (* const get_virtp_info)(struct ast_channel *chan, struct ast_virtp **rtp);
+ /*! Get RTP struct, or NULL if unwilling to transfer */
+ enum ast_rtp_get_result (* const get_vivrtp_info)(struct ast_channel *chan, struct ast_virtp **rtp);
+ /*! Set RTP peer */
+ int (* const set_virtp_peer)(struct ast_channel *chan, struct ast_virtp *peer, struct ast_virtp *vpeer, int codecs, int nat_active);
+ int (* const get_codec)(struct ast_channel *chan);
+ const char * const type;
+ AST_LIST_ENTRY(ast_virtp_protocol) list;
+};
+
+typedef int (*ast_virtp_callback)(struct ast_virtp *rtp, struct ast_frame *f, void *data);
+
+size_t ast_virtp_alloc_size(void);
+
+struct ast_virtp *ast_virtp_new(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode);
+
+struct ast_virtp *ast_virtp_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode, struct sockaddr* addr, socklen_t addrlen);
+
+void ast_virtp_set_peer(struct ast_virtp *rtp, struct sockaddr *them, socklen_t themlen);
+
+int ast_virtp_get_peer(struct ast_virtp *rtp, struct sockaddr *them, socklen_t *themlen);
+
+void ast_virtp_get_us(struct ast_virtp *rtp, struct sockaddr *us, socklen_t *uslen);
+
+struct ast_virtp *ast_virtp_get_bridged(struct ast_virtp *rtp);
+
+void ast_virtp_destroy(struct ast_virtp *rtp);
+
+void ast_virtp_reset(struct ast_virtp *rtp);
+
+void ast_virtp_set_callback(struct ast_virtp *rtp, ast_virtp_callback callback);
+
+void ast_virtp_set_data(struct ast_virtp *rtp, void *data);
+
+int ast_virtp_write(struct ast_virtp *rtp, struct ast_frame *f);
+
+struct ast_frame *ast_virtp_read(struct ast_virtp *rtp);
+
+struct ast_frame *ast_virtcp_read(struct ast_virtp *rtp);
+
+int ast_virtp_fd(struct ast_virtp *rtp);
+
+int ast_virtcp_fd(struct ast_virtp *rtp);
+
+int ast_virtp_senddigit_begin(struct ast_virtp *rtp, char digit);
+
+int ast_virtp_senddigit_end(struct ast_virtp *rtp, char digit);
+
+int ast_virtp_sendcng(struct ast_virtp *rtp, int level);
+
+int ast_virtp_settos(struct ast_virtp *rtp, int tos);
+
+void ast_virtp_pt_clear(struct ast_virtp* rtp);
+void ast_virtp_pt_default(struct ast_virtp* rtp);
+
+void ast_virtp_pt_copy(struct ast_virtp *dest, const struct ast_virtp *src);
+
+void ast_virtp_set_m_type(struct ast_virtp* rtp, int pt);
+void ast_virtp_set_rtpmap_type(struct ast_virtp* rtp, int pt,
+ char *mimeType, char *mimeSubtype,
+ enum ast_rtp_options options);
+
+struct rtpPayloadType ast_virtp_lookup_pt(struct ast_virtp* rtp, int pt);
+int ast_virtp_lookup_code(struct ast_virtp* rtp, int isAstFormat, int code);
+
+void ast_virtp_get_current_formats(struct ast_virtp* rtp,
+ int* astFormats, int* nonAstFormats);
+
+void ast_virtp_setnat(struct ast_virtp *rtp, int nat);
+
+int ast_virtp_getnat(struct ast_virtp *rtp);
+
+void ast_virtp_setdtmf(struct ast_virtp *rtp, int dtmf);
+
+void ast_virtp_setdtmfcompensate(struct ast_virtp *rtp, int compensate);
+
+int ast_virtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
+
+int ast_virtp_proto_register(struct ast_virtp_protocol *proto);
+
+void ast_virtp_proto_unregister(struct ast_virtp_protocol *proto);
+
+int ast_virtp_make_compatible(struct ast_channel *dest, struct ast_channel *src, int media);
+
+int ast_virtp_early_bridge(struct ast_channel *dest, struct ast_channel *src);
+
+void ast_virtp_stop(struct ast_virtp *rtp);
+
+char *ast_virtp_get_quality(struct ast_virtp *rtp);
+
+int ast_virtcp_send_h261fur(void *data);
+
+void ast_virtp_new_init(struct ast_virtp *rtp);
+
+void ast_virtp_init(void);
+
+int ast_virtp_reload(void);
+
+int ast_virtp_codec_setpref(struct ast_virtp *rtp, struct ast_codec_pref *prefs);
+
+struct ast_codec_pref *ast_virtp_codec_getpref(struct ast_virtp *rtp);
+
+/*! \brief Set rtp timeout */
+void ast_virtp_set_rtptimeout(struct ast_virtp *rtp, int timeout);
+/*! \brief Set rtp hold timeout */
+void ast_virtp_set_rtpholdtimeout(struct ast_virtp *rtp, int timeout);
+/*! \brief set RTP keepalive interval */
+void ast_virtp_set_rtpkeepalive(struct ast_virtp *rtp, int period);
+/*! \brief Get RTP keepalive interval */
+int ast_virtp_get_rtpkeepalive(struct ast_virtp *rtp);
+/*! \brief Get rtp hold timeout */
+int ast_virtp_get_rtpholdtimeout(struct ast_virtp *rtp);
+/*! \brief Get rtp timeout */
+int ast_virtp_get_rtptimeout(struct ast_virtp *rtp);
+/* \brief Put RTP timeout timers on hold during another transaction, like T.38 */
+void ast_virtp_set_rtptimers_onhold(struct ast_virtp *rtp);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
More information about the asterisk-commits
mailing list