From 9d234c025f14bfd38d99d5bc720210486d6c3e3a Mon Sep 17 00:00:00 2001 From: Frederic Date: Tue, 19 May 2015 22:41:02 +0200 Subject: [PATCH] Change to BusyBeepingState when a call_ended event occurs while connecting, trigger a call_ended event when busy --- fetapdtest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fetapdtest.py b/fetapdtest.py index ab5f9d6..ccb012d 100644 --- a/fetapdtest.py +++ b/fetapdtest.py @@ -168,6 +168,9 @@ class ConnectingState(AbstractState): # TODO: play sound return BusyBeepingState + def on_call_ended(self): + return BusyBeepingState + class DialingState(AbstractState): def __init__(self, controller): super(DialingState, self).__init__(controller) @@ -291,6 +294,8 @@ def phone_cb(event): c.queue_event('call_ended') elif event == PhoneEvent.CallRinging: c.queue_event('call_ringing') + elif event == PhoneEvent.CallBusy: + c.queue_event('call_ended') elif event == PhoneEvent.CallInvalidNumber: c.queue_event('invalid_number')