def callback(newstate):
print('<STR_LIT>', newstate)<EOL>if newstate == modem.STATE_RING:<EOL><INDENT>if state == modem.STATE_IDLE:<EOL><INDENT>att = {"<STR_LIT>": modem.get_cidtime,<EOL>"<STR_LIT>": modem.get_cidnumber,<EOL>"<STR_LIT>": modem.get_cidname}<EOL>print('<STR_LIT>', att)<EOL><DEDENT><DEDENT>elif newstate == modem.STATE_CALLERID:<EOL><INDENT>att = {"<STR_LIT>": modem.get_cidtime,<EOL>"<STR_LIT>": modem.get_cidnumber,<EOL>"<STR_LIT>": modem.get_cidname}<EOL>print('<STR_LIT>', att)<EOL><DEDENT>elif newstate == modem.STATE_IDLE:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>return<EOL>
Callback from modem, process based on new state