Get intercom DNs

Problem

Your application needs to retrieve all intercom DNs across all intercom partitions in CUCM.

Solution

Cisco UC Manager Version: 8.5

Use the executeSQLQuery AXL API. In this example, we retrieve all intercom DNs.

Step 1: Get all intercom DNs

In this example, we will use the executeSQLQuery API to retrieve a list of all of the intercom DNs. All DNs can be retrieved from the NumPlan table. To filter the intercom DNs from this table, we use NumPlan.tkPatternUsage = 13.

executeSQLQuery
Request Response
<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:executeSQLQuery sequence="?">
        <sql>SELECT dnorpattern FROM NumPlan WHERE NumPlan.tkPatternUsage = 13
		</sql>
      </ns:executeSQLQuery>
   </soapenv:Body>
</soapenv:Envelope>
	
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5">
         <return>
            <row>
               <dnorpattern>1000</dnorpattern>
            </row>
            <row>
               <dnorpattern>2000</dnorpattern>
            </row>
            <row>
               <dnorpattern>3000</dnorpattern>
            </row>
            <row>
               <dnorpattern>4000</dnorpattern>
            </row>
         </return>
      </ns:executeSQLQueryResponse>
   </soapenv:Body>
</soapenv:Envelope>
                                

If you would also like to return the route partition and pattern usage for each DN, you can use the following example. All route partitions can be retrieved from the RoutePartition table and all patterns usages can be retrieved from the TypePatternUsage table.

executeSQLQuery
Request Response
<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:executeSQLQuery sequence="?">
        <sql>select NumPlan.dnorpattern, RoutePartition.name as routepartition, TypePatternUsage.name as patternusage
from NumPlan, RoutePartition, TypePatternUsage
WHERE NumPlan.tkPatternUsage = 13 and
NumPlan.fkroutepartition=RoutePartition.pkid and
NumPlan.tkPatternUsage=TypePatternUsage.enum
		</sql>
      </ns:executeSQLQuery>
   </soapenv:Body>
</soapenv:Envelope>
	
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5">
         <return>
            <row>
               <dnorpattern>1000</dnorpattern>
               <routepartition>Generated_MA_Intercom</routepartition>
               <patternusage>Device Intercom</patternusage>
            </row>
            <row>
               <dnorpattern>2000</dnorpattern>
               <routepartition>Intercom1</routepartition>
               <patternusage>Device Intercom</patternusage>
            </row>
            <row>
               <dnorpattern>3000</dnorpattern>
               <routepartition>Intercom2</routepartition>
               <patternusage>Device Intercom</patternusage>
            </row>
            <row>
               <dnorpattern>4000</dnorpattern>
               <routepartition>Intercom2</routepartition>
               <patternusage>Device Intercom</patternusage>
            </row>
         </return>
      </ns:executeSQLQueryResponse>
   </soapenv:Body>
</soapenv:Envelope>