Add version function
This commit is contained in:
parent
81f2b1695f
commit
dc9d61acfb
|
@ -14,6 +14,7 @@ Currently implemented Features:
|
||||||
* get call status (`call-status`)
|
* get call status (`call-status`)
|
||||||
* get call stats (`call-stats`)
|
* get call stats (`call-stats`)
|
||||||
* unregister an account (`unregister`)
|
* unregister an account (`unregister`)
|
||||||
|
* get daemon version (`version`)
|
||||||
|
|
||||||
|
|
||||||
Features supported by the unix socket (linphone deamon):
|
Features supported by the unix socket (linphone deamon):
|
||||||
|
|
|
@ -24,6 +24,14 @@ class LinphoneCommunicationSocket():
|
||||||
self.socket.send(command.encode("ascii"))
|
self.socket.send(command.encode("ascii"))
|
||||||
return self._await_answer()
|
return self._await_answer()
|
||||||
|
|
||||||
|
def version(self):
|
||||||
|
answer = self.send_command("version")
|
||||||
|
|
||||||
|
if answer["status"]:
|
||||||
|
return answer["data"][0].split(":", 1)[1].strip()
|
||||||
|
else:
|
||||||
|
raise RuntimeError(answer["error"])
|
||||||
|
|
||||||
def register(self, identity, proxy_address, password = "NULL", userid = "NULL", realm = "NULL", parameters = None):
|
def register(self, identity, proxy_address, password = "NULL", userid = "NULL", realm = "NULL", parameters = None):
|
||||||
answer = self.send_command(("register {identity} {proxy_address} {password} {userid} {realm} {parameters}".format(identity=identity, proxy_address=proxy_address, password=password, userid=userid, realm=realm, parameters="" if parameters else parameters)))
|
answer = self.send_command(("register {identity} {proxy_address} {password} {userid} {realm} {parameters}".format(identity=identity, proxy_address=proxy_address, password=password, userid=userid, realm=realm, parameters="" if parameters else parameters)))
|
||||||
return int(answer["data"][0].split(":", 1)[1].strip()) #id of newly registered account
|
return int(answer["data"][0].split(":", 1)[1].strip()) #id of newly registered account
|
||||||
|
|
Loading…
Reference in a new issue