Skip to content

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.

  • 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.
  1. Open My Customers → Accounts and click Add.
  2. Enter Account Name vendor-gw1 and a strong Password. The gateway registers with these credentials.
  3. Select Registration Allowed.
  4. Select a Service Plan without rates. The account exists only to register; with no rates nobody can make calls with its credentials.
  5. Click Save & Close.

Result: the account vendor-gw1 exists.

  1. In the gateway’s SIP settings, set the registrar and proxy to 198.51.100.5, the user name to vendor-gw1 and the password to the account’s password.
  2. Wait until the gateway reports a successful registration.
  3. 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.

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.

  1. Open Vendors → Vendors and click Connections in the row of the vendor.
  2. Click Add Connection and enter Connection Name vendor-gw1 registered.
  3. Select Protocol SIP/UDP and enter Destination 198.51.100.5, the switch’s own address.
  4. Under Number Translation enter CLD Translation Rule s/^/vendor-gw1;cld=/.
  5. Click Save & Close.
  6. Add the connection with the vendor’s termination route to your routing group. See Routing groups.
Screenshot "tutorials/vendor-dynamic-ip-connection" has not been generated yet — see scripts/screenshots/screens.yml.

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.

  1. Open Tools & Debugs → Test Dialplan and simulate a call from one of your customers to a number the vendor terminates.
  2. Check that Routing Entries list the connection with the CLD vendor-gw1;cld=….
  3. Make a real test call and check that the gateway rings the destination.
  4. 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.