 uint8_t hookState = 0;
 uint32_t hookTimeOut = 0;
 uint8_t followState = 1;
+uint8_t ringingState = 0;
+uint32_t ringingTimmer = 0;
+uint8_t ringingStage = 0;
 
 
 void setup()


void ringStart()
{
    analogWrite(RINGER,128);
}

void ringStop()
{
    analogWrite(RINGER, 0);
}


/*
void keypadEvent(KeypadEvent key){
  switch (keypad.getState()){
    case PRESSED:
      switch (key){
        case '#': digitalWrite(ledPin,!digitalRead(ledPin)); break;
        case '*': 
          digitalWrite(ledPin,!digitalRead(ledPin));
        break;
      }
      break;
    case RELEASED:
      switch (key){
        case '*': 
          digitalWrite(ledPin,!digitalRead(ledPin));
          blink = false;
        break;
      }
      break;
    case HOLD:
      switch (key){
        case '*': blink = true; break;
      }
      break;
  }
}
*/
#define RINGER 11

#define HOOK_TIMEOUT 5
#define RING_ON_TIME 400
#define RING_OFF_TIME 200


int8_t incoming;
volatile uint8_t newHookState = 0;
