2 system(scripts) excuting at the same time?

I have the need for two scripts to be executed via the system command and continue to executed after the caller hangs up.

If I have this.

exten => 800,1,Answer()
exten => 800,n,Wait(1)
exten => 800,n,Playback(somefile)
exten => 800,n,System(script1)
exten => 800,n,System(script2)
exten => 800,n,HangUp()

My questions are as follows.

Will Script 2 wait for Script 1 to execute before it is started? If so Can I have them both start at the same time?

Also what will happen when the caller hangs up prior to both system calls being made? Will it stop the script? Should I use the ‘h’ priority for the system calls?

I will be doing testing on Monday when I get to the office just wanted to see if any of you had any advice. Thanks!!


you are correct on all points.

Script 2 will wait for script 1 and yes if they hangup early the scripts wont be run at all.

I would at least put a catch in the h extension. also why have 2 scripts just make them into 1



I was wanting to do something like this for about a week to give me time to re-write both scripts into one. But after what you said I think I will just bite the bullet and re-wrote them into one… well now.

So thanks for the response. Question for my new one supercool script… If I am redirecting the output to someware else (not Asterisk) will it continue to run even after the caller has hung up? As long as they stay on the line long enough to trigger it. Like PHP does.



As long as any variables are passed to it it need then yes the script will carry on happily.