diff --git a/README.md b/README.md index ca29f39..d2c385c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Currently implemented Features: * mute the call (`mute-call`) * pause the call (`call-pause`) * resume the call (`call-resume`) +* play dtmf tones (`dtmf`) Features supported by the unix socket (linphone deamon): diff --git a/pylinphone.py b/pylinphone.py index 26a43ee..c463a96 100644 --- a/pylinphone.py +++ b/pylinphone.py @@ -101,6 +101,14 @@ class LinphoneCommunicationSocket(): else: raise RuntimeError(answer["error"]) + def dtmf(self, digit): + self.socket.send("dtmf {digit}".format(digit=digit).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()