[asterisk-users] if statement recording - after hours

Joseph syscon780 at gmail.com
Thu Sep 11 17:56:34 CDT 2014

I'm trying to avoid type the same sub-routine on each pattern, so I included the time in [outgoing] first three lines.

The way I understand if the time is past 17pm it will start recording, execute next two lines.
But I'm not certain what will happen if the time is before 17pm will it go to "exten => 2 to it will go to in of the pattern in [goto-dialout].

exten => s,1,GotoIfTime(17:00-24:00,*,*,*?outgoing,s,2) ;rec
exten => s,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten => s,n,MixMonitor(${recordfilename},b)

include => blocked-numbers
include => goto-dialout

exten => _NXXXXXX,1,Dial(SIP/7780${EXTEN}@pstn-9998,60,tr)
exten => _NXXXXXX,n,GotoIf($[$["${DIALSTATUS}" = "BUSY"] | $["${DIALSTATUS}" = "CONGESTION"]]?line2)
exten => _NXXXXXX,n(line2),Dial(SIP/9780${EXTEN}@pstn-4444,60,tr)
exten => _NXXXXXX,n,Hangup()

exten => _18XXXXXXXXX,1,Set(CHANNEL(musicclass)=default)
exten => _18XXXXXXXXX,n,Dial(SIP/7${EXTEN}@pstn-9998,60,tr)


On 09/11/14 17:18, James Thomas wrote:
>   GotoIfTime()
>   Check out-
>   [1]http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime
>   If the time is within a certain range, execute the recording dialplan.
>   If it's outside the range, then skip to the dialplan after the
>   recording stuff.
>   1. http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime

>-- Bandwidth and Colocation Provided by http://www.api-digital.com --
>New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>asterisk-users mailing list
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users

More information about the asterisk-users mailing list