[asterisk-users] if statement recording - after hours

2014-09-11 Thread Joseph

In my dial plan I have these two lines:

exten = 
_NXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten = _NXX,n,MixMonitor(${recordfilename},b)

How to add if statement to execute these line only after let say 5pm.  To 
record conversation only after 5pm.

--
Joseph

--
_
-- 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


Re: [asterisk-users] if statement recording - after hours

2014-09-11 Thread James Thomas
GotoIfTime()
Check out-
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.
-- 
_
-- 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

Re: [asterisk-users] if statement recording - after hours

2014-09-11 Thread Joseph

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].

[outgoing]
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

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

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

--
joseph

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.

References

  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


--
_
-- 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


Re: [asterisk-users] if statement recording - after hours

2014-09-11 Thread Eric Wieling
See ExecIf in the output of core show applications.  The IF function might be 
useful, see core show functions.   I assume the Asterisk Book also covers 
this.

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joseph
Sent: Thursday, September 11, 2014 5:43 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] if statement recording - after hours

In my dial plan I have these two lines:

exten = 
_NXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten = _NXX,n,MixMonitor(${recordfilename},b)

How to add if statement to execute these line only after let say 5pm.  To 
record conversation only after 5pm.

-- 
Joseph

-- 
_
-- 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

-- 
_
-- 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


Re: [asterisk-users] if statement recording - after hours

2014-09-11 Thread Brian LaVallee

There are multiple ways to do time-of-day routing.
ExecIf w/ IFTIME, GotoIfTime, and ExecIfTime.
I put some examples below.


Sincerely,
Brian LaVallee


On 9/12/14, 10:05, Eric Wieling wrote:

See ExecIf in the output of core show applications.  The IF function might be useful, 
see core show functions.   I assume the Asterisk Book also covers this.

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joseph
Sent: Thursday, September 11, 2014 5:43 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] if statement recording - after hours

In my dial plan I have these two lines:

exten = 
_NXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten = _NXX,n,MixMonitor(${recordfilename},b)

[main]
exten = _NXX,1,NoOP(Check Time)
 same = GotoIfTime(9:00-17:00,mon-fri,*,*?open:closed)
[open]
exten = _NXX,1,NoOP(Normal Call)
[closed]
exten = _NXX,1,NoOP(Take a Message)
; end

[main]
exten = _NXX,1,NoOP(Check Time)
 same = n,ExecIf(${IFTIME(9:00-17:00,mon-fri,*,*?1:0)}?Goto(closed))
 same = n,NoOp(Process Normal Call)
[closed]
exten = _NXX,1,NoOP(Take a Message)
; end

[main]
exten = _NXX,1,NoOP(Check Time)
 same = n,ExecIfTime(9:00-17:00,mon-fri,*,*?open)
 same = n,NoOp(Take a Message)
[open]
exten = _NXX,1,NoOP(Normal Call)
; end

How to add if statement to execute these line only after let say 5pm.  To 
record conversation only after 5pm.






--
_
-- 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


Re: [asterisk-users] if statement recording - after hours

2014-09-11 Thread Mitul Limbani
Read GotoIfTime function.p
On 12-Sep-2014 3:13 AM, Joseph syscon...@gmail.com wrote:

 In my dial plan I have these two lines:

 exten = _NXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${
 STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
 exten = _NXX,n,MixMonitor(${recordfilename},b)

 How to add if statement to execute these line only after let say 5pm.
 To record conversation only after 5pm.

 --
 Joseph

 --
 _
 -- 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

-- 
_
-- 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