
NAMESPACE_BEGIN

//  0 - 425Hz
//  1 - 350Hz
//  2 - 440Hz
//  3 - 350Hz
//  4 - 400Hz
//  5 - 450Hz
//  6 - 480Hz
//  7 - 620Hz
//  8 - 330Hz
//  9 - 440Hz 

// tone pairs
//  0 - 0/- -10dB           Europe
//  1 - 1/2 -13dB/-13dB     US Dial
//  2 - 4/- -16db           UK Busy
//  3 - 1/2 -13dB/-13dB     unused
//  4 - 4/5 -14dB/-14dB     UK Alert
//  5 - 2/6 -15dB           US ALert
//  6 - 5/7 -8dB/-8dB       US Busy
//  7 - 9   -19dB           US Call Waiting
//  8 - 8    -8dB           unused
//  9 - 9    -8dB           France Dial/Busy
// 10 - 0    -10dB          unused
// 11 - 5    -10dB          Turkey Dial
// 12 - 1/5  -13dB/-13dB    South Africa Dial

#define PHONE_MAX_TONES     27
#define TONE_MAX_FREQ       16
#define TONE_MAX_PAIRS      16

extern int tone_freq[TONE_MAX_FREQ];
extern struct tone_pair tone_pair[TONE_MAX_PAIRS];

struct tone_pair {
    byte index_high;
    byte index_low;
    byte level_high;
    byte level_low;
};

struct tones {
    class ph_event_tone_on * dialing;
    class ph_event_tone_on * dialing_special;
    class ph_event_tone_on * calling;
    class ph_event_tone_on * ringback;
    class ph_event_tone_on * busy;
    class ph_event_tone_on * holding;
    class ph_event_tone_on * fast_busy;
    class ph_event_tone_on * callwaiting;
    class ph_event_tone_on * holding_cisco;
    class ph_event_tone_on * zipzip;
    class ph_event_tone_on * intrusion;
    class ph_event_tone_on * conference;
    class ph_event_tone_on * confirm;
};

extern const char * tone_num[];
extern const char * tone_title[];
extern struct tones tone_table[PHONE_MAX_TONES];

NAMESPACE_END

