[asterisk-users] Asterisk dialplan date and time operations

Erik Wartusch we at deuromedia.at
Thu Jan 3 03:02:49 CST 2008


Thanks!

I got it now!

Here is a sample for a delayed callback after a caller gets to a users 
voicemailbox. Purpose: Reminder for people that they got a message on their 
v. box.

 exten => 1002,1,Answer
        exten => 1002,2,Set(CHANNEL(musicclass)=default)
        exten => 1002,3,Queue(test|t|||5)
        exten => 1002,4,Voicemail(b1205)
        exten => 1002,5,System(echo -e "Channel: SIP/we-static\\nCallerID: 
VOICEMAIL
 <8500>\\nContext: test\\nExtension: 444" > /tmp/${UNIQUEID}.call)
 ; add 15 minutes (in seconds 900) to the epoch time
        exten => 1002,6,Set(newepoch=${MATH(${EPOCH} + 900 |int)})
 ; write it out for debugging purpose
        exten => 1002,7,NoOp(${newepoch})
        exten => 1002,8,System(touch -t ${STRFTIME(${newepoch},,
%Y%m%d%H%M)} /tmp/${
UNIQUEID}.call)
        exten => 
1002,9,System(mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing
/)
        exten => 1002,10,Hangup


Kind Regards,

Erik

Am Mittwoch, 2. Januar 2008 18:59 schrieb Tilghman Lesher:
> On Wednesday 02 January 2008 09:34:24 Erik Wartusch wrote:
> > No it's even simpler. ( I dont need an IF case)
> > I just want to add e.g. 15 minutes to the current date / time:
> >
> > So simply said:
> >
> > ${STRFTIME(${EPOCH},,%Y%m%d%H%M)} + 15 minutes!
> >
> > My question was how can I do that.? Of yourse e.g. if it's 23.57 pm and I
> > add 15 minutes the day should increase +1 and the hours start with 0:x
> > the minutes with 12 ( and not 72 as the normal addition would result).
>
> ${STRFTIME($[${EPOCH} + (15 * 60)],,%Y%m%d%H%M)}



More information about the asterisk-users mailing list