[dahdi-commits] dahdi/tools.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Aug 1 16:12:13 CDT 2014


branch "master" has been updated
       via  a109763160e7c5e3b97b517e8d4b793f404782a5 (commit)
       via  6c40704fec0b39f9da116d4d907c1fbf33a1eae7 (commit)
       via  95e9dd71d8060435a939d936235c4fe807254ac0 (commit)
       via  df477219627f9f79594fe1b9b00f97ed2998c709 (commit)
      from  4e14561508c54169e7573fb0ad5eb4f46509480b (commit)

Summary of changes:
 dahdi_cfg.c |   11 ++++++-----
 tonezone.c  |   22 ++++++++++++++++++----
 zonedata.c  |   21 ++++++++++++++++++---
 3 files changed, 42 insertions(+), 12 deletions(-)


- Log -----------------------------------------------------------------
commit a109763160e7c5e3b97b517e8d4b793f404782a5
Author: Armen Karlozian <armeniki at hotmail.com>
Date:   Tue May 13 12:46:31 2014 -0500

    tonezone: Fix congestion tone for Australia
    
    The Congestion tone in Australia must be reduced by 10 to 15 dB
    at every other cadence and the frequencies for both at cadences are 425 Hz.
    
    From: Armen Karlozian <armeniki at hotmail.com>
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>

diff --git a/tonezone.c b/tonezone.c
index afdec99..8987061 100644
--- a/tonezone.c
+++ b/tonezone.c
@@ -89,18 +89,19 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 	int firstnobang = -1;
 	int freq1, freq2, time;
 	int modulate = 0;
