<?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 AXL cucm update phone with line Failed.... in Management</title>
    <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4106561#M3422</link>
    <description>List items like lines, speed dial, blf speed dial, etc have to be ALL written back with the call otherwise they fall off.&lt;BR /&gt;&lt;BR /&gt;The API rarely is actually "updating" anything but usually rather replacing.&lt;BR /&gt;&lt;BR /&gt;I call getPhone first, to get the associated line appearances, then you can unpack that as either a hash or array of hashes, modify the values you want, and put the whole thing back with an update call. You're going to want to do this with most of the attributes to avoid losing them. The only one that I haven't figured out how to get past is the load information, since AXL ships out what it should be, default or otherwise, and you have no way to know if it's been set manually. If you write that one back then it will fill in the field even if it was empty before.</description>
    <pubDate>Sat, 20 Jun 2020 00:12:06 GMT</pubDate>
    <dc:creator>Adam Pawlowski</dc:creator>
    <dc:date>2020-06-20T00:12:06Z</dc:date>
    <item>
      <title>python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4087468#M3396</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i have phone name =&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;SEP00059A3C7Acc&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;line1 = 111 , line 2 = 555 , line3 = 666&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i make update phone they remove line2 and line3 and update line1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# CUCM HostName/ IP Address&lt;BR /&gt;&lt;/SPAN&gt;host = &lt;SPAN&gt;'192.168.1.30'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# WSDL Service location download AXLToolKit from Call Manager&lt;BR /&gt;&lt;/SPAN&gt;wsdl = &lt;SPAN&gt;'AXLAPI.wsdl'&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# UserName and Password&lt;BR /&gt;&lt;/SPAN&gt;user = &lt;SPAN&gt;'admin'&lt;BR /&gt;&lt;/SPAN&gt;pwd = &lt;SPAN&gt;'password'&lt;BR /&gt;&lt;/SPAN&gt;location = &lt;SPAN&gt;'https://{host}:8443/axl/'&lt;/SPAN&gt;.format(&lt;SPAN&gt;host&lt;/SPAN&gt;=host)&lt;BR /&gt;binding = &lt;SPAN&gt;"{http://www.cisco.com/AXLAPIService/}AXLAPIBinding"&lt;BR /&gt;&lt;/SPAN&gt;session = Session()&lt;BR /&gt;session.verify = &lt;SPAN&gt;False&lt;BR /&gt;&lt;/SPAN&gt;session.auth = HTTPBasicAuth(user, pwd)&lt;BR /&gt;transport = Transport(&lt;SPAN&gt;cache&lt;/SPAN&gt;=SqliteCache(), &lt;SPAN&gt;session&lt;/SPAN&gt;=session, &lt;SPAN&gt;timeout&lt;/SPAN&gt;=&lt;SPAN&gt;20&lt;/SPAN&gt;)&lt;BR /&gt;history = HistoryPlugin()&lt;BR /&gt;client = Client(&lt;SPAN&gt;wsdl&lt;/SPAN&gt;=wsdl, &lt;SPAN&gt;transport&lt;/SPAN&gt;=transport, &lt;SPAN&gt;plugins&lt;/SPAN&gt;=[history])&lt;BR /&gt;service = client.create_service(binding, location)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;update_Phone():&lt;BR /&gt;    &lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;        response = service.updatePhone(&lt;SPAN&gt;name&lt;/SPAN&gt;=&lt;SPAN&gt;"SEP00059A3C7Acc"&lt;/SPAN&gt;,&lt;BR /&gt;                                       &lt;SPAN&gt;lines&lt;/SPAN&gt;={&lt;SPAN&gt;"line" &lt;/SPAN&gt;: {&lt;SPAN&gt;"index"&lt;/SPAN&gt;: &lt;SPAN&gt;1&lt;/SPAN&gt;,&lt;BR /&gt;                                                         &lt;SPAN&gt;"dirn"&lt;/SPAN&gt;: {&lt;SPAN&gt;"pattern"&lt;/SPAN&gt;: &lt;SPAN&gt;"111"&lt;/SPAN&gt;,&lt;BR /&gt;                                                                  &lt;SPAN&gt;"routePartitionName"&lt;/SPAN&gt;: &lt;SPAN&gt;"A"&lt;/SPAN&gt;}&lt;BR /&gt;                                                                 }&lt;BR /&gt;                                               }&lt;BR /&gt;&lt;BR /&gt;                                       )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(response)&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;except &lt;/SPAN&gt;&lt;SPAN&gt;Exception &lt;/SPAN&gt;&lt;SPAN&gt;as &lt;/SPAN&gt;e:&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;str&lt;/SPAN&gt;(e))&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;update_Phone()&lt;/PRE&gt;&lt;P&gt;how to fix this problem..&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 18:57:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4087468#M3396</guid>
      <dc:creator>abdulazizalmutairy3103</dc:creator>
      <dc:date>2020-05-17T18:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4100875#M3415</link>
      <description>&lt;P&gt;I ran into a similar scenario, check out this thread for a more detailed description of the problem.&amp;nbsp; It's not that you're doing anything incorrectly, but more understanding how the API functions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cisco.com/t5/management/axl-update-device-profile-line-appearance/m-p/4062936#M3374" target="_self"&gt;https://community.cisco.com/t5/management/axl-update-device-profile-line-appearance/m-p/4062936#M3374&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 14:41:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4100875#M3415</guid>
      <dc:creator>derek.fraser</dc:creator>
      <dc:date>2020-06-10T14:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4106561#M3422</link>
      <description>List items like lines, speed dial, blf speed dial, etc have to be ALL written back with the call otherwise they fall off.&lt;BR /&gt;&lt;BR /&gt;The API rarely is actually "updating" anything but usually rather replacing.&lt;BR /&gt;&lt;BR /&gt;I call getPhone first, to get the associated line appearances, then you can unpack that as either a hash or array of hashes, modify the values you want, and put the whole thing back with an update call. You're going to want to do this with most of the attributes to avoid losing them. The only one that I haven't figured out how to get past is the load information, since AXL ships out what it should be, default or otherwise, and you have no way to know if it's been set manually. If you write that one back then it will fill in the field even if it was empty before.</description>
      <pubDate>Sat, 20 Jun 2020 00:12:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4106561#M3422</guid>
      <dc:creator>Adam Pawlowski</dc:creator>
      <dc:date>2020-06-20T00:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4110981#M3426</link>
      <description>&lt;P&gt;You're only defining one line, so when it updates the phone, is assumes you only want one line. You need to do the python/json equivalent of the following XML, which would define 2 lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;      &amp;lt;lines&amp;gt;
        &amp;lt;line&amp;gt;
          &amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;
          &amp;lt;dirn&amp;gt;
            &amp;lt;pattern&amp;gt;1001&amp;lt;/pattern&amp;gt;
            &amp;lt;routePartitionName&amp;gt;Internal-PT&amp;lt;/routePartitionName&amp;gt;
          &amp;lt;/dirn&amp;gt;
        &amp;lt;/line&amp;gt;
        &amp;lt;line&amp;gt; &lt;BR /&gt;          &amp;lt;index&amp;gt;2&amp;lt;/index&amp;gt; &lt;BR /&gt;            &amp;lt;dirn&amp;gt; &lt;BR /&gt;              &amp;lt;pattern&amp;gt;1002&amp;lt;/pattern&amp;gt; &lt;BR /&gt;              &amp;lt;routePartitionName&amp;gt;Internal-PT&amp;lt;/routePartitionName&amp;gt; &lt;BR /&gt;            &amp;lt;/dirn&amp;gt; &lt;BR /&gt;         &amp;lt;/line&amp;gt;       &lt;BR /&gt;      &amp;lt;/lines&amp;gt;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2020 19:36:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4110981#M3426</guid>
      <dc:creator>npetrele</dc:creator>
      <dc:date>2020-06-29T19:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4527683#M3791</link>
      <description>&lt;P&gt;The equivalent to the xml that would define 2 lines is a list.&amp;nbsp; When I use that list together with update_phone all of the lines are removed.&amp;nbsp; The xml looks like&lt;/P&gt;&lt;P&gt;&amp;lt;soap-env:Envelope xmlns:soap-env="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;soap-env:Body&amp;gt;&lt;BR /&gt;&amp;lt;ns0:updatePhone xmlns:ns0="&lt;A href="http://www.cisco.com/AXL/API/12.5" target="_blank"&gt;http://www.cisco.com/AXL/API/12.5&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;SEPF04A02EEED5B&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;description&amp;gt;Test axl description&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;lt;lines/&amp;gt;&lt;BR /&gt;&amp;lt;/ns0:updatePhone&amp;gt;&lt;BR /&gt;&amp;lt;/soap-env:Body&amp;gt;&lt;BR /&gt;&amp;lt;/soap-env:Envelope&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 23:06:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4527683#M3791</guid>
      <dc:creator>mserwon</dc:creator>
      <dc:date>2022-01-06T23:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4527993#M3793</link>
      <description>&lt;P&gt;Yes if you do that it will remove the lines, as you're supplying an empty list element for lines with nothing in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next time I wrote this function into a project I decided to not go down that road and instead use addLine for adding a line. You can do it with update phone. I did learn a lesson however that there have been bugs in the past about sending in empty tags and parsing, and I try not to do that. I thought it would be "cool" to getPhone, update what I want, and paste it back with updatePhone until I broke things. (&amp;lt;vendorConfig /&amp;gt;).&lt;BR /&gt;&lt;BR /&gt;Loosely, with addPhone:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;                line_data = {
                    'line': {
                        'index': new_index,
                        'display': display_name,
                        'displayAscii': display_name,
                        'label': line['line']['alertingName'][:30],
                        'dirn': {
                            'pattern': line['line']['pattern'],
                            'routePartitionName': line['line']['routePartitionName']['_value_1']
                        },
                        'e164Mask': '716XXXXXXX',
                        'associatedEndusers': {
                            'enduser': {
                                'userId': user_id
                            }
                        },
                        'callInfoDisplay': {
                            'callerName': 't',
                            'callerNumber': 'f',
                            'redirectedNumber': 'f',
                            'dialedNumber': 't'
                        },
#                        'maxNumCalls': '2',
#                        'busyTrigger': '2'
                    }
                }

                # Update device

                params = {
                    'name': csf_device,
                    'addLines': line_data
                }

                try:

                    result = VoIPXMPPBot.axl_client.service_proxy.updatePhone(**params)

