[asterisk-commits] kpfleming: branch 1.2 r60398 - /branches/1.2/codecs/codec_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 6 07:41:38 MST 2007


Author: kpfleming
Date: Fri Apr  6 09:41:37 2007
New Revision: 60398

URL: http://svn.digium.com/view/asterisk?view=rev&rev=60398
Log:
remove undocumented 'cardsmode' parameter and stop searching for transcoders during reload()

Modified:
    branches/1.2/codecs/codec_zap.c

Modified: branches/1.2/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/codecs/codec_zap.c?view=diff&rev=60398&r1=60397&r2=60398
==============================================================================
--- branches/1.2/codecs/codec_zap.c (original)
+++ branches/1.2/codecs/codec_zap.c Fri Apr  6 09:41:37 2007
@@ -55,7 +55,6 @@
 #define BUFFER_SAMPLES	8000
 
 static unsigned int global_useplc = 0;
-static int cardsmode = 0;
 
 static int totalchannels = 0;
 static int complexinuse = 0;
@@ -109,17 +108,14 @@
 static int show_transcoder(int fd, int argc, char **argv)
 {
 	ast_mutex_lock(&channelcount);
+
 	if (!totalchannels) { 
 		ast_cli(fd, "No transcoder card registered\n");
 		ast_mutex_unlock(&channelcount);
 		return RESULT_SUCCESS;
 	}
-	if(!cardsmode)
-		ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.729a / G.723.1 5.3 kbps) are in use.\n",complexinuse, simpleinuse, totalchannels);
-	else if (cardsmode == 1)
-		ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.729a) are in use.\n",complexinuse, simpleinuse, totalchannels);
-	else if (cardsmode == 2)
-		ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.723.1 5.3 kbps) are in use.\n",complexinuse, simpleinuse, totalchannels);
+
+	ast_cli(fd, "%d/%d encoders/decoders of %d channels are in use.\n", complexinuse, simpleinuse, totalchannels);
 
 	ast_mutex_unlock(&channelcount);
 	return RESULT_SUCCESS;
@@ -714,8 +710,7 @@
 		ast_log(LOG_ERROR, "Could not allocate translator\n");
 		return -1;
 	}
-	if (!((cardsmode == 1 && (dst == 8 || src == 8)) || (cardsmode == 2 && (dst == 0 || src == 0)) || (cardsmode == 0)))
-		return -1;
+
 	snprintf((char *) (zt->t.name), sizeof(zt->t.name), "zap%sto%s", 
 		 ast_getformatname((1 << src)), ast_getformatname((1 << dst)));
 
@@ -794,7 +789,6 @@
 {
 	struct ast_variable *var;
 	struct ast_config *cfg = ast_config_load("codecs.conf");
-	cardsmode = 0;
 
 	if (!cfg)
 		return;
@@ -806,16 +800,6 @@
 				ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n", global_useplc ? "" : "not ");
 		}
 	}
-	for (var = ast_variable_browse(cfg, "transcoder_card"); var; var = var->next) {
-		if (!strcasecmp(var->name, "mode")) {
-			if(strstr(var->value, "g729"))
-				cardsmode = 1;
-			else if(strstr(var->value, "g723"))
-				cardsmode = 2;
-			else if(strstr(var->value, "mixed"))
-				cardsmode = 0;
-		}
-	}
 
 	ast_config_destroy(cfg);
 }
@@ -891,7 +875,6 @@
 int reload(void)
 {
 	parse_config();
-	find_transcoders();
 
 	return 0;
 }



More information about the asterisk-commits mailing list