Skip to content

DID Management Scripts

Admin scripts for assigning and managing DIDs on the OSS VPS.

Admin Only

These scripts run on the OSS VPS (185.252.235.208). Contributors do not have SSH access -- they email cats@astradial.com to request a DID.

Scripts Location

/opt/astradial-oss/scripts/
├── assign-did.sh     # Assign DID to developer org
├── list-dids.sh      # List all assigned DIDs
└── remove-did.sh     # Remove DID from org

assign-did.sh

Assigns a DID to a developer's organisation. Updates the database, deploys Asterisk config, and pushes routing to the NUC.

# Usage
/opt/astradial-oss/scripts/assign-did.sh <DID> <ORG_ID>

# Example: assign +91-22-XXXX-XXXX to org 5
/opt/astradial-oss/scripts/assign-did.sh 912240001234 5

What it does:

  1. Inserts DID record into astradial_oss database
  2. Generates Asterisk dialplan for the DID
  3. Reloads Asterisk config
  4. Pushes routing rule to NUC (exten => DID,1,Dial(PJSIP/DID@oss_trunk_endpoint,30))

list-dids.sh

Lists all currently assigned DIDs with org info.

# Usage
/opt/astradial-oss/scripts/list-dids.sh

# Output example:
# DID            | Org ID | Org Name       | Assigned
# 912240001234   | 5      | dev-contrib-1  | 2026-04-13
# 912240005678   | 8      | test-org       | 2026-04-10

remove-did.sh

Removes a DID assignment from an organisation. Cleans up database, Asterisk config, and NUC routing.

# Usage
/opt/astradial-oss/scripts/remove-did.sh <DID>

# Example
/opt/astradial-oss/scripts/remove-did.sh 912240001234

What it does:

  1. Removes DID record from database
  2. Removes Asterisk dialplan entry
  3. Reloads Asterisk config
  4. Removes routing rule from NUC

Manual Process

The end-to-end flow for DID assignment:

  1. Developer emails cats@astradial.com with org name and DID request
  2. Admin picks an available DID from the pool
  3. Admin SSHs into OSS VPS and runs assign-did.sh <DID> <ORG_ID>
  4. Admin confirms the DID is routable (test call)
  5. Admin replies to developer with DID number and setup confirmation