Skip to content

Set up a wholesale customer

This tutorial takes a freshly installed switch to the first terminated wholesale call. At the end a customer’s PBX at a fixed IP can call a destination through your vendor, and you see the call in the customer CDRs with your price and in the vendor CDRs with the cost. Allow about two hours on a new switch, one hour if the system parameters are already set.

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

  • You have Administrator access and completed First login.
  • You have a termination agreement with a carrier: the gateway address, how they authenticate you, their price list as a CSV file.
  • You know the IP address the customer’s PBX sends calls from and the destinations they will call.
  • A SIP phone or trunk you control to make a test call from the customer’s IP, or the customer is ready to test with you.

Step 1: Set the parameters that are hard to change later

Section titled “Step 1: Set the parameters that are hard to change later”
  1. Open My Preferences at the bottom of the sidebar and set Base Currency and Time Zone. The base currency is fixed once calls are billed.
  2. Open System Management → System Parameters → Backup, Data Retention. Set Schedule to Daily and the Archive All CDRs in and Purge All CDRs in periods your contracts require.
  3. Open Billing, SMTP Server and set the SMTP Server so that invoices, notifications and password recovery can be sent. Click Test to send a test message.
  4. Open System Management → IP Firewall and allow the panel and SIP ports only from the networks that need them. See Firewall.
  5. Click Save on every page.

Result: backups run nightly, old CDRs are purged on schedule, and the switch can send mail. See System parameters for every field.

  1. Open Vendors → Vendors and click Add Vendor.
  2. Enter Vendor Name: Example Carrier, select Base Currency of the vendor’s price list and the vendor’s Time Zone. Click Save & Close.
  3. Click Connections in the vendor’s row, then Add Connection.
  4. Enter Connection Name: Example Carrier main, keep Protocol at SIP/UDP and enter Destination: sip.example-carrier.net.
  5. Enter Username and Password if the vendor uses SIP digest; leave them empty for IP authentication and send the vendor your signalling IP.
  6. Set Capacity and Max CPS from the agreement and click Save & Close.
Screenshot "admin-panel/connections-list" has not been generated yet — see scripts/screenshots/screens.yml.

Result: the vendor is listed with one connection SIP/UDP:sip.example-carrier.net. See Vendors and Connections.

Step 3: Load the vendor’s price list as termination routes

Section titled “Step 3: Load the vendor’s price list as termination routes”
  1. Open Vendors → Termination Routes and click Add.
  2. Enter Name: Example Carrier USD, select the vendor’s Currency and click Save & Close.
  3. Click Routes in the row, then Upload, and choose the vendor’s CSV file.
  4. In Map CSV Columns check that Prefix and Price N point at the right columns; map Price 1 and Interval 1 / Interval N if the file has them, otherwise set their Default Value. Click Import.
  5. Wait for the status line to show Finished on …. Open Get report. if it reports errors and fix the rows listed.

Result: the Routes list shows the vendor’s prefixes as Currently Active. See Termination routes.

  1. Open Vendors → Routing Groups and click Add.
  2. Enter Group Name: Wholesale default.
  3. In the entries table select Vendor Example Carrier, Connection Example Carrier main and Termination Route Example Carrier USD, then click Add Row.
  4. Open Routing Policy and select Least Cost first; keep Prefix Length as the second policy.
  5. Click Save & Close.

Result: the group is listed with the policy Least Cost/Prefix Length. Add a second vendor to the same group later and calls fail over automatically. See Routing groups.

Step 5: Create the tariff plan with your prices

Section titled “Step 5: Create the tariff plan with your prices”
  1. Open Tariffs & Currencies → Tariff Plans and click Add.
  2. Enter Name: Wholesale USA, select your Currency, set Billing Type to Post-Paid for an invoiced customer or Pre-Paid for one who pays up front, and Avg. Call Duration, sec to 120.
  3. Enable Loss Protection with Max Loss 0 so that no call is sold below the vendor’s price. Click Save & Close.
  4. Click Rates in the row of the plan, then Upload, and load your own price list, or click Add Rate and enter Prefix 1, Interval 1 60, Price 1 0.012, Interval N 60, Price N 0.012.

Result: the plan shows Currently Active rates for every prefix you sell. See Tariffs and Rates.

Step 6: Create the customer and the account

Section titled “Step 6: Create the customer and the account”
  1. Open My Customers → Resellers and click Add Reseller. Enter Reseller Name: Example Telecom, select a Tariff in the customer’s currency, enter Credit Limit and click Save & Close. The customer owns the accounts and receives the statements.
  2. Open My Customers → Accounts and click Add.
  3. Enter Account Name: example-telecom. Clear Registration Allowed: a trunk authenticated by IP does not register.
  4. Under Routing & Billing select Service Plan Wholesale USA and Routing Group Wholesale default.
  5. Set Balance for a prepaid customer or Credit Limit for a postpaid one, and the customer’s Time Zone.
  6. Click Save & Close.

Result: the account is listed with the service plan and routing group. See Customers and Accounts.

  1. In the Accounts list open Actions → Authentication Rules for example-telecom and click Add.
  2. Enter Remote IP Address: 203.0.113.10.
  3. Leave Incoming CLI/ANI and Incoming CLD/DNIS empty. Set Max Calls Per Second to the agreed limit if there is one.
  4. Click Save & Close.

Result: the rule is listed for the account. Add a second rule for each additional IP the customer uses. See IP-to-IP authentication.

  1. Open Tools & Debugs → Test Dialplan, set Mode to Not Authenticated Call, enter CLD (destination) 12125551234, CLI 441234567890 and Remote Address 203.0.113.10, and click Proceed. The result must name the account example-telecom, the tariff Wholesale USA, the routing group Wholesale default and a price.
  2. Make a real call from the PBX at 203.0.113.10 to a US number.
  3. Open Reports → Call Records (CDRs): the call is listed under Acct. example-telecom with your price.
  4. Open Reports → Vendors Call Records: the same call is listed under Example Carrier with the vendor’s cost.

If the test call fails, open Reports → Calls, find the call and read the Diagnosis in its card. See Call records.

Result: two CDRs for one call and a margin between them. The customer can start sending traffic.