cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
442
Views
0
Helpful
0
Replies

trying to add multiple lines to a phone through AXL- Python

Hi All,

 

I am recently started trying the automations with AXL and  Python.

Now I have encountered an issue.

I am trying to add / Update a phone with two Directory Number, but when I am running the script it only adds one DN.

The last specified index is only adding to CUCM, attaching the screenshot of device page for better understanding.

 

Please find the Py code for the same.


def Update_lineTwo():
    #Function to Update line 2
    try:
        update_line2 = axl.updatePhone(name="SEP{}".format(MAC_AddresstoUpdate),
                                       lines={"line":{"index":'2',
                                                      "label":"{}".format(Line_Text_Label),
                                                         "display": "{}".format(Display_Name),
                                                         "displayAscii": "{}".format(Display_Name),
                                                         "dirn": {"pattern": "{}".format(DN_One),
                                                                        "routePartitionName": "{}".format(PT)},

                                                       "index":'1',
                                                      "label":"{}".format(Line_Text_Label),
                                                         "display": "{}".format(Display_Name),
                                                         "displayAscii": "{}".format(Display_Name),
                                                         "dirn": {"pattern": "{}".format(DN_Two),
                                                                        "routePartitionName": "{}".format(PT)}            
                                                      }})
        print("DN2 added Succesfully")
    except Fault as add_line2_err:
        print("Line 2 Update failed")
        print(add_line2_err)
0 Replies 0