Commit 5b5178ba authored by Hemlata's avatar Hemlata Committed by Yalu Zhang
Browse files

asterisk: restructure of UCI config for more TR-104 compliant

- Restructure of UCI sections as per TR-104
- Renaming of UCI options for more TR-104 compliant and consistent
- Some corrections
parent 28571d81
......@@ -13,7 +13,7 @@ PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_VERSION:=57662a871e3b9c0df4ff6ec806663eace12f6400
PKG_SOURCE_VERSION:=00686d93e7793ae83751b402e4d3952679709035
PKG_SOURCE:=asterisk-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/asterisk.git
PKG_SOURCE_PROTO:=git
......
......@@ -46,7 +46,7 @@ start_service() {
config_load $VOICE_UCI_CONFIG
# Don't start the service if it is disabled
config_get_bool enabled general enabled 0
config_get_bool enabled general enable 0
if [ $enabled -eq 0 ]; then
$msg_log "service is not enabled in /etc/config/$NAME"
exit 1
......
......@@ -12,7 +12,10 @@ context_direct=|CONTEXT|-direct
dialtone_extension_hint_context=|LINE_NAME|_dialtone
dialtone_extension_hint=|DIALTONE_EXTENSION_HINT|
callwaiting=|CALLWAITING|
clir=|CLIR|
anonymouscallenable=|ANONYMOUSCALLENABLE|
calleridenable=|CALLERIDENABLE|
calleridnameenable=|CALLERNAMEENABLE|
dtmfrelay=|DTMFRELAY|
do_not_disturb=|DO_NOT_DISTURB|
;|ALLOW|
config asterisk 'general'
option enabled '1'
option enable '1'
option log_stderr '1'
option log_stdout '1'
option options ''
config tel_line 'telline0'
option enabled '1'
option extension '0000'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option sip_account 'sip0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline1'
option enabled '1'
option extension '1111'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option sip_account 'sip0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline2'
option enabled '1'
option extension '2222'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline3'
option enabled '1'
option extension '3333'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline4'
option enabled '1'
option extension '4444'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline5'
option enabled '1'
option extension '5555'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline6'
option enabled '1'
option extension '6666'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config tel_line 'telline7'
option enabled '1'
option extension '7777'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
config line 'line0'
option enable '1'
option provider 'sip0'
option calling_features 'set1'
config extension 'extension0'
option enable '1'
option extension_number '0000'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config extension 'extension1'
option enable '1'
option extension_number '1111'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config extension 'extension2'
option enable '1'
option extension_number '2222'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config extension 'extension3'
option enable '1'
option extension_number '3333'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config extension 'extension4'
option enable '1'
option extension_number '4444'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config extension 'extension5'
option enable '1'
option extension_number '5555'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option provider ''
option type ''
option calling_features 'set1'
option voice_mail ''
option name ''
config dialplan 'custom_dialplan'
option custom_outgoing_enabled '0'
option custom_incoming_enabled '0'
option custom_hangup_enabled '0'
option custom_outgoing_enable '0'
option custom_incoming_enable '0'
option custom_hangup_enable '0'
option all_ports_extension '#123456'
option test_audio_extension '#123457'
option test_echo_extension '#123458'
option record_message_extension '#999999'
config sip_advanced 'sip_options'
option rtpstart '10000'
option rtpend '20000'
option dtmfmode 'rfc4733'
option remotehold 'yes'
option rtp_start '10000'
option rtp_end '20000'
option dtmf_mode 'rfc4733'
option remote_hold 'yes'
option tls_version 'sslv23'
option dnsmgr 'no'
option dnsmgr_refresh_interval '300'
option srvlookup 'yes'
option dns_mgr 'no'
option dns_mgr_refresh_interval '300'
option srv_lookup 'yes'
config tel_advanced 'tel_options'
option country 'se'
option jbenable 'yes'
option jbforce 'no'
option jbmaxsize '500'
option jbimpl 'adaptive'
option dialoutmsec '4000'
option jb_enable 'yes'
option jb_force 'no'
option jb_maxsize '500'
option jb_impl 'adaptive'
option dial_out_timeout '4000'
option echo_cancel '1'
config advanced_features 'call_features'
option cbbs_type 'internal'
option callforward_enabled '1'
option redial_enabled '1'
option callreturn_enabled '1'
option moh_passthrough '1'
option mwi_enabled '0'
option internal_service '0'
config calling_features 'set1'
option caller_id_enable '1'
option caller_name_enable '1'
option call_waiting_enable '0'
option call_forward_unconditional '1'
option call_forward_on_busy '0'
option call_forward_on_no_answer '0'
option mwi_enable '0'
option anonymous_call_enable '0'
option dnd_enable '0'
option voice_mail_enable '0'
option ccbs_enable '0'
option redial_enable '1'
option cbbs_type 'internal'
option internal_service '0'
option callreturn_enable '1'
option moh_passthrough '1'
option cbbs_key '5'
option cbbs_maxretry '5'
option cbbs_retrytime '300'
option cbbs_waittime '30'
option cfim_on '*21*'
option cfim_off '#21#'
option cfbs_on '*61*'
option cfbs_off '#61#'
option cfb_on '*67*'
option cfb_off '#67#'
option cw_on '*43#'
option cw_off '#43#'
option cw_status '*#43#'
option dnd_on '*261#'
option dnd_off '#261#'
option dnd_status '*#261#'
option call_return '*69'
option redial '*66'
config log 'log_options'
option console 'notice,warning,error'
......@@ -154,10 +160,6 @@ config log 'log_options'
config cdr 'cdr_options'
option csv_max_row '100'
config call_filter 'call_filter0'
option block_outgoing '0'
option block_incoming '0'
config codec_profile 'alaw'
option name 'G.711ALaw'
option ptime '20'
......@@ -166,36 +168,36 @@ config codec_profile 'ulaw'
option name 'G.711MuLaw'
option ptime '20'
config incoming_map 'incoming_map1'
option enable '1'
option extension 'group1'
option line 'line0'
config outgoing_map 'outgoing_map1'
option enable '1'
option extension 'group1'
option line 'line0'
config group 'group1'
list extensions ''
config call_filter 'call_filter0'
option block_foreign '0'
option block_special_rate '0'
option block_outgoing '0'
option block_incoming '0'
config sip_service_provider 'sip0'
option name 'account 1'
option enabled '0'
option enable '0'
list codecs 'alaw'
list codecs 'ulaw'
option cbbs_key '5'
option cbbs_maxretry '5'
option cbbs_retrytime '300'
option cbbs_waittime '30'
option cfim_on '*21*'
option cfim_off '#21#'
option cfbs_on '*61*'
option cfbs_off '#61#'
option cfb_on '*67*'
option cfb_off '#67#'
option cw_on '*43#'
option cw_off '#43#'
option cw_status '*#43#'
option dnd_on '*261#'
option dnd_off '#261#'
option dnd_status '*#261#'
option call_return '*69'
option redial '*66'
option is_fax '0'
option support_fax '0'
option transport 'udp'
option call_lines ''
option outbound_proxy ''
option outbound_proxy_port ''
option user ''
option domain ''
option encryption 'no'
option mediasec '0'
option dtmf_mode 'rfc4733'
option encryption 'no'
option mediasec '0'
......@@ -3,14 +3,26 @@
. /lib/voice/utils.sh
if [ $2 != '?' ]; then
for tel_line in `uci show $VOICE_UCI_CONFIG | grep telline | grep $1 | cut -d . -f 2`; do
sed -i "/\[$tel_line\]/,/^\[/ s/\(do_not_disturb=\)[0-9]/\1$2/" $ASTERISK_CONF_DIR/chan_telephony.conf
for tel_line in `uci show $VOICE_UCI_CONFIG | grep outgoing_map | grep line | cut -d "'" -f 2`; do
for provider in `uci show $VOICE_UCI_CONFIG | grep $tel_line | grep provider| cut -d "'" -f 2`;do
if [ $1 == "$provider" ]; then
mapname=`uci show $VOICE_UCI_CONFIG | grep outgoing_map | grep $tel_line | cut -d '.' -f 2`
extensionname=`uci show $VOICE_UCI_CONFIG | grep $mapname | grep extension | cut -d "'" -f 2`
sed -i "/\[$extensionname\]/,/^\[/ s/\(do_not_disturb=\)[0-9]/\1$2/" $ASTERISK_CONF_DIR/chan_telephony.conf
fi
done
done
else
for tel_line in `uci show $VOICE_UCI_CONFIG | grep telline | grep $1 | cut -d . -f 2`; do
status=`sed -n "/\[$tel_line\]/,/^\[/ s/do_not_disturb=\([0-9]\)/\1/p" $ASTERISK_CONF_DIR/chan_telephony.conf`
echo $status
exit 0
for tel_line in `uci show $VOICE_UCI_CONFIG | grep outgoing_map |grep line |cut -d "'" -f 2`;do
for provider in `uci show $VOICE_UCI_CONFIG | grep $tel_line | grep provider| cut -d "'" -f 2`;do
if [ $1 == "$provider" ]; then
mapname=`uci show $VOICE_UCI_CONFIG | grep outgoing_map | grep $tel_line | cut -d '.' -f 2`
extensionname=`uci show $VOICE_UCI_CONFIG | grep $mapname | grep extension | cut -d "'" -f 2`
status=`sed -n "/\[$extensionname\]/,/^\[/ s/do_not_disturb=\([0-9]\)/\1/p" $ASTERISK_CONF_DIR/chan_telephony.conf`
echo $status
exit 0
fi
done
done
fi
......@@ -4,7 +4,7 @@
VOICE_UCI_CONFIG=asterisk
ASTERISK_CONF_DIR=/var/etc/asterisk
LINENAME="telline"
LINENAME="extension"
CHANNELNAME="TELCHAN"
getSerial() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment