Skip to content

Quickstart: wholesale

In the wholesale scenario a customer sends you calls from their own PBX or SIP trunk, authenticated by IP address, and you terminate them through a carrier. At the end of this quickstart a test call from the customer’s IP reaches the vendor, and both of you see it in the CDRs with the right price. Allow about an hour.

The example uses a vendor called Example Carrier with the gateway sip.example-carrier.net, a customer called Example Telecom whose PBX has the IP 203.0.113.10, and traffic to the United States (prefix 1).

Wholesale call flow: PBX or SIP trunk, account, routing group, vendor connection, vendor

  • You have Administrator access to the panel and you completed First login, including the base currency.
  • You have a termination agreement with at least one carrier: the gateway address, the authentication method (IP or SIP digest) and their price list.
  • You know the IP address the customer sends calls from.
  1. Open Vendors → Vendors.
  2. Click Add Vendor.
  3. Enter Vendor Name: Example Carrier.
  4. Set Base Currency to the currency of the vendor’s price list. Prices are converted to your base currency through Exchange Rates.
  5. Set Time Zone to the time zone the vendor bills you in. Reconciliation is easier when both CDR sets use the same day boundaries.
  6. Leave Balance at 0. It goes negative as you terminate calls and comes back up when you record a payment to the vendor.
  7. Click Save & Close.

Web Login and Web Password are generated automatically. Give them to the vendor if you want them to see their CDRs in the vendor portal.

Result: the vendor appears in the list with Balance 0 and no connections yet.

A connection is one SIP gateway of the vendor. One vendor can have several.

  1. In the Vendors list click Connections in the row of Example Carrier.
  2. Click Add.
  3. Enter Connection Name: Example Carrier main.
  4. Set Protocol: SIP.
  5. Enter Destination: sip.example-carrier.net. Add :port only when the gateway does not listen on 5060.
  6. If the vendor authenticates you by SIP digest, enter Username and Password. Leave both empty for IP authentication; in that case the vendor must allow the switch’s signalling IP on their side.
  7. Set Capacity and Max CPS to the limits from the agreement, or leave them empty for unlimited.
  8. Click Save & Close.

Result: the connection is listed under the vendor as SIP:sip.example-carrier.net.

Termination routes hold the vendor’s price list: a prefix, the billing intervals and the price per minute. Every connection you want to use needs a termination route.

  1. Open Vendors → Termination Routes.
  2. Click Add, enter Name: Example Carrier USD, select the vendor’s Currency and click Save.
  3. Click Routes in the row you created.
  4. Add the routes in one of two ways:
    • Click Add Route and enter Prefix: 1, Interval 1: 60, Price 1: 0.010, Interval N: 60, Price N: 0.010. Click Save & Close. Repeat for every prefix.
    • Click Upload and load the vendor’s price list from a CSV file. Map the columns once; the mapping is remembered for the next upload.

Interval 1 and Price 1 apply to the first billing interval, Interval N and Price N to every following one. 60/60 is per-minute billing, 1/1 is per-second billing.

Result: the Routes list shows your prefixes with Currently Active status.

A routing group decides which connection handles a call. It is assigned to accounts.

  1. Open Vendors → Routing Groups.
  2. Click Add.
  3. Enter Group Name: Wholesale default.
  4. Click Add Row and select Vendor Example Carrier, Connection Example Carrier main and Termination Route Example Carrier USD.
  5. Leave Order # at 1. With several connections, the lowest order is tried first; use Weight to split traffic between connections with the same order.
  6. Click Save & Close.

Result: the routing group is listed with one entry. You can add more vendors to the same group later and the switch will fail over in order.

The tariff plan is what you charge the customer: a price list that mirrors the termination routes with your margin on top, plus the billing rules. The sidebar manages tariffs and their plans on one screen.

  1. Open Tariffs & Currencies → Tariff Plans.
  2. Click Add.
  3. Enter Name: Wholesale USA, select your Currency and set Avg. Call Duration, sec to a realistic value such as 120. Leave Connect Fee and Free Seconds at 0 for wholesale.
  4. Set Billing Type: Post-Paid for a customer you invoice, Pre-Paid for one who pays in advance.
  5. Click Save & Close.
  6. Click Rates in the row of the new plan.
  7. Click Add Rate and enter Prefix: 1, Interval 1: 60, Price 1: 0.012, Interval N: 60, Price N: 0.012. Click Save & Close. Or click Upload and load your price list from a CSV file, exactly like the termination routes.

Result: the plan shows Currently Active rates for every prefix you sell.

In wholesale the customer’s PBX or SIP trunk is one account. The account carries the balance and the credit limit.

  1. Open My Customers → Accounts.
  2. Click Add.
  3. Enter Account Name: example-telecom. For IP authentication the name is only a label; the PBX never sends it.
  4. In Routing & Billing select Service Plan Wholesale USA and Routing Group Wholesale default.
  5. Set Balance and Credit Limit. A prepaid customer gets a positive balance and Credit Limit 0; a postpaid customer gets Balance 0 and a credit limit equal to the agreed exposure.
  6. Set Time Zone to the customer’s time zone so their CDRs show local time.
  7. Click Save & Close.

Result: the account appears in the list with the service plan and routing group you selected.

The rule tells the switch that calls arriving from the customer’s IP belong to this account.

  1. In the Accounts list open the Actions menu of example-telecom and click Authentication Rules.
  2. Click Add.
  3. Enter Remote IP Address: 203.0.113.10.
  4. Leave Incoming CLI/ANI empty to accept any caller number from that IP. Set it when the same IP sends traffic for several customers.
  5. Click Save & Close.

The Advanced Parameters of a rule can override the Tariff and the Routing Group of the account, which lets one account carry several price levels. See IP-to-IP authentication and Understanding authentication.

Result: the rule is listed for the account with the customer’s IP.

The dialplan test simulates a call without sending a single SIP packet.

  1. Open Tools & Debugs → Test Dialplan.
  2. Set Mode: Not Authenticated Call.
  3. Enter CLD (destination): 12125551234, CLI: 441234567890 and Remote Address: 203.0.113.10.
  4. Click Proceed.
Screenshot "getting-started/test-dialplan" has not been generated yet — see scripts/screenshots/screens.yml.

The Result block must show Authenticated Account example-telecom, Tariff Wholesale USA, Routing Group Wholesale default, the matched Prefix and the Price. If it shows an error, the message says which step is missing: no authentication rule for the IP, no rate for the prefix, or no route in the routing group.

  1. Ask the customer to dial a US number from the PBX at 203.0.113.10, or send one yourself from a SIP trunk with that IP.
  2. Open System Management → Active Calls while the call is up. It shows the account, the connection and the media relay in use.
  3. After hang-up open Reports → Call Records (CDRs). The call appears once with the customer’s price.
  4. Open Reports → Vendors Call Records. The same call appears with the vendor’s price.

If the call fails, open Tools & Debugs → SIP Logs Viewer, search by the CLD and read the final response code. See SIP response codes.

Result: one CDR for the customer and one for the vendor, with the margin between the two prices.