Ability for 'module' configs to have an optional 'createdialplan' section.
authorMichael Geddes <openwrt@frog.wheelycreek.net>
Sun, 18 Jan 2009 12:48:35 +0000 (12:48 +0000)
committerMichael Geddes <openwrt@frog.wheelycreek.net>
Sun, 18 Jan 2009 12:48:35 +0000 (12:48 +0000)
Used to create voicemenus.

contrib/package/asterisk-xip/files/uci/asteriskuci

index 6f08dffd64a384a12be86124b36bb7fe3419f338..4de95a7fc6dc0630a6cfb81dd07fb397e38da478 100755 (executable)
@@ -76,7 +76,10 @@ check_checksum() {
 # Add config module to initialise list
 ast_add_conf() append asterisk_conf_list $1 " "
 # Add module to initialise list
-ast_add_module() append asterisk_module_list $1 " "
+ast_add_module() {
+       append asterisk_module_list $1 " "
+       eval "createdialplan_$1() return 0"
+}
 # Add to 'reload' list.
 ast_add_reload() append asterisk_load_list $1 " "
 
@@ -202,6 +205,11 @@ setup_asterisk() {
                        logdebug 1 "Create $i config"
                        eval "create_${i}conf"
                done
+
+               for i in ${asterisk_module_list} ; do
+                       logdebug 1 "Create Dialplan for module $i"
+                       eval "createdialplan_${i}"
+               done
                create_dialplanconf
                create_moduleconf