I made prototype which initiates calls using the ARI and reacts to DTMF events (play sound).
The goal is to build an IVR application. I know IVR can be implemented in Asterisk via the dialplan quite easily.
Is it advisable to combine ARI and the dialplan to build an IVR application or should I code the features just jusing ARI? Are there best practices for this usecase?
What exactly is the use case? What are you trying to achieve?
The usecase is:
Text and phone number are entered in a database (gui and rest service).
Audio file is generated (TTS).
Java program calls phone number through Asterisk (ARI).
User answers call → here an IVR logic will be implemented.
With the brief information you’ve provided, either dialplan or ARI would work. I don’t see why you’d mix both for an IVR, unless there’s additional details you’ve left out which would have it make more sense.
Dialplan would be less effort, that is the reason why I considered it.
My idea was to combine the dialplan IVR features with an external Java app which uses ARI to initiate calls.
The reason i wrote this post is, I am not sure if it is possible to create a call channel with ARI and then delegate the call to the dialplan for the IVR logic.
As far as I know you can define an extension in the dialplan, which is processed if a caller calls this extension number. In my use case, a java program calls a number through Asterisk ARI. I don’t know how to connect the created channel to a dialplan extension …
I stumbled upon this post, where you explained the continue operation.
“Then you will need to use the ‘continue’ operation as I mentioned. This sends it out of ARI and into the dialplan at a specific position.”
Call redirection with ARI - Asterisk / Asterisk APIs - Asterisk Community
I think that’s what I need. Will try it out.
Ok it works with continueInDialplan.
But after all I think i will go for a pure ARI implementation.