Send calls to a vendor with a dynamic IP
A connection sends calls to a fixed Destination. Some vendor gateways have none: a GSM gateway on a mobile or DSL line changes its IP address, or sits behind NAT. This tutorial lets such a gateway register on the switch like a phone and routes calls to wherever it is registered. Allow about 20 minutes.
If the vendor has a DNS name that always points to the gateway, for example from a dynamic DNS service, you need none of this: enter the host name as Destination of the connection.
The example gateway registers as vendor-gw1.
Before you start
Section titled “Before you start”- The vendor exists under Vendors → Vendors, with a termination route for the destinations it terminates. See Vendors and Termination routes.
- You know your switch’s SIP address: System Management → Environments, column Assigned IPs. The examples use
198.51.100.5. - You can change the SIP settings of the vendor’s gateway, or the vendor can.
Step 1: Create an account for the gateway
Section titled “Step 1: Create an account for the gateway”- Open My Customers → Accounts and click Add.
- Enter Account Name
vendor-gw1and a strong Password. The gateway registers with these credentials. - Select Registration Allowed.
- Select a Service Plan without rates. The account exists only to register; with no rates nobody can make calls with its credentials.
- Click Save & Close.
Result: the account vendor-gw1 exists.
Step 2: Register the gateway
Section titled “Step 2: Register the gateway”- In the gateway’s SIP settings, set the registrar and proxy to
198.51.100.5, the user name tovendor-gw1and the password to the account’s password. - Wait until the gateway reports a successful registration.
- In the Accounts list, hover over the status icon of
vendor-gw1. It shows Online with the gateway’s user agent and contact address.
Result: the switch knows where to reach the gateway, and updates the address every time it registers again.
Step 3: Create the connection
Section titled “Step 3: Create the connection”The connection sends calls to the switch’s own address and names the gateway account in the called number. The switch’s SIP front end looks up the registration of the account and forwards the call to the gateway.
- Open Vendors → Vendors and click Connections in the row of the vendor.
- Click Add Connection and enter Connection Name
vendor-gw1 registered. - Select Protocol SIP/UDP and enter Destination
198.51.100.5, the switch’s own address. - Under Number Translation enter CLD Translation Rule
s/^/vendor-gw1;cld=/. - Click Save & Close.
- Add the connection with the vendor’s termination route to your routing group. See Routing groups.
For the number 442079460123 the switch sends an INVITE to sip:vendor-gw1;cld=442079460123@198.51.100.5. The front end removes vendor-gw1;cld= and sends the call to the gateway’s registered address with the request URI sip:442079460123@…. The To header still carries vendor-gw1;cld=442079460123.
When the gateway expects another format, add it after cld=: s/^/vendor-gw1;cld=+/ sends +442079460123. More formats are in Translation rule examples.
Result: calls routed to the connection reach the gateway wherever it is.
Step 4: Test it
Section titled “Step 4: Test it”- Open Tools & Debugs → Test Dialplan and simulate a call from one of your customers to a number the vendor terminates.
- Check that Routing Entries list the connection with the CLD
vendor-gw1;cld=…. - Make a real test call and check that the gateway rings the destination.
- If the call connects but there is no audio, open the connection and set Use Media Relay to Always: a gateway behind NAT often cannot receive media directly.
What’s next
Section titled “What’s next”- Connecting GoIP gateways: the same setup for GSM gateways.
- Connections: every field of a connection.
- Number translation: how the CLD rule fits into the call.