From 45983e4578d0fa42a30837506dee74daf090ee0b Mon Sep 17 00:00:00 2001 From: sqozz Date: Tue, 1 Sep 2020 14:09:40 +0200 Subject: [PATCH] Add function to pause call --- README.md | 1 + pylinphone.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e51d392..417a2c6 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Currently implemented Features: * answer an incoming call (`accept`) * terminate a running call (`terminate`) * mute the call (`mute-call`) +* pause the call (`call-pause`) Features supported by the unix socket (linphone deamon): diff --git a/pylinphone.py b/pylinphone.py index 5c52132..0926d3a 100644 --- a/pylinphone.py +++ b/pylinphone.py @@ -80,7 +80,14 @@ class LinphoneCommunicationSocket(): def call_mute(self, mute=True): self.socket.send("call-mute {mute}".format(mute="1" if mute else "0").encode("ascii")) answer = self._await_answer() - pdb.set_trace() + if answer["status"]: + return True + else: + raise RuntimeError(answer["error"]) + + def call_pause(self, call_id): + self.socket.send("call-pause {call_id}".format(call_id=call_id).encode("ascii")) + answer = self._await_answer() if answer["status"]: return True else: