Creating a SIP participant
To make outbound calls with SIP Service, create a SIP participant with the CreateSIPParticipant
API. It returns an SIPParticipantInfo
object that describes the participant.
Outbound calling requires at least one Outbound Trunk.
Create a file at sipParticipant.json
with the following content:
{"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 Call"}
Then create the SIP Participant using lk
:
lk sip participant create sipParticipant.json
This command will make a call to a specified number using number(s) associated with SIP Outbound Trunk. SIP Participant should immediately appear in room my-sip-room
.
Making a call with extension codes (DTMF)
To make outbound calls with fixed extension codes (DTMF tones), set dtmf
field in CreateSIPParticipant
request:
{"sip_trunk_id": "<your-trunk-id>","sip_call_to": "<phone-number-to-dial>","dtmf": "*123#www456","room_name": "my-sip-room","participant_identity": "sip-test","participant_name": "Test Call"}
Character w
can be used to delay DTMF by 0.5 sec.
This example will dial a specified number and will send the following DTMF tones:
*123#
- Wait 1 sec
456
Playing ringtone while the call is dialing
SIP participants emit no audio by default while the call connects. This can be changed by setting play_ringtone
field in CreateSIPParticipant
request:
{"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 Call","play_ringtone": true}
SIP Participant will start playing a dialing tone to the room until the phone is picked up.