docs: def _pollCallStatus(self, expectedState, callId=None, timeout=None):
          """ Poll the status of outgoing calls.    
          This is used for modems that do not have a known set of call status update notifications.
          
          :param expectedState: The internal state we are waiting for. 0 == initiated, 1 == answered, 2 = hangup
          :type expectedState: int
          
          :raise TimeoutException: If a timeout was specified, and has occurred
          """
          callDone = False
          timeLeft = timeout or 999999
          while self.alive and not callDone and timeLeft > 0:
              time.sleep(0.5)
              if expectedState == 0: # Only call initializing can timeout
                  timeLeft -= 0.5
              try:
                  clcc = self._pollCallStatusRegex.match(self.write('AT+CLCC')[0])
              except TimeoutException as timeout:
                  # Can happend if the call was ended during our time.sleep() call
                  clcc = None
              if clcc:
                  direction = int(clcc.group(2))
                  if direction == 0: # Outgoing call
                      # Determine call state
                      stat = int(clcc.group(3))
                      if expectedState == 0: # waiting for call initiated
                          if stat == 2 or stat == 3: # Dialing or ringing ("alerting")                            
                              callId = int(clcc.group(1))
                              callType = int(clcc.group(4))
                              self._handleCallInitiated(None, callId, callType) # if self_dialEvent is None, this does nothing
                              expectedState = 1 # Now wait for call answer
                      elif expectedState == 1: # waiting for call to be answered
                          if stat == 0: # Call active
                              callId = int(clcc.group(1))
                              self._handleCallAnswered(None, callId)
                              expectedState = 2 # Now wait for call hangup                            
              elif expectedState == 2 : # waiting for remote hangup
                  # Since there was no +CLCC response, the call is no longer active
                  callDone = True
                  self._handleCallEnded(None, callId=callId)
              elif expectedState == 1: # waiting for call to be answered
                  # Call was rejected
                  callDone = True
                  self._handleCallRejected(None, callId=callId)
          if timeLeft <= 0:
              raise TimeoutException()