code: def callback(newstate):
      
      print('callback: ', newstate)
      if newstate == modem.STATE_RING:
          if state == modem.STATE_IDLE:
              att = {"cid_time": modem.get_cidtime,
                     "cid_number": modem.get_cidnumber,
                     "cid_name": modem.get_cidname}
              print('Ringing', att)
      elif newstate == modem.STATE_CALLERID:
          att = {"cid_time": modem.get_cidtime,
                 "cid_number": modem.get_cidnumber,
                 "cid_name": modem.get_cidname}
          print('CallerID', att)
      elif newstate == modem.STATE_IDLE:
          print('idle')
      return
docs: Callback from modem, process based on new state