# README
LiveKit SIP Outbound call test
This CLI runs a E2E test for SIP outbound calls.
Prerequisites
- Two LK servers with SIP:
LK1
(outbound) andLK2
(inbound). Can be the same server. - Two SIP phone numbers:
NUM1
(outbound) andNUM2
(inbound). - SIP Trunks associated with those numbers:
TR1
(forNUM1
) andTR2
(forNUM2
). - SIP Dispatch Rule for inbound:
DR2
(forTR2
andNUM2
). With optionalPIN
. - Two LK rooms:
RM1
(onLK1
) andRM2
(onLK2
).
Twilio configuration
Trunk config for TR1
{
"outbound_number": "<NUM1>",
"outbound_address": "<project>.pstn.twilio.com",
"outbound_username": "<Twilio username>",
"outbound_password": "<Twilio password>"
}
Trunk config for TR2
{
"inbound_addresses": [],
"inbound_numbers": ["<NUM1>"],
"outbound_number": "<NUM2>"
}
Dispatch Rule config for DR2
{
"trunk_ids": ["<TR2>"],
"rule": {
"dispatch_rule_direct": {
"room_name": "<RM2>",
"pin": "<PIN>"
}
}
}
LiveKit Cloud configuration
Trunk config for TR1
{
"outbound_number": "<NUM1>",
"outbound_address": "<project-id>.sip.livekit.cloud",
"outbound_username": "<username>",
"outbound_password": "<password>"
}
Trunk config for TR2
{
"inbound_addresses": [],
"inbound_numbers": ["<NUM1>"],
"inbound_username": "<username>",
"inbound_password": "<password>",
"outbound_number": "<NUM2>"
}
Dispatch Rule config for DR2
{
"trunk_ids": ["<TR2>"],
"rule": {
"dispatch_rule_direct": {
"room_name": "<RM2>",
"pin": "<PIN>"
}
}
}
Running the test
go build .
./lktest-sip-outbound \
--ws-out $LK1_URL --key-out $LK1_KEY --secret-out $LK1_SECRET \
--ws-in $LK2_URL --key-in $LK2_KEY --secret-in $LK2_SECRET \
--trunk-out $TR1 --number-out $NUM1 --room-out $RM1 \
--number-in $NUM2 --room-in $RM2 --room-pin $PIN