cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7929
Views
1
Helpful
8
Replies

Looking for SIP Trunk Status (In Service/Out of Service) via AXL

caten
Cisco Employee
Cisco Employee

Hello,

I work on generating monitoring profiles for a third party NMS. We are looking for a way to gather SIP Trunk Status via the AXL API. I took a look through some older documentation and found this link:


http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/devguide/9_1_1/xmldev-911/serviceability.html#wp1079635

From this link, it states that selectCMDevice:
{
SIPStatus
Displays the status of SIP trunk. The following options are available:

•InService

•OutOfService

•PartialService

•Unknown
}


When I use the risport API call for selectCMDevice or selectCMDeviceSIP I do not receive my response. Below is my response from a 10.5 node:
{
<item xsi:type="ns1:CmNodeSIP">
<ReturnCode xsi:type="ns1:RisReturnCode">Ok</ReturnCode>
<Name xsi:type="xsd:string">HQA-CUCM-10X</Name>
<NoChange xsi:type="xsd:boolean">false</NoChange>
<CmDevices soapenc:arrayType="ns1:CmDeviceSIP[1]" xsi:type="soapenc:Array">
<item xsi:type="ns1:CmDeviceSIP">
<Name xsi:type="xsd:string">HQA-ExpresswayC-8X_Trunk</Name>
<IpAddress xsi:type="xsd:string">172.31.50.30</IpAddress>
<DirNumber xsi:type="xsd:string" xsi:nil="true"/>
<Class xsi:type="ns1:DeviceClass">SIP Trunk</Class>
<Model xsi:type="xsd:unsignedInt">131</Model>
<Product xsi:type="xsd:unsignedInt">0</Product>
<BoxProduct xsi:type="xsd:unsignedInt">0</BoxProduct>
<Httpd xsi:type="ns1:CmDevHttpd">Unknown</Httpd>
<RegistrationAttempts xsi:type="xsd:unsignedInt">0</RegistrationAttempts>
<IsCtiControllable xsi:type="xsd:boolean">false</IsCtiControllable>
<LoginUserId xsi:type="xsd:string" xsi:nil="true"/>
<Status xsi:type="ns1:CmDevRegStat">Unknown</Status>
<StatusReason xsi:type="xsd:unsignedInt">0</StatusReason>
<PerfMonObject xsi:type="xsd:unsignedInt">0</PerfMonObject>
<DChannel xsi:type="xsd:unsignedInt">0</DChannel>
<Description xsi:type="xsd:string">HQA-ExpresswayC-8X</Description>
<H323Trunk xsi:type="ns1:H323Trunk">
<ConfigName xsi:type="xsd:string" xsi:nil="true"/>
<TechPrefix xsi:type="xsd:string" xsi:nil="true"/>
<Zone xsi:type="xsd:string" xsi:nil="true"/>
<RemoteCmServer1 xsi:type="xsd:string" xsi:nil="true"/>
<RemoteCmServer2 xsi:type="xsd:string" xsi:nil="true"/>
<RemoteCmServer3 xsi:type="xsd:string" xsi:nil="true"/>
<AltGkList xsi:type="xsd:string" xsi:nil="true"/>
<ActiveGk xsi:type="xsd:string" xsi:nil="true"/>
<CallSignalAddr xsi:type="xsd:string" xsi:nil="true"/>
<RasAddr xsi:type="xsd:string" xsi:nil="true"/>
</H323Trunk>
<TimeStamp xsi:type="xsd:unsignedInt">0</TimeStamp>
<Protocol xsi:type="ns1:ProtocolType">Any</Protocol>
<NumOfLines xsi:type="xsd:unsignedInt">0</NumOfLines>
<LinesStatus soapenc:arrayType="ns1:CmDevSingleLineStatus[0]" xsi:type="soapenc:Array"/>
</item>
</CmDevices>
</item>
</CmNodes>
</SelectCmDeviceResultSIP>
}


Does anyone know of a better method to gather SIP trunk status?


Thanks!

1 Accepted Solution

Accepted Solutions

