[asterisk-commits] file: branch file/rtp_engine r129166 - in /team/file/rtp_engine: channels/ in...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 8 16:20:41 CDT 2008


Author: file
Date: Tue Jul  8 16:20:40 2008
New Revision: 129166

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129166
Log:
Hey look! It compiles!

Modified:
    team/file/rtp_engine/channels/chan_sip.c
    team/file/rtp_engine/include/asterisk/rtp_engine.h
    team/file/rtp_engine/res/res_rtp_asterisk.c

Modified: team/file/rtp_engine/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/file/rtp_engine/channels/chan_sip.c?view=diff&rev=129166&r1=129165&r2=129166
==============================================================================
--- team/file/rtp_engine/channels/chan_sip.c (original)
+++ team/file/rtp_engine/channels/chan_sip.c Tue Jul  8 16:20:40 2008
@@ -5931,12 +5931,18 @@
 	p->ocseq = INITIAL_CSEQ;
 
 	if (sip_methods[intended_method].need_rtp) {
-		p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
+		//p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
+		p->rtp = ast_rtp_instance_new(NULL, NULL);
+		ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_RTCP, 1);
 		/* If the global videosupport flag is on, we always create a RTP interface for video */
-		if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT))
-			p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
- 		if (ast_test_flag(&p->flags[1], SIP_PAGE2_TEXTSUPPORT))
- 			p->trtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
+		if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT)) {
+			p->vrtp = ast_rtp_instance_new(NULL, NULL);
+			ast_rtp_instance_set_prop(p->vrtp, AST_RTP_PROPERTY_RTCP, 1);
+		}
+ 		if (ast_test_flag(&p->flags[1], SIP_PAGE2_TEXTSUPPORT)) {
+			p->trtp = ast_rtp_instance_new(NULL, NULL);
+			ast_rtp_instance_set_prop(p->trtp, AST_RTP_PROPERTY_RTCP, 1);
+		}
 		if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT))
 			p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr);
  		if (!p->rtp|| (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) && !p->vrtp) 
@@ -6855,14 +6861,13 @@
 			if (framing && p->autoframing) {
 				struct ast_codec_pref *pref = &p->rtp->codecs.pref;
 				int codec_n;
-				int format = 0;
 				for (codec_n = 0; codec_n < AST_RTP_MAX_PT; codec_n++) {
-					format = ast_rtp_codec_getformat(codec_n);
-					if (!format)	/* non-codec or not found */
+					struct ast_rtp_payload_type format = ast_rtp_codecs_payload_lookup(&p->rtp->codecs, codec_n);
+					if (!format.isAstFormat || !format.code)	/* non-codec or not found */
 						continue;
 					if (option_debug)
-						ast_log(LOG_DEBUG, "Setting framing for %d to %ld\n", format, framing);
-					ast_codec_pref_setsize(pref, format, framing);
+						ast_log(LOG_DEBUG, "Setting framing for %d to %ld\n", format.code, framing);
+					ast_codec_pref_setsize(pref, format.code, framing);
 				}
 				ast_rtp_codecs_packetization_set(&p->rtp->codecs, p->rtp, pref);
 			}
@@ -6875,7 +6880,7 @@
 
 			sscanf(red_cp, "%u", &red_data_pt[red_num_gen]);
 			red_cp = strtok(red_cp, "/");
