How to interact with external programs

Hi everybody!

I’m a beginner in using Asterisk and my first job is to implement an IVR with a connection to a couple of Java-scripts…

Maybe the easiest way to explain my questions is some fantasy-code.
I want to setup something like the following:


… Background(choose 1_or_2)
if 1 then resultcode = RunExternalJavaProgram(ProgA)
if 2 then resultcode = RunExternalJavaProgram(ProgB)

if resultcode == -1 then
{
Playback(Error)
HangUp()
}

if resultcode == 0 then
{
Playback(OK)
ReadSomeDigitsFromFileAndSayThem(Filename)
HangUp()
}

I’m not asking for a complete solution. But can you direct me which way to go? What commands could be interesting? Any hints?

Thanks a lot!

Marc

Try using AGI with some wrapper to java.