Hmm...that's indeed odd.  SIPStatus in the response seems to have made its way into the docs (up until 9.1, removed thereafter) though it doesn't appear in any of the WSDLs or in the implementation.

"PartiallyRegistered" should only apply to SIP phones (with multiple lines), in that it's possible that only some of a phone's SIP lines could be registered.  This does not apply to SIP trunks.

Per the schema versions I checked, the <Status> field should be able to return the complete range of statuses, i.e.:

<simpleType name="CmDevRegStat">

  <restriction base="xsd:string">

    <enumeration value="Any"/>

    <enumeration value="Registered"/>

    <enumeration value="UnRegistered"/>

    <enumeration value="Rejected"/>

    <enumeration value="PartiallyRegistered"/>

    <enumeration value="Unknown"/>

  </restriction>

</simpleType>

View solution in original post

8 Replies 8

npetrele
Cisco Employee
Cisco Employee

Can you post your request XML? 

I have tried both selectCMDevice and selectCMDeviceSIP. Note that the below are pulled from a BASH script to make things easier for me to edit/test.

selectCMDevice

request='<?xml version="1.0" encoding="utf-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soapenv:Body>

    <ns1:SelectCmDevice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.cisco.com/ast/soap/">

      <StateInfo xsi:type="xsd:string"/>

      <CmSelectionCriteria href="#id0"/>

    </ns1:SelectCmDevice>

    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:CmSelectionCriteria" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://schemas.cisco.com/ast/soap/">

      <MaxReturnedDevices xsi:type="xsd:unsignedInt">1000</MaxReturnedDevices>

      <Class xsi:type="xsd:string">Any</Class>

      <Model xsi:type="xsd:unsignedInt">255</Model>

      <Status xsi:type="xsd:string">Registered</Status>

      <NodeName xsi:type="xsd:string" xsi:nil="true"/>

      <SelectBy xsi:type="xsd:string">Name</SelectBy>

      <SelectItems soapenc:arrayType="ns2:SelectItem[1]" xsi:type="soapenc:Array">

      <item soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:SelectItem">

        <Item>>HQA-ExpresswayC-8X_Trunk</Item>

      </item>

      </SelectItems>

    </multiRef>

   <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:SelectItem" xmlns:ns3="http://schemas.cisco.com/ast/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

      <Item xsi:type="xsd:string">*</Item>

    </multiRef>

  </soapenv:Body>

</soapenv:Envelope>'

curl --silent -k -u 'XXXXXXXX:XXXXXX' -H "Content-type: text/xml;" -H "SOAPAction: http://schemas.cisco.com/ast/soap/action/#RisPort#selectCmDevice" -d "$request" https://172.31.50.30:8443/realtimeservice/services/RisPort | xmllint --format -

No results for this trunk are found here:

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soapenv:Body>

    <ns1:SelectCmDeviceResponse xmlns:ns1="http://schemas.cisco.com/ast/soap/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

      <SelectCmDeviceResult xsi:type="ns1:SelectCmDeviceResult">

        <TotalDevicesFound xsi:type="xsd:unsignedInt">0</TotalDevicesFound>

        <CmNodes xsi:type="ns1:CmNode" xsi:nil="true"/>

      </SelectCmDeviceResult>

      <StateInfo xsi:type="xsd:string"/>

    </ns1:SelectCmDeviceResponse>

  </soapenv:Body>

</soapenv:Envelope>

selectCMDeviceSIP

request='<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

   <soapenv:Header>

   </soapenv:Header>

   <soapenv:Body>

      <soap:SelectCmDeviceSIP soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

         <CmSelectionCriteriaSIP xsi:type="soap:CmSelectionCriteriaSIP">

            <MaxReturnedDevices xsi:type="xsd:unsignedInt">100</MaxReturnedDevices>

            <Class xsi:type="xsd:string">SIP Trunk</Class>

            <Model xsi:type="xsd:unsignedInt">255</Model>

            <Status xsi:type="xsd:string">Any</Status>

            <SelectBy xsi:type="xsd:string">Name</SelectBy>

            <SelectItems xsi:type="soap:SelectItems" soapenc:arrayType="soap:SelectItem[1]">

               <item>

                  <Item>HQA-ExpresswayC-8X_Trunk</Item>

               </item>

            </SelectItems>

            <Protocol xsi:type="soap:protocolType">SIP</Protocol>

         </CmSelectionCriteriaSIP>

      </soap:SelectCmDeviceSIP>

   </soapenv:Body>

