|
|
|
@ -7,9 +7,10 @@ import configreader
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DialConfiguration(object):
|
|
|
|
|
def __init__(self, dial_timeout, shortcuts):
|
|
|
|
|
def __init__(self, dial_timeout, shortcuts, blacklist):
|
|
|
|
|
self.dial_timeout = dial_timeout
|
|
|
|
|
self.shortcuts = shortcuts
|
|
|
|
|
self.blacklist = blacklist
|
|
|
|
|
|
|
|
|
|
class IllegalEventError(Exception):
|
|
|
|
|
pass
|
|
|
|
@ -117,7 +118,14 @@ class RegisteringState(BaseState):
|
|
|
|
|
class IdleState(BaseState):
|
|
|
|
|
def on_incoming_call(self):
|
|
|
|
|
print('incomfing call')
|
|
|
|
|
return SchelltState
|
|
|
|
|
caller = self._controller.phone.get_remote_number()
|
|
|
|
|
print('From: %s' % caller)
|
|
|
|
|
if caller in self._controller.dialconfig.blacklist:
|
|
|
|
|
print('Caller on blacklist - declining')
|
|
|
|
|
self._controller.phone.decline_call()
|
|
|
|
|
return CallTerminatingState
|
|
|
|
|
else:
|
|
|
|
|
return SchelltState
|
|
|
|
|
|
|
|
|
|
def on_gabelschalter_up(self):
|
|
|
|
|
print('gabel up')
|
|
|
|
|