|
|
@ -19,6 +19,9 @@ class AbstractState(object): |
|
|
|
def on_registration_successful(self): |
|
|
|
def on_registration_successful(self): |
|
|
|
raise IllegalEventError() |
|
|
|
raise IllegalEventError() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def on_registration_lost(self): |
|
|
|
|
|
|
|
raise IllegalEventError() |
|
|
|
|
|
|
|
|
|
|
|
def on_gabelschalter_up(self): |
|
|
|
def on_gabelschalter_up(self): |
|
|
|
raise IllegalEventError() |
|
|
|
raise IllegalEventError() |
|
|
|
|
|
|
|
|
|
|
@ -62,6 +65,9 @@ class BaseState(AbstractState): |
|
|
|
def __init__(self, controller): |
|
|
|
def __init__(self, controller): |
|
|
|
self._controller = controller |
|
|
|
self._controller = controller |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def on_registration_lost(self): |
|
|
|
|
|
|
|
return InitState |
|
|
|
|
|
|
|
|
|
|
|
def on_gabelschalter_up(self): |
|
|
|
def on_gabelschalter_up(self): |
|
|
|
return None |
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
@ -310,6 +316,8 @@ def phone_cb(event): |
|
|
|
c.queue_event('registration_in_progress') |
|
|
|
c.queue_event('registration_in_progress') |
|
|
|
elif event == PhoneEvent.RegSuccessfull: |
|
|
|
elif event == PhoneEvent.RegSuccessfull: |
|
|
|
c.queue_event('registration_successful') |
|
|
|
c.queue_event('registration_successful') |
|
|
|
|
|
|
|
elif event == PhoneEvent.RegLost: |
|
|
|
|
|
|
|
c.queue_event('registration_lost') |
|
|
|
elif event == PhoneEvent.CallIncoming: |
|
|
|
elif event == PhoneEvent.CallIncoming: |
|
|
|
c.queue_event('incoming_call') |
|
|
|
c.queue_event('incoming_call') |
|
|
|
elif event == PhoneEvent.CallAccepted: |
|
|
|
elif event == PhoneEvent.CallAccepted: |
|
|
|