From f2a8cefdf95bf651b5c7740dd93833f2480d5379 Mon Sep 17 00:00:00 2001 From: sqozz Date: Tue, 1 Sep 2020 14:23:24 +0200 Subject: [PATCH] Add function to resume call --- README.md | 1 + pylinphone.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 417a2c6..ca29f39 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Currently implemented Features: * terminate a running call (`terminate`) * mute the call (`mute-call`) * pause the call (`call-pause`) +* resume the call (`call-resume`) Features supported by the unix socket (linphone deamon): diff --git a/pylinphone.py b/pylinphone.py index 0926d3a..26a43ee 100644 --- a/pylinphone.py +++ b/pylinphone.py @@ -93,6 +93,14 @@ class LinphoneCommunicationSocket(): else: raise RuntimeError(answer["error"]) + def call_resume(self, call_id): + self.socket.send("call-resume {call_id}".format(call_id=call_id).encode("ascii")) + answer = self._await_answer() + if answer["status"]: + return True + else: + raise RuntimeError(answer["error"]) + def process_event(self): self.socket.send("pop-event".encode("ascii")) answer = self._await_answer() @@ -186,3 +194,14 @@ class LinphoneCommunicationSocket(): print("dummy onLinphoneCallOutgoingRinging") pass + def onLinphoneCallPausing(self, event): + print("dummy onLinphoneCallPausing") + pass + + def onLinphoneCallPaused(self, event): + print("dummy onLinphoneCallPaused") + pass + + def onLinphoneCallResuming(self, event): + print("dummy onLinphoneCallResuming") + pass