def GetCMSCallID(endpointUri):
ssl._create_default_https_context = ssl._create_unverified_context
conn = http.client.HTTPSConnection(Config.cmsFqdn)
headers = {
'authorization': Config.cmsGenericAuthRealm,
'cache-control': "no-cache",
'postman-token': "9620f24c-7e1e-36f2-cede-e016ef0641e4"
}
conn.request("GET", "/api/v1/calllegs", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
tree = etree.fromstring(data)
print(tree)
callID = ""
found = False
for child in tree:
for child2 in child:
print(child2.tag)
print(child2.attrib)
print(child2.text)
if ((child2.tag == "remoteParty") & (child2.text == endpointUri)):
found = True
if ((child2.tag == "call") & (found == True)):
return child2.text
CMSRecordingControl.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录