cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
274
Views
1
Helpful
3
Replies

VendorConfigXml in Service Profile

mikael.andre
Level 1
Level 1

Hi dev team,

On CUCM running on version 14.0.1.13900-155, I would like, via API, to modify the "Credentials source for voicemail service" parameter in the Service Profile from "not set" to "Unified CM - IM and Presense".

ServiceProfile_CredentialSource.png

According to the AXL documentation AxlSoap_addServiceProfile , this is done at the serviceProfileXml parameter level.

When I do a “get” on an existing service profile, there are parameters but they are encoded.ServiceProfile_VendorConfigXml.png

Is there any documentation regarding possible values?

1 Accepted Solution

Accepted Solutions

mikael.andre
Level 1
Level 1

Hi @Elliot Dierksen ,

Thank you for your reply.

With your tips to parse XML elements in Service Profile, I successfully make modifications on service profile using the following Python code:

print("*** Update service profiles ***")
SpVendorXml001 = '<items><VoicemailServiceCredentialsSource>2</VoicemailServiceCredentialsSource></items>'
SpVendorXml002 = '<items><UseUDS>true</UseUDS><UseUserCredential>false</UseUserCredential><RecursiveSearch1>true</RecursiveSearch1><SearchTimeout>5</SearchTimeout><AllowJabberUserstoSearchandAddSecurityGroups>false</AllowJabberUserstoSearchandAddSecurityGroups></items>'
spXmlOptions001 = ET.fromstring(SpVendorXml001)
spXmlOptions002 = ET.fromstring(SpVendorXml002)
spVendorXmlArray001 = []
spVendorXmlArray002 = []
for i in spXmlOptions001:
spVendorXmlArray001.append(i)
ucm.update_service_profile(name='SP_Collab1k_All', serviceProfileInfos={ 'serviceProfileInfo': [ { 'profileName': 'Voicemail Profile', 'serviceProfileXml': { '_value_1': spVendorXmlArray001 }}]})
time.sleep(timer01)
for j in spXmlOptions002:
spVendorXmlArray002.append(j)
ucm.update_service_profile(name='SP_Collab1k_All', serviceProfileInfos={ 'serviceProfileInfo': [ { 'profileName': 'Directory Profile', 'serviceProfileXml': { '_value_1': spVendorXmlArray002 }}]})
time.sleep(timer02)

View solution in original post

3 Replies 3

That means _value_1 is an array. I might not be using the exact correct python data type description, but that is why it dumps the data that way. Here is a similar thing I did to parse the vendor XML for a phone. I think this depends on the lxml library which I import.

from lxml import etree

                loc = 0
                for elem in vendorxml:
                        if elem.tag == 'spanToPCPort':
                                if Debug:
                                        print('Found spanToPCPort',elem.text,'at loc',loc)
                                vendorxml[loc].text = '1'
                                break
                        loc += 1

 

mikael.andre
Level 1
Level 1

Hi @Elliot Dierksen ,

Thank you for your reply.

With your tips to parse XML elements in Service Profile, I successfully make modifications on service profile using the following Python code:

print("*** Update service profiles ***")
SpVendorXml001 = '<items><VoicemailServiceCredentialsSource>2</VoicemailServiceCredentialsSource></items>'
SpVendorXml002 = '<items><UseUDS>true</UseUDS><UseUserCredential>false</UseUserCredential><RecursiveSearch1>true</RecursiveSearch1><SearchTimeout>5</SearchTimeout><AllowJabberUserstoSearchandAddSecurityGroups>false</AllowJabberUserstoSearchandAddSecurityGroups></items>'
spXmlOptions001 = ET.fromstring(SpVendorXml001)
spXmlOptions002 = ET.fromstring(SpVendorXml002)
spVendorXmlArray001 = []
spVendorXmlArray002 = []
for i in spXmlOptions001:
spVendorXmlArray001.append(i)
ucm.update_service_profile(name='SP_Collab1k_All', serviceProfileInfos={ 'serviceProfileInfo': [ { 'profileName': 'Voicemail Profile', 'serviceProfileXml': { '_value_1': spVendorXmlArray001 }}]})
time.sleep(timer01)
for j in spXmlOptions002:
spVendorXmlArray002.append(j)
ucm.update_service_profile(name='SP_Collab1k_All', serviceProfileInfos={ 'serviceProfileInfo': [ { 'profileName': 'Directory Profile', 'serviceProfileXml': { '_value_1': spVendorXmlArray002 }}]})
time.sleep(timer02)

Glad to hear you got it working. I would encourage you to look more at the etree (ET as you have it imported) libraries. You can use it to build items and then put the XML tree together. It is (IMHO) much easier and less error prone than trying to build the XML from text manually.