Commit e1e5fa85 authored by Wenpeng Song's avatar Wenpeng Song Committed by Yalu Zhang
Browse files

asterisk: fix warning log messages

Replace obsolete macros with new ones and disable those unused and non-supported features.
parent 541542f7
......@@ -501,7 +501,7 @@ AST_CFG_FILES:= \
users.conf res_config_sqlite3.conf
AST_EMB_MODULES:=\
app_dial app_echo app_macro app_playback \
app_dial app_echo app_stack app_playback \
func_callerid func_logic func_strings func_timeout \
pbx_config res_crypto res_timing_timerfd
......
;
; --- Call Completion Supplementary Services ---
;
; For more information about CCSS, see the CCSS user documentation
; https://wiki.asterisk.org/wiki/display/AST/Call+Completion+Supplementary+Services+(CCSS)
;
[general]
; The cc_max_requests option is a global limit on the number of
; CC requests that may be in the Asterisk system at any time.
;
cc_max_requests = 20
;
; The cc_STATE_devstate variables listed below can be used to change the
; default mapping of the internal state machine tracking the state of
; call completion to an Asterisk Device State value. The acceptable values
; that can be provided are as follows, with a description of what the
; equivalent device BLF that this maps to:
;
; UNKNOWN ; Device is valid but channel didn't know state
; NOT_INUSE ; Device is not used
; INUSE ; Device is in use
; BUSY ; Device is busy
; INVALID ; Device is invalid
; UNAVAILABLE ; Device is unavailable
; RINGING ; Device is ringing
; RINGINUSE ; Device is ringing *and* in use
; ONHOLD ; Device is on hold
;
; These states are used to generate DEVICE_STATE information that can be
; included with Asterisk hints for phones to subscribe to the state information
; or dialplan to check the state using the EXTENSION_STATE() function or
; the DEVICE_STATE() function.
;
; The states are in the format of: "ccss:TECH/ID" so an example of device
; SIP/3000 making a CallCompletionRequest() could be checked by looking at
; DEVICE_STATE(ccss:SIP/3000) or an Asterisk Hint could be generated such as
;
; [hint-context]
; exten => *843000,hint,ccss:SIP/3000
;
; and then accessed with EXTENSION_STATE(*843000@hint-context)
; or subscribed to with a BLF button on a phone.
;
; The available state mapping and default values are:
;
cc_available_devstate = NOT_INUSE
cc_offered_devstate = NOT_INUSE
cc_caller_requested_devstate = NOT_INUSE
cc_active_devstate = INUSE
cc_callee_ready_devstate = INUSE
cc_caller_busy_devstate = ONHOLD
cc_recalling_devstate = RINGING
cc_complete_devstate = NOT_INUSE
cc_failed_devstate = NOT_INUSE
exten => |EXTEN|,1,Dial(TELCHAN/|LINE|,|TIMEOUT|,gF(hangup,h,2))
exten => |EXTEN|,n,GotoIf($["${DIALSTATUS}"="ANSWER"]?endcall)
exten => |EXTEN|,n,|VOICEMAIL|
exten => |EXTEN|,n(endcall),Macro(endcall,TELCHAN,|LINE|,|EXTEN|,${CHANNEL(name)},|MAX_RETRIES|,|RETRYTIME|,|WAITTIME|,|CBBS_KEY|,|CONGESTIONTONE|)
exten => |EXTEN|,n(endcall),GoSub(sub-endcall,s,1(TELCHAN,|LINE|,|EXTEN|,${CHANNEL(name)},|MAX_RETRIES|,|RETRYTIME|,|WAITTIME|,|CBBS_KEY|,|CONGESTIONTONE|))
exten => |EXTEN|,n,Goto(hangup,h,2)
exten => |EXTEN|,n,Hangup()
......@@ -9,7 +9,7 @@
; - Control will be handed back to normal call handler at the end of this
; macro unless the call is ended with Hangup() or similar.
;------------------------------------------------------------------------------
[macro-custom-outgoing]
[sub-custom-outgoing]
;Example macro, will playback monkeys if calling extension 1234
exten => s,1, GotoIf($["${DIAL_EXTEN}" = "1234"]?monkeys:continue)
exten => s,n(monkeys), Playback(tt-monkeys)
......@@ -28,7 +28,7 @@ exten => s,n(continue), NoOp(Continue with normal outgoing call to ${DIAL_EXTEN}
; - Control will be handed back to normal call handler at the end of this
; macro unless the call is ended with Hangup() or similar.
;------------------------------------------------------------------------------
[macro-custom-incoming]
[sub-custom-incoming]
; Example macro, will play a beep before continuing normal call procedure
exten => s,1,Answer()
exten => s,n,NoOp(Custom handling for incoming call to extension ${MACRO_EXTEN})
......@@ -38,7 +38,7 @@ exten => s,n,Playback(beep)
; Allows customized actions when other party hangs up, for example
; playing a beep or busy tone to indicate that call is ended.
;------------------------------------------------------------------------------
[macro-custom-hangup]
[sub-custom-hangup]
exten => s,1,Hangup()
; Manage Call Forwarding on busy/no answer/immediate in asterisk.
......@@ -47,7 +47,7 @@ exten => s,1,Hangup()
; Macros to place incoming calls according to the forwarding settings.
;
[macro-create_cfim]
[sub-create_cfim]
;
; ${ARG1} - Associated SIP peer
;
......@@ -56,7 +56,7 @@ exten => s,n, Set(DB(CFIM/${ARG1})=${input})
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-delete_cfim]
[sub-delete_cfim]
;
; ${ARG1} - Associated SIP peer
;
......@@ -65,7 +65,7 @@ exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-create_cfbs]
[sub-create_cfbs]
;
; ${ARG1} - Associated SIP peer
;
......@@ -74,7 +74,7 @@ exten => s,n, Set(DB(CFBS/${ARG1})=${input})
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-delete_cfbs]
[sub-delete_cfbs]
;
; ${ARG1} - Associated SIP peer
;
......@@ -83,7 +83,7 @@ exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-create_cfb]
[sub-create_cfb]
;
; ${ARG1} - Associated SIP peer
;
......@@ -92,7 +92,7 @@ exten => s,n, Set(DB(CFB/${ARG1})=${input})
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-delete_cfb]
[sub-delete_cfb]
;
; ${ARG1} - Associated SIP peer
;
......@@ -101,7 +101,7 @@ exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-create_cw]
[sub-create_cw]
;
; ${ARG1} - Associated SIP peer
;
......@@ -110,7 +110,7 @@ exten => s,n, System(asterisk -rx 'telephony reload')
|TONE_ON|
exten => s,n, Hangup()
[macro-delete_cw]
[sub-delete_cw]
;
; ${ARG1} - Associated SIP peer
;
......@@ -119,7 +119,7 @@ exten => s,n, System(asterisk -rx 'telephony reload')
|TONE_OFF|
exten => s,n, Hangup()
[macro-status_cw]
[sub-status_cw]
;
; ${ARG1} - Associated SIP peer
;
......@@ -128,13 +128,13 @@ exten => s,n, GotoIf(${result}?cwon:cwoff)
;If call waiting on play beep and hang up
exten => s,n(cwon), Playback(|CW_ON_TONE|)
exten => s,n, Hangup()
exten => s,n, MacroExit()
exten => s,n, Return()
;If call waiting off play two beep and hang up
exten => s,n(cwoff), Playback(|CW_OFF_TONE|)
exten => s,n, Hangup()
exten => s,n, MacroExit()
exten => s,n, Return()
[macro-create_dnd]
[sub-create_dnd]
;
; ${ARG1} - Associated SIP peer
;
......@@ -143,7 +143,7 @@ exten => s,n, System(asterisk -rx 'telephony reload')
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-delete_dnd]
[sub-delete_dnd]
;
; ${ARG1} - Associated SIP peer
;
......@@ -153,7 +153,7 @@ exten => s,n, Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
[macro-status_dnd]
[sub-status_dnd]
;
; ${ARG1} - Associated SIP peer
;
......@@ -162,44 +162,46 @@ exten => s,n, GotoIf(${result}?dndon:dndoff)
;If call waiting on play beep and hang up
exten => s,n(dndon), Playback(beep)
exten => s,n, Hangup()
exten => s,n, MacroExit()
exten => s,n, Return()
;If call waiting off play two beep and hang up
exten => s,n(dndoff), Playback(beep)
exten => s,n, Playback(beep)
exten => s,n, Hangup()
exten => s,n, MacroExit()
exten => s,n, Return()
[macro-call_return]
[sub-call_return]
;
; Return call to last incoming caller
; ${ARG1} - Associated SIP peer
; ${ARG2} - LastCaller number
;
exten => s,1, Set(num=${DB(LASTCALLER/${ARG1})})
exten => s,1, Set(num=${ARG2})
exten => s,n, GotoIf(${num}?:nonumber)
exten => s,n, GotoIf($["${num}" = "anonymous"]?nonumber)
exten => s,n, SayDigits(${num})
exten => s,n, Set(DIAL_EXTEN=${num})
exten => s,n, Goto(${ARG1}-outgoing, ${num})
exten => s,n, Goto(${ARG1}-outgoing,${num},1)
exten => s,n, Hangup()
;If no number was found to dial, play beep and hang up
exten => s,n(nonumber), Playback(beep)
exten => s,n, Hangup()
[macro-redial]
[sub-redial]
;
; Redial last dialled number
; ${ARG1} - Associated SIP peer
; ${ARG2} - LastCall number
;
exten => s,1, Set(num=${DB(LASTCALL/${ARG1})})
exten => s,1, Set(num=${ARG2})
exten => s,n, GotoIf(${num}?:nonumber)
exten => s,n, Set(DIAL_EXTEN=${num})
exten => s,n, Goto(${ARG1}-outgoing, ${num})
exten => s,n, Goto(${ARG1}-outgoing,${num},1)
exten => s,n, Hangup()
;If no number was found to dial, play beep and hang up
exten => s,n(nonumber), Playback(beep)
exten => s,n, Hangup()
[macro-endcall]
[sub-endcall]
;
; Called after dialling out, in order to take appropriate action
; depending on the result of the call.
......@@ -219,6 +221,9 @@ exten => s,n, Hangup()
; ${ARG9} - Tone to play on congestion
;
exten => s,1, Goto(s-${DIALSTATUS},1)
exten => s-ANSWER,1, Hangup()
exten => s-NOANSWER,1, Hangup()
exten => s-CANCEL,1, Hangup()
exten => s,n, Hangup()
;handle busy (with CBBS support)
......@@ -241,10 +246,10 @@ exten => s-CHANUNAVAIL,n, Wait(5)
exten => s-CHANUNAVAIL,n, Congestion()
exten => s-CHANUNAVAIL,n, Hangup()
[macro-callhandler]
[sub-callhandler]
;
; ${ARG1} - Calling sip peer
;
; ${ARG2} - extension
; Load Call Forwarding settings
exten => s,1, Set(linecfim=${DB(CFIM/${ARG1})})
......@@ -253,13 +258,13 @@ exten => s,1, Set(linecfim=${DB(CFIM/${ARG1})})
exten => s,n, GotoIf(${linecfim}?call_cfim)
;Call line normally, by going to call_line context
exten => s,n, Goto(call_line,${MACRO_EXTEN},1)
exten => s,n, Goto(call_line,${ARG2},1)
;Call CFIM number
exten => s,n(call_cfim), Dial(PJSIP/${linecfim}@${ARG1},)
exten => s,n, Hangup()
[macro-callhandler-noanswer]
[sub-callhandler-noanswer]
;
; ${ARG1} - Calling sip peer
;
......@@ -269,7 +274,7 @@ exten => s,1, Set(linecfbs=${DB(CFBS/${ARG1})})
exten => s,n, Set(linecfb=${DB(CFB/${ARG1})})
exten => s,n, GotoIf(${linecfbs}?call_cfbs)
exten => s,n, GotoIf(${linecfb}?call_cfb)
exten => s,n, MacroExit()
exten => s,n, Return()
;Call CFBS
exten => s,n(call_cfbs), Dial(PJSIP/${linecfbs}@${ARG1})
......@@ -277,14 +282,14 @@ exten => s,n(call_cfbs), Dial(PJSIP/${linecfbs}@${ARG1})
;Call CFB
exten => s,n(call_cfb), Dial(PJSIP/${linecfb}@${ARG1})
[macro-callhandler-incoming-blocked]
[sub-callhandler-incoming-blocked]
;
; ${ARG1} - Extension
;
exten => s,1, Congestion(10)
exten => s,n, Hangup()
[macro-callhandler-outgoing-blocked]
[sub-callhandler-outgoing-blocked]
;
; ${ARG1} - Extension
;
......
......@@ -32,7 +32,7 @@ exten => _[*#0-9].,n, Set(DB(LASTCALL/|PROVIDER|)=${DIAL_EXTEN})
exten => _[*#0-9].,n, Set(CALLERID(name)=|DISPLAYNAME|)
exten => _[*#0-9].,n, Set(__TRANSFER_CONTEXT=|PROVIDER|-transfer)
exten => _[*#0-9].,n, Dial(PJSIP/${DIAL_EXTEN}@|PROVIDER|,,gT)
exten => _[*#0-9].,n, Macro(endcall,PJSIP,|PROVIDER|,${DIAL_EXTEN},${CHANNEL(name)},|MAX_RETRIES|,|RETRYTIME|,|WAITTIME|,|CBBS_KEY|,|CONGESTIONTONE|)
exten => _[*#0-9].,n, GoSub(sub-endcall,s,1(PJSIP,|PROVIDER|,${DIAL_EXTEN},${CHANNEL(name)},|MAX_RETRIES|,|RETRYTIME|,|WAITTIME|,|CBBS_KEY|,|CONGESTIONTONE|))
exten => _[*#0-9].,n, Goto(hangup,h,2)
exten => _[*#0-9].,n, Hangup()
......@@ -62,4 +62,6 @@ noload => res_pjsip_acl.so
noload => app_echo.so
noload => res_pjsip_exten_state.so
noload => cdr_syslog.so
;noload => app_macro.so
load => app_stack.so
;
......@@ -3,4 +3,4 @@
[default]
mode=files
directory=/usr/lib/asterisk/moh
random=yes
sort=random
......@@ -11,7 +11,7 @@ use_callerid_contact = yes
[system]
type = system
timer_t1 = 500
timer_b = 16000
timer_b = 32000
[transport-udp]
type = transport
......
......@@ -5,7 +5,7 @@
[general]
; Formats for writing Voicemail. Note that when using IMAP storage for
; voicemail, only the first format specified will be used.
format=wav49|gsm|wav
format=gsm
; Maximum number of messages per folder. If not specified, a default value
; (100) is used. Maximum value for this option is 9999. If set to 0, a
; mailbox will be greetings-only.
......
......@@ -114,6 +114,7 @@ config tel_advanced 'tel_options'
option jb_impl 'adaptive'
option dial_out_timeout '4000'
option echo_cancel '1'
option maxsessionsperline '2'
config calling_features 'set1'
option caller_id_enable '1'
......
......@@ -479,11 +479,11 @@ configure_ivr() {
opening_hours_profile_macro="NoOp()"
if [ -n "$opening_hours_profile" -a "x$opening_hours_profile" != "x-" ] ; then
opening_hours_profile_macro="Macro(check-$opening_hours_profile)"
opening_hours_profile_macro="GoSub(sub-check-$opening_hours_profile,s,1)"
fi
echo "[macro-$1]" >> $WORK_DIR/macros
echo "exten => $extension,1,Macro($1)" >> $WORK_DIR/extensions_local
echo "[sub-$1]" >> $WORK_DIR/macros
echo "exten => $extension,1,GoSub(sub-$1,s,1)" >> $WORK_DIR/extensions_local
echo "exten => $extension,n,Hangup()" >> $WORK_DIR/extensions_local
tmp=$(mktemp)
......@@ -533,7 +533,7 @@ configure_ivr() {
cat $tmp >> $WORK_DIR/macros
echo "exten => s,n,Goto(intro)" >> $WORK_DIR/macros
fi
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
echo "exten => s,n(closed),NoOp()" >> $WORK_DIR/macros
# check for mailbox
......@@ -563,7 +563,7 @@ configure_queue() {
continue
fi
echo "exten => $extension,1,Macro($1)" >> $WORK_DIR/extensions_local
echo "exten => $extension,1,GoSub(sub-$1,s,1)" >> $WORK_DIR/extensions_local
echo "exten => $extension,n,Hangup()" >> $WORK_DIR/extensions_local
cp "$TEMPLATE_DIR/queue" "$WORK_DIR/queue"
......@@ -591,14 +591,14 @@ configure_queue() {
cat $WORK_DIR/queue >> $WORK_DIR/queues.conf
echo "[macro-$1]" >> $WORK_DIR/macros
echo "[sub-$1]" >> $WORK_DIR/macros
echo "exten => s,1,Answer()" >> $WORK_DIR/macros
# Workaround to fix no ringback issue for incoming SIP calls
echo "exten => s,n,Playback(silence/1)" >> $WORK_DIR/macros
echo "exten => s,n,Queue($1,R)" >> $WORK_DIR/macros
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
echo "" >> $WORK_DIR/macros
}
......@@ -638,18 +638,18 @@ configure_call_filter_helper() {
return
fi
echo "[macro-$1-$direction]" >> $WORK_DIR/macros
echo "[sub-$1-$direction]" >> $WORK_DIR/macros
echo "exten => s,1,NoOp()" >> $WORK_DIR/macros
# Do nothing if blocking of outgoing calls is disabled
if [ "x$direction" == "xoutgoing" -a "x$block_outgoing" != "x1" ] ; then
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
return
fi
# Do nothing if blocking of incoming calls is disabled
if [ "x$direction" == "xincoming" -a "x$block_incoming" != "x1" ] ; then
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
return
fi
......@@ -679,12 +679,12 @@ configure_call_filter_helper() {
fi
done
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
if [ "x$direction" == "xincoming" ] ; then
cmd="Macro(callhandler-incoming-blocked,\${CALLERID(num)})"
cmd="GoSub(sub-callhandler-incoming-blocked,s,1(\${CALLERID(num)}))"
echo "exten => s,n(block),$cmd" >> $WORK_DIR/macros
else
cmd="Macro(callhandler-outgoing-blocked,\${DIAL_EXTEN})"
cmd="GoSub(sub-callhandler-outgoing-blocked,s,1(\${DIAL_EXTEN}))"
echo "exten => s,n(block),$cmd" >> $WORK_DIR/macros
fi
}
......@@ -701,13 +701,13 @@ get_call_filter() {
local call_filter enabled
config_get call_filter $provider call_filter "call_filter0"
if ! [ -z "$call_filter" -o "$call_filter" == "-" ] ; then
macro="Macro($call_filter-$direction)"
macro="GoSub(sub-$call_filter-$direction,s,1)"
fi
echo $macro
}
configure_opening_hours_profile() {
echo "[macro-check-$1]" >> $WORK_DIR/macros
echo "[sub-check-$1]" >> $WORK_DIR/macros
echo "exten => s,1,NoOp()" >> $WORK_DIR/macros
local invert label
config_get invert $1 invert
......@@ -739,7 +739,7 @@ configure_opening_hours_profile() {
echo "exten => s,n,Goto(closed)" >> $WORK_DIR/macros
fi
echo "exten => s,n(open),Set(OPEN=1)" >> $WORK_DIR/macros
echo "exten => s,n,MacroExit()" >> $WORK_DIR/macros
echo "exten => s,n,Return()" >> $WORK_DIR/macros
echo "exten => s,n(closed),Set(OPEN=0)" >> $WORK_DIR/macros
echo "" >> $WORK_DIR/macros
}
......@@ -764,13 +764,13 @@ configure_extensions() {
if [ -z "$custom_incoming_enabled" -o "$custom_incoming_enabled" = "0" ] ; then
sed -i "s/|CUSTOM_INCOMING|/NoOp()/" $WORK_DIR/extensions.conf
else
sed -i "s/|CUSTOM_INCOMING|/Macro(custom-incoming)/" $WORK_DIR/extensions.conf
sed -i "s/|CUSTOM_INCOMING|/GoSub(sub-custom-incoming,s,1)/" $WORK_DIR/extensions.conf
fi
if [ -z "$custom_hangup_enabled" -o "$custom_hangup_enabled" = "0" ] ; then
sed -i "s/|CUSTOM_HANGUP|/Playback(beep)/" $WORK_DIR/extensions.conf
else
sed -i "s/|CUSTOM_HANGUP|/Macro(custom-hangup)/" $WORK_DIR/extensions.conf
sed -i "s/|CUSTOM_HANGUP|/GoSub(sub-custom-hangup,s,1)/" $WORK_DIR/extensions.conf
fi
if [ -z "$howler_timeout" ] ; then
......@@ -879,7 +879,7 @@ configure_extensions_provider() {
if [ -z "$custom_outgoing" -o "$custom_outgoing" = "0" ] ; then
custom_outgoing="NoOp()"
else
custom_outgoing="Macro(custom-outgoing)"
custom_outgoing="GoSub(sub-custom-outgoing,s,1)"
fi
# check call filters for outgoing calls
......@@ -974,7 +974,7 @@ configure_extensions_provider() {
echo "exten => $user,n,GotoIf($[\"\${DIALSTATUS}\"=\"ANSWER\"]?endcall)" >> $tmp
echo "exten => $user,n,GotoIf($[\"\${DIALSTATUS}\"=\"BUSY\"]?noanswer)" >> $tmp
echo "exten => $user,n,GotoIf($[\"\${DIALSTATUS}\"=\"NOANSWER\"]?noanswer:endcall)" >> $tmp
echo "exten => $user,n(noanswer),Macro(callhandler-noanswer,\${CHANNEL(endpoint)})" >> $tmp
echo "exten => $user,n(noanswer),GoSub(sub-callhandler-noanswer,s,1(\${CHANNEL(endpoint)}))" >> $tmp
#configure incomingmap details are present to set line
config_foreach configure_incomingmap incoming_map $1
......@@ -988,9 +988,9 @@ configure_extensions_provider() {
config_foreach configure_voicemail_incoming line $boxnumber $1
if ! [ -z "$call_queue" ] ; then
echo "exten => $user,n,Macro($call_queue)" >> $tmp
echo "exten => $user,n,GoSub(sub-$call_queue,s,1)" >> $tmp
elif ! [ -z "$call_ivr" ] ; then
echo "exten => $user,n,Macro($call_ivr)" >> $tmp
echo "exten => $user,n,GoSub(sub-$call_ivr,s,1)" >> $tmp
fi
echo "exten => $user,n(endcall),Hangup()" >> $tmp
......@@ -1176,41 +1176,45 @@ configure_feature_set(){
tmp=$(mktemp)
if [ -n "$internal_service" -a "$internal_service" = "1" ] ; then
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_on_busy' $WORK_DIR/extensions.conf
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_unconditional' $WORK_DIR/extensions.conf
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_on_no_answer' $WORK_DIR/extensions.conf
sed -i '/\['$provider'\]/a include => '$provider'-do_not_disturb' $WORK_DIR/extensions.conf
# Configure call forwarding if enabled
if [ -n "$call_forward_unconditional" -a "$call_forward_unconditional" = "1" ] ; then
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_unconditional' $WORK_DIR/extensions.conf
echo "[$provider-call_forward_unconditional]" >> $tmp
echo "exten => $cfim_off,1, Macro(delete_cfim,$provider)" >> $tmp
echo "exten => $cfim_off,1, GoSub(sub-delete_cfim,s,1($provider))" >> $tmp
echo "" >> $tmp
fi
if [ -n "$call_forward_on_busy" -a "$call_forward_on_busy" = "1" ] ; then
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_on_busy' $WORK_DIR/extensions.conf
echo "[$provider-call_forward_on_busy]" >> $tmp
echo "exten => $cfb_off,1, Macro(delete_cfb,$provider)" >> $tmp
echo "exten => $cfb_off,1, GoSub(sub-delete_cfb,s,1($provider))" >> $tmp
echo "" >> $tmp
fi
if [ -n "$call_forward_on_no_answer" -a "$call_forward_on_no_answer" = "1" ] ; then
sed -i '/\['$provider'\]/a include => '$provider'-call_forward_on_no_answer' $WORK_DIR/extensions.conf
echo "[$provider-call_forward_on_no_answer]" >> $tmp
echo "exten => $cfbs_off,1, Macro(delete_cfbs,$provider)" >> $tmp
echo "exten => $cfbs_off,1, GoSub(sub-delete_cfbs,s,1($provider))" >> $tmp
fi
# Configure call return if enabled
if [ -n "$callreturn_enabled" -a "$callreturn_enabled" = "1" ] ; then
echo "exten => $call_return,1, Macro(call_return,$provider)" >> $tmp
sed -i '/\['$provider'\]/a include => '$provider'-call_return' $WORK_DIR/extensions.conf
echo "[$provider-call_return]" >> $tmp
echo "exten => $call_return,1, GoSub(sub-call_return,s,1($provider,\${DB(LASTCALLER/$provider)}))" >> $tmp
fi
# Configure redial if enabled
if [ -n "$redial_enabled" -a "$redial_enabled" = "1" ] ; then
echo "exten => $redial,1, Macro(redial,$provider)" >> $tmp
sed -i '/\['$provider'\]/a include => '$provider'-call_redial' $WORK_DIR/extensions.conf
echo "[$provider-call_redial]" >> $tmp
echo "exten => $redial,1, GoSub(sub-redial,s,1($provider,\${DB(LASTCALL/$provider)}))" >> $tmp
fi
echo "" >> $tmp
fi
if [ -n "$internal_service" -a "$internal_service" = "1" -a \( -n "$call_forward_unconditional" -a "$call_forward_unconditional" = "1" \) ] ; then
sed -i "s/|INCOMING_HANDLER|/Macro(callhandler,\${CHANNEL(endpoint)})/" $WORK_DIR/extensions.conf
sed -i "s/|INCOMING_HANDLER|/GoSub(sub-callhandler,s,1(\${CHANNEL(endpoint)},\${EXTEN}))/" $WORK_DIR/extensions.conf
else
sed -i "s/|INCOMING_HANDLER|/Goto(call_line,\${EXTEN},1)/" $WORK_DIR/extensions.conf
fi
......@@ -1234,17 +1238,17 @@ configure_feature_set(){
if [ -n "$featureset" ]; then
# Configure call waiting
echo "[$provider-callwaiting]" >> $tmp
echo "exten => $cw_off,1, Macro(delete_cw,$provider)" >> $tmp
echo "exten => ${cw_on},1, Macro(create_cw,$provider)" >> $tmp