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

Adding a Phone and Line to CM at the same time?

detho9000
Level 1
Level 1

Hi everyone,

I'm attempting to build a script to create a phone and line at the same time, I'm wondering if this is the correct order of operations?

Here's my SOAP envelope:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/11.5">

   <soapenv:Header/>

   <soapenv:Body>

      <ns:addPhone sequence="?">

         <phone ctiid="?">

            <name>SEPAABBCC112233</name>

            <description>Delete this extension - 7004</description>

            <product>Cisco 8845</product>

            <model>Cisco 8845</model>

            <class>Phone</class>

            <protocol>SIP</protocol>

            <protocolSide>User</protocolSide>

            <callingSearchSpaceName uuid="?">Device-CSS</callingSearchSpaceName>

            <devicePoolName uuid="?">DP1</devicePoolName>

            <commonDeviceConfigName uuid="?">CDC1</commonDeviceConfigName>

            <commonPhoneConfigName uuid="?">Standard Common Phone Profile</commonPhoneConfigName>

            <locationName uuid="?">LOC1</locationName>

            <securityProfileName uuid="?">Cisco 8845 - Standard SIP Non-Secure Profile</securityProfileName>

            <lines>

               <line ctiid="?">

               <index>5</index>

                        <pattern>7004</pattern>

                        <display>Delete this extension</display>

                        <ringSetting>Use System Default</ringSetting>

                        <displayAscii>Delete this extension</displayAscii>

                        <e164Mask>5550001234</e164Mask>

                        <maxNumCalls>2</maxNumCalls>

                        <busyTrigger>1</busyTrigger>

                        <recordingProfileName uuid="?">Calabrio</recordingProfileName>

                        <monitoringCssName uuid="?">Calabrio-CSS</monitoringCssName>

                        <recordingFlag>Automatic Call Recording Enabled</recordingFlag>

                        <partitionUsage>General</partitionUsage>

                        <associatedEndusers>

                     <enduser>

                        <userId>user01</userId>

                     </enduser>

                  </associatedEndusers>

                        <missedCallLogging>true</missedCallLogging>

                        <recordingMediaSource>Phone Preferred</recordingMediaSource>               

               </line>

               <lineIdentifier>

                  <directoryNumber>7004</directoryNumber>

                  <routePartitionName>1-DN-PT</routePartitionName>

               </lineIdentifier>

            </lines>

            <softkeyTemplateName uuid="?">Standard User</softkeyTemplateName>

            <ownerUserName uuid="?">user01</ownerUserName>

         </phone>

      </ns:addPhone>

   </soapenv:Body>

</soapenv:Envelope>

The server returns the following:

Cannot associate a null DN with a non-UDT (Universal Device Template) device. Only UDT with NULL DN is allowed.

AXL code:  4215

Obviously there's something wrong with my Line configuration but I'm not sure what.  From what I understand the Index and Pattern are the only required fields, so everything else should just be additional configuration.  I don't have a <dirn> field because I think they're just used to associated existing DNs, and I'm trying to create a new one when I create the phone.

Is it possible to create the line and phone all in one shot or do I need to break those two operations out and then use the <dirn> field in the addPhone SOAP envelop to associate the Line?

1 Accepted Solution

Accepted Solutions

dstaudt
Cisco Employee
Cisco Employee

<add/updatePhone><lines><line><dirn> must refer to an already existing DN.  So you will first need to perform <addLine> (which should return your the uuid of the new line), then do <addPhone)

View solution in original post

5 Replies 5

dstaudt
Cisco Employee
Cisco Employee

<add/updatePhone><lines><line><dirn> must refer to an already existing DN.  So you will first need to perform <addLine> (which should return your the uuid of the new line), then do <addPhone)

Thank you for your reply.  You're correct; I had to add the Line first and then the Phone.  For anyone else reading this, you can associate the Line with the Phone without the UUID with the following in the addPhone request:

<dirn ctiid="?">

     <pattern>xxxx</pattern>

     <routePartitionName uuid="?">RoutePart</routePartitionName>

</dirn>

Is it possible to do the association using just the line uuid?  what does the xml look like?

Here's an example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.cisco.com/AXL/API/10.5">

  <SOAP-ENV:Body>

    <ns1:updatePhone>

      <name>CSFDSTAUDT</name>

              <lines>

                  <line>

                    <index>1</index>

                    <dirn uuid="{14AAD4F3-1F55-4895-6C27-AB98B9393873}"/>

                    <busyTrigger>1</busyTrigger>

                  </line>

              </lines>

    </ns1:updatePhone>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

Thank you! I was able to get it working in Java after your comment.

XFkType routePartition = new XFkType();
routePartition.setValue("partition");

AddLineReq createLineReq = new AddLineReq();
XLine createLine = new XLine();
createLine.setPattern("5432");
createLine.setDescription("Test Line Create");
createLine.setAlertingName("test line Create");
createLine.setRoutePartitionName(objectFactory.createUpdateLineReqRoutePartitionName(routePartition));
createLineReq.setLine(createLine);
StandardResponse createLineResponse = axlPort.addLine(createLineReq);
System.out.println("Create Line: " + createLineResponse)