|
|
|
@ -93,6 +93,22 @@ class LinphoneCommunicationSocket():
@@ -93,6 +93,22 @@ class LinphoneCommunicationSocket():
|
|
|
|
|
else: |
|
|
|
|
raise RuntimeError(answer["error"]) |
|
|
|
|
|
|
|
|
|
def call_status(self, call_id): |
|
|
|
|
self.socket.send("call-status {call_id}".format(call_id=call_id).encode("ascii")) |
|
|
|
|
answer = self._await_answer() |
|
|
|
|
|
|
|
|
|
if answer["status"]: |
|
|
|
|
data = answer["data"] |
|
|
|
|
status = { |
|
|
|
|
"state": data[0].split(":", 1)[1].strip(), |
|
|
|
|
"from": data[1].split(":", 1)[1].strip(), |
|
|
|
|
"direction": data[2].split(":", 1)[1].strip(), |
|
|
|
|
"duration": int(data[3].split(":", 1)[1].strip()) |
|
|
|
|
} |
|
|
|
|
return status |
|
|
|
|
else: |
|
|
|
|
raise RuntimeError(answer["error"]) |
|
|
|
|
|
|
|
|
|
def call_resume(self, call_id): |
|
|
|
|
self.socket.send("call-resume {call_id}".format(call_id=call_id).encode("ascii")) |
|
|
|
|
answer = self._await_answer() |
|
|
|
|