cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1310
Views
0
Helpful
4
Replies

soapenv:Server -1 addPhone

So I am recieving a weird error with no real information to why it is failing when i try to addPhone. Have any of ya seen an error similar to this? Here is the script below and i attached the logs. It seems when I run an addPhone request it is returning java.lang.null exception and i believe that is where it is failing out and give the axlcode message -1. I am assuming the request has certain fields that are not present in my request so it sends it with the value null and the CUCM i assuming doesn't know what to do with it.

 

 

if ($cred -eq $null){$cred = get-credential}



$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("SOAPAction", "CUCM:DB ver=10.5 addPhone")
$headers.Add("Content-Type", "text/xml; charset=utf-8")
$headers.Add("Acc", "text/xml")
$headers.Add("Authorization", "Basic Noneofyourbussiness")


$AXL = @"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">
<soapenv:Header/>
<soapenv:Body>
    <ns:addPhone>
        <name>CSFuser01</name>
        <description>user01</description>
        <product>Cisco Unified Client Services Framework</product>
        <class>Phone</class>
        <protocol>SIP</protocol>
        <protocolSide>User</protocolSide>
        <devicePoolName>DP</devicePoolName>
        <commonPhoneConfigName>Standard Common Phone Profile</commonPhoneConfigName>
        <locationName>Hub_None</locationName>
        <useTrustedRelayPoint>Default</useTrustedRelayPoint>
        <lines>
            <line>
                <index>1</index>
                <display>User01</display>
                <dirn>
                    <pattern>8325</pattern>
                    <routePartitionName>Default</routePartitionName>
                </dirn>
                <displayAscii>User01</displayAscii>
                <maxNumCalls>6</maxNumCalls>
                <busyTrigger>2</busyTrigger>
                <callInfoDisplay>
                    <callerName>true</callerName>
                    <callerNumber>false</callerNumber>
                    <redirectedNumber>false</redirectedNumber>
                    <dialedNumber>true</dialedNumber>
                </callInfoDisplay>
                <associatedEndUsers>
                    <enduser>
                        <userId>User01</userId>
                    </enduser>
                </associatedEndUsers>
            </line>
        </lines>
        <phoneTemplateName>Standard Client Services Framework</phoneTemplateName>
        <primaryPhoneName />
        <builtInBridgeStatus>Default</builtInBridgeStatus>
        <ownerUserName>User01</ownerUserName>
        <packetCaptureMode>None</packetCaptureMode>
        <allowCtiControlFlag>true</allowCtiControlFlag>
        <presenceGroupName>Standard Presence group</presenceGroupName>
        <certificateOperation>Install/Upgrade</certificateOperation>
        <authenticationMode>By Null String</authenticationMode>
        <keySize>2048</keySize>
        <authenticationString/>
        <upgradeFinishTime>2022:08:7:12:00</upgradeFinishTime>
        <deviceMobilityMode>Default</deviceMobilityMode>
        <mtpRequired>true</mtpRequired>
        <mtpPreferedCodec>711ulaw</mtpPreferedCodec>
    </ns:addPhone>
</soapenv:Body>
</soapenv:Envelope>
"@


Invoke-RestMethod 'https://CUCM:8443/axl/' -Method 'POST' -Headers $headers -Body $AXL -SkipCertificatecheck -credential $cred 

 

1 Accepted Solution

Accepted Solutions

i missed the <phone></phone> tag.....

View solution in original post

4 Replies 4

stephan.steiner
Spotlight
Spotlight

Have you checked all your properties against the schema to make sure they're correct? the addPhone schema also tells you what's really required (if you want standard values for the rest, just leave them out, CUCM will put them in)

 

A few things I'm not usually seeing:

leave out primaryPhoneName (don't think I've ever see it used)

Leave out the certificate options unless you have no standard settings (certificateOperation, authenticationMode, keySize, authenticationString)

Leave out upgradeFinishTime (don't think that makes any sense in an add)

 

Also, be careful about dirn.. you have the uuid, as well as pattern/routePartitionName. You usually do either uuid, or pattern/rpn. Especially if you're extracting a template, and use it as the basis for adding, it's easy to miss the uuid and end up with something undesired.

 

The axl log unfortunately is not very helpful in this case.. it bombs out pretty much at the start.

Hey Stephan,

 

So im going off the schema reference 12.5 from cisco. From what I read on the versioning there shouldnt be any changes from 10.5 to 12.5. Unless, I am incorrect on this. I did as you advise and im still recieving the same error and to answer @npetrele I have been able to create a script that adds the line and the user is being sync through ldap. So both the line and the User are being created, I am using a getuser and getline and a getphone of the same type to build the request. On what is needed from the schema it is the boxes that have the solid lines and all of are present, correct? I know I have certain tags that are not "mandatory". I might just take them for to see if i can get this working.

 

Thanks, for the all the help guys.

npetrele
Cisco Employee
Cisco Employee

Did you create the line, user, etc. before attempting this addPhone?  addPhone doesn't add a new line. It can only point to a line that already exists.

 

 

i missed the <phone></phone> tag.....