Added 3 new tones: congestion, out-of-order, digital milliwatt.

git-svn-id: http://yate.null.ro/svn/yate/trunk@107 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2004-11-04 00:32:25 +00:00
parent fc3d3c0df5
commit 1ae2f0e117
2 changed files with 27 additions and 0 deletions

View File

@ -84,3 +84,6 @@
^99991002$=tone/busy
^99991003$=tone/ring
^99991004$=tone/specdial
^99991005$=tone/congestion
^99991006$=tone/outoforder
^99991007$=tone/milliwatt

View File

@ -92,6 +92,13 @@ static const short tone421hz[] = {
-1645,-4759,-7357,-9157,-9965,-9694,-8371,-6142,-3246,
0 };
// 1000Hz (8 samples @ 8kHz) standard digital milliwatt
static const short tone1000hz[] = {
8,
8828, 20860, 20860, 8828,
-8828, -20860, -20860, -8828
};
static const Tone t_dial[] = { { 8000, tone421hz }, { 0, 0 } };
static const Tone t_busy[] = { { 4000, tone421hz }, { 4000, 0 }, { 0, 0 } };
@ -100,6 +107,17 @@ static const Tone t_specdial[] = { { 7600, tone421hz }, { 400, 0 }, { 0, 0 } };
static const Tone t_ring[] = { { 8000, tone421hz }, { 32000, 0 }, { 0, 0 } };
static const Tone t_congestion[] = { { 2000, tone421hz }, { 2000, 0 }, { 0, 0 } };
static const Tone t_outoforder[] = {
{ 800, tone421hz }, { 800, 0 },
{ 800, tone421hz }, { 800, 0 },
{ 800, tone421hz }, { 800, 0 },
{ 1600, tone421hz }, { 1600, 0 },
{ 0, 0 } };
static const Tone t_mwatt[] = { { 8000, tone1000hz }, { 0, 0 } };
ToneSource::ToneSource(const String &tone)
: m_name(tone), m_tone(0), m_data(0,480), m_brate(16000), m_total(0), m_time(0)
{
@ -134,6 +152,12 @@ const Tone *ToneSource::getBlock(const String &tone)
return t_ring;
else if (tone == "specdial" || tone == "sd")
return t_specdial;
else if (tone == "congestion" || tone == "cg")
return t_congestion;
else if (tone == "outoforder" || tone == "oo")
return t_outoforder;
else if (tone == "milliwatt" || tone == "mw")
return t_mwatt;
Debug(DebugWarn,"No waveform is defined for tone '%s'",tone.c_str());
return 0;
}