Export and bulk import of unassigned destinations
This guide describes how to export all unassigned destinations to CSV, assign them to destination groups in the file, and re-import them in bulk. It uses the existing Directions and Destinations and Unassigned Destinations concepts.
Background
What are unassigned destinations?
Destinations that have no associated destination group in MOR. They appear under SETTINGS → Billing → Directions → Unassigned Destinations.
Why does it matter?
- Destinations not assigned to any group do not appear in call reports (e.g. Calls by Source).
- This can lead to incorrect billing and missing call records.
- Assigning them to destination groups is required for proper monitoring and billing.
Who can use this?
Admins and accountants with the appropriate permission (e.g. manage directions). The same permission is used as for the Unassigned Destinations page and the "Fix all Unassigned Destinations" feature.
Overview of the workflow
- Export – Download a CSV of all unassigned destinations from the Unassigned Destinations page.
- Edit – In the CSV, fill in the destination group for each row (by ID and/or name).
- Import – Upload the CSV via SETTINGS → Billing → Directions → Groups → Import from CSV; review the map results and fix any invalid lines if needed, then run the import.
Step 1: Export all unassigned destinations to CSV
- Go to SETTINGS → Billing → Directions → Unassigned Destinations.
- On the same row as Fix all Unassigned Destinations, click Export all unassigned to CSV (CSV icon + label).
- The browser will download a file named like:
unassigned_destinations_YYYYMMDD_HHMMSS.csv.
CSV contents:
- Columns:
prefix,name,direction_code,action,dst_group_id,dst_group_name actionis set toaddfor every row (assign to a group).dst_group_idanddst_group_nameare empty; you will fill one or both in the next step.- The import matches each row to a destination by prefix (the export already includes the correct prefix; you do not need to look up destination ID for the import).
- The CSV uses the same column separator as in your user/CSV settings so it matches the rest of MOR.
Note:
If there are no unassigned destinations, you will get a CSV with only headers. The export is streamed and can handle thousands of rows.
Step 2: Edit the CSV and assign destination groups
- Open the downloaded CSV in Excel, LibreOffice Calc, or another spreadsheet editor (or a text editor if you prefer).
- For each row you want to assign:
- Option A: Fill dst_group_id with the numeric ID of the destination group (match by ID first on import).
- Option B: Fill dst_group_name with the exact name of the destination group (used if ID is empty or not found).
- Option C: Fill both; import will resolve by ID first, then by name if needed.
- Leave prefix, name, direction_code, and action unchanged unless you know what you are doing. The import uses prefix to find the destination and action =
addto assign it to the group. - Save the file as CSV (same separator as in MOR if possible, to avoid re-upload issues).
Validation rules (import will enforce these):
- The destination group must exist in the system (by ID or by unique name). Rows that do not match any group will be reported as invalid and not imported.
- If the same prefix appears more than once in the CSV, only the first occurrence is processed; duplicates are skipped and a warning is shown on the Map Results page.
Where to find group IDs and names:
Go to SETTINGS → Billing → Directions → Groups (the Groups list). The list shows group names; IDs can be taken from the URL when editing a group or from exports/reports that include destination group ID.
How to find destination group ID (for dst_group_id):
- From the Groups list: Click Edit (pencil icon) next to a destination group. The browser URL will look like
.../destination_groups/edit/123— the number at the end is the destination group ID (e.g. 123). - From the Groups list: Click View for a group to see its destinations. The URL will look like
.../destination_groups/destinations/123— that number is the destination group ID. - You can then use this ID in the dst_group_id column of your CSV. Using dst_group_name (exact name as shown in the list) is also supported and does not require knowing the ID.
Step 3: Import the CSV via Groups
- Go to SETTINGS → Billing → Directions → Groups (the main list of destination groups).
- At the top of the page, click Import from CSV (CSV icon + "Import from CSV").
- Upload:
- On the file upload page, click Choose File (or equivalent) and select your edited CSV.
- Click Upload file.
- Map Results:
- After upload, you are taken to the Map Results page.
- Check:
- Total – total rows in the file.
- Prefixes to remove – destinations that will be unassigned from their current group (if your file only has
addrows, this is often 0). - Prefixes to add – destinations that will be assigned to the groups you specified.
- Invalid – number of rows that could not be processed (wrong/missing group, prefix not found, invalid action, etc.). Click the number to open Invalid Lines and see details.
- If the CSV contained duplicate prefixes, a warning appears: "Duplicate prefixes in CSV were skipped (first occurrence used)" and a truncated list of those prefixes.
- Buttons:
- Cancel – abort the import and drop the uploaded file.
- Import – run the import (enabled only when there is at least one row to add or remove).
- Confirm:
- When you click Import, a confirmation dialog appears ("Are you sure?"). Click OK to proceed.
- After the import finishes, you are redirected to the Groups list and a success or error message is shown.
Step 4: If there are invalid lines
- On the Map Results page, click the Invalid count to open Invalid Lines.
- Use the search filters (Prefix, Destination group, Action, Reason) to narrow down rows.
- Reasons you may see:
- Prefix_was_not_found – the prefix in the CSV does not exist in the destinations table (e.g. typo or old data).
- Destination_group_was_not_found – the destination group (by ID or name) does not exist or is ambiguous (e.g. duplicate name). Correct dst_group_id or dst_group_name in the CSV and re-upload, or fix the group in MOR first.
- Action_was_not_found – the action is not
addorremove; fix the CSV. - Already_Assigned / Already_Unassigned / Multiple_Destination_groups_exist – see the invalid lines view for details; adjust the CSV or the groups as needed.
- Fix the CSV (and optionally the system data), then go back to SETTINGS → Billing → Directions → Groups → Import from CSV and upload the corrected file again. You can use Back to Map Results to return from Invalid Lines without re-uploading.
Summary checklist
| Step | Where | Action |
|---|---|---|
| 1 | SETTINGS → Billing → Directions → Unassigned Destinations | Click Export all unassigned to CSV and save the file. |
| 2 | Your computer | Open CSV; fill dst_group_id and/or dst_group_name for each row; save. |
| 3 | SETTINGS → Billing → Directions → Groups | Click Import from CSV → choose file → Upload file. |
| 4 | Map Results page | Check Total, Prefixes to add/remove, Invalid; read duplicate-prefix warning if shown; click Import and confirm. |
| 5 | If needed | Open Invalid Lines from the Invalid count; fix CSV or data and re-upload. |
See also
- Directions and Destinations – Unassigned Destinations section and "Fix all Unassigned Destinations".
- I cannot see calls in Calls by Source – why unassigned destinations affect reporting.
- Destinations Groups – managing destination groups and adding destinations manually.
- Integrity Check – Destinations not assigned to Destination Groups – alternative way to find and handle unassigned destinations.