Hello, I read a thread on the asterisk dev list (call file handling suggestion) May i have some comment/opinion on these two ways below to place a call file in the future ? (from the wiki and the asterisk book but added typos and stupidity come from me) The best is ? (and should work ?) tmsp = the delay in future.. say 100 seconds exten=> ra,n,System(NOW='date %S') exten=> ra,n,System(let NOW=$NOW+$tmsp) exten=> ra,n,System(TOUCH_TMSP='date -d "1970-01-01 $NOW sec GMT+1" +%Y%m%d%H%M. %S) ********* or this way ? exten=> ra,n,Set(touchtime=$[${EPOCH} + ${tmsp}]) exten=> ra,n,Set(TOUCH_TMSP=${STRFM(${touchtime},GMT+1,%C%y%m%d%H%M%S) ********* next step: exten=> ra,n,System(touch -t $TOUCH_TMSP /tmp/${idclient}.call)) exten=> ra,n,System(mv /tmp/${idclient}.call /var/spool/asterisk/outgoing) Thanks for your attention, happy 2009..... and perhaps a reply ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090117/3d20167b/attachment.htm
On Sat, Jan 17, 2009 at 7:52 PM, didier.cuffaut <didier.cuffaut at neuf.fr> wrote:> May i have some comment/opinion on these two ways below to place a call file > in the future ? (from the wiki and the asterisk book but added typos and > stupidity come from me) > > The best is ? (and should work ?)This is just me, but if I were going to program calls in the future I would just name them with the time (2009-01-17-20-08.call for four minutes from now, for example) and put them in a directory. The I'd have a cron job running that looked once per minute in that dir and did the mv if found file with that name. Does that make sense?
First, thanks for your help Ok, i going to do a script and call ot with only one 'System' (cf Gordon Henderson) and take a look to 'incron' (T Cohen) Just need some explanations: 1) If the call file 'failed', an 'exitstatus' is happend....Good How to check/get these $ and put in in an * $ ? (of course, the call file have to have archive= yes and go to 'outgoing-done') sorry, i'm not a linux guru and it's not a pure Asterisk pb..... Anyway, could someone show me the complete exact way and syntax to do this? ????Using something as: $ egrep -vw "(^#|^)" file | awk -F " " '{ print $2 }' (or some use of awk) 2) From my first post, are these lines OK or wrong? (syntax error?) tmsp = the delay in future.. say 100 seconds exten=> ra,n,System(NOW='date %S') exten=> ra,n,System(let NOW=$NOW+$tmsp) exten=> ra,n,System(TOUCH_TMSP='date -d "1970-01-01 $NOW sec GMT+1" +%Y%m%d%H%M. %S) < NOTE THE 'M. %S' ********* or this way ? exten=> ra,n,Set(touchtime=$[${EPOCH} + ${tmsp}]) exten=> ra,n,Set(TOUCH_TMSP=${STRFM(${touchtime},GMT+1,%C%y%m%d%H%M%S) ********* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090119/749336df/attachment.htm