Skip to main content
Hamsa answers and places calls on numbers you already own. You can connect a Twilio number with your account credentials, or any number from a SIP provider through a SIP trunk. Once a number is added, you assign it to an agent on the Phone numbers page.

Before you start

  • You need to be an Owner or Admin in the project.
  • For Twilio: the number, your Twilio account SID and auth token.
  • For a SIP trunk: the number, your provider’s SIP address, and the trunk username and password if your provider uses them.

Add a Twilio number

1

Open Bring your own number

In the sidebar, open Telephony > Bring your own number and click Add number > Twilio.
The Add number menu with Twilio and SIP trunkThe Add number menu with Twilio and SIP trunk
2

Fill in the number

The Twilio form filled in: Label, Phone number, Twilio account SID and Twilio auth token, with the tip to use an Ireland (IE1) auth tokenThe Twilio form filled in: Label, Phone number, Twilio account SID and Twilio auth token, with the tip to use an Ireland (IE1) auth token
3

Click Add

Hamsa checks your credentials, checks that the number belongs to that Twilio account, and connects it.
Use the auth token from your Twilio IE1 (Ireland) region. The Ireland edge is closest to Hamsa’s voice infrastructure, so calls have less delay. A US auth token still works, with more delay.
What Hamsa changes in your Twilio account: it creates an Elastic SIP trunk that sends the number’s calls to Hamsa, and moves the number onto it. If the number was handling calls somewhere else, it stops doing that. When you delete the number in Hamsa, that trunk is removed. Errors you may see:

Add a SIP trunk number

1

Open Bring your own number

Click Add number > SIP trunk.
2

Enter the label and number

Enter a Label. Under the number, choose Phone number for a regular number, or Other for an extension or short code your system dials, such as 1000.
3

Copy the inbound address

Under Inbound configuration, copy the Origination URI. Your provider sends the number’s calls to this address. If the form also asks for Carrier IPs, enter the IP addresses your provider sends calls from (see The Hamsa SIP gateway).
4

Enter the outbound details

Under Outbound configuration, enter where Hamsa sends calls when your agent dials out:
Outbound configuration filled in: SIP address, Transport type TCP, trunk username and password, Custom SIP headers, and the Advanced section collapsedOutbound configuration filled in: SIP address, Transport type TCP, trunk username and password, Custom SIP headers, and the Advanced section collapsed
5

Click Add

The number is saved. Give your provider the values on its page (see below).
The SIP trunk form for a +971 number: Label, Phone number, Inbound configuration with the gateway Origination URI and two Carrier IPs, and the start of Outbound configurationThe SIP trunk form for a +971 number: Label, Phone number, Inbound configuration with the gateway Origination URI and two Carrier IPs, and the start of Outbound configuration
Hamsa never shows the trunk password again after you save. You can’t edit a number later: to change anything, delete it and add it again.

The Hamsa SIP gateway

On Hamsa cloud, SIP numbers in international format (a + and 6 to 15 digits) and short numbers (2 to 15 digits) go through the Hamsa SIP gateway. The gateway sits between your provider and your agent and gives you extra settings. The form shows the gateway fields when your number qualifies. Extra fields for gateway numbers:
The Advanced section open: Media encryption (SRTP) Off (default), Codecs PCMU, then PCMA (default), and Headers to pass to the agentThe Advanced section open: Media encryption (SRTP) Off (default), Codecs PCMU, then PCMA (default), and Headers to pass to the agent
The origination URI follows the transport type: sip:sbc.tryhamsa.com:5060;transport=tcp for TCP, sip:sbc.tryhamsa.com:5060;transport=udp for UDP and sips:sbc.tryhamsa.com:5061;transport=tls for TLS. Always copy it from the form. After you add a gateway number, its page shows Carrier setup with what your provider needs:
A gateway number's page: Carrier setup with Send calls to and Allow calls from, then its SIP configurationA gateway number's page: Carrier setup with Send calls to and Allow calls from, then its SIP configuration
If the number’s page has no Carrier setup card, the number connects directly: give your provider the Origination URI from SIP configuration. Carrier IPs, TLS, SRTP, codecs and pass-through headers don’t apply to direct numbers.

The gateway’s addresses

The gateway uses one static IP for SIP signalling and call audio. Give these to your provider, or to whoever sets up its firewall:

Use SIP headers in your agent

Headers your provider sends on inbound calls are available to the agent as {{sip.headers['header-name']}}, with the header name in lowercase, whatever case your provider uses. For example, {{sip.headers['x-conversation-id']}}. On gateway numbers, only the headers listed in Headers to pass to the agent reach it. See System variables.

Good to know

  • Each number can be added to Hamsa once, across all projects.
  • Twilio numbers are checked against your Twilio account when you add them. SIP numbers aren’t checked: a wrong address only shows when a call fails.
  • There’s no connection test in the form. Place a test call after adding the number (see Test a call from a number).
  • If the SIP address or credentials are wrong, inbound calls can still work while outbound and batch calls fail when they dial.

Phone numbers

Assign the number to an agent and test it.

Make an outbound call

Have your agent call someone.

System variables

Read the caller’s number and SIP headers in prompts.

Batch calls

Call a list of people from the number.