4 Replies Latest reply on Jul 7, 2014 12:28 PM by noor

    Optional/multiple elements in AOS Config Templates

    jamessewellwcg New Member

      We have recently upgraded our n-Command to 7.1.1-10792 with the plan to start using the new templating system.  So far so good overall, but I have a specific question that doesn't seem to be covered in the manual.


      We are using TA-900's to provide PRI trunking services.  The item I am concerned with is:


      voice grouped-trunk PRI

        trunk T02

        accept ${didrange} cost 0


      where ${didrange} is a DID telephone number with optional wild cards.  Our concern is what if a user has multiple non-consecutive DIDs that have to be added to multiple "accept" statements?  How can we allow multiple instances of the accept ${didrange} statement?


      One thought is we could just have:


        accept ${didrange1} cost 0

        accept ${didrange2} cost 0

        accept ${didrange3} cost 0

        accept ${didrangeN...} cost 0


      For as many as we think we'd ever need.  But how would these be handled if a customer doesn't have that many DIDs?  Will the AOS accept a blank "accept" command?


      There has to be a cleaner way, some way to only include a config element if populated.  Am I barking up the wrong tree here?




        • Re: Optional/multiple elements in AOS Config Templates



          Thank you for asking this question in the support community.  There are multiple ways you can configure the AOS switchboard/dial plan, and these methods are described in detail in the Configuring the Switchboard and Dial Plan in AOS guide.  As a general summary, you can have multiple accept statements as you mentioned, or you can simply use the "$" wildcard which represents any digit; any number of digits.


          Also, here is the Creating AOS Configuration Templates for n-Command MSP guide for reference.


          I hope that makes sense, but please do not hesitate to reply to this post with any additional questions or information.  I will be happy to help in any way I can.



            • Re: Optional/multiple elements in AOS Config Templates
              jamessewellwcg New Member



              Yes I know you can have multiple "accept" statements in the AOS config.  That's not the question.


              The question is the best way to make a template in n-Command to allow for an arbitrary number of "accept" statement(s).


              I have reviewed the Template guide you linked in detail and did not find the answer.

                • Re: Optional/multiple elements in AOS Config Templates
                  david Employee



                  Unfortunately, at this time, there is not any logic built into MSP Configuration Templates that will allow you to dynamically create an arbitrary number of "accept" statements.  However, I am going to notify the Product Manager that you were seeking this feature, so that it can be considered for a future version of software.  If there are only a few cases that you need to cover, you could create a different template for each case.  For example, a "Two_DIDs" template would cover cases where two are needed, "Three_DIDs" for three entries, etc. 

                  It is generally not recommended that you create and leave blank entries since that will create "unrecognized command" errors when the script is run and trigger job errors within MSP.  However, you could implement something like the following.


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




                  Customer DID Templates

                  Enter DID Template 1: <input allowblank="true" id="accept1" type="text"></input>

                  Enter DID Template 2: <input allowblank="true" id="accept2" type="text"></input>

                  Enter DID Template 3: <input allowblank="true" id="accept3" type="text"></input>

                  Enter DID Template 4: <input allowblank="true" id="accept4" type="text"></input>





                  voice grouped-trunk PRI

                    accept $accept1 cost 0

                    accept $accept2 cost 0

                    accept $accept3 cost 0

                    accept $accept4 cost 0





                  Just keep in mind that when any entries are left blank, you will end up with failed job reports since "accept  cost 0" will be an unrecognized command.




                    • Re: Optional/multiple elements in AOS Config Templates

                      jamessewellwcg -

                      I went ahead and flagged the "Correct Answer" on this post to make it more visible and help other members of the community find solutions more easily. If you don't feel like the answer I marked was correct, feel free to come back to this post to unmark it and select another in its place with the applicable buttons.  If you have any additional information on this that others may benefit from, please come back to this post to provide an update.  If you still need assistance, we would be more than happy to continue working with you on this - just let us know in a reply.