cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
2867
Views
0
Helpful
8
Replies
George Paxson
Beginner

How do I determine which users are logged into the Jabber CTI phone control feature?

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.

1 ACCEPTED SOLUTION

Accepted Solutions

#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()

View solution in original post

8 REPLIES 8
Anthony Holloway
Cisco Employee

Maybe in RTMT you can go to Voice/Video > CTI > CTI Search > Line and set the filter to Line Status = Opened, Device Name Begins with SEP*, and maybe change the IP Subnet to match your data network (which matches the IP of the workstation running Jabber).

Alternatively, you could use the CLI or the Serviceability API to process the information with a little more flexibility:

show risdb query ctimline

https://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/devguide/9_1_1/xmldev-911/serviceability.html#54926

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

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!

Oooh, Python huh? I'd be interested in seeing what you come up with.

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

 

 

 

We are a WebEx messenger shop here.  I do not have on prem Jabber Messenger.

George Paxson
Beginner

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

#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()

View solution in original post

Content for Community-Ad

Spotlight Awards 2021