[asterisk-commits] rizzo: branch rizzo/astobj2 r76230 - /team/rizzo/astobj2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 20 21:34:35 CDT 2007


Author: rizzo
Date: Fri Jul 20 21:34:34 2007
New Revision: 76230

URL: http://svn.digium.com/view/asterisk?view=rev&rev=76230
Log:
more merge from trunk: one piece of code related to g723, whitespace fixes,
and remove an unnecessary null pointer check before ast_strlen_zero

Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=76230&r1=76229&r2=76230
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Fri Jul 20 21:34:34 2007
@@ -6788,6 +6788,9 @@
 	if (codec == AST_FORMAT_G729A) {
 		/* Indicate that we don't support VAD (G.729 annex B) */
 		ast_str_append(a_buf, 0, "a=fmtp:%d annexb=no\r\n", rtp_code);
+	} else if (codec == AST_FORMAT_G723_1) {
+		/* Indicate that we don't support VAD (G.723.1 annex A) */
+		ast_str_append(a_buf, 0, "a=fmtp:%d annexa=no\r\n", rtp_code);
 	} else if (codec == AST_FORMAT_ILBC) {
 		/* Add information about us using only 20/30 ms packetization */
 		ast_str_append(a_buf, 0, "a=fmtp:%d mode=%d\r\n", rtp_code, fmt.cur_ms);
@@ -6795,6 +6798,7 @@
 
 	if (fmt.cur_ms && (fmt.cur_ms < *min_packet_size))
 		*min_packet_size = fmt.cur_ms;
+
 	/* Our first codec packetization processed cannot be zero */
 	if ((*min_packet_size)==0 && fmt.cur_ms)
 		*min_packet_size = fmt.cur_ms;
@@ -6928,7 +6932,6 @@
 	ast_str_append(&m_modem, 0, "s=session\r\n");
 	ast_str_append(&m_modem, 0, "c=IN IP4 %s\r\n", ast_inet_ntoa(udptldest.sin_addr));
 	ast_str_append(&m_modem, 0, "t=0 0\r\n");
-
 	ast_str_append(&m_modem, 0, "m=image %d udptl t38\r\n", ntohs(udptldest.sin_port));
 	
 	if ((p->t38.jointcapability & T38FAX_VERSION) == T38FAX_VERSION_0)
@@ -6975,8 +6978,7 @@
 	ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d\r\n", rtp_code,
 			 ast_rtp_lookup_mime_subtype(0, format, 0),
 			 sample_rate);
-	if (format == AST_RTP_DTMF)
-		/* Indicate we support DTMF and FLASH... */
+	if (format == AST_RTP_DTMF) /* Indicate we support DTMF and FLASH... */
 		ast_str_append(a_buf, 0, "a=fmtp:%d 0-16\r\n", rtp_code);
 }
 
@@ -7139,7 +7141,7 @@
 		}
 		ast_str_append(&m_text, 0, "m=text %d RTP/AVP", ntohs(tdest.sin_port));
 
-		if (debug) 
+		if (debug) /* XXX should I use tdest below ? */
 			ast_verbose("Text is at %s port %d\n", ast_inet_ntoa(p->ourip.sin_addr), ntohs(tsin.sin_port));
 	}
 
@@ -7238,6 +7240,7 @@
 	/* XXX don't think you can have ptime for text */
 	if (min_text_packet_size)
 		ast_str_append(&a_text, 0, "a=ptime:%d\r\n", min_text_packet_size);
+
 	if (m_audio->len - m_audio->used < 2 || m_video->len - m_video->used < 2 ||
 		m_text->len - m_text->used < 2 || a_text->len - a_text->used < 2 ||
 		a_audio->len - a_audio->used < 2 || a_video->len - a_video->used < 2)
@@ -7273,7 +7276,7 @@
 		add_line(resp, a_video->str);
 		add_line(resp, hold);	/* Repeat hold for the video stream */
 	}
-	if (needtext) {
+	if (needtext) {	/* only if text response is appropriate */
 		add_line(resp, m_text->str);
 		add_line(resp, a_text->str);
 		add_line(resp, hold);	/* Repeat hold for the text stream */
@@ -7715,7 +7718,7 @@
 	}
 	/* This new INVITE is part of an attended transfer. Make sure that the
 	other end knows and replace the current call with this new call */
-	if (p->options && p->options->replaces && !ast_strlen_zero(p->options->replaces)) {
+	if (p->options && !ast_strlen_zero(p->options->replaces)) {
 		add_header(&req, "Replaces", p->options->replaces);
 		add_header(&req, "Require", "replaces");
 	}




More information about the asterisk-commits mailing list