A Few Notes about Twilio TwiML Transcriptions

Twilio Logo

Recently, we had to create an Interactive Voice Response (IVR) application in PHP using the Twilio TwiML API. Part of this task involved retrieving transcriptions of the called party responses using the TwiML API, so they could be stored in the database.  While doing the work, we noticed some aspects that are not mentioned in the TwiML documentation:

Transcription callbacks do not contain session info.

If you set a session cookie for the TwiML calls, the responses will include said cookie, but not the transcription callbacks. To work around this, you can add GET parameters to the callback URL in the TwiML call.

Transcription callback URLs.

You can use full (https://example.com/twilio_app/callback_handler.php), or relative (twilio_app/callback_handler.php or callback_handler.php) URLs.

Empty voice responses do not generate a transcription.

When the called party leaves an empty voice response, the transcription callback is not generated. While developing the application we expected to receive an empty transcription, and we spent some time wondering what could be wrong in the code until Twilio Support told us about this behavior.

It seems other developers have also found this confusing, so it’s possible that Twilio will implement callbacks on empty transcriptions in the future.

If you need help with your Twilio application, you can contact us.