-	float gain;
+	float db, gain;
 	int used = 0;
 	dup = strdup(t->data);
 	s = strtok(dup, ",");
 	while(s && strlen(s)) {
 		/* Handle optional ! which signifies don't start here*/
-		if (s[0] == '!') 
+		if (s[0] == '!') {
 			s++;
-		else if (firstnobang < 0) {
+		} else if (firstnobang < 0) {
 			PRINT_DEBUG("First no bang: %s\n", s);
 			firstnobang = *count;
 		}
+
 		if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &time) == 3) {
 			/* f1+f2/time format */
 			PRINT_DEBUG("f1+f2/time format: %d, %d, %d\n", freq1, freq2, time);
@@ -111,18 +112,31 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 		} else if (sscanf(s, "%d+%d", &freq1, &freq2) == 2) {
 			PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
 			time = 0;
+			db = 1.0;
 		} else if (sscanf(s, "%d*%d", &freq1, &freq2) == 2) {
 			PRINT_DEBUG("f1+f2 format: %d, %d\n", freq1, freq2);
 			modulate = 1;
 			time = 0;
+			db = 1.0;
 		} else if (sscanf(s, "%d/%d", &freq1, &time) == 2) {
 			PRINT_DEBUG("f1/time format: %d, %d\n", freq1, time);
 			freq2 = 0;
+			db = 1.0;
+		} else if (sscanf(s, "%d@/%d", &freq1, &time) == 2) {
+			/* The "@" character has been added to enable an
+ 			 * approximately -20db tone generation of any frequency This has been done
+ 			 * primarily to generate the Australian congestion tone.
+			 * Example: "425/375,0/375,425@/375,0/375" 
+			 */
+			PRINT_DEBUG("f1 reduced amplitude/time format: %d, %d\n", freq1,time);
+			db = 0.3;
+			freq2 = 0;
 		} else if (sscanf(s, "%d", &freq1) == 1) {
 			PRINT_DEBUG("f1 format: %d\n", freq1);
 			firstnobang = *count;
 			freq2 = 0;
 			time = 0;
+			db = 1.0;
 		} else {
 			fprintf(stderr, "tone component '%s' of '%s' is a syntax error\n", s,t->data);
 			return -1;
@@ -137,7 +151,7 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
 		td = data;
 
 		/* Bring it down -8 dbm */
-		gain = pow(10.0, (LEVEL - 3.14) / 20.0) * 65536.0 / 2.0;
+		gain = db*(pow(10.0, (LEVEL - 3.14) / 20.0) * 65536.0 / 2.0);
 
 		td->fac1 = 2.0 * cos(2.0 * M_PI * (freq1 / 8000.0)) * 32768.0;
 		td->init_v2_1 = sin(-4.0 * M_PI * (freq1 / 8000.0)) * gain;
diff --git a/zonedata.c b/zonedata.c
index 437ab0c..1d314b1 100644
--- a/zonedata.c
+++ b/zonedata.c
@@ -59,11 +59,18 @@ struct tone_zone builtin_zones[] =
 	  .description = "Australia",
 	  .ringcadence = {  400, 200, 400, 2000 },
 	  .tones = {
-			{ DAHDI_TONE_DIALTONE, "413+438" },
+				  
+			{ DAHDI_TONE_DIALTONE, "415+440" },
 			{ DAHDI_TONE_BUSY, "425/375,0/375" },
 			{ DAHDI_TONE_RINGTONE, "413+438/400,0/200,413+438/400,0/2000" },
-			/* XXX Congestion: Should reduce by 10 db every other cadence XXX */
-			{ DAHDI_TONE_CONGESTION, "425/375,0/375,420/375,0/375" },
+			/* The Australian congestion tone is 425Hz, 375ms On, 375ms Off, with the
+			 * second cadence being half the amplitude of the first; so the first cadence
+			 * is approximately -10dB with the second one being -20dB.  Using the update
+			 * ToneZone.c file, this can be accomplished by adding the "@" symbol in front
+			 * of the frequency to reduce amplification, as in the following entry for
+			 * Congestion:
+			 */
+			{ DAHDI_TONE_CONGESTION, "425/375,0/375,425@/375,0/375" },
 			{ DAHDI_TONE_CALLWAIT, "425/100,0/200,425/200,0/4400" },
 			{ DAHDI_TONE_DIALRECALL, "413+428" },
 			{ DAHDI_TONE_RECORDTONE, "!425/1000,!0/15000,425/360,0/15000" },

commit 6c40704fec0b39f9da116d4d907c1fbf33a1eae7
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Tue Dec 18 13:21:04 2012 -0600

    zonedata: Ensure all zones have a default DAHDI_TONE_DIALRECALL.
    
    The default 'us' tone is most likely better than silence when Asterisk tries to
    generate the recall tone on a DAHDI channel.
    
    Internal-Issue-ID: DAHTOOL-63
    Reported-By: Igor Kravets
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>

diff --git a/zonedata.c b/zonedata.c
index 3330c13..437ab0c 100644
--- a/zonedata.c
+++ b/zonedata.c
@@ -928,6 +928,8 @@ struct tone_zone builtin_zones[] =
 			{ DAHDI_TONE_RECORDTONE, "1400/400,0/15000" },
 			{ DAHDI_TONE_INFO, "950/330,1440/330,1800/330,0/1000" },
 			{ DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" },
+			/* DIALRECALL - not specified */
+			{ DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" },
 		},
 	  .dtmf_high_level = -10,
 	  .dtmf_low_level = -10,
@@ -948,6 +950,8 @@ struct tone_zone builtin_zones[] =
 			/* This should actually be 950+1400+1800, but we only support 2 tones at a time */
 			{ DAHDI_TONE_INFO,       "!950+1400/300,!0/1000,!950+1400/300,!0/1000,!950+1400/1000,0" },
 			{ DAHDI_TONE_STUTTER,    "!450/100,!0/100,!450/100,!0/100,!450/100,!0/100,!450/100,!0/100,!450/100,!0/100,!450/100,!0/100,450" },
+			/* DIALRECALL - not specified */
+			{ DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" },
 		},
 		.dtmf_high_level = -10,
 		.dtmf_low_level = -10,
@@ -996,6 +1000,8 @@ struct tone_zone builtin_zones[] =
 			{ DAHDI_TONE_INFO, "950/333,1400/333,1800/333,0/1000" },
 			/* STUTTER TONE - not specified */
 			{ DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" },
+			/* DIALRECALL - not specified */
+			{ DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" },
 		},
 		.dtmf_high_level = -10,
 		.dtmf_low_level = -10,
@@ -1044,6 +1050,8 @@ struct tone_zone builtin_zones[] =
 			{ DAHDI_TONE_INFO, "950/330,1450/330,1850/330,0/1000" },
 			/* STUTTER TONE */
 			{ DAHDI_TONE_STUTTER, "380+420" },
+			/* DIALRECALL - not specified */
+			{ DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" },
 		},
 		.dtmf_high_level = -10,
 		.dtmf_low_level = -10,

commit 95e9dd71d8060435a939d936235c4fe807254ac0
Author: Russ Meyerriecks <rmeyerriecks at digium.com>
Date:   Wed Jul 23 13:20:14 2014 -0500

    dahdi_cfg: Reduce mass ioctls on non-existing channels
    
    Logic was calling DAHDI_SPECIFY ioctl on all channels up to maximum channel
    limit. Added a short circuit to prevent the ioctl on channels that aren't
    configured.
    
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
    Acked-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/dahdi_cfg.c b/dahdi_cfg.c
index 432675e..30add83 100644
--- a/dahdi_cfg.c
+++ b/dahdi_cfg.c
@@ -826,8 +826,9 @@ static int apply_fiftysix(void)
 	int chanfd;
 
 	for (x = 1; x < DAHDI_MAX_CHANNELS; x++) {
-		if (skip_channel(x))
+		if (skip_channel(x) || !cc[x].sigtype)
 			continue;
+
 		chanfd = open("/dev/dahdi/channel", O_RDWR);
 		if (chanfd == -1) {
 			fprintf(stderr, 

commit df477219627f9f79594fe1b9b00f97ed2998c709
Author: Russ Meyerriecks <rmeyerriecks at digium.com>
Date:   Tue Jul 22 16:24:26 2014 -0500

    dahdi_cfg: minor: Rename fo_real to dry_run
    
    Minor readability change
    
    Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
    Acked-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/dahdi_cfg.c b/dahdi_cfg.c
index c8369db..432675e 100644
--- a/dahdi_cfg.c
+++ b/dahdi_cfg.c
@@ -109,7 +109,7 @@ static int fiftysixkhdlc[DAHDI_MAX_CHANNELS];
 
 static int spans=0;
 
-static int fo_real = 1;
+static int dry_run = 0;
 
 static int verbose = 0;
 
@@ -1590,7 +1590,7 @@ int main(int argc, char *argv[])
 			force++;
 			break;
 		case 't':
-			fo_real = 0;
+			dry_run = 1;
 			break;
 		case 's':
 			stopmode = 1;
@@ -1683,9 +1683,9 @@ finish:
 	if (verbose) {
 		printconfig(fd);
 	}
-	if (!fo_real) 
-		exit(0);
 
+	if (dry_run)
+		exit(0);
 	
 	if (debug & DEBUG_APPLY) {
 		printf("About to open Master device\n");

-----------------------------------------------------------------------


-- 
dahdi/tools.git



More information about the dahdi-commits mailing list