Hi team, quick question about outbound SIP to Twil...
# telephony
r
Hi team, quick question about outbound SIP to Twilio PSTN using LiveKit. We’re placing calls with
livekit-server-sdk
via
SipClient.createSipParticipant
(LiveKit → SIP → Twilio → PSTN). We’d like Twilio to run Answering Machine Detection (AMD). Here’s the simplified call:
Copy code
ts
const sipParticipantOptions = {
  participantIdentity: `ai-caller-${contactId}-${Date.now()}`,
  participantName: 'AI Assistant',
  krispEnabled: false,
  waitUntilAnswered: false,
};

await sipClient.createSipParticipant(
  outboundTrunkId,
  customerPhoneNumber, // PSTN
  roomName,
  sipParticipantOptions,
);
Questions: - Is there a way to pass Twilio AMD settings (machineDetection/asyncAmd/asyncAmdStatusCallback) through
createSipParticipant
or via SIP headers so Twilio runs AMD on this call? - If not supported, is the recommended approach to flip the flow: have Twilio originate the call via Calls API with AMD enabled, and once it’s classified as human, use TwiML
<Dial><Sip>
to bridge back to our LiveKit SIP ingress? - Any roadmap or guidance for enabling AMD when LiveKit is the SIP UAC? Note: Twilio’s
<Sip>
noun attributes don’t list
machineDetection
, which suggests AMD is only configurable when Twilio originates the call via Calls API, not via
<Dial><Sip>
or SIP INVITE headers. Doc ref: TwiML <Sip> attributes (
statusCallbackEvent
etc.) [Twilio docs](https://www.twilio.com/docs/voice/twiml/sip#attributes-status-callback-event). Thanks!
b
@rough-account-81660 did you get Twilio AMD working on top of LiveKit?
We are also thinking to use Twilio to do AMD
we tried this - If not supported, is the recommended approach to flip the flow: have Twilio originate the call via Calls API with AMD enabled, and once it’s classified as human, use TwiML
<Dial><Sip>
to bridge back to our LiveKit SIP ingress? One thing we don't like is the callee hears the ringtone. Here is the flow: 1. Twilio call number A with AMD enabled 2. number A picked up. Twilio does <Dial><Sip> to connect to LiveKit 3. then number A hears the ringtone as Twilio is connecting to LiveKit. We checked ChatGPT and didn't see there is a good solution to fix the ringtone