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.
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.
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.
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.