 void pickedUpHandler(telephone::ButtonState buttonState) {
   isGettingPhoneNumber = buttonState == PRESSED;
   if (isGettingPhoneNumber) {
+    Serial.println("Headset up");
     phoneNumber = "";
-    digitCounter = 0;
   } else {
+    Serial.println("Headset down");
     isGettingDigit = false;
     if (isTalking) {
       gsmVoiceCall.hangCall();

boolean isGettingDigit;
boolean isTalking;

int digitCounter;
int digitValue;
String phoneNumber;

const int DIGITS_IN_PHONE_NUMBER = 11;
char phoneNumberChars[DIGITS_IN_PHONE_NUMBER + 1];

//---- gsm begin
#define SIM_PIN_NUMBER ""

  buttonRotate.setHandler(rotatingHandler);
  buttonCounter.setHandler(rotaryCounterHandler);
  
  Serial.print("Connecting..");
  while (true) {
    Serial.print(".");
    if (gsmAccess.begin(SIM_PIN_NUMBER) == GSM_READY) {
      Serial.println("done");
      break;
    }
    delay(1000);
  }
}

void loop() {
  refreshButtons();
}
