SIP & your own PBX
Asterisk, FreePBX, 3CX or any SIP peer: credentials, addresses, codecs.
Asterisk, FreePBX, 3CX, or a carrier Pinecall does not list: anything that speaks SIP can send its calls to your agent. You declare it once as a SIP peer, point a trunk of your PBX at Pinecall, and every number it sends rings the agent you chose.
What is a SIP peer?#
A SIP peer is one of your org's carrier accounts, like a Twilio account, but with no API behind it. It is made of:
What your PBX must do#
| send calls to | the host the console shows, port 5060 |
| transport | UDP or TCP |
| the called number | in E.164 (+59829001199) in the Request-URI |
| codecs | G.722, G.711 µ-law (PCMU), G.711 A-law (PCMA), in that order of preference |
| touch tones | as telephone-events |
| authentication | the peer's username and password |
Pinecall does not take TLS or SRTP yet: a PBX or carrier that requires them cannot reach it. It also sends no REGISTER and refuses one. A carrier that only delivers calls to a registered endpoint needs a PBX in between, which registers to the carrier and sends the calls on to Pinecall.
Set up the trunk#
Add your PBX#
On production's console, open Numbers ▸ Add a number ▸ Your own PBX or another carrier. Give it
a name, the address it calls from (an IP, or a network no wider than a /24), the number it sends,
and the agent that answers. Calls go out through is optional: fill it in to call out.
Ask for approval#
Press Ask for approval. Pinecall makes the peer's username and password and shows them, with the host to send calls to. The password is shown once: copy it now.
Configure the PBX#
In your PBX, create a SIP trunk to that host on port 5060 (UDP or TCP), with that username and password, and route the number to it.
Wait for the approval#
Your addresses are approved once. Until then the number shows Not reaching us yet, and its path says what it waits for. After that, calls reach the agent, and every other number you add from this PBX is admitted right away.
The same from a terminal; the password is read on stdin, never from a flag:
$ pinecall carriers add sip --username oficina-madrid --address 198.51.100.10 \
--outbound-host pbx.example.com --label "FreePBX · Oficina Madrid"
$ pinecall carriers show oficina-madrid
$ pinecall numbers import +34910123456 --agent clinica-norte --prod
pinecall carriers show prints each address with where it stands: waiting, approved or
refused. The address your PBX sends to is shown in the console only.
pinecall numbers importworks while the org holds one carrier account; with more, add the number from the console (Phone numbers).
Approved addresses#
Port 5060 is closed to the internet: Pinecall only accepts SIP from addresses it knows. Each address
of a peer must be a public IPv4 address or a network no wider than a /24. A private, loopback or
documentation range is refused. Each one waits for whoever runs the gateway (Pinecall, on Pinecall
Cloud) to approve it, once; a refused address never opens.
To change the addresses, run pinecall carriers add sip again with the same username and every
address it should have. That replaces the peer, its password included. Addresses already approved
stay approved, new ones wait, and an address you leave out is forgotten.
Calling out#
A peer with an outbound host is one of the two kinds of account an agent can call out through (the other is your own Twilio account). Pinecall dials the host you gave, with the peer's username and password unless you set an outbound pair:
| flag | what it sets |
|---|---|
--outbound-host <host> |
where Pinecall sends the agents' calls |
--outbound-transport auto|udp|tcp|tls |
the transport it dials with; auto when unsaid |
--outbound-username <user> |
a second username for calls out; its password is read on a second line of stdin |
The addresses a peer calls from are not where it takes calls: without an outbound host, a peer cannot call out. Every call out passes the org's dialling rules: Calling out.