11-29-2018 07:16 AM
Hi Team!
Could you help me, i have tried to create a new phone om my CUCM 11.5. via Python. There is my function:
resp = service.addPhone(phone={"name": 000100020003,
"description": "AXL Test Phone",
"product": "Cisco 8845",
"class": "Phone",
"protocol": "SIP",
"protocolSide": "User",
"callingSearchSpaceName": "CSS_MSK_FullAccess",
"devicePoolName": "DP_MSK",
"lines": {"line": {"index": 1,
"label": "AXL Test Phone",
"display": "AXL Test Phone",
"dirn": {"pattern": 94952374,
"routePartitionName": "Pt_Internal"}}},
"commonDeviceConfigName": "None",
"commonPhoneConfigName": "Standard Common Phone Profile",
"locationName": "Hub_None",
"useTrustedRelayPoint": "Default",
"phoneTemplateName": "Standard 8845 SIP",
"primaryPhoneName": "None",
"softkeyTemplateName": "Standard User PickUp",
"securityProfileName": "Cisco 8845 - Standard SIP Non-Secure Profile",
"builtInBridgeStatus": "Default",
"packetCaptureMode" : "None",
"certificateOperation": "No Pending Operation",
"deviceMobilityMode": "Default"})
I know that, the Line should be created before the the Phone, I have already done it with "rest = service.add Line(...)". However when i try to add a new phone, i get a message
"<axlmessage>Item not valid: The specified None was not found</axlmessage>"
There is my request:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ns0:addPhone xmlns:ns0="http://www.cisco.com/AXL/API/11.5">
<phone>
<name>000100020003</name>
<description>AXL Test Phone</description>
<product>Cisco 8845</product>
<class>Phone</class>
<protocol>SIP</protocol>
<protocolSide>User</protocolSide>
<callingSearchSpaceName>CSS_MSK_FullAccess</callingSearchSpaceName>
<devicePoolName>DP_MSK</devicePoolName>
<commonDeviceConfigName>None</commonDeviceConfigName>
<commonPhoneConfigName>Standard Common Phone Profile</commonPhoneConfigName>
<locationName>Hub_None</locationName>
<useTrustedRelayPoint>Default</useTrustedRelayPoint>
<securityProfileName>Cisco 8845 - Standard SIP Non-Secure Profile</securityProfileName>
<lines>
<line>
<index>1</index>
<label>AXL Test Phone</label>
<display>AXL Test Phone</display>
<dirn>
<pattern>94952374</pattern>
<routePartitionName>Pt_Internal</routePartitionName>
</dirn>
</line>
</lines>
<phoneTemplateName>Standard 8845 SIP</phoneTemplateName>
<primaryPhoneName>None</primaryPhoneName>
<softkeyTemplateName>Standard User PickUp</softkeyTemplateName>
<builtInBridgeStatus>Default</builtInBridgeStatus>
<packetCaptureMode>None</packetCaptureMode>
<certificateOperation>No Pending Operation</certificateOperation>
<deviceMobilityMode>Default</deviceMobilityMode>
</phone>
</ns0:addPhone>
</soap-env:Body>
</soap-env:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Item not valid: The specified None was not found</faultstring>
<detail>
<axlError>
<axlcode>5007</axlcode>
<axlmessage>Item not valid: The specified None was not found</axlmessage>
<request>addPhone</request>
</axlError>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Process finished with exit code 0
12-05-2018 01:31 PM
Here is an example of what mine looks like, maybe it will help you. I would say you should triple check your variable names are correct. We store phone numbers in e164 format in CUCM '\+1xxxyyyzzzz'
phone_name = sep_plus_mac product = 'Cisco 8851' common_phone_config = '8851 Standard Common Phone Profile' phone_template = '8851 2 Line 3 BLF/SPD SIP' description = line_description device_CSS = 'dCSS-OKC' device_pool = 'DP-OKC' device_config = 'CDC Default' phone_config = '8851 Standard Common Phone Profile' subscribe_CSS = 'CSS-Internal' security_profile = 'Cisco 8851 - Standard SIP Non-Secure Profile' sip_profile = 'Standard SIP Profile' subscribe_CSS = 'CSS-SubscribeDefault' hookswitch_control = '<ehookEnable>1</ehookEnable>' mobility = 'true' phone_data = {'name': phone_name, 'product': product, 'class': 'Phone', 'protocol': 'SIP', 'protocolSide': 'User', 'devicePoolName': device_pool, 'commonPhoneConfigName': common_phone_config, 'locationName': 'Hub_None', 'useTrustedRelayPoint': 'Default', 'phoneTemplateName': phone_template, 'primaryPhoneName': None, 'builtInBridgeStatus': 'Default', 'packetCaptureMode': 'None', 'certificateOperation': 'No Pending Operation', 'deviceMobilityMode': 'Default', 'subscribeCallingSearchSpaceName': subscribe_CSS, 'securityProfileName': security_profile, 'sipProfileName': sip_profile, 'ownerUserName': user_input, 'description': description, 'vendorConfig': ET.fromstring(hookswitch_control), 'callingSearchSpaceName': device_CSS, 'commonDeviceConfigName': 'CDC Default', 'enableExtensionMobility': 'false', 'networkHoldMohAudioSourceId': '0', 'userHoldMohAudioSourceId': '0', 'lines': {'line': {'index': '1', 'dirn': e164_phone_number, # /+number 'display': user_fullname, 'displayAscii': user_fullname, 'e164Mask': e164_no_slash, # +number 'label': description}}}
12-10-2018 01:03 AM
04-03-2019 12:45 PM
hi
do you use zeep?
i m trying to addphone using zeep but struggle with 'vendorConfig'
what's the ET.fromstring(hookswitch_control)?
thanks
07-01-2019 02:28 PM
The vendor config isn't needed to add a phone using zeep. I just used it so we could set "headset hookswitch control" to ON by default.
# import this module import lxml.etree as ET # vendor config is done differently than the rest of the phone build and uses XML 'vendorConfig': ET.fromstring('<ehookEnable>1</ehookEnable>'),
11-17-2023 11:31 AM
@Evgeny Udaltsov ,i know this is an old post.I want to achieve something similar.I want to use python to add cisco jabber to cucm.I have a template for cisco jabber. So i will be adding only the device name ,extension no, owner id, Display Name. Users already exist in the cucm. can you provide with the script to connect to cucm via axl and add a new phone using the phone template
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