02-09-2018 07:54 AM - edited 03-15-2019 05:40 AM
Is there a log, api, or SQL query that would indicate which Jabber users have CTI phone control logged in and working? I am working change control to enable SSO and need to know who would require a Jabber client reset.
Solved! Go to Solution.
02-17-2018 07:24 PM
#Python script to accumulate set of open CTI devices pulled from RISService70 when script is run several times a week. Script assumes there are Open CTI connections in PHONELIST
from requests import Session
from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc.
from zeep import Client
from zeep.transports import Transport
PHONELIST = 'SEPBADCEEF00D10,SEPBADCEEF00D11,SEPBADCEEF00D12,SEPBADCEEF00D13'
user_list = []
for item in open('userlist.txt', 'r'):
item.rstrip()
user_list.append(item.rstrip())
session = Session()
session.auth = HTTPBasicAuth('admin', 'password')
session.verify = False
client = Client('https://yourserver.yourdomain.com:8443/realtimeservice2/services/RISService70?wsdl',
transport=Transport(session=session))
client.set_ns_prefix('soap', 'http://schemas.cisco.com/ast/soap')
my_service = client.service.selectCtiItem('', {
'MaxReturnedItems':'1000',
'CtiMgrClass':'Line',
'Status':'Open',
'NodeName':'',
'SelectAppBy':'UserId',
'AppItems':{},
'DevNames':{
'item':{'DevName':PHONELIST},},
'DirNumbers':{},
})
my_list = []
cucm1 = my_service['SelectCtiItemResult']['CtiNodes']['item'][0]
cucm2 = my_service['SelectCtiItemResult']['CtiNodes']['item'][1]
cucm3 = my_service['SelectCtiItemResult']['CtiNodes']['item'][2]
for j in cucm1['CtiItems']['item']:
my_list.append(j['UserId'])
for j in cucm2['CtiItems']['item']:
my_list.append(j['UserId'])
for j in cucm3['CtiItems']['item']:
my_list.append(j['UserId'])
my_set = set(my_list + user_list)
outfile = open('userlist.txt', 'w')
for item in my_set:
item += '\n'
outfile.write(item)
outfile.close()
02-12-2018 09:58 AM
02-12-2018 10:37 AM
Anthony:
I think you may have the correct answer. I did not think to check all servers in the cluster for the entire picture. I think the command line is probably the way to go. I'll confirm.
Thanks
02-12-2018 11:03 AM
Anthony:
I looked at RTMT as you suggested and see the correct table.
I found the XML in the Serviceability XML API in the provided link.
I think the correct approach is to plug this into Python.
I'll update.
Thanks!
02-12-2018 12:13 PM
02-12-2018 06:50 PM
Hi,
you can login into IMP and navigate to IM and Presence Reporting from top right.
Click on Presence Usage and Generate Reports.You will get "Presence Usage Counts"
regds,
aman
02-13-2018 01:11 PM
We are a WebEx messenger shop here. I do not have on prem Jabber Messenger.
02-15-2018 10:13 AM
I pulled phone device names and associated users from bulk export. I put the phones and users in a python array. I queried RISService70 with request.session and request.requests and correct XML string marking any results in 'Open' status. I'll check for a week and compare results. Getting correct XML string was the tough part.
DATA = """<!--RisPort70 API - SelectCtiItem - Request-->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:selectCtiItem>
<soap:StateInfo></soap:StateInfo>
<soap:CtiSelectionCriteria>
<soap:MaxReturnedItems>1000</soap:MaxReturnedItems>
<soap:CtiMgrClass>Line</soap:CtiMgrClass>
<soap:Status>Any</soap:Status>
<soap:NodeName></soap:NodeName>
<soap:SelectAppBy>UserId</soap:SelectAppBy>
<soap:AppItems>
<!--Zero or more repetitions:-->
</soap:AppItems>
<soap:DevNames>
<!--Zero or more repetitions:-->
<soap:item>
<soap:DevName>%s</soap:DevName>
</soap:item>
</soap:DevNames>
<soap:DirNumbers>
<!--Zero or more repetitions:-->
</soap:DirNumbers>
</soap:CtiSelectionCriteria>
</soap:selectCtiItem>
</soapenv:Body>
</soapenv:Envelope>""" % (item)
Thanks
02-17-2018 07:24 PM
#Python script to accumulate set of open CTI devices pulled from RISService70 when script is run several times a week. Script assumes there are Open CTI connections in PHONELIST
from requests import Session
from requests.auth import HTTPBasicAuth # or HTTPDigestAuth, or OAuth1, etc.
from zeep import Client
from zeep.transports import Transport
PHONELIST = 'SEPBADCEEF00D10,SEPBADCEEF00D11,SEPBADCEEF00D12,SEPBADCEEF00D13'
user_list = []
for item in open('userlist.txt', 'r'):
item.rstrip()
user_list.append(item.rstrip())
session = Session()
session.auth = HTTPBasicAuth('admin', 'password')
session.verify = False
client = Client('https://yourserver.yourdomain.com:8443/realtimeservice2/services/RISService70?wsdl',
transport=Transport(session=session))
client.set_ns_prefix('soap', 'http://schemas.cisco.com/ast/soap')
my_service = client.service.selectCtiItem('', {
'MaxReturnedItems':'1000',
'CtiMgrClass':'Line',
'Status':'Open',
'NodeName':'',
'SelectAppBy':'UserId',
'AppItems':{},
'DevNames':{
'item':{'DevName':PHONELIST},},
'DirNumbers':{},
})
my_list = []
cucm1 = my_service['SelectCtiItemResult']['CtiNodes']['item'][0]
cucm2 = my_service['SelectCtiItemResult']['CtiNodes']['item'][1]
cucm3 = my_service['SelectCtiItemResult']['CtiNodes']['item'][2]
for j in cucm1['CtiItems']['item']:
my_list.append(j['UserId'])
for j in cucm2['CtiItems']['item']:
my_list.append(j['UserId'])
for j in cucm3['CtiItems']['item']:
my_list.append(j['UserId'])
my_set = set(my_list + user_list)
outfile = open('userlist.txt', 'w')
for item in my_set:
item += '\n'
outfile.write(item)
outfile.close()
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide