What you need
- A SIP trunk from a carrier, with one or more Indian numbers on it.
- These details from your carrier: their SIP address and port, UDP or TCP, the IP addresses they send calls from, and how they write phone numbers. Some carriers also give you a dial prefix, or a username and password.
- A published agent to answer the calls.
What a trunk can do today
Not supported yet: encrypted calls (TLS and SRTP), registering with your
carrier (SIP REGISTER), keypad tones (DTMF relay), call transfer, and numbers
outside India. If your carrier insists on one of these, the trunk won’t work
with Mirai yet.
Step 1: Connect the trunk
- Open Phone numbers in the console and click Get a number.
- Choose Connect your SIP trunk.
- Pick your carrier: Plivo, VoiceLink or Other. A preset fills in what it can. Check every value against what your carrier gave you.
- Fill in the rest of the form and click Connect SIP trunk.
You can change any of this later with Edit on the trunk’s card. Leave the
password blank to keep the saved one. Changes apply from the next call.
Step 2: Give your carrier our details
After you connect, the trunk’s card opens at Point your trunk at us. You’ll find the card later under Phone numbers → Accounts → Your SIP trunks. Each value has a Copy button, and Copy all copies them together, ready to paste into an email to your carrier. The card is the source of truth. If it ever differs from this page, use the card. Today it shows:
Ask your carrier to:
- Send calls for your numbers to
sip.miraiminds.co, port 5060, over the transport you chose. - Accept calls and audio from
168.220.248.249. - Send and receive audio on UDP ports 20000 to 29999 at that address, as PCMU or PCMA without encryption.
Step 3: Add your numbers
A SIP trunk has no number list for us to read, so you type each number in.- On the trunk’s card, click Add a number.
- Enter the number: an Indian number, +91 and 10 digits, such as
+91 98765 43210. - Under Who answers, choose the agent that answers calls to it.
- Click Add number.
Step 4: Test both directions
- Call one of the numbers from another phone. You should hear your agent’s greeting.
- Call out from it. Click Call my phone on the trunk’s card, pick the
number under Calls come from in a small test campaign, or place an API
call with its
phone_number_id. - On each call, check that both sides hear each other. Hang up once from each end.
- Look at the trunk’s card. It shows the last call in and the last call out, with the reason if one failed. It also lists calls we turned away because they came from an address that isn’t on your list.
Billing
Calls on your own trunk carry no Mirai line charge. Your carrier bills you for the numbers and the minutes. Your agents’ minutes are billed at your plan’s rate, the same as any other call. See Billing & tiers.Carrier walkthroughs
Plivo
Plivo calls its SIP trunking Zentrunk. In the Plivo console, open SIP Trunking and:- Create an IP access list with our IP address,
168.220.248.249. - Create an outbound trunk that uses that list. Plivo gives the trunk a domain
that looks like
123456789.zt.plivo.com. You’ll enter it in Mirai. - Create an origination URI,
sip.miraiminds.co:5060, and an inbound trunk that uses it. - Attach your Plivo number to the inbound trunk.
Then add the number you attached to the inbound trunk, as in
Step 3.
Mirai can also use a Plivo number without a trunk: connect your Plivo account
with its Auth ID and Auth Token instead. See
Receive inbound phone calls.
VoiceLink
In the VoiceLink panel:- Open Voice Services → SIP Trunk Management and click Add SIP Trunk.
- Set BOT provider to Custom, and enter our SIP address and IP address from Step 2.
- Tick the numbers (DIDs) that should come to Mirai.
- Note the Tech Prefix the panel shows for your trunk.
Other carriers
Choose Other and ask your carrier for:- The SIP address and port to send calls to, and UDP or TCP.
- Every IP address they send calls from.
- How they want numbers written, and their tech prefix if they use one.
- A username and password, if they want our calls to sign in.
Troubleshooting
Set it up through the API
The API takes the same steps. Use your workspace’s API host and key, and the id of the published agent that should answer:1. Read what to give your carrier
GET /v2/telephony/options carries sip only when SIP trunks are on for your
workspace. These are the values the console shows under Point your trunk at
us.
2. Connect the trunk
The answer is
201 with the trunk. Its state is verified at once, because
nothing is checked with your carrier. Its sip holds the settings, with
has_password in place of the password.
3. Add a number and choose who answers
The number isready as soon as it’s added. Assign an agent with the number’s
current version.
phone_number_id on
POST /v2/calls, or add it to a
pool.
4. Change the trunk later
PATCH /v2/telephony/connections/{id} takes the trunk’s current version and,
in sip, only the fields that change. Leave password out to keep it, or send
null to remove it. Send "dial_prefix": "" to remove the prefix.
"state": "disabled" turns the trunk off. Changes apply from the next call.
Errors
Related
Phone numbers and pools
Pools, pace, number health, and which number a call comes from.
Receive inbound phone calls
Rent a number or connect your Plivo account, then assign an agent.
Run a campaign from your own numbers
Put your numbers in a pool and call from it at a human pace.
Billing & tiers
What a minute costs on each plan.