diff options
Diffstat (limited to 'contrib/package/asterisk-xip/files/uci/featureconf')
-rwxr-xr-x | contrib/package/asterisk-xip/files/uci/featureconf | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/contrib/package/asterisk-xip/files/uci/featureconf b/contrib/package/asterisk-xip/files/uci/featureconf new file mode 100755 index 000000000..e336570ef --- /dev/null +++ b/contrib/package/asterisk-xip/files/uci/featureconf @@ -0,0 +1,99 @@ +#!/bin/sh + +# Feature.conf +ast_add_conf feature +init_featureconf(){ + ast_add_reload feature + ast_enable_type feature + ast_enable_type featurepark + ast_enable_type featuremap + + feature_park_parkenabled=no + feature_park_parkext=700 + feature_park_parkpos="701-720" + feature_park_context=parkedcalls + feature_park_parkingtime=45 + feature_park_courtesytone=beep + feature_park_parkedplay=caller + feature_park_adsipark=yes + feature_park_findslot=first + feature_park_parkedmusicclass=default + feature_park_transferdigittimeout=3 + feature_park_xfersound=beep + feature_park_xferfailsound=beeperr + feature_park_pickupexten="*8" + feature_park_featuredigittimeout=500 + feature_park_atxfernoanswertimeout=15 +} + +feature_park_list="parkext parkpos context parkingtime \ +courtesytone parkedplay adsipark findslot parkedmusicclass \ +transferdigittimeout xfersound xferfailsound pickupexten \ +featuredigittimeout atxfernoanswertimeout" +feature_map_list="blindxfer disconnect automon atxfer parkcall" + +valid_features(){ + case $1 in + park) is_in_list $2 ${feature_park_list} parkenabled ; return $? ;; + map) is_in_list $2 ${feature_map_list} ; return $? ;; + *) return 1;; + esac +} + +create_featureconf(){ + file=${DEST_DIR}/features.conf + get_checksum feature_conf $file + + local isempty=1 + if [ $feature_park_parkenabled == no ] ; then + rm -f $file + isempty=2 + else + enable_module res_features + echo "${asteriskuci_gen}${N}[general]" > $file + for i in ${feature_park_list} ; do + eval value="\"\${feature_park_$i}\"" + [ ! -z "$value" ] && echo "$i=$value" >> $file + done + echo "${N}[featuremap]" >> $file + for i in ${feature_map_list} ; do + eval value="\"\${feature_map_$i}\"" + [ ! -z "$value" ] && echo "$i=$value" >> $file + done + fi + check_checksum "$feature_conf" "$file" || ast_feature_restart=$isempty + +} +handle_featurepark() { + handle_feature park +} +handle_featuremap() { + handle_feature map +} + +handle_feature() { + feature_type=$1 + option_cb() { + if valid_features ${feature_type} $1 $2 ; then + eval "feature_${feature_type}_$1=\"$2\"" + else + logerror "Invalid feature: $1" + fi + } +} + +append_dialplan_park(){ + local file=$1 + # Check for parked calls - add into available extensions + if [ ${feature_park_parkenabled} == yes ] && [ ! -z ${feature_park_context} ] ; then + add_dialplan_include extensions ${feature_park_context} + enable_module app_parkandannounce + enable_format gsm + fi +} + + +reload_feature() astcmd "module reload res_features.so" +unload_feature() astcmd "module unload res_features.so" + +# vim: ts=2 sw=2 noet foldmethod=indent |