***Question: How to call SIP extensions (not phone...
# ask-ai
b
***Question: How to call SIP extensions (not phone numbers) using CreateSIPParticipant?* I’m trying to implement a warm transfer feature where the AI agent calls an operator at extension
1001
on my Asterisk server. ***Current Setup:* - Outbound SIP Trunk configured: - Address:
sip.example.com:5060
- Auth: Username/password configured - Numbers:
[“+15105550100”]
(for inbound only) ***Code:* ```python await livekit_sip.create_sip_participant( sip_trunk_id=“ST_xxxxxxxxxxxxx”, sip_call_to=“1001”, # Extension number, not a phone number room_name=consultation_room_name, participant_identity=“operator-1001" ) Error Received: TwirpError(code=unknown, message=SipCallTo should be a phone number or SIP user, not a full SIP URI, status=500) What I’ve Tried: 1. ✅ sip_call_to=“1001” → LiveKit accepts it but doesn’t send SIP INVITE to Asterisk 2. ❌ sip_call_to=“sip:1001@sip.example.com:5060" → Error: “should be a phone number or SIP user, not a full SIP URI” Questions: 1. What format should I use for sip_call_to when calling a SIP extension/user (not a phone number)? 2. Does the SIP Trunk need additional configuration to route extension calls? 3. Is CreateSIPParticipant intended only for phone numbers, and should I use TransferSIPParticipant (SIP REFER) instead for extensions? Expected Behavior: LiveKit should send INVITE sip:1001@sip.example.com:5060 to my Asterisk server. Additional Context: - Documentation shows phone number examples only (e.g., +12135550100) - The error message mentions “SIP user” is supported, but no documentation on how to use it - Inbound calls (Asterisk → LiveKit) work perfectly
t
Thanks for reaching out, Tomoaki. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you call SIP extensions or users using
CreateSIPParticipant
, here are a few friendly suggestions you can try: 1. Simply use the extension directly in the
sip_call_to
field, like
1001
or
1001@yourpbx.com
. Just make sure your SIP trunk and PBX are set up to handle these calls smoothly. 2. If your PBX prefers a full SIP URI, you might try
sip:1001@yourpbx.com
. Keep in mind, though, that some systems might not accept the
sip:
prefix. 3. If dialing the extension directly doesn’t work, another way is to call your main number and then use DTMF tones to reach the extension. For example:
Copy code
{
  "sip_trunk_id": "<your-trunk-id>",
  "sip_call_to": "+1234567890",
  "dtmf": "1001#",
  "room_name": "my-sip-room",
  "participant_identity": "sip-test"
}
Just double-check that your SIP trunk is properly configured to route calls to your PBX, and keep an eye on the SIP logs to see how the INVITE requests are formatted. If you run into any bumps or have questions, I’m here to help—just let me know! Sources: Make outbound calls | LiveKit docs | Making outbound calls | LiveKit docs | protobufs/livekit_sip.proto | lib/livekit/sip_service_client.rb | SIP participant | LiveKit docs