Inbound calls (origination)
When someone calls a number attached to your trunk, we deliver the call to your SIP server.
Attach numbers to your trunk
Calls reach your server only for numbers attached to your trunk. You can attach as many of your Superfone numbers as you need. They all share the trunk's limits and your organisation's limits.
A number can be attached when it:
- is a Superfone number on your account,
- is in service (not on hold or refunded),
- is not linked to an SFVoPI app, and
- is not attached to another trunk.
Write numbers in E.164 format with a leading +, for example +91XXXXXXXXXX.
A number has exactly one owner at a time: one trunk or one SFVoPI app. If a number is already on another trunk or an SFVoPI app, attaching it fails with an error that names the number. Attaching a number that is already on this trunk is not treated as a conflict. We never move a number from one trunk or app to another on our own. Detach it from its current owner first. See Errors when attaching a number.
When you detach a number, or delete the trunk, the number goes back to working like any other Superfone number.
What we need from you
| Host | A public IPv4 address or public hostname for your SIP server. Private and IPv6 addresses are not accepted |
| Port | Defaults to 5060 |
| Transport | udp or tcp, as set on your trunk. udp is the default. tls is not supported. See Transport |
| Fallback | Optional. A second host, port and transport that we try when your primary server is down. See Fallback destination |
| Firewall | Accept SIP over your trunk's transport, and RTP, from our network addresses |
| Codec | Accept G.711 A-law (PCMA) |
What your server receives
We send a standard SIP INVITE to your host and port.
| Part | What it contains |
|---|---|
| Request-URI | sip:+<dialled number>@<your host>:<your port>;transport=<udp or tcp>. The user part is the Superfone number that was called, in E.164 format with +. The transport parameter matches your trunk's transport setting |
| From | The caller's number, in E.164 format with +. If we cannot read the caller's number, we pass it on as we received it |
| To | Do not route on this header. Use the user part of the Request-URI to find out which of your numbers was called |
| SDP | G.711 audio |
For example, a call from +91YYYYYYYYYY to your number +91XXXXXXXXXX, with your server at pbx.example.com, arrives as:
INVITE sip:+91XXXXXXXXXX@pbx.example.com:5060;transport=udp SIP/2.0
From: <sip:+91YYYYYYYYYY@...>;tag=...
Your server may receive additional X- headers. Do not depend on them. They can change or be removed without notice.
When delivery fails
| What happened | Result |
|---|---|
| Your server rings but does not answer within 60 seconds | The call ends. We do not try your fallback |
Your server rejects the call: busy, declined, or another 4xx or 6xx reply | The call ends. We do not try your fallback |
| Your server cannot be reached, or does not respond within about 5 seconds | We try your fallback once, if you set one. Otherwise the call ends |
Your server replies with a 5xx error | We try your fallback once, if you set one. Otherwise the call ends |
| The trunk is suspended | The call is not delivered to your server |
| The number is not attached to the trunk | The call is handled like any other Superfone number, not sent to your server |
| Your wallet balance is Rs. 200 or below | The call is not delivered to your server. The caller may hear ringing before the call ends |
| The trunk, or your organisation, is at its CPS or concurrent-call limit | The call is not delivered to your server |
Organisation call limits ship with the org-limits release.
Fallback destination
You can give your trunk a fallback: a second SIP server for when your primary is down. We always deliver to your primary first. We try the fallback once, only when the primary does not respond within about 5 seconds or replies with a 5xx error. If the primary rang and nobody answered, or it rejected the call, we do not try the fallback. Unanswered calls ring for up to 60 seconds in total.
The fallback gets the same INVITE as your primary, addressed to the fallback host and port. Allow our network addresses on both servers. To set or remove a fallback, see Fallback destination in the API reference.
Several destinations with priority and weight are on the roadmap.
Recording and call records
Inbound trunk calls are recorded according to your trunk's recording setting. When the trunk has none, which is the default, they follow the call recording setting of the number that was called. Each call produces a Superfone call record with your trunk FQDN on it. See Limits and billing.
Next Steps
- Outbound calls: send calls from your server to Indian numbers
- Troubleshooting: inbound calls that do not reach your server
- Limits and billing: how limits and the wallet affect inbound calls