[asterisk-commits] file: branch file/iceicebaby r367851 - in /team/file/iceicebaby: channels/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 29 14:08:18 CDT 2012


Author: file
Date: Tue May 29 14:08:14 2012
New Revision: 367851

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=367851
Log:
Incorporate review feedback.

Modified:
    team/file/iceicebaby/channels/chan_sip.c
    team/file/iceicebaby/res/res_rtp_asterisk.c

Modified: team/file/iceicebaby/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/file/iceicebaby/channels/chan_sip.c?view=diff&rev=367851&r1=367850&r2=367851
==============================================================================
--- team/file/iceicebaby/channels/chan_sip.c (original)
+++ team/file/iceicebaby/channels/chan_sip.c Tue May 29 14:08:14 2012
@@ -1324,8 +1324,8 @@
 static int process_sdp_a_video(const char *a, struct sip_pvt *p, struct ast_rtp_codecs *newvideortp, int *last_rtpmap_codec);
 static int process_sdp_a_text(const char *a, struct sip_pvt *p, struct ast_rtp_codecs *newtextrtp, char *red_fmtp, int *red_num_gen, int *red_data_pt, int *last_rtpmap_codec);
 static int process_sdp_a_image(const char *a, struct sip_pvt *p);
-static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a_buf, int debug);
-static void start_ice(struct ast_rtp_instance *instance, int debug);
+static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a_buf);
+static void start_ice(struct ast_rtp_instance *instance);
 static void add_codec_to_sdp(const struct sip_pvt *p, struct ast_format *codec,
 			     struct ast_str **m_buf, struct ast_str **a_buf,
 			     int debug, int *min_packet_size);
@@ -9139,15 +9139,15 @@
 			if (process_sdp_a_sendonly(value, &sendonly)) {
 				processed = TRUE;
 				vsendonly = sendonly;
-			}
-			else if (process_sdp_a_audio(value, p, &newaudiortp, &last_rtpmap_codec))
+			} else if (process_sdp_a_audio(value, p, &newaudiortp, &last_rtpmap_codec)) {
 				processed = TRUE;
-			else if (process_sdp_a_video(value, p, &newvideortp, &last_rtpmap_codec))
+			} else if (process_sdp_a_video(value, p, &newvideortp, &last_rtpmap_codec)) {
 				processed = TRUE;
-			else if (process_sdp_a_text(value, p, &newtextrtp, red_fmtp, &red_num_gen, red_data_pt, &last_rtpmap_codec))
+			} else if (process_sdp_a_text(value, p, &newtextrtp, red_fmtp, &red_num_gen, red_data_pt, &last_rtpmap_codec)) {
 				processed = TRUE;
-			else if (process_sdp_a_image(value, p))
+			} else if (process_sdp_a_image(value, p)) {
 				processed = TRUE;
+			}
 
 			/* We can't stop processing after each of these since it may apply to each */
 			process_sdp_a_ice(value, p, p->rtp);
@@ -9351,39 +9351,43 @@
 			case 'a':
 				/* Audio specific scanning */
 				if (audio) {
-					if (process_sdp_a_sendonly(value, &sendonly))
+					if (process_sdp_a_sendonly(value, &sendonly)) {
 						processed = TRUE;
-					else if (process_sdp_a_ice(value, p, p->rtp))
+					} else if (process_sdp_a_ice(value, p, p->rtp)) {
 						processed = TRUE;
-					else if (process_crypto(p, p->rtp, &p->srtp, value))
+					} else if (process_crypto(p, p->rtp, &p->srtp, value)) {
 						processed = TRUE;
-					else if (process_sdp_a_audio(value, p, &newaudiortp, &last_rtpmap_codec))
+					} else if (process_sdp_a_audio(value, p, &newaudiortp, &last_rtpmap_codec)) {
 						processed = TRUE;
+					}
 				}
 				/* Video specific scanning */
 				else if (video) {
-					if (process_sdp_a_sendonly(value, &vsendonly))
+					if (process_sdp_a_sendonly(value, &vsendonly)) {
 						processed = TRUE;
-					else if (process_sdp_a_ice(value, p, p->vrtp))
+					} else if (process_sdp_a_ice(value, p, p->vrtp)) {
 						processed = TRUE;
-					else if (process_crypto(p, p->vrtp, &p->vsrtp, value))
+					} else if (process_crypto(p, p->vrtp, &p->vsrtp, value)) {
 						processed = TRUE;
-					else if (process_sdp_a_video(value, p, &newvideortp, &last_rtpmap_codec))
+					} else if (process_sdp_a_video(value, p, &newvideortp, &last_rtpmap_codec)) {
 						processed = TRUE;
+					}
 				}
 				/* Text (T.140) specific scanning */
 				else if (text) {
-					if (process_sdp_a_ice(value, p, p->trtp))
+					if (process_sdp_a_ice(value, p, p->trtp)) {
 						processed = TRUE;
-					else if (process_sdp_a_text(value, p, &newtextrtp, red_fmtp, &red_num_gen, red_data_pt, &last_rtpmap_codec))
+					} else if (process_sdp_a_text(value, p, &newtextrtp, red_fmtp, &red_num_gen, red_data_pt, &last_rtpmap_codec)) {
 						processed = TRUE;
-					else if (process_crypto(p, p->trtp, &p->tsrtp, value))
+					} else if (process_crypto(p, p->trtp, &p->tsrtp, value)) {
 						processed = TRUE;
+					}
 				}
 				/* Image (T.38 FAX) specific scanning */
 				else if (image) {
-					if (process_sdp_a_image(value, p))
+					if (process_sdp_a_image(value, p)) {
 						processed = TRUE;
+					}
 				}
 				break;
 			}
@@ -9503,7 +9507,7 @@
 	/* Setup audio address and port */
 	if (p->rtp) {
 		if (portno > 0) {
-			start_ice(p->rtp, debug);
+			start_ice(p->rtp);
 			ast_sockaddr_set_port(sa, portno);
 			ast_rtp_instance_set_remote_address(p->rtp, sa);
 			if (debug) {
@@ -9551,7 +9555,7 @@
 	/* Setup video address and port */
 	if (p->vrtp) {
 		if (vportno > 0) {
-			start_ice(p->vrtp, debug);
+			start_ice(p->vrtp);
 			ast_sockaddr_set_port(vsa, vportno);
 			ast_rtp_instance_set_remote_address(p->vrtp, vsa);
 			if (debug) {
@@ -9569,7 +9573,7 @@
 	/* Setup text address and port */
 	if (p->trtp) {
 		if (tportno > 0) {
-			start_ice(p->trtp, debug);
+			start_ice(p->trtp);
 			ast_sockaddr_set_port(tsa, tportno);
 			ast_rtp_instance_set_remote_address(p->trtp, tsa);
 			if (debug) {
@@ -9848,7 +9852,7 @@
 	} else if (sscanf(a, "ice-pwd: %255s", pwd) == 1) {
 		ice->set_authentication(instance, NULL, pwd);
 		found = TRUE;
-	} else if (sscanf(a, "candidate:%31s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, &candidate.priority,
+	} else if (sscanf(a, "candidate: %31s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, &candidate.priority,
 			  address, &port, cand_type, relay_address, &relay_port) >= 7) {
 		candidate.foundation = foundation;
 		candidate.transport = transport;
@@ -11393,7 +11397,7 @@
 }
 
 /*! \brief Add ICE attributes to SDP */
-static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a_buf, int debug)
+static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a_buf)
 {
 	struct ast_rtp_engine_ice *ice = ast_rtp_instance_get_ice(instance);
 	const char *username, *password;
@@ -11442,7 +11446,7 @@
 }
 
 /*! \brief Start ICE negotiation on an RTP instance */
-static void start_ice(struct ast_rtp_instance *instance, int debug)
+static void start_ice(struct ast_rtp_instance *instance)
 {
 	struct ast_rtp_engine_ice *ice = ast_rtp_instance_get_ice(instance);
 
@@ -11925,7 +11929,7 @@
 			}
 
 			if (!doing_directmedia) {
-				add_ice_to_sdp(p->vrtp, &a_video, debug);
+				add_ice_to_sdp(p->vrtp, &a_video);
 			}
 		}
 
@@ -11942,7 +11946,7 @@
 			}
 
 			if (!doing_directmedia) {
-				add_ice_to_sdp(p->trtp, &a_text, debug);
+				add_ice_to_sdp(p->trtp, &a_text);
 			}
 		}
 
@@ -12039,7 +12043,7 @@
 			ast_str_append(&a_text, 0, "a=ptime:%d\r\n", min_text_packet_size);
 
 		if (!doing_directmedia) {
-			add_ice_to_sdp(p->rtp, &a_audio, debug);
+			add_ice_to_sdp(p->rtp, &a_audio);
 		}
 
 		if (m_audio->len - m_audio->used < 2 || m_video->len - m_video->used < 2 ||

Modified: team/file/iceicebaby/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/file/iceicebaby/res/res_rtp_asterisk.c?view=diff&rev=367851&r1=367850&r2=367851
==============================================================================
--- team/file/iceicebaby/res/res_rtp_asterisk.c (original)
+++ team/file/iceicebaby/res/res_rtp_asterisk.c Tue May 29 14:08:14 2012
@@ -429,7 +429,7 @@
 {
 	char address[PJ_INET6_ADDRSTRLEN];
 
-	if (!rtp->ice || !rtp->ice->comp[component - 1].valid_check || (component < 1)) {
+	if (!rtp->ice || (component < 1) || !rtp->ice->comp[component - 1].valid_check) {
 		return;
 	}
 




More information about the asterisk-commits mailing list