Are variables in #include statements supported?
This doesn’t seem to work…
sip.conf:
[user1]
context=from_phone
accountcode=user1
extensions.conf:
[from_phone]
#include “inc/${ACCOUNTCODE}-blocked.conf”
inc/user1-blocked.conf:
exten => _1900X.,1,Answer
exten => _1900X.,n,Wait,1
exten => _1900X.,3,Playback(tt-weasels)
exten => _1900X.,4,Hangup
When I do a show dialplan, there’s no mention of the _1900X extension. Anyone ever done this?
The more I think about it, the more I think it would be best to manage the ENTIRE dial plan from one or more AGI scripts. We can check blocked numbers, extensions from a database and execute whatever logic we so desire. I would have liked to have investigate AEL but considering it can’t process #includes at all, and you have to restart asterisk completely after making a modification, that rules it out.
Can anyone advise any dangers or limitations of doing this? Hopefully I can get more functionality than I can with the very limited extensions.conf