This has probably been in Asterisk for quite awhile, but I hadn't seen
it documented anywhere and I thought it was pretty handy:

Contexts are cumulative, and can override existing values:

extensions.conf:
#include extensions-extra.conf
[default]
exten => 1111,1,Dial(sip/abc123)

   +

extensions-extra.conf:
[default]
exten => 1111,1,Goto(2222,1)
exten => 2222,1,Dial(sip/def456)

   =

[default]
exten => 1111,1,Goto(2222,1)
exten => 2222,1,Dial(sip/def456)

verify:
cli> dialplan show default
cli> dialplan show 1...@default

When replacing steps (1111), it will overwrite existing ones, leaving
any extras in place. So that if you only declared 1-3 in the -extra
file, steps 4-6 would still exist.

The behavior is slightly different for the globals section, you need
to add a (+) to the context

extensions.conf:
[global]
A=B
#include extensions-extra.conf

   +

extensions-extra.conf:
[global](+)
B=C

   =

[global]
A=B
B=C

verify:
cli> core show globals

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to