</soapenv:Envelope>'

curl --silent -k -u 'XXXXXXXX:XXXXXX' -H "Content-type: text/xml;" -H "SOAPAction: http://schemas.cisco.com/ast/soap/action/#RisPort#selectCmDeviceSIP" -d "$request" https://172.31.50.30:8443/realtimeservice/services/RisPort | xmllint --format -

Results are found:

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soapenv:Body>

    <ns1:SelectCmDeviceSIPResponse xmlns:ns1="http://schemas.cisco.com/ast/soap/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

      <SelectCmDeviceResultSIP xsi:type="ns1:SelectCmDeviceResultSIP">

        <TotalDevicesFound xsi:type="xsd:unsignedInt">1</TotalDevicesFound>

        <CmNodes xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arrayType="ns1:CmNodeSIP[3]" xsi:type="soapenc:Array">

          <item xsi:type="ns1:CmNodeSIP">

            <ReturnCode xsi:type="ns1:RisReturnCode">Ok</ReturnCode>

            <Name xsi:type="xsd:string">172.31.50.129</Name>

            <NoChange xsi:type="xsd:boolean">false</NoChange>

            <CmDevices xsi:type="ns1:CmDeviceSIP" xsi:nil="true"/>

          </item>

          <item xsi:type="ns1:CmNodeSIP">

            <ReturnCode xsi:type="ns1:RisReturnCode">NotFound</ReturnCode>

            <Name xsi:type="xsd:string">172.31.50.32</Name>

            <NoChange xsi:type="xsd:boolean">true</NoChange>

            <CmDevices xsi:type="ns1:CmDeviceSIP" xsi:nil="true"/>

          </item>

          <item xsi:type="ns1:CmNodeSIP">

            <ReturnCode xsi:type="ns1:RisReturnCode">Ok</ReturnCode>

            <Name xsi:type="xsd:string">HQA-CUCM-10X</Name>

            <NoChange xsi:type="xsd:boolean">false</NoChange>

            <CmDevices soapenc:arrayType="ns1:CmDeviceSIP[1]" xsi:type="soapenc:Array">

              <item xsi:type="ns1:CmDeviceSIP">

                <Name xsi:type="xsd:string">HQA-ExpresswayC-8X_Trunk</Name>

                <IpAddress xsi:type="xsd:string">172.31.50.30</IpAddress>

                <DirNumber xsi:type="xsd:string" xsi:nil="true"/>

                <Class xsi:type="ns1:DeviceClass">SIP Trunk</Class>

                <Model xsi:type="xsd:unsignedInt">131</Model>

                <Product xsi:type="xsd:unsignedInt">0</Product>

                <BoxProduct xsi:type="xsd:unsignedInt">0</BoxProduct>

                <Httpd xsi:type="ns1:CmDevHttpd">Unknown</Httpd>

                <RegistrationAttempts xsi:type="xsd:unsignedInt">0</RegistrationAttempts>

                <IsCtiControllable xsi:type="xsd:boolean">false</IsCtiControllable>

                <LoginUserId xsi:type="xsd:string" xsi:nil="true"/>

                <Status xsi:type="ns1:CmDevRegStat">Registered</Status>

                <StatusReason xsi:type="xsd:unsignedInt">0</StatusReason>

                <PerfMonObject xsi:type="xsd:unsignedInt">0</PerfMonObject>

                <DChannel xsi:type="xsd:unsignedInt">0</DChannel>

                <Description xsi:type="xsd:string">HQA-ExpresswayC-8X</Description>

                <H323Trunk xsi:type="ns1:H323Trunk">

                  <ConfigName xsi:type="xsd:string" xsi:nil="true"/>

                  <TechPrefix xsi:type="xsd:string" xsi:nil="true"/>

                  <Zone xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer1 xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer2 xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer3 xsi:type="xsd:string" xsi:nil="true"/>

                  <AltGkList xsi:type="xsd:string" xsi:nil="true"/>

                  <ActiveGk xsi:type="xsd:string" xsi:nil="true"/>

                  <CallSignalAddr xsi:type="xsd:string" xsi:nil="true"/>

                  <RasAddr xsi:type="xsd:string" xsi:nil="true"/>

                </H323Trunk>

                <TimeStamp xsi:type="xsd:unsignedInt">0</TimeStamp>

                <Protocol xsi:type="ns1:ProtocolType">Any</Protocol>

                <NumOfLines xsi:type="xsd:unsignedInt">0</NumOfLines>

                <LinesStatus soapenc:arrayType="ns1:CmDevSingleLineStatus[0]" xsi:type="soapenc:Array"/>

              </item>

            </CmDevices>

          </item>

        </CmNodes>

      </SelectCmDeviceResultSIP>

      <StateInfo xsi:type="xsd:string">&lt;StateInfo&gt;&lt;Node Name="172.31.50.129" SubsystemStartTime="0" StateId="0" TotalItemsFound="0" TotalItemsReturned="0"/&gt;&lt;Node Name="172.31.50.32" SubsystemStartTime="0" StateId="0" TotalItemsFound="0" TotalItemsReturned="0"/&gt;&lt;Node Name="HQA-CUCM-10X" SubsystemStartTime="1446234354" StateId="22" TotalItemsFound="1" TotalItemsReturned="1"/&gt;&lt;/StateInfo&gt;</StateInfo>

    </ns1:SelectCmDeviceSIPResponse>

  </soapenv:Body>

