How to validate user input on routing automation in Freshcaller with the help of Serverless app?

Hi,

I’m trying to setup a serverless app in Freshcaller in combination with the routing automation system. The idea is, when someone calls we want to let the user input a ‘multiple digit’ and then check with the serverless app to an external API if this user input is correct. If so we want to return a success value and then redirect the user accordingly.

In the documentation I found there are several events you can let the app listen to. But i can not find anything in the documentation about the event of user input (in the routing automation admin page there is an option input type: ‘multiple digits’). Is it possible to listen for this user input in anyway? And if so how it the possible? If not are there any other ways to accomplish this?

Thanks!

Hi @MarcoCh,

In Freshcaller, the Serverless app only supports the following two product events.

  1. onCallCreate
  2. onCallUpdate

Both of these gets triggered after the call gets connected and these events are asynchronous by nature. The call operation will not depend on it and will only trigger these events as a side-effect. So, the call cannot be controlled based on these events.

There are some Frontend event methods available as listed here. None of these events support the user input change event before the call.
So, I’m afraid there are no native methods that will satisfy the use-case that you have mentioned.

Hi @MarcoCh,

We can listen to the user’s input. This Github sample app repository is developed by our team. You can verify the structure of the app and it contains info on handling different types of user input.

Thanks.

3 Likes

Welcome to the Freshworks community @MarcoCh! We are excited to see you are looking to build a serverless app to route calls using automation in Freshcaller.

I believe what @AshwinElangovan shared earlier points to a sample app demonstrating how you could try achieving this using our yet-to-be-launched Custom Actions feature. This feature will be documented alongside official sample apps in the next couple of weeks. Please do look out for the announcement right here on our Community’s Announcements page!

2 Likes

Thanks @AshwinElangovan and @satwik,

I managed to find a solution thanks to the examples provided by Ashwin. Turns out you can simply export a function and use it in the routing automation call flow to check the users input and verify accordingly.

3 Likes

Hi,
@AshwinElangovan & @satwik I saw that there is only one sample app on the GitHub thus. More sample apps are probably not available yet because the feature is relatively new and still under development, or?

One thing that could be really useful for development:
It would be really nice to have sample app that that simply does a direct mapping.
That is: take multiple digits as input and just pass it on as output.
This would let us see how sample apps are built and we could directly test it before building more complex apps by setting a response to say 111 and assign some action like a special call queue and then just dial 111 when in the automation and see if the call is placed in the correct queue.

Do you think something like that could be released to us sometime soon?

Hi @alexander-san,

Yes, the feature is relatively new as you have mentioned. We still have some more steps to document and publish it along with the sample apps.

We will consider your requested use-case when building the sample app. We are working on it and sample apps and documentation will be out soon.

1 Like

Hi @alexander-san,

We can send the user’s input as the app’s output. Currently, we don’t have any other sample apps other than the above-mentioned app.

But with minor changes in the given sample app, you can achieve the requirement. In server/server.js, by assigning response = request.input directly in the function corresponding to your input type (eg: validateUserSingleDigit
for single-digit input…etc), you can receive the user’s input as the app’s output.

With the response received, you can map to several call queues in the routing automation via Freshcaller UI.

Kindly let me know if this solves your query.

Thanks.