Skip to content

Bulk route upload

A vendor’s price list often has thousands of prefixes, and prices change every week. Instead of editing routes one by one, you download the routes of a termination route as a file, change it in a spreadsheet and upload it back. Each row carries an action that says whether to add, update or delete the route. The same method works for the rates of your tariffs.

Open Vendors → Termination Routes, click Routes in the row of the vendor’s termination route, and use Download and Upload above the list. The URL is /routes.php?i_destination_set=<id>. Uploading needs the edit right of your access level. See Termination routes.

Screenshot "admin-panel/routes-upload-mapping" has not been generated yet — see scripts/screenshots/screens.yml.

Download exports the routes that match the current filter as CSV or Excel, in your download format. The file has these columns:

Column Meaning
Action [A|D|U|S|SA] What to do with the row on upload. Empty in a downloaded file; an empty action skips the row
Id The route’s id. Needed for U and D; leave it empty for new rows
Prefix The destination prefix. Letters, digits, _ and #. Several prefixes separated by commas in one row are applied one by one for A, S and SA
Country Exported for reference, ignored on upload
Preference Preference of the route; 5 when the column is not mapped
Interval 1, Interval N Billing intervals in seconds
Price 1, Price N The vendor’s price per minute for the first and the next intervals
1xx Timeout, 2xx Timeout The route’s timeouts in seconds; 10 and 60 when not mapped
Huntstop, Forbidden 1 or 0
Activation Date When the route starts: a date and time, or now. Must not be in the past
Expiration Date When the route ends: a date and time, or never. Empty means never

A termination route with Local Calling enabled adds Area/State Name, Local Interval 1, Local Interval N, Local Price 1 and Local Price N.

  1. Click Download to get the current routes. For a new termination route, add one route by hand first and download it as a template.
  2. Open the file in a spreadsheet and put an action in the first column of every row you want to change, as described below. Add new rows at the end with A.
  3. Save the file as .csv or .xlsx.
  4. Click Upload and choose the file. Map CSV Columns opens.
  5. Check that each field is mapped to the right column. Prefix and Price N are required. For an unmapped field set a default, and set a Multiplier on the prices if you want to scale them, for example 1.05 for 5%.
  6. Click Import.
  7. Wait for the job to finish. The status line shows Uploading, then Processed with the percentage, and Finished on with the time. The termination route is locked for changes until then.
  8. Click Get report. when the status shows with errors. The report holds the rows that failed, each with an Error Message column.

A vendor’s own file can be uploaded directly, without the download step: map its columns in the dialog and set the default action to A — Add or AS — Add or Update.

Action What it does
A Adds a new route. If the prefix already has an open-ended route, the new one must start later; the old one is closed at that date
U Updates the route with this Id
S Updates the current route with this Prefix
SA (or AS) Updates the route with this Prefix if there is one, adds it otherwise
D Deletes the route with this Id

The order of the letters does not matter: SA and AS are the same action.

An active route keeps its Activation Date: on U and S the value in the file is ignored for routes that are already active. To change an active price from a date, add a new route for the prefix with A and that Activation Date, or set an Expiration Date on the old one. A discontinued route cannot be changed. See Activation and expiration dates.

The report lists every row that failed with its reason. The usual ones:

Message Fix
"Prefix" field has incorrect format. Remove spaces, + and other symbols from the prefix
"Activation Date" cannot be in the past. Use now or a future date for new routes
Another Route with conflicting "Prefix" or "Activation/Expiration Date" already exists. The prefix already has a route for that period: use S to update it, or give the new route a later activation date
Unrecognized Action. Use one of A, U, S, SA, D
No such Id. The Id belongs to another termination route or the route was deleted: download the file again
No such Prefix. S found no active route for the prefix: use SA to add it

Fix the failed rows in your original file, not in the report. Clear the action of the rows that succeeded, so they are not applied twice, and upload the file again.