Hello all, I want to save the recording of each day in Date Folder e.g. exten => s,1,Answer() exten => s,2,MixMonitor(/sanjay/recording/${DATE}/${UNIQUEID}.wav) How can I compute the $DATE variable? Regards, Sanjay Rajdev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080603/f9daa742/attachment.htm
http://www.voip-info.org/wiki-Asterisk+variables has some ideas - including ${DATETIME} PaulH On Tue, 2008-06-03 at 06:35 +0530, Sanjay Rajdev wrote:> Hello all, > > I want to save the recording of each day in Date Folder e.g. > > exten => s,1,Answer() > exten => s,2,MixMonitor(/sanjay/recording/${DATE}/${UNIQUEID}.wav) > > How can I compute the $DATE variable? > > Regards, > Sanjay Rajdev > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Hi Sanjay you may have to use a cron like this one: #!/bin/shdate1=`date +%Y%m%d`mkdir -p /var/spool/asterisk/monitor/sanjay/$date1+1 so you have to make work that ron every day t 23 59 min, and you will have a file created for every day. youre rontab -e must be like this: 59 23 * * * /usr/local/cron_youre_cron.sh Bye. Date: Tue, 3 Jun 2008 06:35:28 +0530From: sanjay.rajdev at featherstoneinformatics.comTo: asterisk-users at lists.digium.comSubject: [asterisk-users] Date in Dialplan Hello all,I want to save the recording of each day in Date Folder e.g.exten => s,1,Answer()exten => s,2,MixMonitor(/sanjay/recording/${DATE}/${UNIQUEID}.wav)How can I compute the $DATE variable?Regards,Sanjay Rajdev _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080602/bece5fe3/attachment.htm
On Monday 02 June 2008 20:05:28 Sanjay Rajdev wrote:> Hello all, > > I want to save the recording of each day in Date Folder e.g. > > exten => s,1,Answer() > exten => s,2,MixMonitor(/sanjay/recording/${DATE}/${UNIQUEID}.wav) > > How can I compute the $DATE variable?With the STRFTIME function; something along the lines of: /sanjay/recording/${STRFTIME(,,%Y%m%d%H%M%S)}/${UNIQUEID}.wav See the output of 'core show function STRFTIME'. Also, don't forget to mkdir the directory first. -- Tilghman
On Mon, Jun 2, 2008 at 8:05 PM, Sanjay Rajdev <sanjay.rajdev at featherstoneinformatics.com> wrote:> I want to save the recording of each day in Date Folder e.g. > exten => s,1,Answer() > exten => s,2,MixMonitor(/sanjay/recording/${DATE}/${UNIQUEID}.wav) > How can I compute the $DATE variable?Looks at the STRFTIME() function. It works just like the strftime(3) library function and accepts all of the same % conversions. I use it for exactly the same purpose you have in your example. -James