|
|
|
@ -56,6 +56,18 @@ class LinphoneCommunicationSocket():
@@ -56,6 +56,18 @@ class LinphoneCommunicationSocket():
|
|
|
|
|
def answer(self, call_id=None): |
|
|
|
|
self.socket.send(("answer {call_id}".format(call_id="" if call_id == None else call_id)).encode("ascii")) |
|
|
|
|
answer = self._await_answer() |
|
|
|
|
if answer["status"]: |
|
|
|
|
return True |
|
|
|
|
else: |
|
|
|
|
raise RuntimeError(answer["error"]) |
|
|
|
|
|
|
|
|
|
def terminate(self, call_id=None): |
|
|
|
|
self.socket.send(("terminate {call_id}".format(call_id="" if call_id == None else 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")) |
|
|
|
|