Contact Sales

All fields are required

Programmable SIP: Connectivity and Routing | SignalWire
Product

Programmable SIP: Connectivity and Routing

How to add VoIP features to your applications and use SignalWire to route calls to SIP endpoints.

SignalWire

SIP connectivity and routing allows developers to build out solutions on SignalWire that include SIP endpoints in addition to regular business phone numbers. You can create SIP endpoints programmatically or in your SignalWire Space and route traffic to those endpoints in the SignalWire network. These endpoints could be many things, such as: PBXs / Business Phone Systems, IP Phones, Softphones, Mobile Applications, and IoT devices, just to name a few.

Creating a SIP endpoint on SignalWire is simple. You can follow our guide to creating one in your SignalWire Space or set up a SIP endpoint programmatically with our API. For an example, let’s create a SIP endpoint using cURL:

curl -L -X POST 'https://$SPACE_NAME.signalwire.com/api/relay/rest/endpoints/sip' \
-u '$PROJECT_ID:$API_TOKEN' \
--data-raw '{
 "username": "c3p0",
 "password": "yavinOrBust",
 "caller_id": "C-3P0",
 "encryption": "required"
 }'
 
 RESPONSE 201 Created
 
 {
 "type": "sip_endpoint",
 "id": "d0...11c",
 "username": "c3p0",
 "caller_id": "C-3P0",
 "send_as": "random",
 "ciphers": [
 "AEAD_AES_256_GCM_8",
 "AES_256_CM_HMAC_SHA1_80",
 "AES_CM_128_HMAC_SHA1_80",
 "AES_256_CM_HMAC_SHA1_32",
 "AES_CM_128_HMAC_SHA1_32"
 ],
 "codecs": [
 "OPUS",
 "G722",
 "PCMU",
 "PCMA",
 "G729",
 "VP8",
 "H264"
 ],
 "encryption": "required"
}

Once the endpoint has been created, you can enter the SIP credentials in your SIP device and the device will register to the network.

If you are interested in SIP trunking, you can connect your endpoint to your company’s PBX or existing system and forgo SignalWire application-level features like recording, IVR or call controls. In this setup, SignalWire takes care of sending your SIP traffic to carriers.

If you want to build an application with SignalWire services to tie into your SIP endpoint, programmatically routing SIP calls to SIP endpoints on the SignalWire network is equally as easy. Using Compatibility XML:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
 <Dial>
 <Sip>sip:alice@example.com</Sip>
 </Dial>
</Response>

Or PHP:

<?php
 use SignalWire\LaML;
 $response = new LaML;

 $dial = $response->dial();
 $dial->sip('sip:alice@example.com');
 echo $response;
?>

Caller ID

Outbound caller ID can be set in your SIP Endpoint settings in your Space or, as in the first example above, you can set it programmatically. For calls to a PSTN number, you may only choose to send calls as any purchased number or a verified number, using verified caller ID. You can even use your mobile or current business phone number. For SIP-to-SIP calls, you can use any alphanumeric combination for your caller ID.

SIP Calling (Devices and Programmatically)

SIP devices calling between SIP endpoints (SIP <-> SIP) must be done with endpoints that are in the same SignalWire project. PSTN-to-SIP calls can be routed to any SIP endpoints outside of SignalWire, Eg. PSTN -> LāML -> External SIP.

Configuring your SIP device

Depending on what your SIP device is, be it a PBX or a SIP application or IP Phone, they all require many of the same field parameters.

SIP Username
SIP Password
Local SIP Port
SIP Server 
SIP Server Port
SIP Server 
Transport Protocol
Outbound Proxy
Outbound Proxy Port
Outbound Proxy Transport Protocol

Note: In order to avoid malicious behavior, we suggest choosing a local SIP port that is not the typical SIP port.

Continuing with our earlier example, our parameters for a SIP IP Phone or soft client might be:

SIP Username: c3p0
SIP Password: yavinOrBust
Local SIP Port: 6050
SIP Server: c3p0@xxx-xxx.sip.signalwire.com (refer to your Dashboard for the correct URL)
SIP Server Port: 5061 (SIP Port: 5060, TLS Port 5061)
SIP Server Transport Protocol: TLS
Outbound Proxy: (supported but not generally needed)
Outbound Proxy Port: (supported but not generally needed)
Outbound Proxy Transport Protocol: (supported but not generally needed)

Security

Security is important to us! Communications over the open internet should be secure both in signaling and in media. We feel so strongly about security that we decided to support TLS (Transport Layer Security) and SRTP (Secure Real-time Transport Protocol) by default, at no extra charge. Other competitors in the space charge extra for encrypting calls, that’s not how we roll at SignalWire.

Call Logs

All call logs can be viewed in the Usage tab of your SignalWire Dashboard. Here, you can see details for each call including the SignalWire resource type and cost. Additional details for each call are available by clicking on the resource name.

Pricing

Our price for SIP is metered per minute/per call leg with discounts offered based on call volume. Check out our pricing page for up to date pricing. As mentioned earlier, our customers get encryption for free. We also do not charge for using LāML to route calls.

Come and build something great on SignalWire!

Here are some resources to help you get started:

To get started with a project, sign up for your free SignalWire account today. If you have any questions as you work with SIP, stop by our Community Discord to connect with our team.

Frequently asked questions

What is a SIP endpoint?

A SIP endpoint is a set of credentials and an address that a SIP device or application uses to register and place or receive calls, for example a PBX, IP phone, or softphone.

What is the difference between SIP trunking and routing calls to a SIP endpoint?

SIP trunking typically connects a provider to a PBX so the PBX handles call control, while routing calls to a SIP endpoint can also include application-level steps like IVR or call control before the call reaches the endpoint.

How do I route PSTN calls to a SIP endpoint on SignalWire?

A common pattern is to route an inbound phone number to a call handling step, then forward the call to a SIP address or endpoint on the SignalWire network using cXML or application logic.

What caller ID can I use for outbound calls?

For calls to PSTN numbers, outbound caller ID generally needs to be a purchased number or a verified caller ID. For SIP-to-SIP calls, caller ID can be more flexible, including alphanumeric values.

Does SignalWire support secure SIP calling?

Yes. The post states TLS for signaling and SRTP for media are supported by default, at no extra charge.

Related Articles