[zap-theritegroup]
exten => s,1,GotoIfTime(8:00-17:00|mon-fri|*|*?theritegroupbusinesshours,s,1)
exten => s,n,Goto(theritegroupafterhours,s,1)
[theritegroupbusinesshours]
exten => s,1,Answer
exten => s,n,System(cp /etc/asterisk/intercom.call /etc/asterisk/intercom.outgoing)
exten => s,n,System(mv /etc/asterisk/intercom.outgoing /var/spool/asterisk/outgoing)
exten => s,n,Playback(pbx-transfer)
exten => s,n,Hangup
[theritegrouafterhours]
exten => s,1,Answer
exten => s,n,Background(3000)
exten => s,n,Hangup
+++++++++++++++++++++++=
#
# This is a sample file that can be dumped in /var/spool/asterisk/outgoing
# to generate a call.
#
# Comments are indicated by a '#' character that begins a line, or follows
# a space or tab character. To be consistent with the configuration files
# in Asterisk, comments can also be indicated by a semicolon. However, the
# multiline comments (;-- --;) used in Asterisk configuration files are not
# supported. Semicolons can be escaped by a backslash.
#
# Obviously, you MUST specify at least a channel in the same format as you
# would for the "Dial" application. Only one channel name is permitted.
#
Channel: Local/1
#
# You may also specify a wait time (default is 45 seconds) for how long to
# wait for the channel to be answered, a retry time (default is 5 mins)
# for how soon to retry this call, and a maximum number of retries (default
# is 0) for how many times to retry this call.
#
MaxRetries: 2
RetryTime: 60
WaitTime: 30
#
# Once the call is answered, you must provide either an application/data
# combination, or a context/extension/priority in which to start the PBX.
#
Context: [intercomincomingcall]
Extension: s
Priority: 1
#
# Alternatively you can specify just an application
# and its arguments to be run, instead of a context
# extension and priority
#
#Application: VoiceMailMain
#Data: 1234
#
# You can set the callerid that will be used for the outgoing call
#
Callerid: ATTENTION
#
# An account code can be specified the following way:
#
#Account: mysuperfunaccountcode
#
# Normally, a call file is always deleted after the call is successful
# or the maximum number of tries is reached even if the modification
# time of the call file was changed during the call to be in the
# future. By Setting AlwaysDelete to No the modification time of the
# call file will be checked after the call is completed or the maximum
# number of retries is reached. If the modification time is in the
# future, the call file will not be deleted.
#
AlwaysDelete: Yes
#
# You can set channel variables that will be passed to the channel.
# This includes writable dialplan functions. To set a writable dialplan
# function, the module containing this function *must* be loaded.
#
#Set: file1=/tmp/to
#Set: file2=/tmp/msg
#Set: timestamp=20021023104500
#Set: CDR(userfield|r)=42
#
# Setting Archive to yes the call file is never deleted, but is moved
# in the subdir "outgoing_done" of the spool directory. In this case
# will be appended a line with "Status: value", where value can be
# Completed, Expired or Failed.
#
#Archive: yes
+++++++++++++++=
*CLI> -- Executing [800@downstairs:1] Goto("SIP/110-081dca30", "zap-theritegroup|s|1]") in new stack
-- Goto (zap-theritegroup,s,1)
-- Executing [s@zap-theritegroup:1] GotoIfTime("SIP/110-081dca30", "8:00-17:00|mon-fri|*|*?theritegroupbusinesshours|s|1") in new stack
-- Goto (theritegroupbusinesshours,s,1)
-- Executing [s@theritegroupbusinesshours:1] Answer("SIP/110-081dca30", "") in new stack
-- Executing [s@theritegroupbusinesshours:2] System("SIP/110-081dca30", "cp /etc/asterisk/intercom.call /etc/asterisk/intercom.outgoing") in new stack
-- Executing [s@theritegroupbusinesshours:3] System("SIP/110-081dca30", "mv /etc/asterisk/intercom.outgoing /var/spool/asterisk/outgoing") in new stack
-- Executing [s@theritegroupbusinesshours:4] Playback("SIP/110-081dca30", "pbx-transfer") in new stack
-- <SIP/110-081dca30> Playing 'pbx-transfer' (language 'en')
-- Attempting call on Local/1 for s@[intercomincomingcall]:1 (Retry 1)
[Jun 7 09:35:23] NOTICE[9268]: chan_local.c:566 local_alloc: No such extension/context 1@default creating local channel
[Jun 7 09:35:23] NOTICE[9268]: channel.c:2942 __ast_request_and_dial: Unable to request channel Local/1
[Jun 7 09:35:23] WARNING[9268]: cdr.c:760 ast_cdr_init: CDR already initialized on '**Unknown**'
[Jun 7 09:35:23] NOTICE[9268]: cdr.c:430 check_start: CDR on channel '**Unknown**' already started
[Jun 7 09:35:23] NOTICE[9268]: pbx_spool.c:341 attempt_thread: Call failed to go through, reason 0
-- Executing [s@theritegroupbusinesshours:5] Hangup("SIP/110-081dca30", "") in new stack
== Spawn extension (theritegroupbusinesshours, s, 5) exited non-zero on 'SIP/110-081dca30'
-- Attempting call on Local/1 for s@[intercomincomingcall]:1 (Retry 2)
[Jun 7 09:36:24] NOTICE[9283]: chan_local.c:566 local_alloc: No such extension/context 1@default creating local channel
[Jun 7 09:36:24] NOTICE[9283]: channel.c:2942 __ast_request_and_dial: Unable to request channel Local/1
[Jun 7 09:36:24] WARNING[9283]: cdr.c:760 ast_cdr_init: CDR already initialized on '**Unknown**'
[Jun 7 09:36:24] NOTICE[9283]: cdr.c:430 check_start: CDR on channel '**Unknown**' already started
[Jun 7 09:36:24] NOTICE[9283]: pbx_spool.c:341 attempt_thread: Call failed to go through, reason 0
-- Attempting call on Local/1 for s@[intercomincomingcall]:1 (Retry 3)
[Jun 7 09:37:25] NOTICE[9298]: chan_local.c:566 local_alloc: No such extension/context 1@default creating local channel
[Jun 7 09:37:25] NOTICE[9298]: channel.c:2942 __ast_request_and_dial: Unable to request channel Local/1
[Jun 7 09:37:25] WARNING[9298]: cdr.c:760 ast_cdr_init: CDR already initialized on '**Unknown**'
[Jun 7 09:37:25] NOTICE[9298]: cdr.c:430 check_start: CDR on channel '**Unknown**' already started
[Jun 7 09:37:25] NOTICE[9298]: pbx_spool.c:341 attempt_thread: Call failed to go through, reason 0