'Listen to incoming or outgoing calls.'

def _listen(self):

    while (not self.stopped.isSet()):
        try:
            response = self.sock.recv(2048)
        except socket.timeout:
            continue
        response = str(response, 'utf-8')
        if (not response):
            self.sock = None
            while (self.sock is None):
                self.connect()
                time.sleep(INTERVAL_RECONNECT)
        else:
            line = response.split('\n', 1)[0]
            self._parse(line)
            time.sleep(1)
    return
