dSIPRouter Fraud-Detection Skill
Purpose
Identify potentially fraudulent SIP activity in a dSIPRouter instance by analyzing CDRs (Call Detail Records), auth failures, and unusual destination patterns. Produce a concise report with flagged items and recommended mitigations.
When to Use
- User asks to find fraudulent calls, short-duration bursts, auth failures, or unusual destinations in dSIPRouter.
- Investigations involving CDR analysis over a specific time window.
Requirements
- dSIPRouter API base URL (typically
https://<host>:5000)
- DSIP_TOKEN
- Time window (e.g., last 2 days, March 1–12) — use
dtfilter=YYYY-MM-DD
- Target scope (endpoint group ID/name or endpoint ID)
- Access to auth logs (syslog or DB) if auth failure analysis is required
Endpoints (common)
- Kamailio stats:
GET /api/v1/kamailio/stats
- Endpoint groups:
GET /api/v1/endpointgroups
- CDRs by endpoint group:
GET /api/v1/cdrs/endpointgroups/{id} (use ?dtfilter=YYYY-MM-DD)
- CDRs by endpoint:
GET /api/v1/cdrs/endpoint/{id} (use ?dtfilter=YYYY-MM-DD)
Note: Use dtfilter to fetch records starting at the given date.
Workflow
- Validate API access
- Call
/api/v1/kamailio/stats with bearer token to confirm auth.
- Resolve target group/endpoint
- List endpoint groups and match by name.
- Fetch CDRs for the time window
- Use
dtfilter=YYYY-MM-DD (records starting at that date).
- Analyze for fraud signals
- Short-duration bursts: multiple calls within minutes, durations < 30–60s.
- Repeated failed auth: requires auth logs or DB.
- Unusual destinations: sudden calls to new country codes or rare destinations.
- Report
- Provide counts, timestamps, source/destination, and reason flagged.
- Recommend mitigations (blocklist, rate-limit, change credentials).
Example Commands
# Validate token
curl -k -H "Authorization: Bearer $DSIP_TOKEN" https://$HOST:5000/api/v1/kamailio/stats
# List endpoint groups
curl -k -H "Authorization: Bearer $DSIP_TOKEN" https://$HOST:5000/api/v1/endpointgroups
# CDRs by endpoint group (from a start date)
curl -k -H "Authorization: Bearer $DSIP_TOKEN" \
"https://$HOST:5000/api/v1/cdrs/endpointgroups/32?dtfilter=2026-03-01"
Output Template
- Time window: …
- Scope: endpoint group / endpoint …
- Flags:
- Short-duration burst (count, time range, dst)
- Unusual destination (dst, frequency)
- Auth failures (source, count)
- Suggested actions: …
Notes
- If the API returns empty data but the UI shows calls, confirm the endpoint group ID or query pagination/filters.
- For auth failures, identify log file location (e.g.,
/var/log/syslog, /var/log/kamailio.log) or DB table.
1---2name: dsiprouter-fraud3description: dSIPRouter Fraud-Detection Skill4---5# dSIPRouter Fraud-Detection Skill67## Purpose8Identify potentially fraudulent SIP activity in a dSIPRouter instance by analyzing CDRs (Call Detail Records), auth failures, and unusual destination patterns. Produce a concise report with flagged items and recommended mitigations.910## When to Use11- User asks to find fraudulent calls, short-duration bursts, auth failures, or unusual destinations in dSIPRouter.12- Investigations involving CDR analysis over a specific time window.1314## Requirements15- dSIPRouter API base URL (typically `https://<host>:5000`)16- DSIP_TOKEN17- Time window (e.g., last 2 days, March 1–12) — use `dtfilter=YYYY-MM-DD`18- Target scope (endpoint group ID/name or endpoint ID)19- Access to auth logs (syslog or DB) if auth failure analysis is required2021## Endpoints (common)22- Kamailio stats: `GET /api/v1/kamailio/stats`23- Endpoint groups: `GET /api/v1/endpointgroups`24- CDRs by endpoint group: `GET /api/v1/cdrs/endpointgroups/{id}` (use `?dtfilter=YYYY-MM-DD`)25- CDRs by endpoint: `GET /api/v1/cdrs/endpoint/{id}` (use `?dtfilter=YYYY-MM-DD`)2627> Note: Use `dtfilter` to fetch records starting at the given date.2829## Workflow301. **Validate API access**31 - Call `/api/v1/kamailio/stats` with bearer token to confirm auth.322. **Resolve target group/endpoint**33 - List endpoint groups and match by name.343. **Fetch CDRs for the time window**35 - Use `dtfilter=YYYY-MM-DD` (records starting at that date).364. **Analyze for fraud signals**37 - **Short-duration bursts**: multiple calls within minutes, durations < 30–60s.38 - **Repeated failed auth**: requires auth logs or DB.39 - **Unusual destinations**: sudden calls to new country codes or rare destinations.405. **Report**41 - Provide counts, timestamps, source/destination, and reason flagged.42 - Recommend mitigations (blocklist, rate-limit, change credentials).4344## Example Commands45```bash46# Validate token47curl -k -H "Authorization: Bearer $DSIP_TOKEN" https://$HOST:5000/api/v1/kamailio/stats4849# List endpoint groups50curl -k -H "Authorization: Bearer $DSIP_TOKEN" https://$HOST:5000/api/v1/endpointgroups5152# CDRs by endpoint group (from a start date)53curl -k -H "Authorization: Bearer $DSIP_TOKEN" \54 "https://$HOST:5000/api/v1/cdrs/endpointgroups/32?dtfilter=2026-03-01"55```5657## Output Template58- **Time window:** …59- **Scope:** endpoint group / endpoint …60- **Flags:**61 - Short-duration burst (count, time range, dst)62 - Unusual destination (dst, frequency)63 - Auth failures (source, count)64- **Suggested actions:** …6566## Notes67- If the API returns empty data but the UI shows calls, confirm the endpoint group ID or query pagination/filters.68- For auth failures, identify log file location (e.g., `/var/log/syslog`, `/var/log/kamailio.log`) or DB table.