Using REST API to initialize calls, handle DTMF, send custom audio files

Hello, I’m kinda lost here. I have an app for my support agents where they have customers queued in and they have a choice to call them to gather more information before actually dedicating real human to them. Now the customer puts their name in the form, alongside with phone number. They are asked to press either 1 or 2 for different departments, the support agents see that DTMF in real time and decide how to proceed further (play another automated message, transfer call, etc.). The callbacks informing about the status (DTMF, call answered…) should be sent to my webhooks (back-end handler is written in Python).

I couldn’t find any way to initialize and then handle the call to achieve similar results, could anyone point me in the right direction?

Thank you very much in advance

is this even possible? If not with FreePBX, are there any alternatives with such capabillites?

FreePBX is a GUI om top of Asterisk. In FreePBX itself it may be quite hard to achieve all of that. I would write a custom Asterisk Dialplan, or even better, a Asterisk ARI app.

This might be a good starting point for you:

You need to explain this more clearly.

Queued in where and how? How are these users queued? So your support agent calls the queued user to ask more questions before sending them to a real human? Are the agents bots?

Where does this form come from? How did it get injected between the agent and the user?

Where does DTMF come into this? How will this agent be monitoring the DTMF? You want the agent to transfer or playback a file to the call? Again, are these agents human or bots?

There seems to be web forms, a voice call and some other interactions need for this but in no way does what has been presented make any of that clear or how their relationship is managed.

Support agents are real humans. To make their job easier they have access to a dashboard where they can see all of the customers awaiting support (via phone call). They can see the current status of that call (waiting to choose department, waiting for support agent, etc.). This gets determined by the number pressed on their dialpad (either 1 or 2) and that information gets sent to our webhooks from where it’s further passed to the dashboard.

The form is available in their user dashboard

Support agents have the abillity to transfer the call to themselves or play a pre-recorded message which asks the user for more info regarding their situation and so on

This sounds promising. I assume these docs should be used as a reference then.

Is there perhaps some better or more newbie-like guide/article? I see in there some stuff I’m not really familiar just yet.

How would I for example initiate a call from outside the Asterisk server enviroment and pass specific arguments alongside with that request (customer name, call ID, time) and get that information sent back later when the call has ended.

How does this part happen and where is this part happening? There’s nothing that holds the user waiting for a prompt that you can really see. Unless you plan to somehow log each part of the call flow and output it to the agents in some form. But even then, a user could press an option before the agent is even told they are at that point. Choosing a department is something like an IVR while waiting for an agent is a Queue. These are completely different things.

This is possible but it is going to take a lot of work and require a lot of custom dialplan and other coding for this to happen. You’re going to need to monitor call events which means you need an AMI listener that can react to the events being raised by actions in Asterisk. You’ll need to use AMI and/or AGI for the agents to be able to transfer calls or trigger Playback()'s on the channel to the user.

As far as ARI is concerned, not sure how it is going to work since calls will be coming from the PSTN. Calls will most likely hit IVRs and then a Queue after that. Not sure where ARI is going to come in here. For example, when the caller hits the IVR to select a department AMI is going to raise an event so as I said you’ll need to listen for AMI events to do this. If the caller is waiting for an agent, they’re going to be in a queue…again not sure how ARI will tie into this.

Like I said, this is something that can be done. It has been done by others but it is going to require time and knowledge of Asterisk to do this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.