Create and Add Intercom Buttons to a Phone
Problem
We are often asked to create different programmable buttons on various phones. With AXL, you have the flexibility to add, update, or remove programmable buttons on a phone by sending XML to the Cisco Unified CM database. There are a few steps that must be taken prior to creating the intercom button. In this example we will walk through those steps.
Solution
Cisco UC Manager Version: 8.5
Creating an intercom button on a phone is a multi-step process which involves
- creating a route partition
- creating an intercom calling search space
- creating intercom lines
- associating the intercom lines to devices.
It is important that the devices are already using a phone button template with a designated intercom button. The following steps will allow us to configure the intercom button via AXL.
Step 1: Create a route partition using addRoutePartition
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:addRoutePartition sequence="?"> <routePartition> <name>Intercom2</name> <description>Intercom between Sarah and Joe</description> <useOriginatingDeviceTimeZone>true</useOriginatingDeviceTimeZone> <partitionUsage>Intercom</partitionUsage> </routePartition> </ns:addRoutePartition> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:addRoutePartitionResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return>{337617E2-C0A6-D45B-1304-B467DBBECAC5}</return> </ns:addRoutePartitionResponse> </soapenv:Body> </soapenv:Envelope>
Step 2: Create intercom calling search space using addCss
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:addCss sequence="?"> <css> <name>Intercom22_GEN</name> <members> <member> <routePartitionName>Intercom2</routePartitionName> <index>1</index> </member> </members> <partitionUsage>Intercom</partitionUsage> </css> </ns:addCss> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:addCssResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return>{50019670-54D3-2BBE-2142-C5F95D839ABF}</return> </ns:addCssResponse> </soapenv:Body> </soapenv:Envelope>
Step 3: Create intercom line for device #1 using addLine
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:addLine sequence="?"> <line> <pattern>4020</pattern> <usage>Device Intercom</usage> <routePartitionName>Intercom2</routePartitionName> <autoAnswer>Auto Answer with Speakerphone</autoAnswer> <shareLineAppearanceCssName>Intercom22_GEN</shareLineAppearanceCssName> <defaultActivatedDeviceName>SEP24B65745E024</defaultActivatedDeviceName> </line> </ns:addLine> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:addLineResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return>{D4C8296B-6C02-6D50-B49C-51E6470692F6}</return> </ns:addLineResponse> </soapenv:Body> </soapenv:Envelope>
Step 4: Create intercom line for device #2 using addLine
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:addLine sequence="?"> <line> <pattern>4021</pattern> <usage>Device Intercom</usage> <routePartitionName>Intercom2</routePartitionName> <autoAnswer>Auto Answer with Speakerphone</autoAnswer> <shareLineAppearanceCssName>Intercom22_GEN</shareLineAppearanceCssName> <defaultActivatedDeviceName>SEPD4D7484071FE</defaultActivatedDeviceName> </line> </ns:addLine> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:addLineResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return>{A1671B80-A17E-1EB6-0920-2D3825D7F76A}</return> </ns:addLineResponse> </soapenv:Body> </soapenv:Envelope>
Step 5: Get line information for device #1 using getPhone (assumes there are already DN's for the device).
Before updating device #1 with the new intercom line,we need to retrieve all the information about the existing lines for device #1. When we update device #1 using updatePhone in Step 6, we must include all the existing lines along with the new line or the existing lines will be removed. The following getPhone call will retrieve the information about the existing lines.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:getPhone sequence="?"> <name>SEP24B65745E024</name> </ns:getPhone> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:getPhoneResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return> <phone uuid="{738F93EE-7CA4-3226-452A-ADE587DA17ED}"> <name>SEP24B65745E024</name> <description>SEP24B65745E024</description> <product>Cisco 8961</product> <model>Cisco 8961</model> <class>Phone</class> <protocol>SIP</protocol> <protocolSide>User</protocolSide> <callingSearchSpaceName/> <devicePoolName uuid="{1B1B9EB6-7803-11D3-BDF0-00108302EAD1}">Default</devicePoolName> <commonDeviceConfigName/> <commonPhoneConfigName uuid="{AC243D17-98B4-4118-8FEB-5FF2E1B781AC}">Standard Common Phone Profile</commonPhoneConfigName> <networkLocation>Use System Default</networkLocation> <locationName uuid="{29C5C1C4-8871-4D1E-8394-0B9181E8C54D}">Hub_None</locationName> <mediaResourceListName uuid="{0C656902-E42F-E38B-4210-EE5A9F319CED}">Media Resource Group List 1</mediaResourceListName> <networkHoldMohAudioSourceId>1</networkHoldMohAudioSourceId> <userHoldMohAudioSourceId>1</userHoldMohAudioSourceId> <automatedAlternateRoutingCssName/> <aarNeighborhoodName/> <loadInformation special="false">sip8961.9-2-2</loadInformation> <vendorConfig> this section truncated for example.... <displayOnWhenIncomingCall>1</displayOnWhenIncomingCall> <rtcp>1</rtcp> </vendorConfig> <versionStamp>{1335280811-EB4DC387-37D8-488A-B3E4-EB8E4B447065}</versionStamp> <traceFlag>false</traceFlag> <mlppDomainId/> <mlppIndicationStatus>Off</mlppIndicationStatus> <preemption>Disabled</preemption> <useTrustedRelayPoint>Default</useTrustedRelayPoint> <retryVideoCallAsAudio>true</retryVideoCallAsAudio> <securityProfileName uuid="{676AADED-C92B-405B-BA9C-46DAAE7AEE31}">Cisco 8961 - Standard SIP Non-Secure Profile</securityProfileName> <sipProfileName uuid="{FCBC7581-4D8D-48F3-917E-00B09FB39213}">Standard SIP Profile</sipProfileName> <cgpnTransformationCssName/> <useDevicePoolCgpnTransformCss>true</useDevicePoolCgpnTransformCss> <geoLocationName/> <geoLocationFilterName/> <sendGeoLocation>false</sendGeoLocation> <lines> <line uuid="{EA259ABE-FCD8-84B2-A238-60E014789C76}"> <index>1</index> <label/> <asciiLabel/> <display/> <dirn uuid="{E94EA5E8-A09F-9781-ACE9-FEB55DE98625}"> <pattern>2022</pattern> <routePartitionName/> </dirn> <ringSetting>Use System Default</ringSetting> <consecutiveRingSetting>Use System Default</consecutiveRingSetting> <ringSettingIdlePickupAlert>Use System Default</ringSettingIdlePickupAlert> <ringSettingActivePickupAlert>Use System Default</ringSettingActivePickupAlert> <displayAscii/> <e164Mask/> <dialPlanWizardId/> <mwlPolicy>Use System Policy</mwlPolicy> <maxNumCalls>4</maxNumCalls> <busyTrigger>2</busyTrigger> <callInfoDisplay> <callerName>true</callerName> <callerNumber>false</callerNumber> <redirectedNumber>false</redirectedNumber> <dialedNumber>true</dialedNumber> </callInfoDisplay> <recordingProfileName/> <monitoringCssName/> <recordingFlag>Call Recording Disabled</recordingFlag> <audibleMwi>Default</audibleMwi> <speedDial/> <partitionUsage>General</partitionUsage> <associatedEndusers/> <missedCallLogging>true</missedCallLogging> </line> </lines> <numberOfButtons>41</numberOfButtons> <phoneTemplateName uuid="{DF401647-5CAC-E781-FAFC-FE5EB139D55E}">SEP24B65745E024-SIP-Individual Template</phoneTemplateName> Response truncated for example... </phone> </return> </ns:getPhoneResponse> </soapenv:Body> </soapenv:Envelope>
Step 6: Update device #1 using updatePhone
When updating the phone with the new intercom line, we must include the new intercom line, the primary DN and all of the existing lines. Any lines that are not included in the updatePhone request will be removed. You can use the information in the <lines> element returned in the getPhone response above to specify the lines.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:updatePhone sequence="?"> <name>SEP24B65745E024</name> <lines> <line uuid="{EA259ABE-FCD8-84B2-A238-60E014789C76}"> <index>1</index> <label/> <asciiLabel/> <display/> <dirn uuid="{E94EA5E8-A09F-9781-ACE9-FEB55DE98625}"> <pattern>2022</pattern> <routePartitionName/> </dirn> <ringSetting>Use System Default</ringSetting> <consecutiveRingSetting>Use System Default</consecutiveRingSetting> <ringSettingIdlePickupAlert>Use System Default</ringSettingIdlePickupAlert> <ringSettingActivePickupAlert>Use System Default</ringSettingActivePickupAlert> <displayAscii/> <e164Mask/> <dialPlanWizardId/> <mwlPolicy>Use System Policy</mwlPolicy> <maxNumCalls>4</maxNumCalls> <busyTrigger>2</busyTrigger> <callInfoDisplay> <callerName>true</callerName> <callerNumber>false</callerNumber> <redirectedNumber>false</redirectedNumber> <dialedNumber>true</dialedNumber> </callInfoDisplay> <recordingProfileName/> <monitoringCssName/> <recordingFlag>Call Recording Disabled</recordingFlag> <audibleMwi>Default</audibleMwi> <speedDial/> <partitionUsage>General</partitionUsage> <associatedEndusers/> <missedCallLogging>true</missedCallLogging> </line> <line> <index>1</index> <dirn> <pattern>4020</pattern> <routePartitionName>Intercom2</routePartitionName> </dirn> <speedDial>4021</speedDial> <partitionUsage>Intercom</partitionUsage> </line> </lines> </ns:updatePhone> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:updatePhoneResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return>{738F93EE-7CA4-3226-452A-ADE587DA17ED}</return> </ns:updatePhoneResponse> </soapenv:Body> </soapenv:Envelope>
Step 7: Repeat step 5 and 6 for device #2.
Perform the same getPhone and updatePhone operations for device #2.