[Asterisk-cvs] asterisk/channels chan_agent.c, 1.99, 1.100 chan_alsa.c, 1.30, 1.31 chan_iax2.c, 1.223, 1.224 chan_mgcp.c, 1.97, 1.98 chan_modem_i4l.c, 1.18, 1.19 chan_skinny.c, 1.59, 1.60

markster at lists.digium.com markster at lists.digium.com
Sun Dec 19 16:17:39 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv6173/channels

Modified Files:
	chan_agent.c chan_alsa.c chan_iax2.c chan_mgcp.c 
	chan_modem_i4l.c chan_skinny.c 
Log Message:
Merge Olle's comment patch (bug #3097)


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- chan_agent.c	16 Dec 2004 03:15:20 -0000	1.99
+++ chan_agent.c	19 Dec 2004 21:13:41 -0000	1.100
@@ -508,7 +508,7 @@
 		if (res)
 			ast_log(LOG_WARNING, "Unable to set read format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
 	} else {
-		// Agent hung-up
+		/* Agent hung-up */
 		p->chan = NULL;
 	}
 

Index: chan_alsa.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_alsa.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- chan_alsa.c	28 Nov 2004 21:28:30 -0000	1.30
+++ chan_alsa.c	19 Dec 2004 21:13:41 -0000	1.31
@@ -1,9 +1,9 @@
 /*
  * Asterisk -- A telephony toolkit for Linux.
  *
- * Copyright (C) 2002, Linux Support Services
+ * Copyright (C) 2002-2004, Digium, inc
  *
- * By Matthew Fredrickson <creslin at linux-support.net>
+ * By Matthew Fredrickson <creslin at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License
@@ -61,7 +61,7 @@
 #define MIN_SWITCH_TIME 600
 
 static snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
-//static int block = O_NONBLOCK;
+/* static int block = O_NONBLOCK; */
 static char indevname[50] = ALSA_INDEV;
 static char outdevname[50] = ALSA_OUTDEV;
 
@@ -284,14 +284,14 @@
 	snd_pcm_sw_params_t *swparams = NULL;
 	struct pollfd pfd;
 	snd_pcm_uframes_t period_size = PERIOD_FRAMES * 4;
-	//int period_bytes = 0;
+	/* int period_bytes = 0; */
 	snd_pcm_uframes_t buffer_size = 0;
 
 	unsigned int rate = DESIRED_RATE;
 #if 0
 	unsigned int per_min = 1;
 #endif
-	//unsigned int per_max = 8;
+	/* unsigned int per_max = 8; */
 	snd_pcm_uframes_t start_threshold, stop_threshold;
 
 	err = snd_pcm_open(&handle, dev, stream, O_NONBLOCK);
@@ -334,7 +334,7 @@
 		ast_log(LOG_DEBUG, "Period size is %d\n", err);
 	}
 
-	buffer_size = 4096 * 2; //period_size * 16;
+	buffer_size = 4096 * 2; /* period_size * 16; */
 	err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffer_size);
 	if (err < 0) {
 		ast_log(LOG_WARNING, "Problem setting buffer size of %ld: %s\n", buffer_size, snd_strerror(err));
@@ -542,7 +542,7 @@
 	int len = sizpos;
 	int pos;
 	int res = 0;
-	//size_t frames = 0;
+	/* size_t frames = 0; */
 	snd_pcm_state_t state;
 	/* Immediately return if no sound is enabled */
 	if (nosound)

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -d -r1.223 -r1.224
--- chan_iax2.c	19 Dec 2004 18:26:12 -0000	1.223
+++ chan_iax2.c	19 Dec 2004 21:13:41 -0000	1.224
@@ -6617,8 +6617,8 @@
 				}
 			} else if (!strcasecmp(v->name, "timezone")) {
 				strncpy(peer->zonetag, v->value, sizeof(peer->zonetag)-1);	
-			}// else if (strcasecmp(v->name,"type"))
-			//	ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
+			}/* else if (strcasecmp(v->name,"type")) */
+			/*	ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
 			v=v->next;
 		}
 		if (!peer->authmethods)
@@ -6755,8 +6755,8 @@
 				}
 			} else if (!strcasecmp(v->name, "inkeys")) {
 				strncpy(user->inkeys, v->value, sizeof(user->inkeys) - 1);
-			}// else if (strcasecmp(v->name,"type"))
-			//	ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
+			}/* else if (strcasecmp(v->name,"type")) */
+			/*	ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
 			v = v->next;
 		}
 		if (!user->authmethods) {
@@ -7038,8 +7038,8 @@
 			}
 		} else if (!strcasecmp(v->name, "language")) {
                         strncpy(language, v->value, sizeof(language) - 1);
-		} //else if (strcasecmp(v->name,"type"))
-		//	ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
+		} /*else if (strcasecmp(v->name,"type")) */
+		/*	ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
 		v = v->next;
 	}
 	iax2_capability = capability;

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- chan_mgcp.c	18 Dec 2004 23:32:42 -0000	1.97
+++ chan_mgcp.c	19 Dec 2004 21:13:41 -0000	1.98
@@ -1019,7 +1019,7 @@
 		e = g->endpoints;
 		ast_cli(fd, "Gateway '%s' at %s (%s)\n", g->name, g->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), g->addr.sin_addr) : ast_inet_ntoa(iabuf, sizeof(iabuf), g->defaddr.sin_addr), g->dynamic ? "Dynamic" : "Static");
 		while(e) {
-			// JS: Don't show wilcard endpoint
+			/* JS: Don't show wilcard endpoint */
 			if (strcmp(e->name, g->wcardep) !=0)
 				ast_cli(fd, "   -- '%s@%s in '%s' is %s\n", e->name, g->name, e->context, e->sub->owner ? "active" : "idle");
 			hasendpoints = 1;
