Using Twilio's transcription from recordings obtained via dial (forwarded calls)

175 views Asked by At

Folks, I'm currently entrusted with the task of implementing, while using Twilio, transcriptions for interactions between clients and end users. After our number is called, I need to make some checks for smart routing depending on the caller number. After that, I proceed to redirect (forward) the call from end user to the number of our client best fit to deal with the user in question. It goes about that:

import VoiceResponse = require("twilio/lib/twiml/VoiceResponse");


    const response: VoiceResponse = new twilio.twiml.VoiceResponse();
    response.dial({
                   action: statusCallback,
                   method: statusCallbackMethod,
                   callerId,
                   record: 'record-from-answer-dual',
                   recordingStatusCallback: `${config.apiURL}/recordings/${app_id}`
                 })

By doing so, I get the recording callback to work (I'm using the Twilio's Nodejs library). The problem is that in that case, the dial method (verb) won't take a transcription property in its argument, like when using the record method, like below:

response.record({
                 transcribe: true,
                 transcribeCallback: `${config.apiURL}/transcriptions/${app_id}`,
                 recordingStatusCallback: `${config.apiURL}/recordings/${app_id}`
               })

In summary, how can I turn on transcription for the records obtained by the dial method (forwarded call)?

0

There are 0 answers