Browse Source

Add dtmf tones

master
sqozz 4 years ago
parent
commit
9e5c0a69ee
  1. 1
      README.md
  2. 8
      pylinphone.py

1
README.md

@ -10,6 +10,7 @@ Currently implemented Features: @@ -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):

8
pylinphone.py

@ -101,6 +101,14 @@ class LinphoneCommunicationSocket(): @@ -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()

Loading…
Cancel
Save