Retrieve available DNs

Version 1
    This document was generated from CDN thread

    Created by: Joachim Bolz on 21-09-2009 02:12:55 PM
    Hi all,
     
    is there somebody out there who would like to give a "poor voip administrator" (without much programming skills...) a quick hint how to achive the following aim... ;-)
    What I actually want to achive is this:
     
    I want to assign directory numbers from within a certain range (e.g. 33000 - 34999) to new devices.
    Therefore I am looking for an easy way to check out, which DNs are already in use and subtract these numbers from the defined range in order to just display the numbers which are still free to use...
     
    I already found a way, how to check the numbers which are in use.
    This is done by a SOAP request, which I am able to send to my communications manager via the CURL tool.
    (you'll find the SOPA request below)
     
    So far, this works as expected. In fact, it responds with all DNs which are already in use.
     
    But now, I would like to get the "still free to use" DNs displayed, rather than the "already in use" DNs.
     
    I assume, this could be done by some JAVA (or alternative programming language) code...
    But as I mentioned, this is not my strongest skill.. :-(
     
    I would be more than happy, if someone could give me some hints or provide me with some sample programming code...
     
    Thanks in advance,
    Joachim
     
    -----------------------------------
     
    Here is my SOAP request:
     
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
        <axlapi:executeSQLQuery xmlns:axlapi="http://www.cisco.com/AXL/API/1.0" xmlns:axl="http://www.cisco.com/AXL/API/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sequence="1" xsi:schemaLocation="http://www.cisco.com/AXL/API/1.0 axlsoap.xsd">
          <sql>Select dnorpattern from numplan where dnorpattern like '33___' or dnorpattern like '34___'</sql>
        </axlapi:executeSQLQuery>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>