Create a SIP Endpoint
You can create a SIP endpoint manually within your SignalWire space or programmatically through the Create A SIP Endpoint API.
If you want to create a SIP endpoint in your SignalWire Space, click the SIP tab in the left-hand side nav and click Create a Sip Endpoint.
You will need to set a few things; the username you will register your SIP endpoint as, a password to authenticate your endpoint when registering, what purchased from SignalWire or SignalWire verified phone number you would like to show when dialing a PSTN number (if left blank, a random number from your purchased numbers will be chosen), encryption status, and the default codecs/ciphers you would like to use.
You can create a SIP endpoint programmatically by making a POST request to the SIP Endpoint resource.
curl https://your-space.signalwire.com/api/relay/rest/endpoints/sip \
-X POST \
-u 'YourProjectID:YourAuthToken' \
-H 'Content-Type: application/json' \
"username" : "c3p0",
"password" : "yavinOrBust",
"caller_id" : "C-3P0"
Register SIP Endpoint to a SignalWire Phone Number
After creating a SIP Endpoint, you can register it to a phone number in the space for calls to function properly. Navigate to the Phone Numbers tab on the left-hand side nav, click the phone number that you would like to register, and then click edit settings to make changes to how the phone number will handle inbound calls and messages.
Here you will select Voice Calls for Accept Incoming Calls As, a SIP Endpoint for Handle Calls Using and you will need to use your sip username from earlier so that the system knows which endpoint to dial.
Click Save, and you are ready to make a call to your SIP endpoint!
Dial a SIP Endpoint Using SignalWire Compatible XML
You can also use SignalWire Compatible XML to dial a SIP endpoint.
To do this, use an XML Bin with the following XML in the text area and replace email@example.com with the actual sip endpoint address that was created above.
<?xml version="1.0" encoding="UTF-8"?>
This time in Phone Number Settings you will select Voice Calls for Accept Incoming Calls As, LaML Webhooks for Handle Calls Using and the URL for your LaML Bin created above for When a Call Comes In.
Click Save and give it a call!