-			while (red_cp && red_num_gen++ < RED_MAX_GENERATION) {
+			while (red_cp && red_num_gen++ < AST_RED_MAX_GENERATION) {
 				sscanf(red_cp, "%u", &red_data_pt[red_num_gen]);
 				red_cp = strtok(NULL, "/");
 			}
@@ -8166,11 +8171,11 @@
 	struct sockaddr_in *dest, struct sockaddr_in *vdest)
 {
 	/* First, get our address */
-	ast_rtp_get_us(p->rtp, sin);
+	memcpy(sin, &p->rtp->remote_address, sizeof(*sin));
 	if (p->vrtp)
-		ast_rtp_get_us(p->vrtp, vsin);
+		memcpy(vsin, &p->vrtp->remote_address, sizeof(*vsin));
 	if (p->trtp)
-		ast_rtp_get_us(p->trtp, tsin);
+		memcpy(tsin, &p->trtp->remote_address, sizeof(*tsin));
 
 	/* Now, try to figure out where we want them to send data */
 	/* Is this a re-invite to move the media out, then use the original offer from caller  */
@@ -13274,12 +13279,12 @@
 #define FORMAT2 "%-15.15s  %-11.11s  %-8.8s %-10.10s  %-10.10s (%-2.2s) %-6.6s %-10.10s  %-10.10s ( %%) %-6.6s\n"
 #define FORMAT  "%-15.15s  %-11.11s  %-8.8s %-10.10u%-1.1s %-10.10u (%-2.2u%%) %-6.6u %-10.10u%-1.1s %-10.10u (%-2.2u%%) %-6.6u\n"
 	struct sip_pvt *cur = __cur;
-	unsigned int rxcount;
-	unsigned int txcount;
-	char durbuf[10];
-        int duration;
-        int durh, durm, durs;
-	struct ast_channel *c = cur->owner;
+//	unsigned int rxcount;
+//	unsigned int txcount;
+//	char durbuf[10];
+	//       int duration;
+	//  int durh, durm, durs;
+	//struct ast_channel *c = cur->owner;
 	struct __show_chan_arg *arg = __arg;
 	int fd = arg->fd;
 
@@ -15281,7 +15286,7 @@
 		if (p->udptl && p->t38.state == T38_LOCAL_REINVITE) {
 			change_t38_state(p, T38_DISABLED);
 			/* Try to reset RTP timers */
-			ast_rtp_set_rtptimers_onhold(p->rtp);
+			//ast_rtp_set_rtptimers_onhold(p->rtp);
 
 			/* Trigger a reinvite back to audio */
 			transmit_reinvite_with_sdp(p, FALSE, FALSE);
@@ -15290,7 +15295,7 @@
 			   right now we can't fall back to audio so totally abort.
 			*/
 			/* Try to reset RTP timers */
-			ast_rtp_set_rtptimers_onhold(p->rtp);
+			//ast_rtp_set_rtptimers_onhold(p->rtp);
 			ast_log(LOG_ERROR, "Got error on T.38 initial invite. Bailing out.\n");
 
 			change_t38_state(p, T38_DISABLED);
@@ -17803,7 +17808,7 @@
 static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen)
 {
 	struct sip_pvt *p = chan->tech_pvt;
-	char *all = "", *parse = ast_strdupa(preparse);
+	char /**all = "",*/ *parse = ast_strdupa(preparse);
 	int res = 0;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(param);
@@ -21742,13 +21747,6 @@
 	return 0;
 }
 
-/*! \brief Return SIP UA's codec (part of the RTP interface) */
-static int sip_get_codec(struct ast_channel *chan)
-{
-	struct sip_pvt *p = chan->tech_pvt;
-	return p->peercapability ? p->peercapability : p->capability;	
-}
-
 /*! \brief Send a poke to all known peers 
 	Space them out 100 ms apart
 	XXX We might have a cool algorithm for this or use random - any suggestions?

Modified: team/file/rtp_engine/include/asterisk/rtp_engine.h
URL: http://svn.digium.com/view/asterisk/team/file/rtp_engine/include/asterisk/rtp_engine.h?view=diff&rev=129166&r1=129165&r2=129166
==============================================================================
--- team/file/rtp_engine/include/asterisk/rtp_engine.h (original)
+++ team/file/rtp_engine/include/asterisk/rtp_engine.h Tue Jul  8 16:20:40 2008
@@ -29,6 +29,8 @@
 
 /* Maximum number of payloads supported */
 #define AST_RTP_MAX_PT 256
+
+#define AST_RED_MAX_GENERATION 5
 
 struct ast_rtp_instance;
 struct ast_rtp_glue;

Modified: team/file/rtp_engine/res/res_rtp_asterisk.c
URL: http://svn.digium.com/view/asterisk/team/file/rtp_engine/res/res_rtp_asterisk.c?view=diff&rev=129166&r1=129165&r2=129166
==============================================================================
--- team/file/rtp_engine/res/res_rtp_asterisk.c (original)
+++ team/file/rtp_engine/res/res_rtp_asterisk.c Tue Jul  8 16:20:40 2008
@@ -224,7 +224,7 @@
 static int ast_rtp_dtmf_end(struct ast_rtp_instance *instance, char digit);
 static void ast_rtp_new_source(struct ast_rtp_instance *instance);
 static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *frame);
-static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance);
+static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtcp);
 
 /* RTP Engine Declaration */
 static struct ast_rtp_engine asterisk_rtp_engine = {
@@ -723,7 +723,7 @@
 	return 0;
 }
 
-static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance)
+static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtcp)
 {
 	struct ast_rtp *rtp = instance->data;
 	struct sockaddr_in sin;
@@ -733,7 +733,9 @@
 	struct ast_rtp_payload_type payload;
 
 	/* If this is actually RTCP let's hop on over and handle it */
-	if (rtp->rtcp) {
+	if (rtcp) {
+		if (rtp->rtcp) {
+		}
 		return &ast_null_frame;
 	}
 




More information about the asterisk-commits mailing list