Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] if statement recording - after hours


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
syscon780 at gmail.com
Guest





PostPosted: Thu Sep 11, 2014 4:43 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

In my dial plan I have these two lines:

exten => _NXXXXXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten => _NXXXXXX,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
Back to top
jthomasdpu at gmail.com
Guest





PostPosted: Thu Sep 11, 2014 5:18 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

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.
Back to top
syscon780 at gmail.com
Guest





PostPosted: Thu Sep 11, 2014 5:56 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

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

--
joseph

On 09/11/14 17:18, James Thomas wrote:
Quote:
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

Quote:
--
_____________________________________________________________________
-- 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
Back to top
EWieling at nyigc.com
Guest





PostPosted: Thu Sep 11, 2014 8:09 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

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-bounces@lists.digium.com [mailto:asterisk-users-bounces@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 => _NXXXXXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten => _NXXXXXX,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
Back to top
b.lavallee at globalta...
Guest





PostPosted: Thu Sep 11, 2014 11:40 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

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:
Quote:
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-bounces@lists.digium.com [mailto:asterisk-users-bounces@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 => _NXXXXXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten => _NXXXXXX,n,MixMonitor(${recordfilename},b)
[main]
exten => _NXXXXXX,1,NoOP(Check Time)
same => GotoIfTime(9:00-17:00,mon-fri,*,*?open:closed)
[open]
exten => _NXXXXXX,1,NoOP(Normal Call)
[closed]
exten => _NXXXXXX,1,NoOP(Take a Message)
; end

[main]
exten => _NXXXXXX,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 => _NXXXXXX,1,NoOP(Take a Message)
; end

[main]
exten => _NXXXXXX,1,NoOP(Check Time)
same => n,ExecIfTime(9:00-17:00,mon-fri,*,*?open)
same => n,NoOp(Take a Message)
[open]
exten => _NXXXXXX,1,NoOP(Normal Call)
; end
Quote:
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
Back to top
mitul at enterux.in
Guest





PostPosted: Thu Sep 11, 2014 11:54 pm    Post subject: [asterisk-users] if statement recording - after hours Reply with quote

Read GotoIfTime function.p On 12-Sep-2014 3:13 AM, "Joseph" <syscon780@gmail.com (syscon780@gmail.com)> wrote:
Quote:
In my dial plan I have these two lines:

exten => _NXXXXXX,n,Set(recordfilename=${CALLERID(num)}-${EXTEN}-${STRFTIME(${EPOCH},MST,%C%y-%m-%d-%H%M)}.wav)
exten => _NXXXXXX,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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services