also sprach Steve Edwards <[email protected]> [2015-05-16 23:22 +0200]: > I use a preprocessor > (http://software.hixie.ch/utilities/unix/preprocessor/) to tailor > dialplans and configuration files to each host based on the client > (or project) and the hostname.
Yeah sure, templating works, but it introduces a layer of complexity
that can make debugging hard(er).
I just had the following alternative ideas.
- when #include parses a file, prefix all stanzas found therein
with text derived from the path, e.g.
* #include foo/extensions.conf → "foo-"
* #include bar.conf → "bar-"
* #include foo/bar/moo.conf → "foo-bar-moo-"
- if e.g. a context includes another context using a path
separator, then the [common] context is looked up in a different
location:
* include foo/common → "foo/extensions.conf"
* include foo/bar/common → "foo/bar/extensions.conf:foo/bar.conf"
The same logic could be applied e.g. in the arguments of the
Dial() application or local channels or registry instructions in
sip.conf.
The first is probably easier to implement, while the second is
clearer to the user.
Is this something to consider?
--
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
"when faced with a new problem, the wise algorithmist
will first attempt to classify it as np-complete.
this will avoid many tears and tantrums as
algorithm after algorithm fails."
-- g. niruta
spamtraps: [email protected]
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
