Add dtmf tones

This commit is contained in:
sqozz 2020-09-01 17:52:51 +02:00
parent f2a8cefdf9
commit 9e5c0a69ee
2 changed files with 9 additions and 0 deletions

View file

@ -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):

View file

@ -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()