Conditional clauses: Only start script on incoming calls.

This commit is contained in:
Homer S. 2021-07-16 21:41:49 +02:00
parent 3a32e64719
commit 114e9c3e49
1 changed files with 9 additions and 2 deletions

View File

@ -15,10 +15,17 @@ def watch_disconnect(monitor, event_queue, func, tams, healthcheck_interval=10):
else:
# do event processing here:
print(event)
if 'DISCONNECT' in event:
print("Anruf beendet. Jetzt den AB checken.\n")
if 'DISCONNECT;0' in event:
print("Incoming call stopped. Check the TAM.\n")
func(tams)
elif 'DISCONNECT;1' in event:
print("Outgoing call stopped. Do nothing.\n")
else:
print("Unknown event.\n")
def endedCall(func, tams, fritz_ip='192.168.1.1'):