@@ -1721,7 +1721,7 @@
 #if 0
 	printf("Peer RTP is at port %s:%d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
 #endif	
-	// Scan through the RTP payload types specified in a "m=" line:
+	/* Scan through the RTP payload types specified in a "m=" line: */
     ast_rtp_pt_clear(sub->rtp);
 	codecs = m + len;
 	while(strlen(codecs)) {
@@ -1733,18 +1733,18 @@
 		codecs += len;
 	}
 
-        // Next, scan through each "a=rtpmap:" line, noting each
-        // specified RTP payload type (with corresponding MIME subtype):
+        /* Next, scan through each "a=rtpmap:" line, noting each */
+        /* specified RTP payload type (with corresponding MIME subtype): */
         sdpLineNum_iterator_init(&iterator);
         while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
-          char* mimeSubtype = strdup(a); // ensures we have enough space
+          char* mimeSubtype = strdup(a); /* ensures we have enough space */
           if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue;
-          // Note: should really look at the 'freq' and '#chans' params too
+          /* Note: should really look at the 'freq' and '#chans' params too */
           ast_rtp_set_rtpmap_type(sub->rtp, codec, "audio", mimeSubtype);
 	  free(mimeSubtype);
         }
 
-        // Now gather all of the codecs that were asked for:
+        /* Now gather all of the codecs that were asked for: */
         ast_rtp_get_current_formats(sub->rtp,
                                 &peercapability, &peerNonCodecCapability);
 	p->capability = capability & peercapability;
@@ -2167,7 +2167,7 @@
 	struct mgcp_request resp;
 	reqprep(&resp, p, "AUEP");
     /* SC: removed unknown param VS */
-	//add_header(&resp, "F", "A,R,D,S,X,N,I,T,O,ES,E,MD,M");
+	/*add_header(&resp, "F", "A,R,D,S,X,N,I,T,O,ES,E,MD,M"); */
 	add_header(&resp, "F", "A");
     /* SC: fill in new fields */
     resp.cmd = MGCP_CMD_AUEP;
@@ -2923,7 +2923,7 @@
 			if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) {
 					ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name);
 			}
