Adding Line and Phone in CM 6.1

Version 1
    This document was generated from CDN thread

    Created by: MIKE WILCOX on 12-03-2009 03:20:42 PM
    Trying to add a line and phone via AXL on CM 6.1.2-1125-1. Using addLine followed by addPhone. The line adds but is missing the voicemail profile and CSS for call forwarding. The phone will not add and not sure what the error message means. Can't find it documented any where. SOAP requests and results are attached.

    Thanks,

    Mike

    Line Request:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/envelope/')]http://schemas.xmlsoap.org/soap/envelope/" xm
    lns:xsi="[url=javascript:newWin('http://www.w3.org/2001/XMLSchema-instance')]http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="[url=javascript:newWin('http://www.w3.org')]http://www.w3.org
    /2001/XMLSchema">

    <SOAP-ENV:Body>
    <addLine>
    <newLine>
    83565264
    <description>Mike Wilcox</description>
    <usage>Device</usage>
    <routePartitionName>NewTech-L1-PT</routePartitionName>
    <callForwardAll>
    <forwardToVoiceMail>f</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardAll>
    <callForwardNoAnswer>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardNoAnswer>
    <callForwardNoAnswerInt>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardNoAnswerInt>
    <callForwardBusy>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardBusy>
    <callForwardBusyInt>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardBusyInt>
    <callForwardNotRegistered>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardNotRegistered>
    <callForwardNotRegisteredInt>
    <forwardToVoiceMail>t</forwardToVoiceMail>
    <calllingSearchSpaceName>NewTech-CF-CSS</calllingSearchSpaceName>
    </callForwardNotRegisteredInt>
    <alertingName>Mike Wilcox</alertingName>
    <asciiAlertingName>Mike Wilcox</asciiAlertingName>
    <shareLineAppearanceCSSName>NewTech-INTL-CSS</shareLineAppearanceCSSName>
    <voiceMailProfileName'>Exchange_UM</voiceMailProfileName'>
    </newLine>
    </addLine>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Result:

    HTTP/1.1 200 OK
    Connection: close
    Date: Wed, 11 Mar 2009 19:48:10 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 402
    Content-Type: text/xml;charset=utf-8
    Client-Date: Wed, 11 Mar 2009 19:48:09 GMT
    Client-Peer: 10.192.88.3:8443
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=CA/L=FMLab/O=Intel/OU=Labpub/CN=FMT.wan.intel.com
    Client-SSL-Cert-Subject: /C=US/ST=CA/L=FMLab/O=Intel/OU=Labpub/CN=FMT.wan.intel.com
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    Set-Cookie: JSESSIONIDSSO=CEEAF2E4839059DB372ED5CE179807DE; Path=/
    Set-Cookie: JSESSIONID=0D900A46D46C1BBFE06634B2A01BA39F; Path=/axl; Secure
    SOAPAction: 6.0

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/envelope/')]http://schemas.xmlsoap.org/soap/envelope/" SO
    AP-ENV:encodingStyle="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/encoding/')]http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Heade
    r/><SOAP-ENV:Body><axl:addLineResponse xmlns:axl="[url=javascript:newWin('http://www.cisco.com/AXL/API/1')]http://www.cisco.com/AXL/API/1
    .0" xmlns:xsi="[url=javascript:newWin('http://www.cisco.com/AXL/API/1.0')]http://www.cisco.com/AXL/API/1.0"><return>{C88A8CF4-6DEE-C1ED-21A
    7-9D79F82DAFD3}</return></axl:addLineResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

    Phone Request:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/envelope/')]http://schemas.xmlsoap.org/soap/envelope/" xm
    lns:xsi="[url=javascript:newWin('http://www.w3.org/2001/XMLSchema-instance')]http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="[url=javascript:newWin('http://www.w3.org')]http://www.w3.org
    /2001/XMLSchema">

    <SOAP-ENV:Body>
    <addPhone>
    <newPhone>
    <name>BAT001100252103</name>
    <description>perl test</description>
    Cisco 7961
    <model>Cisco 7961</model>
    <class>Phone</class>
    SCCP
    User
    <callingSearchSpaceName>NewTech-Dev-CSS</callingSearchSpaceName>
    <devicePoolName>Lab-phone01</devicePoolName>
    <locationName>USR1</locationName>
    <securityProfileName>Cisco 7961 - Standard SCCP Non-Secure Profile</securityProf
    ileName>
    <lines>
    <line>
    <label>6-5264</label>
    <display>Mike Wilcox</display>
    <dirn>
    83565264
    <usage>Device</usage>
    <routePartitionName>NewTech-L1-PT</routePartitionName>
    </dirn>
    <displayAscii>Mike Wilcox</displayAscii>
    <associatedEndUsers>
    <enduser><userid>mjwilcox</userid></enduser>
    </associatedEndUsers>
    </line>
    </lines>
    <softkeyTemplateName>Standard Corporate Feature</softkeyTemplateName>
    <ownerUserId>mjwilcox</ownerUserId>
    <allowCtiControlFlag>t</allowCtiControlFlag>
    </newPhone>
    </addPhone>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Result:

    HTTP/1.1 200 OK
    Connection: close
    Date: Wed, 11 Mar 2009 19:48:13 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 606
    Content-Type: text/xml;charset=utf-8
    Client-Date: Wed, 11 Mar 2009 19:48:12 GMT
    Client-Peer: 10.192.88.3:8443
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=CA/L=FMLab/O=Intel/OU=Labpub/CN=FMT.wan.intel.com
    Client-SSL-Cert-Subject: /C=US/ST=CA/L=FMLab/O=Intel/OU=Labpub/CN=FMT.wan.intel.com
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    Set-Cookie: JSESSIONIDSSO=B5274E74E580C8FDAB4B4DF240928213; Path=/
    Set-Cookie: JSESSIONID=36DC25C6BDEB279F8DD33795C039A9C6; Path=/axl; Secure
    SOAPAction: 6.0

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/envelope/')]http://schemas.xmlsoap.org/soap/envelope/" SO
    AP-ENV:encodingStyle="[url=javascript:newWin('http://schemas.xmlsoap.org/soap/encoding/')]http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Heade
    r/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultst
    ring>Cannot insert a null into column (devicenumplanmap.numplanindex).</faultstr
    ing><detail><axl:Error xmlns:axl="[url=javascript:newWin('http://www.cisco.com/AXL/API/1.0')]http://www.cisco.com/AXL/API/1.0"><axl:code>-3
    91</axl:code><axl:message>Cannot insert a null into column (devicenumplanmap.num
    planindex).</axl:message><request>addPhone</request></axl:Error></detail></SOAP-
    ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

    Subject: RE: Adding Line and Phone in CM 6.1
    Replied by: Stephan Steiner on 25-03-2009 10:44:05 AM
    In your initial request you have ' where no ' should be:
    <voiceMailProfileName'>Exchange_UM</voiceMailProfileName'>
     
    Not sure about the CSS right now.. I'd do a getLine of an existing line and compare with what you're sending.
     
    Then for the addPhone.. the dirn element should contain the line uuid you got back from addLine
    so
     
    <dirn uuid="{....}"/>
    on top of that, in each
    <line> tag you need to specify a line id (as the error message says).. that's the numplanindex in the database and it specifies which line key the line is attached to (starting with 1 and going up to the number of line keys the phone in question has). So, to configure line 1:
     
    <lines>
    <line index="1">
    .....
    <dirn uuid="{....}"/>
    ....
    </line>
     
    Unfortunately, the index isn't really marked as mandatory but it most definitely is.
     
    You can get the data schema for the sql db.. it helps understand such errors. Also.. when in doubt, do a getXYZ, and compare the contents with your addXYZ.

    Subject: RE: Adding Line and Phone in CM 6.1
    Replied by: MIKE WILCOX on 27-03-2009 10:03:35 PM
    Stephan,
     
    I am very new at this so please bear with me
     
    I am using perl to generate the SOAP request and send it to the CM. What would the request look like for the getLine? I have the following:
     
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.
    org/2001/XMLSchema">
             <SOAP-ENV:Body>
            <getLine>
            83565266
    <routePartitionName>NewTech-L1-PT</routePartitionName>
    <routeFilterName></routeFilterName>
    </getline>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
     
    and get this response:
     
    500 No Host option provided
    Content-Type: text/plain
    Client-Date: Fri, 27 Mar 2009 21:53:27 GMT
    Client-Warning: Internal response
    500 No Host option provided
     
    After I get that right, I need to figure how to read the response in perl to see the actual data returned.
     
    Thanks for your help,
     
    Mike

    Subject: RE: Adding Line and Phone in CM 6.1
    Replied by: Stephan Steiner on 30-03-2009 03:59:02 PM
    Don't you have the schema in front of you at all times? XMLSpy 2008 enterprise can generate nice html files from the schema (Cisco also offered them for download) and you should have that open at all times when doing AXL.
     
    getLine either takes:
     
    uuid
     
    or
     
    pattern & router partition (route filter is optional in this case..)
     
    so get line looks something like (taken from java code so there's formatting and stuff you need to take out)
     
    StringBuilder soaprequest = new StringBuilder("<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">\n");
            soaprequest.append("<SOAP-ENV:Body>\n");
    soaprequest.append("<axl:" + request + " xmlns:axl=\"http://www.cisco.com/AXL/1.0\" xsi:schemaLocation=\"http://www.cisco.com/AXL/1.0 http://gkar.cisco.com/schema/axlsoap.xsd\" xsi:type=\"XRequest\" sequence=\"1234\">\n");
            soaprequest.append(parameters + "\n");
            soaprequest.append("</axl:" + request + ">\n");
            soaprequest.append("</SOAP-ENV:Body>\n");
            soaprequest.append("</SOAP-ENV:Envelope>");
     
    request is getLine in this case (as you can see this is generic code that gets called for all my axl requests.. I simply supply the name of the command I'm calling and the parameters and I get a string that I can post to the CCM.
     
    parameters is (as per the schema)
     
    <uuid>{xxxx-.....}</uuid>
     
    or
     
    1234
    <routePartitionName>my_partition</routePartitionName>
     
    1234 is the extension in this case, my_partition the partition
    If you have the partitions uuid, you could also use
     
    1234
    <routePartitionId>{xxxx......}</routePartitionId>
     
    (basically the elements that have an Id at the end (exceptions apply.. e.g. userid is obviously different) refer to uuids)
     
    When you load a phone then the lines you'd obviously use the uuid since that's what you get from the getLine response (you might also get the partition/css as uuids but I can't be entirely sure (don't have examples lying around and I have higher level code that handles both.. I just do a getPhone and tell it to parse lines, then change pattern/partition/caller identification/e.164 and such and write it back).
     

    Subject: Adding Mulitple Lines  and Phone in CM 6.1
    Replied by: irfan h on 28-02-2010 10:59:33 PM
    Hi ,
     
    I want to add muliptle lines to  my device profile using PHP. Can anyone suggest how to implement it?
     
    Thanks
    IAH