<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers in Management</title>
    <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4031068#M3312</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Rajesh,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i am writing a python script with version 12.5 recently and encountering the same issue as you, here is how i resolved it :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Use any browser to access '&lt;A href="https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl" target="_blank" rel="noopener"&gt;https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the x.x.x.x is your CUCM IP address, and save the output to your python server as text file, lets say: RISService70-125.wsdl, and delete the first line "This XML file...."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in the bottom of the file, you will find&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;wsdlsoap:address location="https://&lt;FONT color="#FF0000"&gt;localhost&lt;/FONT&gt;:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;/PRE&gt;&lt;P&gt;change it to :&lt;/P&gt;&lt;PRE&gt;&amp;lt;wsdlsoap:address location="https://&lt;FONT color="#FF0000"&gt;x.x.x.x&lt;/FONT&gt;:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;the x.x.x.x is your CUCM IP address&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Change the wsdl path in your previous script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;wsdl = 'https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;wsdl = 'file:///&lt;FONT color="#FF0000"&gt;PATH&lt;/FONT&gt;/RISService70-125.wsdl'&amp;nbsp; &lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the &lt;FONT color="#FF0000"&gt;PATH&lt;/FONT&gt; is where the file locates in your python server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know if it works for your case, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Eddie Lu&lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2020 03:00:17 GMT</pubDate>
    <dc:creator>eddie.lue</dc:creator>
    <dc:date>2020-05-29T03:00:17Z</dc:date>
    <item>
      <title>Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877283#M3076</link>
      <description>&lt;P&gt;Here is my Python script for display registered IP Phones details from Cisco CallManager 11.5. I am facing one issue in displaying output in customized format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from zeep import Client&lt;BR /&gt;from zeep.cache import SqliteCache&lt;BR /&gt;from zeep.transports import Transport&lt;BR /&gt;from zeep.plugins import HistoryPlugin&lt;BR /&gt;from requests import Session&lt;BR /&gt;from requests.auth import HTTPBasicAuth&lt;BR /&gt;from lxml import etree&lt;BR /&gt;import urllib3&lt;BR /&gt;from urllib3 import disable_warnings&lt;BR /&gt;from urllib3.exceptions import InsecureRequestWarning&lt;BR /&gt;username = 'xxxx'&lt;BR /&gt;password = 'xxxx'&lt;BR /&gt;wsdl = '&lt;A href="https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl" target="_blank" rel="noopener"&gt;https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl&lt;/A&gt;'&lt;BR /&gt;session = Session()&lt;BR /&gt;session.verify = False&lt;BR /&gt;session.auth = HTTPBasicAuth(username, password)&lt;BR /&gt;transport = Transport(cache=SqliteCache(), session=session, timeout=20)&lt;BR /&gt;history = HistoryPlugin()&lt;BR /&gt;client = Client(wsdl=wsdl, transport=transport, plugins=[history])&lt;BR /&gt;factory = client.type_factory('ns0')&lt;BR /&gt;macs = ['*'] #'*' for all&lt;BR /&gt;item=[]&lt;BR /&gt;for mac in macs:&lt;BR /&gt;item.append(factory.SelectItem(Item=mac))&lt;BR /&gt;Item = factory.ArrayOfSelectItem(item)&lt;BR /&gt;stateInfo = ''&lt;BR /&gt;criteria = factory.CmSelectionCriteria(&lt;BR /&gt;MaxReturnedDevices = 1000,&lt;BR /&gt;DeviceClass='Phone',&lt;BR /&gt;Model=255, #255 for all&lt;BR /&gt;Status='Registered',&lt;BR /&gt;NodeName='',&lt;BR /&gt;SelectBy='Name',&lt;BR /&gt;SelectItems=Item,&lt;BR /&gt;Protocol='Any',&lt;BR /&gt;DownloadStatus='Any'&lt;BR /&gt;)&lt;BR /&gt;result = client.service.selectCmDevice(stateInfo, criteria)&lt;BR /&gt;for node in (result['SelectCmDeviceResult']['CmNodes']):&lt;BR /&gt;for device in node['CmDevices']:&lt;BR /&gt;print (device['Name'], device['IpAddress'], device['DirNumber'], device['Description'])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I just print (result) I am getting output as below output, I want to display output in proper way, onlt name, IP address, directory number and description&lt;BR /&gt;But while adding "for device in node" I am getting error on this line as below;&lt;BR /&gt;for device in node['CmDevices']:&lt;BR /&gt;error is:&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "phone2.py", line 40, in &amp;lt;module&amp;gt;&lt;BR /&gt;for device in node['CmDevices']:&lt;BR /&gt;TypeError: string indices must be integers&lt;/P&gt;&lt;P&gt;Pls. advice why TypeError: string indices must be integers&lt;/P&gt;&lt;P&gt;Script Output from Cisco CallManager, while running the script with only print (result)&lt;BR /&gt;{&lt;BR /&gt;'SelectCmDeviceResult': {&lt;BR /&gt;'TotalDevicesFound': 43,&lt;BR /&gt;'CmNodes': {&lt;BR /&gt;'item': [&lt;BR /&gt;{&lt;BR /&gt;'ReturnCode': 'NotFound',&lt;BR /&gt;'Name': '10.10.161.10',&lt;BR /&gt;'NoChange': False,&lt;BR /&gt;'CmDevices': {&lt;BR /&gt;'item': []&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;'ReturnCode': 'Ok',&lt;BR /&gt;'Name': '10.10.161.11',&lt;BR /&gt;'NoChange': False,&lt;BR /&gt;'CmDevices': {&lt;BR /&gt;'item': [&lt;BR /&gt;{&lt;BR /&gt;'Name': 'SEP009AD2D3E9C0',&lt;BR /&gt;'DirNumber': '7010-Registered',&lt;BR /&gt;'DeviceClass': 'Phone',&lt;BR /&gt;'Model': 688,&lt;BR /&gt;'Product': 573,&lt;BR /&gt;'BoxProduct': 0,&lt;BR /&gt;'Httpd': 'Yes',&lt;BR /&gt;'RegistrationAttempts': 1,&lt;BR /&gt;'IsCtiControllable': True,&lt;BR /&gt;'LoginUserId': None,&lt;BR /&gt;'Status': 'Registered',&lt;BR /&gt;'StatusReason': 0,&lt;BR /&gt;'PerfMonObject': 2,&lt;BR /&gt;'DChannel': 0,&lt;BR /&gt;'Description': 'SEP009AD2D3E9C0',&lt;BR /&gt;'H323Trunk': {&lt;BR /&gt;'ConfigName': None,&lt;BR /&gt;'TechPrefix': None,&lt;BR /&gt;'Zone': None,&lt;BR /&gt;'RemoteCmServer1': None,&lt;BR /&gt;'RemoteCmServer2': None,&lt;BR /&gt;'RemoteCmServer3': None,&lt;BR /&gt;'AltGkList': None,&lt;BR /&gt;'ActiveGk': None,&lt;BR /&gt;'CallSignalAddr': None,&lt;BR /&gt;'RasAddr': None&lt;BR /&gt;},&lt;BR /&gt;'TimeStamp': 1561098640,&lt;BR /&gt;'Protocol': 'SIP',&lt;BR /&gt;'NumOfLines': 1,&lt;BR /&gt;'LinesStatus': {&lt;BR /&gt;'item': [&lt;BR /&gt;{&lt;BR /&gt;'DirectoryNumber': '7010',&lt;BR /&gt;'Status': 'Registered'&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;'ActiveLoadID': 'ce-9.3.0-d31e4c18-2017-11-21',&lt;BR /&gt;'InactiveLoadID': None,&lt;BR /&gt;'DownloadStatus': 'Unknown',&lt;BR /&gt;'DownloadFailureReason': None,&lt;BR /&gt;'DownloadServer': None,&lt;BR /&gt;'IPAddress': {&lt;BR /&gt;'item': [&lt;BR /&gt;{&lt;BR /&gt;'IP': '10.10.161.187',&lt;BR /&gt;'IPAddrType': 'ipv4',&lt;BR /&gt;'Attribute': 'Unknown'&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;'Name': 'SEP00A3D15CBB31',&lt;BR /&gt;'DirNumber': '7020-Registered',&lt;BR /&gt;'DeviceClass': 'Phone',&lt;BR /&gt;'Model': 690,&lt;BR /&gt;'Product': 575,&lt;BR /&gt;'BoxProduct': 0,&lt;BR /&gt;'Httpd': 'Yes',&lt;BR /&gt;'RegistrationAttempts': 1,&lt;BR /&gt;'IsCtiControllable': True,&lt;BR /&gt;'LoginUserId': None,&lt;BR /&gt;'Status': 'Registered',&lt;BR /&gt;'StatusReason': 0,&lt;BR /&gt;'PerfMonObject': 2,&lt;BR /&gt;'DChannel': 0,&lt;BR /&gt;'Description': 'Africa MR',&lt;BR /&gt;'H323Trunk': {&lt;BR /&gt;'ConfigName': None,&lt;BR /&gt;'TechPrefix': None,&lt;BR /&gt;'Zone': None,&lt;BR /&gt;'RemoteCmServer1': None,&lt;BR /&gt;'RemoteCmServer2': None,&lt;BR /&gt;'RemoteCmServer3': None,&lt;BR /&gt;'AltGkList': None,&lt;BR /&gt;'ActiveGk': None,&lt;BR /&gt;'CallSignalAddr': None,&lt;BR /&gt;'RasAddr': None&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "phone2.py", line 40, in &amp;lt;module&amp;gt;&lt;BR /&gt;for device in node['CmDevices']:&lt;BR /&gt;TypeError: string indices must be integers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:14:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877283#M3076</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-21T08:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877903#M3084</link>
      <description>&lt;P&gt;What is the exact data structure your script is storing in&amp;nbsp;&lt;STRONG&gt;node&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;Try with this and share the output:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;import pprint&lt;/STRONG&gt;&lt;BR /&gt;. . .&lt;BR /&gt;&lt;SPAN&gt;result = client.service.selectCmDevice(stateInfo, criteria)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for node in (result['SelectCmDeviceResult']['CmNodes']):&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;    pprint.pprint(node)&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;This should return the output in a readable format.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 16:18:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877903#M3084</guid>
      <dc:creator>Hector Gustavo Serrano Gutierrez</dc:creator>
      <dc:date>2019-06-22T16:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877915#M3085</link>
      <description>&lt;P&gt;Dear Hector&lt;/P&gt;&lt;P&gt;I have rectified it by modifying the script print part as below. Now script is working fine.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;result = client.service.selectCmDevice(stateInfo, criteria)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;for node in (result['SelectCmDeviceResult']['CmNodes']['item']):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;for device in node['CmDevices']['item']:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ipaddresses = device['IPAddress']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ipaddress = ipaddresses['item'][0]['IP'] if ipaddresses else ''&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;print (device['Name'], ipaddress, device['DirNumber'], device['Model'], device['Protocol'], device['Description'])&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this entire script works fine with Cisco CallManager version 11.5. But when I run this script on &lt;FONT color="#FF0000"&gt;CallManager ver 12.5. I get error.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ python phone2-m.py&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connection.py", line 159, in _new_conn&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;(self._dns_host, self.port), self.timeout, **extra_kw)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\util\connection.py", line 80, in create_connection&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;raise err&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\util\connection.py", line 70, in create_connection&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;sock.connect(sa)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen&lt;BR /&gt;chunked=chunked)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request&lt;BR /&gt;self._validate_conn(conn)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn&lt;BR /&gt;conn.connect()&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connection.py", line 301, in connect&lt;BR /&gt;conn = self._new_conn()&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connection.py", line 168, in _new_conn&lt;BR /&gt;self, "Failed to establish a new connection: %s" % e)&lt;BR /&gt;urllib3.exceptions.NewConnectionError: &amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x03A34ED0&amp;gt;: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\requests\adapters.py", line 449, in send&lt;BR /&gt;timeout=timeout&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen&lt;BR /&gt;_stacktrace=sys.exc_info()[2])&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\urllib3\util\retry.py", line 399, in increment&lt;BR /&gt;raise MaxRetryError(_pool, url, error or ResponseError(cause))&lt;BR /&gt;urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /realtimeservice2/services/RISService70 (Caused by NewConnectionError('&amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x03A34ED0&amp;gt;: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "phone2-moh.py", line 38, in &amp;lt;module&amp;gt;&lt;BR /&gt;result = client.service.selectCmDevice(stateInfo, criteria)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\zeep\proxy.py", line 45, in __call__&lt;BR /&gt;kwargs,&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\zeep\wsdl\bindings\soap.py", line 122, in send&lt;BR /&gt;response = client.transport.post_xml(options["address"], envelope, http_headers)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\zeep\transports.py", line 95, in post_xml&lt;BR /&gt;return self.post(address, message, headers)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\zeep\transports.py", line 62, in post&lt;BR /&gt;address, data=message, headers=headers, timeout=self.operation_timeout&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\requests\sessions.py", line 572, in post&lt;BR /&gt;return self.request('POST', url, data=data, json=json, **kwargs)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\requests\sessions.py", line 524, in request&lt;BR /&gt;resp = self.send(prep, **send_kwargs)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\requests\sessions.py", line 637, in send&lt;BR /&gt;r = adapter.send(request, **kwargs)&lt;BR /&gt;File "D:\code\dnav3-code\venv\lib\site-packages\requests\adapters.py", line 516, in send&lt;BR /&gt;raise ConnectionError(e, request=request)&lt;BR /&gt;requests.exceptions.ConnectionError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: /realtimeservice2/services/RISService70 (Caused by NewConnectionError('&amp;lt;urllib3.connection.VerifiedHTTPSConnection object at 0x03A34ED0&amp;gt;: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))&lt;BR /&gt;(venv)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 16:50:51 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877915#M3085</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-22T16:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877919#M3087</link>
      <description>&lt;P&gt;First problem was related to the way you were parsing the data in the "node" variable.&lt;/P&gt;
&lt;P&gt;But now for your second problem, it looks your script cannot even connect to your instance of&amp;nbsp;CallManager running 12.5 on TCP port 8443.&lt;/P&gt;
&lt;P&gt;- Is there a firewall or similar blocking this connectivity from your PC to your&amp;nbsp;CallManager running 12.5?&lt;/P&gt;
&lt;P&gt;- Is your&amp;nbsp;CallManager running 12.5 really listening on TCP 8443?&lt;/P&gt;
&lt;P&gt;- Is your CallManager running 12.5 configured to refuse incoming connections from certain IPs?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 17:15:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3877919#M3087</guid>
      <dc:creator>Hector Gustavo Serrano Gutierrez</dc:creator>
      <dc:date>2019-06-22T17:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878045#M3088</link>
      <description>Thanks, I will cross verify. it could be firewall issue.&lt;BR /&gt;Is there any limitation of only 1000 IP Phones can be retrieved ? Currently I don't have setup with more than 1000 IP Phones.</description>
      <pubDate>Sun, 23 Jun 2019 09:18:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878045#M3088</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-23T09:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878047#M3089</link>
      <description>Seems like something else is wrong. I can access this link through browser. Script is giving error. But same script works perfectly with CUCM version 11.5&lt;BR /&gt;&lt;A href="https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl" target="_blank"&gt;https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl&lt;/A&gt;</description>
      <pubDate>Sun, 23 Jun 2019 09:26:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878047#M3089</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-23T09:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878049#M3091</link>
      <description>Hi&lt;BR /&gt;for CUCM version 12.5&lt;BR /&gt;inside https://&amp;lt;cucmIP&amp;gt;:8443/realtimeservice2/services/RISService70?wsdl&lt;BR /&gt;I have below entry.&lt;BR /&gt;&amp;lt;wsdlsoap:address location="https://localhost:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;but for CUCM 11.5&lt;BR /&gt;localhost is replaced with specific IP address. Is that could be causing the issue ?</description>
      <pubDate>Sun, 23 Jun 2019 10:14:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878049#M3091</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-23T10:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878119#M3092</link>
      <description>&lt;P&gt;If it is shown in your WebBrowser on the same PC you are running the script from then may be something with the script itself... are the username and password correct?&lt;/P&gt;
&lt;PRE&gt;username = 'xxxx'
password = 'xxxx'
session.auth = HTTPBasicAuth(username, password)
&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jun 2019 16:29:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878119#M3092</guid>
      <dc:creator>Hector Gustavo Serrano Gutierrez</dc:creator>
      <dc:date>2019-06-23T16:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878157#M3093</link>
      <description>Hi credentials are correct. Cross verified.&lt;BR /&gt;&lt;BR /&gt;Here is my observation. Is this could be causing the issue ?&lt;BR /&gt;for CUCM version 12.5&lt;BR /&gt;inside https://&amp;lt;cucmIP&amp;gt;:8443/realtimeservice2/services/RISService70?wsdl&lt;BR /&gt;I have below entry.&lt;BR /&gt;&amp;lt;wsdlsoap:address location="https://localhost:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;but for CUCM 11.5&lt;BR /&gt;localhost is replaced with specific IP address. Is that could be causing the issue ?</description>
      <pubDate>Sun, 23 Jun 2019 19:02:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3878157#M3093</guid>
      <dc:creator>rajesh.kumar</dc:creator>
      <dc:date>2019-06-23T19:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3880092#M3099</link>
      <description>&lt;P&gt;When you create the service object, Zeep allows you to modify the target location:&lt;/P&gt;
&lt;PRE&gt;client = Client( WSDL_FILE, settings = settings, transport = transport, plugins = plugin )

service = client.create_service( '{http://schemas.cisco.com/ast/soap}RisBinding',
    'https://{cucm}:8443/realtimeservice2/services/RISService70'.format( cucm = creds.CUCM_ADDRESS ))&lt;/PRE&gt;
&lt;P&gt;This construction will also allow you to query multiple CUCM nodes without downloading the WSDL from each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this sample project which I've updated using the above - seems to work for 11.5/12.5: &lt;A href="https://github.com/CiscoDevNet/serviceability-python-zeep-samples/" target="_blank"&gt;https://github.com/CiscoDevNet/serviceability-python-zeep-samples/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 15:32:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/3880092#M3099</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2019-06-26T15:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4031068#M3312</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Rajesh,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i am writing a python script with version 12.5 recently and encountering the same issue as you, here is how i resolved it :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Use any browser to access '&lt;A href="https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl" target="_blank" rel="noopener"&gt;https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl&lt;/A&gt;'&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the x.x.x.x is your CUCM IP address, and save the output to your python server as text file, lets say: RISService70-125.wsdl, and delete the first line "This XML file...."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in the bottom of the file, you will find&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;wsdlsoap:address location="https://&lt;FONT color="#FF0000"&gt;localhost&lt;/FONT&gt;:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;/PRE&gt;&lt;P&gt;change it to :&lt;/P&gt;&lt;PRE&gt;&amp;lt;wsdlsoap:address location="https://&lt;FONT color="#FF0000"&gt;x.x.x.x&lt;/FONT&gt;:8443/realtimeservice2/services/RISService70"/&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;the x.x.x.x is your CUCM IP address&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Change the wsdl path in your previous script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;wsdl = 'https://x.x.x.x:8443/realtimeservice2/services/RISService70?wsdl'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;wsdl = 'file:///&lt;FONT color="#FF0000"&gt;PATH&lt;/FONT&gt;/RISService70-125.wsdl'&amp;nbsp; &lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the &lt;FONT color="#FF0000"&gt;PATH&lt;/FONT&gt; is where the file locates in your python server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know if it works for your case, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Eddie Lu&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 03:00:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4031068#M3312</guid>
      <dc:creator>eddie.lue</dc:creator>
      <dc:date>2020-05-29T03:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4266163#M3561</link>
      <description>&lt;P&gt;TypeError: means that you are trying to perform an operation on a value whose type is not compatible with that operation. If you are accessing items from a dictionary , make sure that you are accessing the dictionary itself and not a key in the dictionary. TypeError: &lt;A href="http://net-informations.com/python/err/indices.htm" target="_self"&gt;string indices must be integers&lt;/A&gt; has been caused because you are trying to access values from dictionary using string indices instead of integer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 06:33:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4266163#M3561</guid>
      <dc:creator>jefryarch</dc:creator>
      <dc:date>2021-01-04T06:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - TypeError: string indices must be integers</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4440708#M3708</link>
      <description>&lt;P&gt;This fixed my issue with 12.5!!!&lt;/P&gt;&lt;P&gt;Same script was working with 11.5 ...... great fix jsut wish I found it sooner! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 23:44:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4440708#M3708</guid>
      <dc:creator>rchaseling</dc:creator>
      <dc:date>2021-07-28T23:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python script for display registered phones from CUCM ver 11.5 - T</title>
      <link>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4916365#M4102</link>
      <description>&lt;P&gt;Thanks, eddie.lue, and all of you guys.&lt;/P&gt;
&lt;P&gt;I want to share this version that exports the&amp;nbsp;Name, Description, Directory Number, Protocol, Status, IP, Model, Firmware, UnifiedCM in a CSV file.&lt;/P&gt;
&lt;P&gt;Note: You need to still do the eddie.lue steps mentioned above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE style="background-color: #272822; color: #f8f8f2; font-family: 'JetBrains Mono',monospace; font-size: 9.8pt;"&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;zeep &lt;SPAN&gt;import &lt;/SPAN&gt;Client&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;zeep.cache &lt;SPAN&gt;import &lt;/SPAN&gt;SqliteCache&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;zeep.transports &lt;SPAN&gt;import &lt;/SPAN&gt;Transport&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;zeep.plugins &lt;SPAN&gt;import &lt;/SPAN&gt;HistoryPlugin&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;requests &lt;SPAN&gt;import &lt;/SPAN&gt;Session&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;requests.auth &lt;SPAN&gt;import &lt;/SPAN&gt;HTTPBasicAuth&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;lxml &lt;SPAN&gt;import &lt;/SPAN&gt;etree&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;urllib3&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;urllib3 &lt;SPAN&gt;import &lt;/SPAN&gt;disable_warnings&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;urllib3.exceptions &lt;SPAN&gt;import &lt;/SPAN&gt;InsecureRequestWarning&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;pprint &lt;SPAN&gt;import &lt;/SPAN&gt;pprint&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;pandas &lt;SPAN&gt;as &lt;/SPAN&gt;pd&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;datetime&lt;BR /&gt;&lt;BR /&gt;urllib3.&lt;SPAN&gt;disable_warnings&lt;/SPAN&gt;(urllib3.exceptions.InsecureRequestWarning)&lt;BR /&gt;username &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;'username'&lt;BR /&gt;&lt;/SPAN&gt;password &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;'password'&lt;BR /&gt;&lt;/SPAN&gt;wsdl &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;'file:///PATH/RISService70-125.wsdl'&lt;BR /&gt;&lt;/SPAN&gt;session &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;Session&lt;/SPAN&gt;()&lt;BR /&gt;session.verify &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;False&lt;BR /&gt;&lt;/SPAN&gt;session.auth &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;HTTPBasicAuth&lt;/SPAN&gt;(username, password)&lt;BR /&gt;transport &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;Transport&lt;/SPAN&gt;(&lt;SPAN&gt;cache&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;SqliteCache&lt;/SPAN&gt;(), &lt;SPAN&gt;session&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;session, &lt;SPAN&gt;timeout&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;)&lt;BR /&gt;history &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;HistoryPlugin&lt;/SPAN&gt;()&lt;BR /&gt;client &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;Client&lt;/SPAN&gt;(&lt;SPAN&gt;wsdl&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;wsdl, &lt;SPAN&gt;transport&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;transport, &lt;SPAN&gt;plugins&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;[history])&lt;BR /&gt;factory &lt;SPAN&gt;= &lt;/SPAN&gt;client.&lt;SPAN&gt;type_factory&lt;/SPAN&gt;(&lt;SPAN&gt;'ns0'&lt;/SPAN&gt;)&lt;BR /&gt;macs &lt;SPAN&gt;= &lt;/SPAN&gt;[&lt;SPAN&gt;'*'&lt;/SPAN&gt;] &lt;SPAN&gt;#'*' for all&lt;BR /&gt;&lt;/SPAN&gt;item&lt;SPAN&gt;=&lt;/SPAN&gt;[]&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;mac &lt;SPAN&gt;in &lt;/SPAN&gt;macs&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;    item.&lt;SPAN&gt;append&lt;/SPAN&gt;(factory.&lt;SPAN&gt;SelectItem&lt;/SPAN&gt;(&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;mac))&lt;BR /&gt;Item &lt;SPAN&gt;= &lt;/SPAN&gt;factory.&lt;SPAN&gt;ArrayOfSelectItem&lt;/SPAN&gt;(item)&lt;BR /&gt;stateInfo &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;criteria &lt;SPAN&gt;= &lt;/SPAN&gt;factory.&lt;SPAN&gt;CmSelectionCriteria&lt;/SPAN&gt;(&lt;BR /&gt;&lt;SPAN&gt;MaxReturnedDevices &lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;2000&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;DeviceClass&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'Any'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;Model&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;255&lt;/SPAN&gt;, &lt;SPAN&gt;#255 for all&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Status&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'Any'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;NodeName&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;SelectBy&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'Name'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;SelectItems&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;Item,&lt;BR /&gt;&lt;SPAN&gt;Protocol&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'Any'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;DownloadStatus&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'Any'&lt;BR /&gt;&lt;/SPAN&gt;)&lt;BR /&gt;result &lt;SPAN&gt;= &lt;/SPAN&gt;client.service.&lt;SPAN&gt;selectCmDevice&lt;/SPAN&gt;(stateInfo, criteria)&lt;BR /&gt;d &lt;SPAN&gt;= &lt;/SPAN&gt;[]&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;node &lt;SPAN&gt;in &lt;/SPAN&gt;(result[&lt;SPAN&gt;'SelectCmDeviceResult'&lt;/SPAN&gt;][&lt;SPAN&gt;'CmNodes'&lt;/SPAN&gt;][&lt;SPAN&gt;'item'&lt;/SPAN&gt;])&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;device &lt;SPAN&gt;in &lt;/SPAN&gt;node[&lt;SPAN&gt;'CmDevices'&lt;/SPAN&gt;][&lt;SPAN&gt;'item'&lt;/SPAN&gt;]&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;        ipaddresses &lt;SPAN&gt;= &lt;/SPAN&gt;device[&lt;SPAN&gt;'IPAddress'&lt;/SPAN&gt;]&lt;BR /&gt;        ipaddress &lt;SPAN&gt;= &lt;/SPAN&gt;ipaddresses[&lt;SPAN&gt;'item'&lt;/SPAN&gt;][&lt;SPAN&gt;0&lt;/SPAN&gt;][&lt;SPAN&gt;'IP'&lt;/SPAN&gt;] &lt;SPAN&gt;if &lt;/SPAN&gt;ipaddresses &lt;SPAN&gt;else &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;BR /&gt;&lt;/SPAN&gt;        DirNumber &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;(device[&lt;SPAN&gt;'DirNumber'&lt;/SPAN&gt;])&lt;BR /&gt;        DirNumber &lt;SPAN&gt;= &lt;/SPAN&gt;DirNumber.&lt;SPAN&gt;replace&lt;/SPAN&gt;(&lt;SPAN&gt;'-Registered'&lt;/SPAN&gt;, &lt;SPAN&gt;''&lt;/SPAN&gt;)&lt;BR /&gt;        DirNumber &lt;SPAN&gt;= &lt;/SPAN&gt;DirNumber.&lt;SPAN&gt;replace&lt;/SPAN&gt;(&lt;SPAN&gt;'-UnRegistered'&lt;/SPAN&gt;, &lt;SPAN&gt;''&lt;/SPAN&gt;)&lt;BR /&gt;        d.&lt;SPAN&gt;append&lt;/SPAN&gt;(&lt;BR /&gt;            {&lt;BR /&gt;                &lt;SPAN&gt;'Name'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;device[&lt;SPAN&gt;'Name'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'Description'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;device[&lt;SPAN&gt;'Description'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'Directory Number'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;DirNumber,&lt;BR /&gt;                &lt;SPAN&gt;'Protocol'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;device[&lt;SPAN&gt;'Protocol'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'Status'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;device[&lt;SPAN&gt;'Status'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'IP'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;ipaddress,&lt;BR /&gt;                &lt;SPAN&gt;'Model'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;device[&lt;SPAN&gt;'DeviceClass'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'Firmware'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;device[&lt;SPAN&gt;'ActiveLoadID'&lt;/SPAN&gt;],&lt;BR /&gt;                &lt;SPAN&gt;'UnifiedCM'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;node[&lt;SPAN&gt;'Name'&lt;/SPAN&gt;]&lt;BR /&gt;            }&lt;BR /&gt;        )&lt;BR /&gt;dataframe &lt;SPAN&gt;= &lt;/SPAN&gt;pd.&lt;SPAN&gt;DataFrame&lt;/SPAN&gt;(d)&lt;BR /&gt;now &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;(datetime.datetime.&lt;SPAN&gt;now&lt;/SPAN&gt;())&lt;BR /&gt;dataframe.&lt;SPAN&gt;to_csv&lt;/SPAN&gt;(&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;CUCMPhoneStatus "&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;now.&lt;SPAN&gt;replace&lt;/SPAN&gt;(&lt;SPAN&gt;':'&lt;/SPAN&gt;, &lt;SPAN&gt;'.'&lt;/SPAN&gt;)&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;".csv"&lt;/SPAN&gt;, &lt;SPAN&gt;index&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;, &lt;SPAN&gt;header&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;mode&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'w'&lt;/SPAN&gt;)&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Sep 2023 20:35:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-script-for-display-registered-phones-from-cucm-ver-11-5/m-p/4916365#M4102</guid>
      <dc:creator>emiliolara</dc:creator>
      <dc:date>2023-09-01T20:35:26Z</dc:date>
    </item>
  </channel>
</rss>