-			// JS: For RSIP on wildcard we reset all endpoints
+			/* JS: For RSIP on wildcard we reset all endpoints */
 			if (!strcmp(p->name, p->parent->wcardep)) {
 				/* Reset all endpoints */
 				struct mgcp_endpoint *tmp_ep;
@@ -2931,7 +2931,7 @@
 				g = p->parent;
 				tmp_ep = g->endpoints;
 				while (tmp_ep) {
-					//if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/*") != 0)) {
+					/*if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/*") != 0)) { */
 					if (strcmp(tmp_ep->name, g->wcardep) != 0) {
 						struct mgcp_subchannel *tmp_sub, *first_sub;
 						if (option_verbose > 2) {
@@ -3635,7 +3635,7 @@
                         e->needaudit = 1;
                     }
                     strncpy(gw->wcardep, v->value, sizeof(gw->wcardep)-1);
-					//strncpy(e->name, "aaln/*", sizeof(e->name) - 1);
+					/*strncpy(e->name, "aaln/*", sizeof(e->name) - 1); */
 					/* XXX Should we really check for uniqueness?? XXX */
 					strncpy(e->context, context, sizeof(e->context) - 1);
 					strncpy(e->cid_num, cid_num, sizeof(e->cid_num) - 1);

Index: chan_modem_i4l.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem_i4l.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- chan_modem_i4l.c	2 Oct 2004 00:58:31 -0000	1.18
+++ chan_modem_i4l.c	19 Dec 2004 21:13:41 -0000	1.19
@@ -172,8 +172,8 @@
 	if (strlen(p->incomingmsn)) {
 		char *q;
 		snprintf(cmd, sizeof(cmd), "AT&L%s", p->incomingmsn);
-		// translate , into ; since that is the seperator I4L uses, but can't be directly
-		// put in the config file because it will interpret the rest of the line as comment.
+		/* translate , into ; since that is the seperator I4L uses, but can't be directly */
+		/* put in the config file because it will interpret the rest of the line as comment. */
 		q = cmd+4;
 		while (*q) {
 			if (*q == ',') *q = ';';
@@ -319,9 +319,9 @@
 		/* Read the first two bytes, first, in case it's a control message */
 		res = read(p->fd, result, 2);
 		if (res < 2) {
-			// short read, means there was a hangup?
-			// (or is this also possible without hangup?)
-			// Anyway, reading from unitialized buffers is a bad idea anytime.
+			/* short read, means there was a hangup? */
+			/* (or is this also possible without hangup?) */
+			/* Anyway, reading from unitialized buffers is a bad idea anytime. */
 			if (errno == EAGAIN)
 				return i4l_handle_escape(p, 0);
 			return NULL;
@@ -337,7 +337,7 @@
 			ast_modem_trim(result);
 			if (!strcasecmp(result, "VCON")) {
 				/* If we're in immediate mode, reply now */
-//				if (p->mode == MODEM_MODE_IMMEDIATE)
+/*				if (p->mode == MODEM_MODE_IMMEDIATE) */
 					return i4l_handle_escape(p, 'X');
 			} else
 			if (!strcasecmp(result, "BUSY")) {
@@ -587,11 +587,11 @@
 	char tmpmsn[255];
 	struct ast_channel *c = p->owner;
 
-	// Find callerid number first, to set the correct A number
+	/* Find callerid number first, to set the correct A number */
 	if (c && c->cid.cid_num && !(c->cid.cid_pres & 0x20)) {
 	    snprintf(tmpmsn, sizeof(tmpmsn), ",%s,", c->cid.cid_num);
 	    if(strlen(p->outgoingmsn) && strstr(p->outgoingmsn,tmpmsn) != NULL) {
-	      // Tell ISDN4Linux to use this as A number
+	      /* Tell ISDN4Linux to use this as A number */
 	      snprintf(cmd, sizeof(cmd), "AT&E%s\n", c->cid.cid_num);
 	      if (ast_modem_send(p, cmd, strlen(cmd))) {
 		ast_log(LOG_WARNING, "Unable to set A number to %s\n", c->cid.cid_num);

Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- chan_skinny.c	26 Oct 2004 22:25:43 -0000	1.59
+++ chan_skinny.c	19 Dec 2004 21:13:41 -0000	1.60
@@ -3,7 +3,7 @@
  *
  * Implementation of the Skinny protocol
  * 
- * Asterisk is Copyright (C) 1999-2003 Mark Spencer
+ * Copyright (C) 1999-2004 Digium, inc
  *
  * chan_skinny was developed by Jeremy McNamara & Florian Overkamp
  *
@@ -1449,7 +1449,7 @@
                         ((exten[0] != '*') || (!ast_strlen_zero(exten) > 2))) {
             ast_log(LOG_WARNING, "Can't match [%s] from '%s' in context %s\n", exten, chan->cid.cid_num ? chan->cid.cid_num : "<Unknown Caller>", chan->context);
             transmit_tone(s, SKINNY_REORDER); 
-			sleep(3); // hang out for 3 seconds to let congestion play
+			sleep(3); /* hang out for 3 seconds to let congestion play */
 			break;
         }
         if (!timeout)
@@ -2716,7 +2716,7 @@
 int reload(void)
 {
 #if 0
-// XXX Causes Seg
+/* XXX Causes Seg - needs to be fixed, or? */
 
 	delete_devices();
 	reload_config();




More information about the svn-commits mailing list