[asterisk-bugs] [JIRA] (DAHTOOL-66) Congestion tone for Australia not correct in zonedata.c

Armen Karlozian (JIRA) noreply at issues.asterisk.org
Mon May 12 21:27:43 CDT 2014


    [ https://issues.asterisk.org/jira/browse/DAHTOOL-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218064#comment-218064 ] 

Armen Karlozian commented on DAHTOOL-66:
----------------------------------------

Ok finally got my licence request done so here we go:

First thing, is to modify the *congestion* line in {{zonedata.c}} by adding the *@* character at the end of the frequency the amplitude is to be reduced.  Of course, one day it would be great if the amount of reduction can be specified here, but for now, to help with this particular issue the character will cause an approximately -10db decrease.

{noformat}
{ .zone = 1,
	  .country = "au",
	  .description = "Australia",
	  .ringcadence = {  400, 200, 400, 2000 },
	  .tones = {
				  
			{ 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" },
			
			//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" },
			{ DAHDI_TONE_INFO, "425/2500,0/500" },
			{ DAHDI_TONE_STUTTER, "413+438/100,0/40" },
		},
	  .dtmf_high_level = -10,
	  .dtmf_low_level = -10,
	  .mfr1_level = -10,
	  .mfr2_level = -8,
	},
{noformat}

Next, in the {{tonezone.c}} file, the follwing changes are made:

At the beginning of the {noformat} static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *count) {noformat} function, we add another float named *db*:

{noformat}
char *dup, *s;
	struct dahdi_tone_def *td=NULL;
	int firstnobang = -1;
	int freq1, freq2, time;
	int modulate = 0;
	float db, gain;
	int used = 0;
	dup = strdup(t->data);
	s = strtok(dup, ",");
{noformat}

This *db* variable must be set to *1.0* for *all* of the "_else if_ nests that follow except for the one we add which in that case will be defined as *0.3*:

{noformat}
                 	// The following "else if" has been added to enable an approximately -20db tone
			// generation of any frequency, provided that it is preceded with the "@" symbol.
			// This has been done primarily to generate the Australian congestion tone.
			// 
			// Example: "425/375,0/375,425@/375,0/375" 
			//
			// Note that float "db" has been added to this subroutine in various locations
			// to allow functionality, multiplying with "gain" to reduce amplitude when needed.
			
			else if (sscanf(s, "%d@/%d", &freq1, &time) == 2) {
			PRINT_DEBUG("f1 reduced amplitude/time format: %d, %d\n", freq1,time);
			db = 0.3;
			freq2 = 0;
			} 

{noformat}

Finally, at the following line, we multiply the *db* variable with the rest of it.  
{noformat}
gain = db*(pow(10.0, (LEVEL - 3.14) / 20.0) * 65536.0 / 2.0);
{noformat}

That's pretty much it.  It's probably not the best way of doing it but it works.  Files attached.

Cheers,
Armen



> Congestion tone for Australia not correct in zonedata.c
> -------------------------------------------------------
>
>                 Key: DAHTOOL-66
>                 URL: https://issues.asterisk.org/jira/browse/DAHTOOL-66
>             Project: DAHDI-Tools
>          Issue Type: Bug
>      Security Level: None
>    Affects Versions: 2.6.2
>            Reporter: Armen Karlozian
>            Assignee: Russ Meyerriecks
>
> Hi there,
> At approximately Line 66 of the zonedata.c file, the Congestion tone specifications for Australia are not correct.  The cadence is ok however, the frequencies and levels are incorrect.  
> 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.  
> Currently it is very difficult/impossible to distinguish when a line is busy/engaged or out of service, etc.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list