08-19-2019 06:44 PM - edited 08-21-2019 10:24 PM
Hi,
Is there a way to read, update or add name/number in Key Expansion Module using AXL/Python?
I am unable to find any AXL Soap to do that.
I did find this article :https://community.cisco.com/t5/collaboration-documents/expansion-module/ta-p/3620690
But that is way too old and none of the functions listed work.
EDIT:
I am able to pull the index , label and number from KEM using getPhone. But still facing difficulty to update KEM using updatePhone. Can't figure put how to pass three variables to busyLampFields.
Thanks,
Shesh
Solved! Go to Solution.
08-27-2019 06:50 AM
You need to pass back all the BLF items in your update phone or it will erase any BLF's not passed back in updatephone. You can accomplish this by running a getphone and capturing all BLF's and then edit the ones you need changed, you could edit them within the script with interactive prompts. Personally myself and another coworker built a script that exports all BLF items for a particular phone into an excel spreadsheet then you edit that excel and then built another script that imports that spreadsheet into a variable and then passes that variable to updatephone and update whatever phone you input based on MAC. We have this working in production and use this set of scripts weekly to update multiple reception phones in one pass. Our code might not be optimized since we're both self taught but it works for what we need it to do.
08-22-2019 08:58 AM
Unfortunately I don't have an expansion module to test with, but my understanding is that you configure the actual modules with the <add|updatePhone><addOnModules> collection, and then manage any lines/speed dials/BLF/etc. as you normally would on the base phone using the <add|updatePhone><lines>/<speeddials>/<busyLampFields>/<blfDirectedCallParks> fields and <add|updatePhoneButtonTemplate>
08-22-2019 07:42 PM - edited 08-22-2019 09:47 PM
I got the updatePhone function working. However now there is another issue.
Instead of updating the KEM at specified index, it basically deletes all exiting blf and writes the only one that is listed.
Same thing happens when a list of numbers are given to be updated, only the last one gets configured while the rest are not, I assume each one is overwritten by subsequent calls.
------------------------------------------------
num_list=[
{'index' : '1', 'blfDest': '12345', 'label': 'John'},
{'index' : '2', 'blfDest': '78910', 'label': 'Smith'},
{'index' : '3', 'blfDest': '14785', 'label': 'Jane'},
]
for num in num_list:
speed_dial={'busyLampField':{
'index' : num['index'],
'blfDest' : num['blfDest'],
'label' : num['label']
}}
try:
resp = CLIENT.service.updatePhone(uuid = '{xxxxxxxxxxxx}',busyLampFields=speed_dial)
print( '\nupdatePhone response:\n', resp )
except suds.WebFault as err:
error=err
print(error)
------------------------------------------------
Once the above code is run, only Jane is listed in KEM.
I will continue to run some variations but any suggestions are welcome !!!!!
Also I am still using suds to connect. Haven't got around to upgrade to zeep.
08-22-2019 10:00 PM - edited 08-22-2019 10:02 PM
For some reason my previous reply is not getting posted, so repeating again. Please ignore if the my earlier reply gets posted later on.
I am able to get the updatePhone soap working. However it has now run into another issue.
Instead of updating the DN at the specified index, it basically deletes all the existing blfs and keeps the one it was told to update.
Same thing happens when a list of DNs are given. Only the last one gets configured while the others not, which I presume is probably because each entry gets overwritten by the next one.
Below is the code snip:
--------------------------
num_list=[
{'index' : '1', 'blfDest': '12345', 'label': 'John'},
{'index' : '2', 'blfDest': '78910', 'label': 'Smith'},
{'index' : '3', 'blfDest': '14785', 'label': 'Jane'},
]
for num in num_list:
speed_dial={'busyLampField':{
'index' : num['index'],
'blfDest' : num['blfDest'],
'label' : num['label']
}}
try:
resp = CLIENT.service.updatePhone(uuid = '{xxxxxxxxxxxx}',busyLampFields=speed_dial)
print( '\nupdatePhone response:\n', resp )
except suds.WebFault as err:
print(err)
----------------------------
Once the above code is run, only Jane is listed in KEM.
I will continue to run some more variations, but any suggestions are welcome.
Excuse the crude syntax, still learning.
Also I am still using suds, haven't got around to upgrade to zeep.
08-27-2019 06:50 AM
You need to pass back all the BLF items in your update phone or it will erase any BLF's not passed back in updatephone. You can accomplish this by running a getphone and capturing all BLF's and then edit the ones you need changed, you could edit them within the script with interactive prompts. Personally myself and another coworker built a script that exports all BLF items for a particular phone into an excel spreadsheet then you edit that excel and then built another script that imports that spreadsheet into a variable and then passes that variable to updatephone and update whatever phone you input based on MAC. We have this working in production and use this set of scripts weekly to update multiple reception phones in one pass. Our code might not be optimized since we're both self taught but it works for what we need it to do.
08-27-2019 03:49 PM
Hi Mulvihill,
Thank you for replying.
I agree, however it would have been great if there was an option to edit or update a specific index.
Nevertheless I will script to read, edit and update the KEM.
Do you use python to update or something else.? If it's python, could you share your script?
08-28-2019 06:20 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide