Author Message
Torrance

Joined: Feb 7, 2020
Messages: 26
Offline
I am attempting an API call to AES using SMS to create a uniform dial plan entry on CM. I have several other API calls that work great but having a little trouble with this one. I am making the call with a python request using the following SOAP header.
Below the header gets a successful response but the uniform dial plan is not added due the error: "2 6c02ff01 68d5 Resulting number is not a valid extension".

Any Idea what could cause the error?
  • Creating the same uniform dial plan works fine from CM directly:
  • From SMGR CM cutthrough

  • <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ses="http://xml.avaya.com/ws/session" 
    xmlns:ns="http://xml.avaya.com/ws/SystemManagementService/2008/07/01">
       <soapenv:Header>
          <ses:sessionID>?</ses:sessionID>
       </soapenv:Header>
       <soapenv:Body>
          <ns:submitRequest>
             <modelFields>
             <UniformDialplan>
                 <Match_Pattern position="1">10971</Match_Pattern>
                 <Len position="1">5</Len>
                 <Del position="1">0</Del>
                 <Net position="1">ext</Net>
                 <Conv position="1">n</Conv>
             </UniformDialplan>
             </modelFields>
             <operation>change</operation>
             <objectname></objectname>
             <qualifier>10971</qualifier>
          </ns:submitRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    200
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://xml.avaya.com/ws/session" 
    xmlns:ns2="http://xml.avaya.com/ws/SystemManagementService/2008/07/01">
    <SOAP-ENV:Header><ns1:sessionID>blah</ns1:sessionID></SOAP-ENV:Header><SOAP-ENV:Body><ns2:submitRequestResponse>
    <return><result_code>1</result_code><result_data/><message_text>[b]2 6c02ff01 68d5 Resulting number is not a valid extension[/b]
    </message_text></return></ns2:submitRequestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Torrance

    Joined: Feb 7, 2020
    Messages: 26
    Offline
    This seems to fail now on the AES test site (sms_test.php) on my production system. I get the same error there...
    Response {
      var $result_code = 1
      var $result_data = ''
      var $message_text = '2 6c02ff01 68d5 Resulting number is not a valid extension
    '
    }
    Torrance

    Joined: Feb 7, 2020
    Messages: 26
    Offline
    It seems this is an issue with CM. The specific CM I was using won't allow the Net=ext assignment. It will however allow the Net=aar setting. So the issue is not with my code or API call.
    JohnBiggs

    Joined: Jun 20, 2005
    Messages: 891
    Location: Thornton, CO
    Online
    Have you
    1) created an entry using the CM SAT (successfully)
    2) used SMS to 'read' that entry
    3) taken the SMS response and altered it slightly to create a new entry

    ?

    I wouldn't expect SMS to have much intelligence here unless the PHP is simply not handling the case you are sending it (net="ext").
    Torrance

    Joined: Feb 7, 2020
    Messages: 26
    Offline
    Thank you for your response. Please see my answers below.
  • 1) created an entry using the CM SAT (successfully)
    ***
    Yes. I am able to create the uniform dialplan entry using CM SAT. That works just fine.
    ***

  • 2) used SMS to 'read' that entry
    ***
    I can read the entry as well. In my python code I check to see if the entry is there before I try to create a new one.
    ***

  • 3) taken the SMS response and altered it slightly to create a new entry
    ***
    I am not sure this works the way I expected it. I seem to be overwriting the wrong entries when trying alter using the same api call and soap xml header presented earlier.
    ***



  • I guess, I still need help making sure I don't overwrite any entries. That could be why I am getting the error message. The api call is trying to create or alter the entry in position [1]. and that may not be the correct entry every time.
  • *********Net position="1"***************
  • Is there some kind of guide on how all of this is indexed?
    JohnBiggs

    Joined: Jun 20, 2005
    Messages: 891
    Location: Thornton, CO
    Online
    Such a guide would be massive (IOW, no). Use the SAT's behavior as your guide. I believe it will show the last few entries as empty where you would put the next item you were adding if you were using the SAT. Follow its lead with your code. So something like entry 5 or 10 is probably blank on the SAT form and I believe you should use that blank entry to add a new entry with. CM will re-sort the list the next time it shows it to you and only provide N entries in its output each time. Keep in mind you code is simulating/acting as the SAT form, not the actual table in CM's database. I know that is less than satisfying answer, but we work with what we are given as far as documentation goes.
    Torrance

    Joined: Feb 7, 2020
    Messages: 26
    Offline
    Thanks again John.
    I think this is what worries me.

  • "So something like entry 5 or 10 is probably blank on the SAT form and I believe you should use that blank entry to add a new entry with."


  • If I don't guess or predict the correct blank entry, I could overwrite something in a list of over 35,000 entries. I am wondering if CM SAT always does 15 entries when you do a change uniform-dialplan <extension>? As in slot 16 is always empty? That could be a way to predict the blank space. Not sure if that is always the case though.

    JohnBiggs

    Joined: Jun 20, 2005
    Messages: 891
    Location: Thornton, CO
    Online
    it is something like what you describe. It will not present a full page - I believe - always allowing some space for you to add new entries. There may be a small group of forms that expect you to enter new data on page 2 though, I can not be exhaustive in my answer.. too many forms, not enough time.
    MichaelHerman2

    Joined: Jan 9, 2014
    Messages: 96
    Offline
    On my CM, there there 16 entries available on page 1, and 16 available on page 2, making position 32 that correct position for the last row on the form.

    I also believe CM doesn't enforce the qualifier. So you could potentially use "9999999999999999" (sixteen 9's) for example as your qualifier, which would hopefully give you a blank form, and then position 32 for all the fields to add your entry to the last row of the form (just to be safe).
    Torrance

    Joined: Feb 7, 2020
    Messages: 26
    Offline
    Thank you Michael!!!! That seems to work as far as I can see. As long as I don't overwrite any data that is there, I am happy. Thanks again.
    Go to:   
    Mobile view