/*---------------------------------------------------------------------------*/
/* physical.h                                                                */
/* copyright (c) innovaphone 1997 - 2016                                     */
/*                                                                           */
/* phyical layer interface definitions                                       */
/*---------------------------------------------------------------------------*/

NAMESPACE_BEGIN

#define PH_TONE_TYPE_MASK               0x00ff
#define PH_TONE_TYPE_SIT_MASK           0x0f00
#define PH_TONE_TYPE_SIT_ITU			0x0100
#define PH_TONE_TYPE_IN                 0x8000
#define PH_TONE_TYPE_OFF_TRANSPARENT    0x4000
#define PH_TONE_TYPE_CONFERENCE         0x6000
#define PH_TONE_TYPE_NO_RECV			0x1000

struct tone_pattern {
    word on;
    word off;
};

class ph_event_tone_on {
public:
    ph_event_tone_on(word tone_type = 0, word delay = 0, bool off_if_data = false, word on1 = 0, word off1 = 0, word on2 = 0, word off2 = 0, word on3 = 0, word off3 = 0, word on4 = 0, word off4 = 0, short channel=-1) {
        this->tone_type = tone_type;
        this->delay = delay;
        this->off_if_data = off_if_data;
        this->pattern[0].on = on1;
        this->pattern[0].off = off1;
        this->pattern[1].on = on2;
        this->pattern[1].off = off2;
        this->pattern[2].on = on3;
        this->pattern[2].off = off3;
        this->pattern[3].on = on4;
        this->pattern[3].off = off4;
        this->channel = channel;
    }

    word tone_type;
    word delay;
    bool off_if_data;
    struct tone_pattern pattern[4];
    short channel;
};

NAMESPACE_END
