A powerful Bash-based skill for interacting with the dSIPRouter REST API. Generated from the included Postman collection, this skill provides a convenient CLI and a safe curl-based calling convention.
Are you looking for our MCP Server? It's located here
Before installing this skill, ensure you have the following tools available on your system:
- curl — For making HTTP requests
- jq — For JSON processing and formatting
- Bash — Version 4.0 or later
You can verify these are installed:
command -v curl && command -v jq && bash --versionOn macOS, install missing tools using Homebrew:
brew install curl jqOn Linux (Ubuntu/Debian):
sudo apt-get install curl jq- Clone or copy the repository:
git clone https://github.com/dOpensource/dsiprouter-skill
cd dsiprouter-skill- Make the CLI executable:
chmod +x bin/dsiprouter.sh- Add to your PATH (optional but recommended):
# Copy to a directory in your PATH
sudo cp bin/dsiprouter.sh /usr/local/bin/
# Or add the current directory to PATH in your shell profile
export PATH="$PWD/bin:$PATH"- Configure environment variables:
Set the required environment variables for your dSIPRouter instance:
export DSIP_ADDR="your-dsiprouter-host" # e.g., "192.168.1.100" or "dsip.example.com"
export DSIP_TOKEN="your-api-bearer-token" # Your API token from dSIPRouterFor self-signed certificates, you can also set:
export DSIP_INSECURE=1 # Allows connections to servers with self-signed TLS certificatesTo make these permanent, add them to your shell profile (~/.bashrc, ~/.zshrc, etc.).
dsiprouter.sh helpList all endpoint groups:
dsiprouter.sh endpointgroups:list | jq .Get a specific endpoint group:
dsiprouter.sh endpointgroups:get | jq .Create an inbound mapping:
dsiprouter.sh inboundmapping:create '{"did":"13132222223","servers":["#22"],"name":"My Location"}' | jq .Check Kamailio statistics:
dsiprouter.sh kamailio:list | jq .Reload Kamailio after making changes:
dsiprouter.sh kamailio:reload | jq .This skill provides command groups organized by resource type. Each command follows the pattern:
dsiprouter.sh <resource>:<action> [options]Manage endpoint groups and SIP endpoints:
endpointgroups:list— List all endpoint groupsendpointgroups:get— Get details of a specific endpoint groupendpointgroups:create— Create a new endpoint groupendpointgroups:update— Update an existing endpoint groupendpointgroups:delete— Delete an endpoint group
Monitor and manage the Kamailio SIP server:
kamailio:list— Get Kamailio call statisticskamailio:reload— Trigger a Kamailio reload (required after configuration changes)
Configure DID (Direct Inward Dialing) to endpoint mapping:
inboundmapping:list— List all inbound mappingsinboundmapping:create— Create a new inbound mappinginboundmapping:update— Update an existing inbound mappinginboundmapping:delete— Delete an inbound mapping
Manage endpoint leases:
leases:list— List active endpoint leasesleases:revoke— Revoke an endpoint lease
Manage carrier/trunk configurations:
carriergroups:list— List all carrier groupscarriergroups:create— Create a new carrier group
User management:
auth:create— Create a new API user
This skill implements a safe curl wrapper with the following features:
- Automatic authentication — Includes the Bearer token from
DSIP_TOKEN - Error handling — Shows errors and exits on failure
- Timeout protection — 5-second connection timeout, 30-second max time
- TLS flexibility — Optional insecure mode for self-signed certificates
- Content negotiation — Automatically sets JSON headers
The underlying function:
dsip_api() {
local method="$1"; shift
local path="$1"; shift
local insecure=()
if [ "${DSIP_INSECURE:-}" = "1" ]; then insecure=(-k); fi
curl "${insecure[@]}" --silent --show-error --fail-with-body \
--connect-timeout 5 --max-time 30 \
-H "Authorization: Bearer ${DSIP_TOKEN}" \
-H "Content-Type: application/json" \
-X "${method}" "https://${DSIP_ADDR}:5000${path}" \
"$@"
}| Variable | Required | Description |
|---|---|---|
DSIP_ADDR |
Yes | Hostname or IP address of your dSIPRouter instance (without scheme) |
DSIP_TOKEN |
Yes | Bearer token for API authentication |
DSIP_INSECURE |
No | Set to 1 to allow self-signed TLS certificates |
All requests are sent to:
https://$DSIP_ADDR:5000/api/v1
dsiprouter.sh endpointgroups:list | jq '.count'dsiprouter.sh endpointgroups:create '{
"name": "My Endpoints",
"sip_profile_id": 1
}' | jq .dsiprouter.sh inboundmapping:create '{
"did": "13132222223",
"servers": ["#22"],
"name": "Main Office",
"prefix": "",
"strip": 0
}' | jq .After making changes, reload Kamailio:
dsiprouter.sh kamailio:reload | jq .Connection timeout:
error: Failed to connect to dSIPRouter
- Verify
DSIP_ADDRis correct and accessible - Check network connectivity:
ping $DSIP_ADDR - Ensure port 5000 is open
Authentication error (401):
error: Unauthorized
- Verify
DSIP_TOKENis correct - Check that your token hasn't expired
SSL/TLS certificate errors:
error: SSL certificate problem
- For self-signed certificates, set
DSIP_INSECURE=1 - Or add your certificate to the system trust store
Command not found:
dsiprouter: command not found
- Verify the script is executable:
chmod +x bin/dsiprouter.sh - Ensure the directory is in your PATH or use the full path:
./bin/dsiprouter
- See SKILL.md for detailed API documentation
- Check the Postman collection for API examples
- Consult the LICENSE for usage terms