Hi, everyone. Sorry to disturb for your rest. I am...
# ask-ai
t
Hi, everyone. Sorry to disturb for your rest. I am working on the make outbound and inbound call agent using typescript with LiveKit and Twilio. But for testing outbound call agent, I made next frontend and node backend, why isn't the user's phone received the call from agent? The user is disconnected from room soon. So the call from agent to user is not existed.
g
It seems likely that the issue with the outbound call not being received by the user's phone could be related to the SIP trunk configuration or the way the call is being initiated. Based on the LiveKit SIP documentation, ensure that your SIP trunk is correctly set up with the necessary authentication credentials and that the outbound trunk is registered with LiveKit. Additionally, verify that the SIP participant is created correctly with the appropriate phone number and trunk ID. If the room is disconnecting soon after creation, it might be due to the SIP provider not maintaining the connection. According to a Slack discussion, ensure that your SIP provider is sending keep-alive signals to maintain the connection. If the provider does not send these signals, the LiveKit SIP endpoint might send a SIP BYE to disconnect the call. Would you like more detailed troubleshooting steps or information on setting up the SIP trunk and participant correctly? Sources: - Making calls using SIP | LiveKit Docs - Slack discussion πŸ‘ 0 button πŸ‘Ž 0 button πŸ’‘ Hint: Mention @runllm in the thread for followups.
t
@millions-hair-24956 how to ensure that your SIP trunk is correctly set up with the necessary authentication credentials and that the outbound trunk is registered with LiveKit. Additionally, verify that the SIP participant is created correctly with the appropriate phone number and trunk ID.
g
To ensure your SIP trunk is correctly set up with the necessary authentication credentials and registered with LiveKit, follow these steps: 1. Set Up Environment Variables: According to the LiveKit SIP Quickstart, you need to set up environment variables for your LiveKit server URL, API key, and API secret. This is crucial for authenticating your requests. 2. Create an Outbound Trunk: Use the LiveKit CLI to create an outbound trunk. You need to create a JSON file (e.g.,
outbound-trunk.json
) with your phone number, trunk domain name, and authentication credentials (username and password). Then, register this trunk with LiveKit using the command:
Copy code
lk sip outbound create outbound-trunk.json
This command will return a trunk ID, which you should note for later use. 3. Create a SIP Participant: To make an outbound call, create a SIP participant using the
CreateSIPParticipant
API. You need to specify the trunk ID, the phone number to dial, and other participant details in a JSON file (e.g.,
sip-participant.json
):
Copy code
{
  "sip_trunk_id": "<your-trunk-id>",
  "sip_call_to": "<phone-number-to-dial>",
  "room_name": "my-sip-room",
  "participant_identity": "sip-test",
  "participant_name": "Test Caller"
}
Use the CLI to create the participant:
Copy code
lk sip participant create sip-participant.json
Would you like more detailed instructions or troubleshooting tips? Sources: - Making calls using SIP | LiveKit Docs - SIP outbound trunk | LiveKit Docs πŸ‘ 0 button πŸ‘Ž 0 button πŸ’‘ Hint: Mention @runllm in the thread for followups.
t
@millions-hair-24956 I have already create the SIP trunk like your method.
g
If you've already created the SIP trunk, the next steps involve verifying the configuration and ensuring the SIP participant is correctly set up for making outbound calls. Here’s a checklist to help troubleshoot and ensure everything is configured correctly: 1. Verify Trunk Configuration: Ensure that the trunk is correctly configured with the right domain, phone number, and authentication credentials. Double-check the JSON file used to create the trunk for any errors. 2. Check Trunk Registration: Use the LiveKit CLI to list your outbound trunks and verify that your trunk is registered correctly. You can use:
Copy code
lk sip outbound list
This command will show all registered outbound trunks and their details. 3. Create SIP Participant: Ensure that the SIP participant is created with the correct trunk ID and phone number. The JSON file for the participant should include the correct
sip_trunk_id
and
sip_call_to
fields. 4. Monitor Call Status: After creating the SIP participant, monitor the call status using SIP participant attributes. The
sip.callStatus
attribute should change to
active
once the call is connected. 5. Check Logs: Review any logs from LiveKit and your SIP provider for errors or warnings that might indicate why the call is not being received. If these steps do not resolve the issue, it might be helpful to capture SIP traffic using a tool like Wireshark to diagnose any network-related issues. Would you like more detailed troubleshooting steps or assistance with a specific part of the setup? Sources: - Making calls using SIP | LiveKit Docs - SIP participant | LiveKit Docs πŸ‘ 0 button πŸ‘Ž 0 button πŸ’‘ Hint: Mention @runllm in the thread for followups.