• Jacek Jarmulak

Easy Speech IVR for Outbound Calling using Voicegain and Twilio



Outbound IVRs on Voicegain

Voicegain platform makes it easy to build IVRs for simple outbound calling applications like: surveys (Voice-of-Customer, political, etc), reminders (e.g. appointments, payments due), notifications (e.g. school closure, water boil notice), and so on.


One thing that Voicegain cannot do at the moment is make outbound calls - this is not a technical constraint, but a legal one as we would need to monitor usage if we allowed outbound calling.


However, it is trivial to combine outbound calling features of platforms like Twilio or SignalWire with the speech recognition and IVR features of the Voicegain platform. All you need is this simple piece of code to make an outbound call using Twilio and connect it to Voicegain for IVR.

call=client.calls.create(twiml='<Response> \
   <Dial> <Sip>sip:673a8342-b0eds851-7c18b8ca3ba@fs001.voicegain.ai:5080;transport=tcp?x-mycustomheader=foo</Sip> </Dial> \    
   <Say voice="woman" language="en-US">Bye</Say> \</Response>',
   to='+18174221096',
   from_='+14655440912' )


Defining IVRs in declarative way

Voicegain provides a full featured Telephone Bot API. It is a callback style API that can be used in similar way you would use Twilio's TwiML. However, to simplify building IVRs even further we provide a python script that when deployed on AWS Lambda will interpret IVR call flow definitions specified in a simple and intuitive YAML format. The complete code with examples can be found on our github. It is under MIT license so you can modify the main interpreter script to your liking. You might want to do it e.g. to make calls to external webservices that your IVR needs.


In this YAML format, an IVR question would be defined as follows:


AgreeToParticipate:
  type: INPUT
  name: agreeToParticipate
  voice: catherine
  prompt: 'Would you like to participate now, or would you rather have us call you later.'
  bargeIn: true
  grammar: 
    type: JJSGF
    parameters:
      tag-format: semantics/1.0-literals
    grammar: participate
    public:
      root: "(<now> {now}) | (<later> {later}) | (<never> {never})"
    rules:
      now: "(yes [participate] [now]) | ([participate] now)"
      later: "(later)"
      never: "(no) | (never)"
  noInputMax: 1
  noMatchMax: 1
  confirmation:
    threshold: 0.33
    prompt: "Was it: ${agreeToParticipate} ?"
  fail: CallHealth
  next: ParticipateDecision   

As you can see, this is a pretty easy way to define an IVR question. Notice also that we provide a built-in handling for the NOINPUT and NOMATCH re-prompts, as well as the logic for confirmations. This greatly reduces the the clutter in the specification as those flow scenarios do not have to be handled explicitly.


The questions support either use of grammars to map responses to semantic meaning, or they can alternatively simply capture the response using a large vocabulary transcription.


Prompts are played using TTS or can be concatenated from prerecorded clips.


Wait, there is more.

Because this is built on top of Voicegain Telephone Bot API it comes with full API access to the IVR call session. You can obtain details, including all the events and responses, of the complete session using the API. This includes the 2-channel recording plus also full transcription of both channels and also Speech Analytics features.


You can also examine the details of the session from the Voicegain Console and listen to the audio. This helps in testing the application before it gets deployed.




If you have questions about building this type of IVRs running on Voicegain platform, please contact us at support@voicegain.ai

48 views0 comments
Contact Us