[svn-commits] blanchet: branch blanchet/v6 r58507 - /team/blanchet/v6/include/asterisk/rtp.h

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Mar 8 14:59:26 MST 2007


Author: blanchet
Date: Thu Mar  8 15:59:26 2007
New Revision: 58507

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58507
Log:
First cut of IPv6 port of RTP. Make it IP version independent.
Because multiple channels are using RTP and we want to do incremental changes to channels, one channel at a time, it was chosen to duplicate the rtp routines, name the new ones with vi prefix (ast_virtp instead of ast_rtp), and then make the IPv6 changes there. That way, each channel can be updated asynchronously by using the new ast_virtp routines. Better stability during the transition time. However, disadvantage is we need to manually patch the ast_virtp routines with the changes made in ast_rtp ones.

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=58507&r1=58506&r2=58507
==============================================================================
--- team/blanchet/v6/include/asterisk/rtp.h (original)
+++ team/blanchet/v6/include/asterisk/rtp.h Thu Mar  8 15:59:26 2007
@@ -238,6 +238,113 @@
 /* \brief Put RTP timeout timers on hold during another transaction, like T.38 */
 void ast_rtp_set_rtptimers_onhold(struct ast_rtp *rtp);
 
+/* 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);
+
+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_init(void);
+
+int ast_virtp_reload(void);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif



More information about the svn-commits mailing list