dan_ce
(D E)
November 21, 2019, 4:38pm
1
Hallo!
Yet more cake icing.
I’m trying to run two commands from dialplan. One instantly and one in a minute’s time. However, both are executing at once. Anybody know why that might be?
If this isn’t easily doable that’s totally fine!
[domyothercoltcommand]
exten => s,1,TrySystem(. /home/asterisk/c1.sh > /dev/null 2>&1 &)
exten => s,2,TrySystem(. /home/asterisk/c2.sh | at now + 1 minute > /dev/null 2>&1 &)
exten => s,n,Return
Thanks!!
cynjut
(Dave Burgess)
November 21, 2019, 5:35pm
2
I’d drop them both into a shell script that executes under control of the shell instead of trying to do them from the TrySystem() command.
dicko
(dicko)
November 21, 2019, 6:16pm
3
at is a tricky little bugger, you will be using /bin/sh whatever that is on your machine so paths might be a problem , also the interpreted ‘date’ string might need to be quoted, usually it is easier to use at’s -f (file to run) option
xrobau
(Rob Thomas)
November 21, 2019, 6:29pm
4
You are running a command and piping the output of that command into at, which will then be run in 1 minutes time.
I’m pretty sure that’s not what you want to do.
Add at now + 1 minute /home/asterisk/c2.sh
to c1.sh (and that’s assuming that’s the correct syntax, which I’m not sure it is)
dicko
(dicko)
November 21, 2019, 6:48pm
5
This should work if the file has the executable flag set and is owned by asterisk
at “now + 1 minute” -f /home/asterisk/c2.sh
PitzKey
(Itzik)
November 21, 2019, 7:11pm
6
What are you trying to accomplish?
Maybe you can use a Wait(60) in your dialplan
dicko
(dicko)
November 21, 2019, 7:12pm
7
Not a good idea, it will be ‘blocking’, trysystem is not (which is why it is there)
1 Like
system
(system)
Closed
November 28, 2019, 7:13pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.