[asterisk-users] Asterisk "virtual hosting"

martin f krafft madduck at madduck.net
Sun May 17 00:35:37 CDT 2015


also sprach Steve Edwards <asterisk.org at sedwards.com> [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: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital_signature_gpg.asc
Type: application/pgp-signature
Size: 1107 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150517/73276040/attachment.pgp>


More information about the asterisk-users mailing list