...
 
Commits (2)
......@@ -204,7 +204,7 @@ exten => s,1, Set(linecfim=${DB(CFIM/${ARG1})})
exten => s,n, GotoIf(${linecfim}?call_cfim)
; If ringing is disabled, skip calling line normally
exten => s,n, Set(shouldring=${SHELL(uci -q get asterisk.RINGING_STATUS.shouldring):0:-1})
exten => s,n, Set(shouldring=${SHELL(uci -q get asterisk.ringing_status.shouldring):0:-1})
exten => s,n, GotoIf(${shouldring}?:ringing_disabled)
;Call line normally, by going to call_line context
......
config supported_codec 'ulaw'
option name 'G.711MuLaw'
option ptime_min '10'
option ptime_max '150'
option ptime_default '20'
option ptime_increment '10'
config supported_codec 'alaw'
option name 'G.711ALaw'
option ptime_min '10'
option ptime_max '150'
option ptime_default '20'
option ptime_increment '10'
config supported_codec 'g729'
option name 'G.729a'
option ptime_min '10'
option ptime_max '230'
option ptime_default '20'
option ptime_increment '10'
config supported_codec 'g723'
option name 'G.723.1'
option ptime_min '30'
option ptime_max '300'
option ptime_default '30'
option ptime_increment '30'
config supported_codec 'g726'
option name 'G.726'
option ptime_min '10'
option ptime_max '300'
option ptime_default '20'
option ptime_increment '10'
option bitrate '32'
config supported_codec 'gsm'
option name 'GSM'
option ptime_min '10'
option ptime_max '300'
option ptime_default '20'
option ptime_increment '10'
config supported_codec 'ilbc'
option name 'iLBC'
option ptime_min '10'
option ptime_max '300'
option ptime_default '20'
option ptime_increment '10'
config tel_line 'telline0'
option extension '0000'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
option sip_account 'sip0'
......@@ -63,9 +13,9 @@ config tel_line 'telline1'
option extension '1111'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
option sip_account 'sip0'
......@@ -75,9 +25,9 @@ config tel_line 'telline2'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -86,9 +36,9 @@ config tel_line 'telline3'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -97,9 +47,9 @@ config tel_line 'telline4'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -108,9 +58,9 @@ config tel_line 'telline5'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -119,9 +69,9 @@ config tel_line 'telline6'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -130,9 +80,9 @@ config tel_line 'telline7'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain 4
option rxgain 4
option echo_cancel 1
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option callwaiting '0'
option clir '0'
......@@ -145,7 +95,7 @@ config dialplan 'custom_dialplan'
option test_echo_extension '#123458'
option record_message_extension '#999999'
config sip_advanced 'SIP'
config sip_advanced 'sip_options'
option rtpstart '10000'
option rtpend '20000'
option dtmfmode 'rfc2833'
......@@ -160,14 +110,14 @@ config sip_advanced 'SIP'
option registertimeoutguardpct '0.2'
option defaultexpiry '300'
option tls_version 'tlsv1'
option tls_cipher 'DES-CBC3-SHA'
option tls_cipher 'des-cbc3-sha'
option stun_server ''
option dnsmgr 'no'
option dnsmgr_refresh_interval '300'
option srvlookup 'yes'
config tel_advanced 'TEL'
option country 'SWE'
config tel_advanced 'tel_options'
option country 'swe'
option jbenable 'yes'
option jbforce 'no'
option jbmaxsize '500'
......@@ -177,7 +127,7 @@ config tel_advanced 'TEL'
option cw_enable 'yes'
option echo_cancel '1'
config features 'features'
config advanced_features 'call_features'
option cbbs_enabled '1'
option callforward_enabled '1'
option callwaiting_enabled '1'
......@@ -185,13 +135,13 @@ config features 'features'
option callreturn_enabled '1'
option advanced_register_settings '1'
config log 'LOG'
config log 'log_options'
option console 'notice,warning,error'
option messages 'error'
option syslog_facility 'local0'
option syslog ''
config ringing_status 'RINGING_STATUS'
config ringing 'ringing_status'
option status '0'
option enabled '0'
option shouldring '1'
......@@ -202,13 +152,11 @@ config call_filter 'call_filter0'
option block_outgoing '0'
option block_incoming '0'
config cdr_log 'CDR_LOG'
option cdr_syslog '0'
config sip_service_provider 'sip0'
option name 'Account 1'
option name 'account 1'
option enabled '0'
option codec0 'alaw'
option ptime_alaw '20'
option cbbs_key '5'
option cbbs_maxretry '5'
option cbbs_retrytime '300'
......@@ -225,4 +173,7 @@ config sip_service_provider 'sip0'
option redial '*66'
option is_fax '0'
option transport 'udp'
option call_lines ''
option user ''
option domain ''
......@@ -18,14 +18,14 @@ EOT
}
# Add ringing schedule section
uci -q get $VOICE_UCI_CONFIG.RINGING_STATUS >/dev/null || {
uci -q get $VOICE_UCI_CONFIG.ringing_status >/dev/null || {
uci -q batch <<-EOT
add $VOICE_UCI_CONFIG ringing_status
rename $VOICE_UCI_CONFIG.@ringing_status[-1]=RINGING_STATUS
set $VOICE_UCI_CONFIG.RINGING_STATUS.status=0
set $VOICE_UCI_CONFIG.RINGING_STATUS.enabled=0
set $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring=1
add $VOICE_UCI_CONFIG ringing
rename $VOICE_UCI_CONFIG.@ringing[-1]=ringing_status
set $VOICE_UCI_CONFIG.ringing_status.status=0
set $VOICE_UCI_CONFIG.ringing_status.enabled=0
set $VOICE_UCI_CONFIG.ringing_status.shouldring=1
commit $VOICE_UCI_CONFIG
EOT
......
......@@ -28,7 +28,7 @@ escape_sed_substitution() {
echo "$@" | sed -e 's/[\/&]/\\&/g'
}
# read configured codecs for a Line section
# read configured codecs for a line section
read_codecs() {
local codec_allow=""
local codec
......@@ -774,7 +774,7 @@ configure_cdr() {
# Install common macros used by call filters
configure_call_filters() {
local country cty idc cc srn
config_get country TEL country
config_get country tel_options country
# Read the International Dialing Code and the Country Code from config
while read line; do
......@@ -995,8 +995,8 @@ configure_extensions() {
config_get test_audio_extension custom_dialplan test_audio_extension
config_get test_echo_extension custom_dialplan test_echo_extension
config_get record_message_extension custom_dialplan record_message_extension
config_get callforward_enabled features callforward_enabled
config_get clir features clir
config_get callforward_enabled call_features callforward_enabled
config_get clir call_features clir
if [ -z "$custom_incoming_enabled" -o "$custom_incoming_enabled" = "0" ] ; then
sed -i "s/|CUSTOM_INCOMING|/NoOp()/" $WORK_DIR/extensions.conf
......@@ -1081,11 +1081,11 @@ configure_extensions_provider() {
local mailbox
# load general settings
config_get callforward_enabled "features" callforward_enabled
config_get cbbs_enabled "features" cbbs_enabled
config_get callwaiting_enabled "features" callwaiting_enabled
config_get callreturn_enabled "features" callreturn_enabled
config_get redial_enabled "features" redial_enabled
config_get callforward_enabled call_features callforward_enabled
config_get cbbs_enabled call_features cbbs_enabled
config_get callwaiting_enabled call_features callwaiting_enabled
config_get callreturn_enabled call_features callreturn_enabled
config_get redial_enabled call_features redial_enabled
# check if SIP Provider is disabled
config_get enabled $1 enabled
......@@ -1125,8 +1125,8 @@ configure_extensions_provider() {
# check call filters for outgoing calls
call_filter_macro=$(get_call_filter $1 outgoing)
#Set congestion tone (default to congestion)
config_get congestiontone "SIP" congestiontone
# set congestion tone (default to congestion)
config_get congestiontone sip_options congestiontone
if [ -z "$congestiontone" ] ; then
congestiontone=congestion
fi
......@@ -1313,7 +1313,7 @@ configure_tel_line_extension() {
fi
if [ -n "$extension" ] ; then
config_get cbbs_enabled "features" cbbs_enabled
config_get cbbs_enabled call_features cbbs_enabled
# load cbbs settings if enabled
cbbs_key=""
cbbs_maxretry="0"
......@@ -1393,7 +1393,7 @@ configure_sip_user_extension() {
configure_codecs() {
local genericplc
config_get genericplc TEL genericplc
config_get genericplc tel_options genericplc
sed -i "s/|PLC|/$genericplc/" $WORK_DIR/codecs.conf
}
......@@ -1410,16 +1410,16 @@ configure_tel() {
local hold_target_before_refer
local calleridtype
config_get jbenable TEL jbenable
config_get jbforce TEL jbforce
config_get jbmaxsize TEL jbmaxsize
config_get jbimpl TEL jbimpl
config_get dtmfmode SIP dtmfmode
config_get dialoutmsec TEL dialoutmsec
config_get fac TEL fac
config_get echocancel TEL echo_cancel
config_get hold_target_before_refer TEL hold_target_before_refer
config_get calleridtype TEL calleridtype
config_get jbenable tel_options jbenable
config_get jbforce tel_options jbforce
config_get jbmaxsize tel_options jbmaxsize
config_get jbimpl tel_options jbimpl
config_get dtmfmode sip_options dtmfmode
config_get dialoutmsec tel_options dialoutmsec
config_get fac tel_options fac
config_get echocancel tel_options echo_cancel
config_get hold_target_before_refer tel_options hold_target_before_refer
config_get calleridtype tel_options calleridtype
channel_fac="$channel_fac $fac"
# Convert whitespace to commas
......@@ -1661,10 +1661,10 @@ configure_logger() {
local syslog
local syslog_facility
config_get console LOG console
config_get messages LOG messages
config_get syslog LOG syslog
config_get syslog_facility LOG syslog_facility
config_get console log_options console
config_get messages log_options messages
config_get syslog log_options syslog
config_get syslog_facility log_options syslog_facility
if [ -z "$console" ] ; then
console="notice,warning,error"
......@@ -1689,7 +1689,7 @@ configure_logger() {
}
configure_indications() {
config_get country TEL country
config_get country tel_options country
country_code=$(supportedCountries | grep $country |cut -d':' -f3 | tr [A-Z] [a-z])
sed -i "s/^country=.*/country=${country_code}/g" $WORK_DIR/indications.conf
}
......@@ -1779,7 +1779,7 @@ generate_asterisk_config_files() {
config_foreach configure_sip_user_extension sip_user
# Channel
echo "Configuring TEL"
echo "Configuring tel_options"
configure_tel
echo "Configuring telephony lines"
config_foreach configure_tel_line tel_line
......
AUS;0011;61
BEL;00;32
BRA;00;55
CHL;1xx0;56
CHN;00;86
HRV;00;385
CZE;00;420
DNK;00;45
ETS;00;372
FIN;00,99x,99xx,99xxx;358
FRA;00;33
DEU;00;49
HUN;00;36
IND;00;91
ITA;00;39
JPN;010;81
NLD;00;31
NZL;00;64
USA;011;1
ESP;00;34
SWE;00;46
CHE;00;41
NOR;00;47
TWN;00x;886
GBR;00;44
ARE;00;971
aus;0011;61
bel;00;32
bra;00;55
chl;1xx0;56
chn;00;86
hrv;00;385
cze;00;420
dnk;00;45
ets;00;372
fin;00,99x,99xx,99xxx;358
fra;00;33
deu;00;49
hun;00;36
ind;00;91
ita;00;39
jpn;010;81
nld;00;31
nzl;00;64
usa;011;1
esp;00;34
swe;00;46
che;00;41
nor;00;47
twn;00x;886
gbr;00;44
are;00;971
AUS;19x+
BEL;09xx+
BRA;05xx+
CHL;
CHN;
CZE;9xx+
DNK;90xx+
ETS;
FIN;0(7[0,5]|[1-3,6]0)x+
FRA;0[8,9]xx+
DEU;0(9xx|137)x+
HUN;06-[8,9]x+
IND;
ITA;8
JPN;0990x+
NLD;09xx+
NZL;0900x+
USA;1-900x+
ESP;([8,9]0x|118)x+
SWE;90510,09(00|39|44)x+,099x+
CHE;09xx+
NOR;82x+
TWN;020[3,4,9]x+
GBR;0[8,9]xx+
ARE;[2,6]00x+
aus;19x+
bel;09xx+
bra;05xx+
chl;
chn;
cze;9xx+
dnk;90xx+
ets;
fin;0(7[0,5]|[1-3,6]0)x+
fra;0[8,9]xx+
deu;0(9xx|137)x+
hun;06-[8,9]x+
ind;
ita;8
jpn;0990x+
nld;09xx+
nzl;0900x+
usa;1-900x+
esp;([8,9]0x|118)x+
swe;90510,09(00|39|44)x+,099x+
che;09xx+
nor;82x+
twn;020[3,4,9]x+
gbr;0[8,9]xx+
are;[2,6]00x+
......@@ -26,15 +26,15 @@ getAllLines() {
}
supportedCountries() {
echo "Austria:AUT:AT"
echo "Denmark:DNK:DK"
echo "Estonia:EST:EE"
echo "Germany:DEU:DE"
echo "Netherlands:NLD:NL"
echo "Norway:NOR:NO"
echo "Spain:ESP:ES"
echo "Sweden:SWE:SE"
echo "Switzerland:CHE:CH"
echo "United Kingdom:GBR:UK"
echo "Austria:aut:at"
echo "Denmark:dnk:dk"
echo "Estonia:est:ee"
echo "Germany:deu:de"
echo "Netherlands:nld:nl"
echo "Norway:nor:no"
echo "Spain:esp:es"
echo "Sweden:swe:se"
echo "Switzerland:che:ch"
echo "United Kingdom:gbr:uk"
}
......@@ -66,7 +66,7 @@ set_ringing_schedule() {
if [ $daymatch -eq 1 -a $current_time -gt ${start/:/} -a $current_time -lt ${stop/:/} ]; then
timematch=1
uci -q set $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring="$status"
uci -q set $VOICE_UCI_CONFIG.ringing_status.shouldring="$status"
uci commit $VOICE_UCI_CONFIG
fi
......@@ -83,21 +83,21 @@ ringing_schedule() {
config_load $VOICE_UCI_CONFIG
config_get_bool schedule RINGING_STATUS enabled "0"
config_get_bool schedule ringing_status enabled "0"
if [ $schedule == "0" ]; then
uci -q set $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring="1"
uci -q set $VOICE_UCI_CONFIG.ringing_status.shouldring="1"
uci commit $VOICE_UCI_CONFIG
return
fi
config_get_bool sched_status RINGING_STATUS status "0"
config_get_bool sched_status ringing_status status "0"
config_foreach set_ringing_schedule ringing_schedule $sched_status
if [ $timematch -eq 0 ]; then
[ $sched_status == "1" ] && revstatus="0" || revstatus="1"
uci -q set $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring="$revstatus"
uci -q set $VOICE_UCI_CONFIG.ringing_status.shouldring="$revstatus"
uci commit $VOICE_UCI_CONFIG
fi
}
......@@ -105,14 +105,14 @@ ringing_schedule() {
ringing_onoff() {
local status="$1"
[ "$status" == "on" ] && status="1" || status="0"
local cursta="$(uci -q get $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring)"
local cursta="$(uci -q get $VOICE_UCI_CONFIG.ringing_status.shouldring)"
cursta="${cursta:-1}"
if [ "$status" == "$cursta" ]; then
return
fi
uci -q set $VOICE_UCI_CONFIG.RINGING_STATUS.shouldring="$status"
uci -q set $VOICE_UCI_CONFIG.ringing_status.shouldring="$status"
uci commit $VOICE_UCI_CONFIG
/etc/init.d/asterisk reload
......