[asterisk-commits] oej: branch oej/sip-t140-red r116177 - /team/oej/sip-t140-red/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 14 03:08:52 CDT 2008


Author: oej
Date: Wed May 14 03:08:50 2008
New Revision: 116177

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116177
Log:
Cleaning up

Modified:
    team/oej/sip-t140-red/channels/chan_sip.c

Modified: team/oej/sip-t140-red/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip-t140-red/channels/chan_sip.c?view=diff&rev=116177&r1=116176&r2=116177
==============================================================================
--- team/oej/sip-t140-red/channels/chan_sip.c (original)
+++ team/oej/sip-t140-red/channels/chan_sip.c Wed May 14 03:08:50 2008
@@ -6329,11 +6329,12 @@
 	char buf[SIPBUFSIZE];
 	int rua_version;
 	
-	char *cp;
-	char red_fmtp[100] = "empty";
 	int red_data_pt[10];
 	int red_num_gen = 0;
 	int red_pt = 0;
+
+	char *red_cp; 				/* For T.140 red */
+	char red_fmtp[100] = "empty";		/* For T.140 red */
 
 	if (!p->rtp) {
 		ast_log(LOG_ERROR, "Got SDP but have no RTP session allocated.\n");
@@ -6679,19 +6680,20 @@
 			
 		} else if (!strncmp(a, red_fmtp, strlen(red_fmtp))) {
 			/* count numbers of generations in fmtp */
-			cp = &red_fmtp[strlen(red_fmtp)];
+			red_cp = &red_fmtp[strlen(red_fmtp)];
 			strncpy(red_fmtp, a, 100);
 
-			sscanf(cp, "%u", &red_data_pt[red_num_gen]);
-			cp = strtok(cp, "/");
-			while (cp && red_num_gen++ < RED_MAX_GENERATION) {
-				sscanf(cp, "%u", &red_data_pt[red_num_gen]);
-				cp = strtok(NULL, "/");
+			sscanf(red_cp, "%u", &red_data_pt[red_num_gen]);
+			red_cp = strtok(red_cp, "/");
+			while (red_cp && red_num_gen++ < RED_MAX_GENERATION) {
+				sscanf(red_cp, "%u", &red_data_pt[red_num_gen]);
+				red_cp = strtok(NULL, "/");
 			}
-			strncpy(p->red_fmtp, "a=", 2);
-			strncpy(&p->red_fmtp[2], a, 100);
-			cp = red_fmtp;
-			strncpy((cp = memchr(p->red_fmtp, '\0', 100)), "\r\n\0", 4);
+			//SKREP OEJ - Disabled this code
+			//strncpy(p->red_fmtp, "a=", 2);
+			//strncpy(&p->red_fmtp[2], a, 98);
+			//strncpy((cp = memchr(p->red_fmtp, '\0', 100)), "\r\n\0", 4);
+			red_cp = red_fmtp;
 
 		} else if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) == 2) {
 			/* We have a rtpmap to handle */
@@ -7815,19 +7817,11 @@
 	/* Add fmtp code here */
 
 	if (codec == AST_FORMAT_RED) {
-	
-	  ast_str_append(a_buf, 0, "a=fmtp:%d %d/%d/%d\r\n", rtp_code, 
+		ast_str_append(a_buf, 0, "a=fmtp:%d %d/%d/%d\r\n", rtp_code, 
 			 ast_rtp_lookup_code(p->trtp, 1, AST_FORMAT_T140),
 			 ast_rtp_lookup_code(p->trtp, 1, AST_FORMAT_T140),
 			 ast_rtp_lookup_code(p->trtp, 1, AST_FORMAT_T140));
 
-	  /*		if (p->red_fmtp[0] != '\0') {
-			ast_str_append(a_buf, 0, p->red_fmtp);
-		} else {
-			int c = ast_rtp_lookup_code(p->trtp, 1, AST_FORMAT_T140);
-			ast_str_append(a_buf, 0, "a=fmtp:%d %d/%d\r\n", rtp_code, c,c);
-		}
-	  */
 	}
 }
 




More information about the asterisk-commits mailing list