</soapenv:Envelope>

Thanks!

dstaudt
Cisco Employee
Cisco Employee

It looks like the details for the requested device 'HQA-ExpresswayC-8X' are present in the response for SelectCmDeviceSIP, are you looking for something different?

          ...            

             <item xsi:type="ns1:CmDeviceSIP">

                <Name xsi:type="xsd:string">HQA-ExpresswayC-8X_Trunk</Name>

                <IpAddress xsi:type="xsd:string">172.31.50.30</IpAddress>

                <DirNumber xsi:type="xsd:string" xsi:nil="true"/>

                <Class xsi:type="ns1:DeviceClass">SIP Trunk</Class>

                <Model xsi:type="xsd:unsignedInt">131</Model>

                <Product xsi:type="xsd:unsignedInt">0</Product>

                <BoxProduct xsi:type="xsd:unsignedInt">0</BoxProduct>

                <Httpd xsi:type="ns1:CmDevHttpd">Unknown</Httpd>

                <RegistrationAttempts xsi:type="xsd:unsignedInt">0</RegistrationAttempts>

                <IsCtiControllable xsi:type="xsd:boolean">false</IsCtiControllable>

                <LoginUserId xsi:type="xsd:string" xsi:nil="true"/>

                <Status xsi:type="ns1:CmDevRegStat">Registered</Status>

                <StatusReason xsi:type="xsd:unsignedInt">0</StatusReason>

                <PerfMonObject xsi:type="xsd:unsignedInt">0</PerfMonObject>

                <DChannel xsi:type="xsd:unsignedInt">0</DChannel>

                <Description xsi:type="xsd:string">HQA-ExpresswayC-8X</Description>

                <H323Trunk xsi:type="ns1:H323Trunk">

                  <ConfigName xsi:type="xsd:string" xsi:nil="true"/>

                  <TechPrefix xsi:type="xsd:string" xsi:nil="true"/>

                  <Zone xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer1 xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer2 xsi:type="xsd:string" xsi:nil="true"/>

                  <RemoteCmServer3 xsi:type="xsd:string" xsi:nil="true"/>

                  <AltGkList xsi:type="xsd:string" xsi:nil="true"/>

                  <ActiveGk xsi:type="xsd:string" xsi:nil="true"/>

                  <CallSignalAddr xsi:type="xsd:string" xsi:nil="true"/>

                  <RasAddr xsi:type="xsd:string" xsi:nil="true"/>

                </H323Trunk>

                <TimeStamp xsi:type="xsd:unsignedInt">0</TimeStamp>

                <Protocol xsi:type="ns1:ProtocolType">Any</Protocol>

                <NumOfLines xsi:type="xsd:unsignedInt">0</NumOfLines>

                <LinesStatus soapenc:arrayType="ns1:CmDevSingleLineStatus[0]" xsi:type="soapenc:Array"/>

              </item>