&lt;/PRE&gt;
&lt;P&gt;I am using the serviceProxy to re-write the endpoint, but however else you're addressing it, that format works. Display Name values are shortened elsewhere in my code and not there, same with scrubbing out characters like '&amp;amp;' that otherwise cause fault.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 16:06:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4527993#M3793</guid>
      <dc:creator>Adam Pawlowski</dc:creator>
      <dc:date>2022-01-07T16:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4528150#M3795</link>
      <description>&lt;P&gt;Adam,&lt;/P&gt;&lt;P&gt;If I am understanding you correctly you did an update phone with no lines and did an add line afterwards?&lt;/P&gt;&lt;P&gt;I have python code that updates the line for a phone that has only one line and produces this correct result.&amp;nbsp; It does not work for 2 or more lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One line Request&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;Headers:&lt;/P&gt;&lt;P&gt;{'SOAPAction': '"CUCM:DB ver=12.5 updatePhone"', 'Content-Type': 'text/xml; charset=utf-8'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Body:&lt;/P&gt;&lt;P&gt;&amp;lt;soap-env:Envelope xmlns:soap-env="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;soap-env:Body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ns0:updatePhone xmlns:ns0="&lt;A href="http://www.cisco.com/AXL/API/12.5" target="_blank"&gt;http://www.cisco.com/AXL/API/12.5&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;SEPF04A02EEED5B&amp;lt;/name&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;description&amp;gt;Test axl description&amp;lt;/description&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;lines&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;line&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;display&amp;gt;P Test - Display&amp;lt;/display&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dirn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pattern&amp;gt;\+18133920819&amp;lt;/pattern&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;routePartitionName&amp;gt;INTERNAL-PT&amp;lt;/routePartitionName&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dirn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;displayAscii&amp;gt;P Test - DisplayA&amp;lt;/displayAscii&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/line&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/lines&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ns0:updatePhone&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/soap-env:Body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/soap-env:Envelope&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 21:51:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4528150#M3795</guid>
      <dc:creator>mserwon</dc:creator>
      <dc:date>2022-01-07T21:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4528206#M3796</link>
      <description>&lt;P&gt;I was able to use python ordered dictionaries and zeep to get the xml correct to update more than one line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cucm_resp = ucm.update_phone(name=dfaxl['name'][idx],&lt;BR /&gt;description=dfaxl['description'][idx],&lt;BR /&gt;lines = linedict3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;linedict3 = OrderedDict([&lt;BR /&gt;('line',&lt;BR /&gt;[([OrderedDict([('index', 1),&lt;BR /&gt;('label', 'P1 Test - Label'),&lt;BR /&gt;('display', 'P1 Test - Display'),&lt;BR /&gt;('displayAscii', 'P1 Test - Display A'),&lt;BR /&gt;('dirn', OrderedDict([('pattern', '\\+18133920819'), ('routePartitionName', 'INTERNAL-PT' )]))&lt;BR /&gt;])]),&lt;BR /&gt;([OrderedDict([('index', 2),&lt;BR /&gt;('label', 'P1 Test - Label2'),&lt;BR /&gt;('display', 'P1 Test - Display2'),&lt;BR /&gt;('displayAscii', 'P1 Test - Display2 A'),&lt;BR /&gt;('dirn', OrderedDict([('pattern', '\\+18133919999'), ('routePartitionName', 'INTERNAL-PT' )]))&lt;BR /&gt;])])]&lt;BR /&gt;)])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the debug output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request&lt;BR /&gt;-------&lt;BR /&gt;Headers:&lt;BR /&gt;{'SOAPAction': '"CUCM:DB ver=12.5 updatePhone"', 'Content-Type': 'text/xml; charset=utf-8'}&lt;/P&gt;&lt;P&gt;Body:&lt;BR /&gt;&amp;lt;soap-env:Envelope xmlns:soap-env="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;soap-env:Body&amp;gt;&lt;BR /&gt;&amp;lt;ns0:updatePhone xmlns:ns0="&lt;A href="http://www.cisco.com/AXL/API/12.5" target="_blank"&gt;http://www.cisco.com/AXL/API/12.5&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;SEPF04A02EEED5B&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;description&amp;gt;P Test Good&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;lt;lines&amp;gt;&lt;BR /&gt;&amp;lt;line&amp;gt;&lt;BR /&gt;&amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;P1 Test - Label&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;display&amp;gt;P1 Test - Display&amp;lt;/display&amp;gt;&lt;BR /&gt;&amp;lt;dirn&amp;gt;&lt;BR /&gt;&amp;lt;pattern&amp;gt;\+18133920819&amp;lt;/pattern&amp;gt;&lt;BR /&gt;&amp;lt;routePartitionName&amp;gt;INTERNAL-PT&amp;lt;/routePartitionName&amp;gt;&lt;BR /&gt;&amp;lt;/dirn&amp;gt;&lt;BR /&gt;&amp;lt;displayAscii&amp;gt;P1 Test - Display A&amp;lt;/displayAscii&amp;gt;&lt;BR /&gt;&amp;lt;/line&amp;gt;&lt;BR /&gt;&amp;lt;line&amp;gt;&lt;BR /&gt;&amp;lt;index&amp;gt;2&amp;lt;/index&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;P1 Test - Label2&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;display&amp;gt;P1 Test - Display2&amp;lt;/display&amp;gt;&lt;BR /&gt;&amp;lt;dirn&amp;gt;&lt;BR /&gt;&amp;lt;pattern&amp;gt;\+18133919999&amp;lt;/pattern&amp;gt;&lt;BR /&gt;&amp;lt;routePartitionName&amp;gt;INTERNAL-PT&amp;lt;/routePartitionName&amp;gt;&lt;BR /&gt;&amp;lt;/dirn&amp;gt;&lt;BR /&gt;&amp;lt;displayAscii&amp;gt;P1 Test - Display2 A&amp;lt;/displayAscii&amp;gt;&lt;BR /&gt;&amp;lt;/line&amp;gt;&lt;BR /&gt;&amp;lt;/lines&amp;gt;&lt;BR /&gt;&amp;lt;/ns0:updatePhone&amp;gt;&lt;BR /&gt;&amp;lt;/soap-env:Body&amp;gt;&lt;BR /&gt;&amp;lt;/soap-env:Envelope&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Response&lt;BR /&gt;-------&lt;BR /&gt;Headers:&lt;BR /&gt;{'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains', 'Content-Security-Policy': "default-src *; script-src * 'unsafe-inline' 'unsafe-eval';style-src * 'unsafe-inline'; img-src * data: 'unsafe-inline';", 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Content-Type': 'text/xml;charset=UTF-8', 'Content-Length': '311', 'Date': 'Sat, 08 Jan&lt;BR /&gt;2022 02:47:26 GMT', 'Server': ''}&lt;/P&gt;&lt;P&gt;Body:&lt;BR /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;soapenv:Body&amp;gt;&lt;BR /&gt;&amp;lt;ns:updatePhoneResponse xmlns:ns="&lt;A href="http://www.cisco.com/AXL/API/12.5" target="_blank"&gt;http://www.cisco.com/AXL/API/12.5&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;return&amp;gt;{7AA8E651-DA96-A210-E922-5CD9DD416664}&amp;lt;/return&amp;gt;&lt;BR /&gt;&amp;lt;/ns:updatePhoneResponse&amp;gt;&lt;BR /&gt;&amp;lt;/soapenv:Body&amp;gt;&lt;BR /&gt;&amp;lt;/soapenv:Envelope&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 03:30:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4528206#M3796</guid>
      <dc:creator>mserwon</dc:creator>
      <dc:date>2022-01-08T03:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: python AXL cucm update phone with line Failed....</title>
      <link>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4530322#M3799</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/282075"&gt;@mserwon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Adam,&lt;/P&gt;
&lt;P&gt;If I am understanding you correctly you did an update phone with no lines and did an add line afterwards?&lt;/P&gt;
&lt;P&gt;I have python code that updates the line for a phone that has only one line and produces this correct result.&amp;nbsp; It does not work for 2 or more lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, you can do that, but if you send back &amp;lt;lines /&amp;gt; then it will remove all the lines from the device, so whatever was formatting that XML didn't give you what you wanted.&amp;nbsp; Looks like you got your problem resolved - perhaps there was an issue with the serialization that was happening before. &lt;BR /&gt;&lt;BR /&gt;Add line works fine if you want to process it that way without playing with the other elements, so you could say, coke up some sort of thing like a "Night Mode" script that takes a line that would be at reception/service and adds it to other manned devices, and one that removes it, for coverage at a store or utility plant for example. It would be based on device list and known layout of the device. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:41:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-axl-cucm-update-phone-with-line-failed/m-p/4530322#M3799</guid>
      <dc:creator>Adam Pawlowski</dc:creator>
      <dc:date>2022-01-12T16:41:26Z</dc:date>
    </item>
  </channel>
</rss>

