I was able to simplify a lot the use case. in short :
I have a user who called an extension and went through an IVR journey.
at a specific step , where user is waiting on the line, I need to interact with FreePBX to move to next IVR step ( simulate that he pressed 1 or 2 ) . The caller will NOT hit 1 or 2, I need to do it on his behalf.
What I will know for sure at this “waiting step” is :
the exact step in the IVR Journey
the extension dialed ( I can have only one caller on this extension at a time, not possible to have 2 callers, so no conflicts )
the caller to wait “quietly” for the trigger beeing done
Which API call should I do to make the IVR go to next step ( 1 or 2 ) ?
I think it is much more simplier now
What triggers the “specific step”?
Why can’t that “specific step” be an invocation of your next IVR?
Why are you sending someone to what sounds like a largely unrelated IVR?
Why would you simulate that someone pressed 1 or 2? How? What decides which one? I really don’t understand this part. How can you hit 1 or 2 for them? Are you on the call?
What are you calling an IVR Journey? The implication of this is that it’s a long trip through the IVR, and I know I don’t hang around in IVRs that go more than a couple levels deep.
Have you tried drawing this out on a piece of paper so you can see how the logic flows? Can you give us something like a PDL description of the process you want to use? Are you sure that IVR is the right tool?
There are just so many questions. I’m pretty sure without answers to those and many more, we’re just going to spin our wheels on this one.
If you look at the dialplan in very recent versions of the IVR module on 14, you will see the READ application is wrapped in a WHILE application which allows it to loop continuously while waiting for the desired input from the caller. I suspect what you need to do would be easier to accomplish in this fashion, where you loop continuously while polling some API endpoint for a matching value before continuing the call flow.
there is no real trigger, the user reaches step #4.
the next step could be the invocation of the IVR next step, but it needs to be done by another person than the caller. If I can simulate the press of 1,2,3 …etc on behalf of the caller, it will make the job.
the choice of 1 or 2 is made by some external checks with a shell script. This part is easy, I will manage it as it is unrelated to FreePBX.
IVR Journey = the 4 steps that the caller go through before reaching the trigger step.
IVR is the right tool yes. let’s simplify the flow :
______________________ ----> option 1
step 1 -> step 2 - > step 3 /
_____________________ \ ---- > option 2
for step 1, 2, caller made some choice by pressing 1,2,3,4 …etc… usual IVR process.
for the step3 , option 1 and 2 are “pressed” on behalf of the caller, no interaction from him.
@pitzkey : sure , above I hope more details. The goal is to be able to have at some point an "interaction " from a system which is outside FreePBX. I figured out how to trigger a message from freepbx to the external system to notify that caller has reach the “trigger step”, now I would need to have the opposite. The best solution would be to simulate the press of the caller on his behalf.
In classic programming-speak, we have structure called a “Case”.
In the Case structure, there are options. You choose one option and perform a series of steps, then leave the structure.
This is also how an IVR should be envisioned.
You enter the IVR and listen to the options.
You press a button to select which option you want to choose.
The option drops you out of the IVR on the way to a destination based on your choice.
So, your diagram:
“Option 1 -> Option 2 -> Random option 3a or 3b”
isn’t an IVR.
From what I’m understanding, you are actually doing something that sounds more like this:
Make an announcement.
Listen for a response and record it.
Make another announcement.
Listen for another response and record it.
Based on the two responses, send the customer a destination.
This is similar to an IVR, except that, with an IVR, you actually leave the IVR and go to another program flow.
An IVR would look more like this
Option 1 -> Do something
Option 2 -> Do something else
Option 3 -> Do some other thing
Option 1 -> Do yet another thing
Option 2 -> Do yet something else
Option 3 -> Do yet again something else
Option 1 -> Do some other thing
Option 2 -> Do some yet another thing
In this example, each of the IVR choices cascades into a series of other options (like listen to an announcement or “Connect to Sales”) or more IVR choices. Each of those them cascades until they hit a terminal operation.
What you are describing doesn’t sound like an IVR to me. So, no, it doesn’t appear that you are being clear enough for me.
Option 1 -> if you are part of the team press 1
Option 2 -> if you are not part of the team press 2
Option 3 -> if you want to speak to someone ( it will be a potential future option, we will see )
Something ( 1st option 1 ) - please enter your ID & pin ( this is working ok ) , fine , so :
announcement : do you want to trigger the update ?
Option 1 -> YES ( then use custom action - this is working ok )
Option 2 -> No ( non sense , but option is here anyway )
Option 3 -> Check the status ( then use custom action - this is working ok )
Option 4 -> hang up
Something ( 1st option 2 ) else
Option 1 -> check the status ( then use custom action - this is working ok )
Option 2 -> hang up
For the options which a re “check the status” , I would like to be able externally to freepbx to “notify” that the status is delivered.
so as option I would have :
waiting for the press of one option on behalf of the user by my external script which check the status
I gave you all the info for more understanding for all, but I don’t think it really change my question :
How can I press ( or simulate ) the press of an option being in the IVR on behalf of my user ?
This is an IVR. Cool. Record your recording and set up the options.
Or not - you could do this just as easily with an announcement that says “If you at a team member, enter your PIN.” After they don’t (or fail), drop them.
This isn’t (or shouldn’t be) an IVR. This should be a custom app like the one I wrote for logging in and out of TimeTrex. Play the announcements, validate the digits. From there, do a subordinate set of announcements that allows you to press your “Do you want to do the update?” and capture the answer. If Yes, the do it and play “Check the status”. If not, play “Check the Status”. You don’t need a
“hang up” option - just hang up.
This, similarly isn’t an IVR. It is an announcement that checks the status and hangs up.
The advantage of the FreePBX IVR structure is that it can be dropped in almost anywhere in your call process. It seems to me that you are over-complicating your process. Adding a bunch of useless options to get to the magic number (5 plus or minus 2) doesn’t make what you want to do an IVR.
Thanks for your feedbacks Cynjut.
Everything I mentioned is already working and is fine for me and my needs. So I do understand that I’m not doing the “best way” it should be done, but it is working, which is my 1st goal
Being back to my main problem now, being at step X, with 2 options configured in my IVR , I would like to simulate the press of one of the key with an API call or anything through a script I can run
Anyone would could help me on this is Welcome
Thanks in advance !
Thanks for your interest
no, I want to have an “action” done. The timeout would be that there was no external action performed ( means my external script did not launch , or badly or somehting else …etc… ).
a timeout would “mean” -> no key were pressed at all , if I enter in my logic of key pressed simulation