<?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: CUCM AXL. List Primary Extension. in Management</title>
    <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4520153#M3786</link>
    <description>&lt;P&gt;&lt;A href="https://community.cisco.com/t5/management/developper-api-axl-soap-getphone-issue-with-spectralink-model/td-p/4443310" target="_self"&gt;Crossposted&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Dec 2021 20:20:05 GMT</pubDate>
    <dc:creator>dstaudt</dc:creator>
    <dc:date>2021-12-16T20:20:05Z</dc:date>
    <item>
      <title>CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4006310#M3278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the phone's primary line pattern. I need to get this from the phone itself. As I will not always know what extension might be on the phone. However, I am getting stuck on the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;phone = 'SEPAABBCCDDEEFF'
phone_data = {'name': phone}&lt;BR /&gt;
try:
   phone_resp = service.getPhone(**phone_data)
except Fault as err:
   print("\nZeep error: {0}".format(err))
else:
  DN_Pattern = phone_resp['return']['phone']['lines']['line']['dirn']['pattern']

print( 'Line 1: {0}'.format( DN_Pattern ))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error.&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):
File "device.py", line 8, in &amp;lt;module&amp;gt;
DN_Pattern = phone_resp['return']['phone']['lines']['line']['dirn']['pattern']
TypeError: list indices must be integers, not str&lt;/PRE&gt;&lt;P&gt;I can list all the way to DN_Pattern = phone_resp['return']['phone']['lines']['line']. But nothing nested within line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe it has to do with the [&amp;nbsp; after 'line':. I'm not sure how to interpret this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    'lines': {
        'line': &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/FONT&gt;
            {
                'index': 1,
                'label': 'Extension 5555',
                'display': 'Extension 5555',
                'dirn': {
                    'pattern': '5555',
                    'routePartitionName': {&lt;BR /&gt;                        '_value_1': 'Partition-PT',&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on what the proper syntax?&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2020 01:44:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4006310#M3278</guid>
      <dc:creator>arnorton1</dc:creator>
      <dc:date>2020-01-04T01:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4006818#M3282</link>
      <description>&lt;P&gt;Lets have a look in the Documentation&lt;/P&gt;&lt;P&gt;Within the return ther is phone and the lines part&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="getPhone_Lines.JPG" style="width: 458px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/64463i6544C1DCC47F9307/image-size/large?v=v2&amp;amp;px=999" role="button" title="getPhone_Lines.JPG" alt="getPhone_Lines.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it is Return -&amp;gt; Phone -&amp;gt; Lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within Lines you have any line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="getPhone_Line.JPG" style="width: 412px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/64466i0040EB4185A0EF06/image-size/large?v=v2&amp;amp;px=999" role="button" title="getPhone_Line.JPG" alt="getPhone_Line.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So it is Return -&amp;gt; Phone -&amp;gt; Lines -&amp;gt; Line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And a line itself has dirn -&amp;gt; pattern&lt;/P&gt;&lt;P&gt;So it is Return -&amp;gt; Phone -&amp;gt; Lines -&amp;gt; Line-&amp;gt; dirn -&amp;gt; pattern&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would mean your &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;idea is correct.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;What if you work with the line element itself?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;If you only want the primary extension you would even check the index.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Maybe try to build a loop and print every Elemet within line.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 08:44:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4006818#M3282</guid>
      <dc:creator>thedd</dc:creator>
      <dc:date>2020-01-06T08:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4007021#M3284</link>
      <description>&lt;P&gt;As there can be multiple lines, &amp;lt;line&amp;gt; is going to be represented as an array by Zeep.&lt;/P&gt;
&lt;P&gt;Try something like&lt;/P&gt;
&lt;PRE&gt;DN_Pattern = phone_resp['return']['phone']['lines']['line'][0]['dirn']['pattern']&lt;/PRE&gt;
&lt;P&gt;to get the first element of the array.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 15:24:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4007021#M3284</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2020-01-06T15:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4015652#M3291</link>
      <description>Thank You. This worked.</description>
      <pubDate>Tue, 21 Jan 2020 20:37:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4015652#M3291</guid>
      <dc:creator>arnorton1</dc:creator>
      <dc:date>2020-01-21T20:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089321#M3400</link>
      <description>&lt;P&gt;I'm having an issue in the above referenced scenario where if the phone has multiple lines, the first line data is not being returned as part of the variable assignment, because its not listed first in the dictionary output. It seems that the dictionary output picks a random order for the index and respective line info, resulting in ['lines']['line'][0]['dirn']['pattern'] not always returning the line1 instance. Is there a way to force an ordered output of the lines, based on Index value?&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 13:43:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089321#M3400</guid>
      <dc:creator>ghinson</dc:creator>
      <dc:date>2020-05-20T13:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089390#M3401</link>
      <description>&lt;P&gt;You won't be able to force a particular order from AXL (I'm guessing it probably returns them in index order usually), but you should be able to either sort the result or loop through the result looking for index=1.&amp;nbsp; This SO thread had some helpful thoughts: &lt;A href="https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictionary-by-value" target="_blank"&gt;https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictionary-by-value&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 15:11:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089390#M3401</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2020-05-20T15:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089595#M3405</link>
      <description>&lt;P&gt;I looked at the link you sent over along with several other online references about sorting values within a dictionary and I haven't found a working combination yet. I suspect its in part due to the fact that the phone output is not purely a dictionary set, but also contains square brackets that encapsulate the ['line'] data and are addressable with [0][1][2], etc. I've tried using both the sorted and OrderedDict values to organize the dictionary variable output to a new variable and ordered on 'index', but I keep getting "string indices must be integers" and "RPhone not callable" error messages. Not sure how to dial the syntax in.&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 20:16:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4089595#M3405</guid>
      <dc:creator>ghinson</dc:creator>
      <dc:date>2020-05-20T20:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4520010#M3783</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I running into an error when asking for dirn/pattern for 8861 phones.&lt;/P&gt;&lt;P&gt;My 7965, CIPC, and 8821 return my DN, but no 8861 returns DN.&lt;/P&gt;&lt;P&gt;Using cucm 12.5 and 12.5 wsdl in query&lt;/P&gt;&lt;P&gt;??&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 16:16:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4520010#M3783</guid>
      <dc:creator>bhough</dc:creator>
      <dc:date>2021-12-16T16:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: CUCM AXL. List Primary Extension.</title>
      <link>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4520153#M3786</link>
      <description>&lt;P&gt;&lt;A href="https://community.cisco.com/t5/management/developper-api-axl-soap-getphone-issue-with-spectralink-model/td-p/4443310" target="_self"&gt;Crossposted&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 20:20:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/cucm-axl-list-primary-extension/m-p/4520153#M3786</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2021-12-16T20:20:05Z</dc:date>
    </item>
  </channel>
</rss>

