Search code examples
twiliotwilio-api

Twilio Elastic SIP Trunking Webhooks


I have a Twilio Elastic SIP Trunk used by a voice gateway for PSTN access. I'm looking for a way to receive notifications when a call starts and ends. Webhook events would be perfect, but I don't see a way to do that with Elastic SIP Trunk.


Solution

  • Twilio Technical Support Engineer here. With Elastic SIP Trunking, Twilio acts as the gateway to the PSTN via our carrier partners. As you are already aware, there is no TwiML involved with Elastic SIP Trunking, Twilio simply sends the call to the PSTN destination.

    If your Voice Gateway is unable to do this (as an example, this would be possible using FreePBX/Asterisk), the only other alternative would be to use Programmable Voice SIP Domain instead of Elastic SIP Trunking. Using this method, you could have a Serverless Function that returns TwiML to dial the PSTN number and at the same time, generate a notification.