caten
Cisco Employee
Cisco Employee

Check this link:

http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/devguide/9_1_1/xmldev-911/serviceability.html#wp1079635


In 9.1.1 it appears that there was a SIPStatus field that would display one of the following:

InService

OutOfService

PartialService

Unknown

Looking at registration might be OK if SIP trunks to destinations were a 1-to-1 relationship, but how does that show me a partial service SIP trunk?

Thanks

I'm not sure where your document comes from (yes, it's a Cisco link, but I've never seen that doc).  It's possible it is incorrect, or something has changed since 9.1.  But the status is actually one of the following now.  I don't see SIPStatus as a returned field in the current documents.

StatusAllows device searches by status (or state):
  • Any
  • Registered
  • UnRegistered
  • Rejected
  • PartiallyRegistered
  • Unknown

Since you are making your request against a 10.5 server, I wouldn't use 9.1 documentation for it.

Hmm...that's indeed odd.  SIPStatus in the response seems to have made its way into the docs (up until 9.1, removed thereafter) though it doesn't appear in any of the WSDLs or in the implementation.

"PartiallyRegistered" should only apply to SIP phones (with multiple lines), in that it's possible that only some of a phone's SIP lines could be registered.  This does not apply to SIP trunks.

Per the schema versions I checked, the <Status> field should be able to return the complete range of statuses, i.e.:

<simpleType name="CmDevRegStat">

  <restriction base="xsd:string">

    <enumeration value="Any"/>

    <enumeration value="Registered"/>

    <enumeration value="UnRegistered"/>

    <enumeration value="Rejected"/>

    <enumeration value="PartiallyRegistered"/>

    <enumeration value="Unknown"/>

  </restriction>

</simpleType>

caten
Cisco Employee
Cisco Employee

I did some testing in my lab a little bit more and it appears that the status field does change, just not in the way I expected.

Up and Working (Single Destination):

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Registered</Status>

Adjusted Destination to incorrect IP

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Unknown</Status>

Shut Down Destination (Single Destination Down)

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Unknown</Status>

Added second destination to SIP trunk (Partial Service)

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">UnRegistered</Status>

Brought back destination that was down:

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Registered</Status>

Brought Down 2nd destination (Partial Service):

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">UnRegistered</Status>

Shut Down both destinations:

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Unknown</Status>

Brought both destinations up:

./siptrunk.sh | grep CmDevRegStat

                <Status xsi:type="ns1:CmDevRegStat">Registered</Status>

With all of that being said, it appears that the following is true:

Registered = Full Service

Unregistered = Partial Service

Unknown = No Service

I was thinking that we would see partiallyRegistered for the partial service, but through testing it appears that Unregistered is what we should be looking for. It would be great if we could get the time it has been out of service, but that can be calculated easily enough. I appreciate you help.

Thanks!

dstaudt
Cisco Employee
Cisco Employee

Are your trunks configured with SIP OPTIONS ping, to help CUCM determine their online status?  If so, are you waiting 2 or 3 ping intervals between changes to ensure CUCM has a chance to detect the new state (perhaps this is reflected in the CUCM admin UI?)

If not, CUCM does not actually make a connection attempt for the new configuration immediately, which would probably show as 'Unknown'.  Attempting to make calls over the trunk would force CUCM to make a connection attempt and hopefully triggering CUCM to move from 'Unknown' to 'Registered'/'UnRegistered' status (depending on the outcome of the call.)

Partial registration for multiple destination trunks makes a certain amount of sense - curious to see if that is how it works...