Skip to content

Commit fc6c1ca

Browse files
authored
Merge pull request #775 from sipcapture/docs/external-callid-drilldown
docs: Call-ID drill-down for external apps (GitHub Pages)
2 parents 26c859e + 90c9af2 commit fc6c1ca

5 files changed

Lines changed: 117 additions & 3 deletions

File tree

docs/COORDINATOR.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ The deprecated **`oauth2_providers`** array is still accepted at startup and mig
299299
| GET | `/api/v4/transactions` | List transactions |
300300
| POST | `/api/v4/transactions/search` | Search transactions |
301301
| POST | `/api/v4/transactions/messages` | Get transaction messages (with optional Lua call-id correlation, see [`LUA_CORRELATION.md`](./LUA_CORRELATION.md)) |
302+
| POST | `/api/v4/transactions/view/link` | Create a one-time SIP trace view URL (`data.url_view``GET /export/view/:uuid`) for external app redirects — see [Dashboard URL search — external apps](SEARCH_URL.md#external-apps) |
303+
| GET | `/export/view/:uuid` | Standalone HTML SIP transaction view (no JWT; counts toward view token open limit) |
302304
| GET | `/api/v4/messages/:id` | Get single message |
303305
| GET | `/api/v4/messages/:id/decoded` | Get decoded message |
304306
| POST | `/api/v4/transactions/qos` | Get QoS data |

docs/SEARCH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For full setup and configuration details, see [MCP UI Guide](MCP_UI_GUIDE.md).
4040

4141
## Dashboard URL search
4242

43-
Bookmarkable dashboard links (`?from_user=…#dashboard`), per-protocol examples, and how to add new protocols: **[SEARCH_URL.md](SEARCH_URL.md)**.
43+
Bookmarkable dashboard links (`?from_user=…#dashboard`), **external Call-ID drill-down** from other apps, per-protocol examples, and how to add new protocols: **[SEARCH_URL.md](SEARCH_URL.md)** (including [external integrations](SEARCH_URL.md#external-apps)).
4444

4545
## Authentication
4646

docs/SEARCH_URL.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,104 @@ Related docs:
77
- [Search CLI](SEARCH.md) — terminal search and `--proto` names
88
- [Mapping examples](../examples/mappings/README.md)`fields_mapping` JSON per protocol
99
- [Search mappings and field types](SEARCH_MAPPINGS_AND_FIELDS.md) — form fields, virtual filters, `form_type` reference
10+
- [UI and API tokens](UI_COORDINATOR_AUTH_AND_TOKENS.md)`Auth-Token` for server-side integrations
11+
- [Coordinator API](COORDINATOR.md)`POST /api/v4/transactions/view/link`
1012
- API: `POST /api/v4/transactions/search` — same `filter` object the UI sends
1113

1214
---
1315

16+
## External applications (Call-ID drill-down) {#external-apps}
17+
18+
Common question: an external call-search app has a **Call-ID** and you want one click to open Homer (SIP trace or search results) without copy-paste. See also [GitHub discussion #680](https://github.com/sipcapture/homer/discussions/680).
19+
20+
Browsers only follow **GET** links (`<a href>`, redirects). You cannot POST a Call-ID from HTML alone. Use one of the patterns below.
21+
22+
### Choose an integration pattern
23+
24+
| Goal | Pattern | User must log into Homer UI? | Auth |
25+
|------|---------|-------------------------------|------|
26+
| Open **dashboard search** with Call-ID prefilled | GET deep link (this page) | **Yes** (JWT session) | None in URL |
27+
| Open **standalone SIP trace** HTML page | Backend `view/link` → redirect to `/export/view/<uuid>` | **No** (one-time view token) | `Auth-Token` or JWT on your server |
28+
| Embed results in **your own UI** | `POST /api/v4/transactions/search` or `/messages` | No | `Auth-Token` or JWT on your server |
29+
30+
Always pass a **time window** (`from` / `to` in ms, or `minutes` / `m`) together with the Call-ID.
31+
32+
### Homer 11 — dashboard deep link (logged-in users)
33+
34+
Recommended URL (coordinator host, flat query params):
35+
36+
```text
37+
https://<homer-host>/?call_id=<CALL-ID>&from=<from_ms>&to=<to_ms>#dashboard
38+
```
39+
40+
- Alias: `callid` instead of `call_id`
41+
- URL-encode special characters in the Call-ID (`@`, `:`, …)
42+
- Defaults: `proto_type=1`, `event_type=call` (SIP calls)
43+
44+
Example:
45+
46+
```text
47+
https://homer.example/?call_id=abc-def-ghi%4010.0.0.1&from=1710000000000&to=1710086400000#dashboard
48+
```
49+
50+
Relative window:
51+
52+
```text
53+
https://<homer-host>/?call_id=<CALL-ID>&m=60#dashboard
54+
```
55+
56+
### Homer 11 — SIP trace without UI login (API token on server)
57+
58+
For portals that already have Homer API access but users are **not** logged into Homer:
59+
60+
1. Enable static API tokens: `coordinator.api_settings.enable_token_access` (see [UI and API tokens](UI_COORDINATOR_AUTH_AND_TOKENS.md)).
61+
2. Your backend calls:
62+
63+
```http
64+
POST /api/v4/transactions/view/link
65+
Auth-Token: <secret>
66+
Content-Type: application/json
67+
68+
{
69+
"session_id": "your-call-id-here",
70+
"proto_type": 1,
71+
"event_type": "call",
72+
"timestamp": {
73+
"from": 1710000000000,
74+
"to": 1710086400000
75+
}
76+
}
77+
```
78+
79+
3. Response `data.url_view` is e.g. `/export/view/<uuid>`.
80+
4. Redirect the browser:
81+
82+
```text
83+
https://<homer-host>/export/view/<uuid>
84+
```
85+
86+
The view link is **time-limited** (default 72h) and capped by `coordinator.transaction_view_max_opens` (default 3 successful opens). The browser does **not** send `Auth-Token` to open that page.
87+
88+
Use `Authorization: Bearer <jwt>` instead of `Auth-Token` when calling the API with a service account session JWT (not the one-time view UUID).
89+
90+
### Homer 7 — legacy homer-ui JSON URL
91+
92+
On Homer 7 (homer-app + homer-ui, often port **9080**), operators use a single JSON blob as the query string on `/search/result`:
93+
94+
```text
95+
http://homer:9080/search/result?{"timestamp":{"from":<from_ms>,"to":<to_ms>},"param":{"search":{"1_call":{"callid":["<call-id>"]}}}}=
96+
```
97+
98+
Notes:
99+
100+
- Trailing `=` is required for homer-ui parsing.
101+
- Profile key `1_call` is the SIP-calls mapping in homer-app.
102+
- `callid` is a **JSON array** on Homer 7.
103+
104+
Homer 11 does **not** use path `/search/result`. Prefer flat `/?call_id=…#dashboard` above. Legacy JSON (without `/search/result`) is partially supported on the coordinator UI; `callid` as an array may not parse — use flat `call_id` for new links.
105+
106+
---
107+
14108
## URL shape
15109

16110
Use the dashboard hash and put filters in the query string.
@@ -150,9 +244,10 @@ Homer 11 accepts the same JSON when it starts with `{` (before or as `?q=...`).
150244

151245
- `param.search.<profile>.user_from``from_user`
152246
- `param.search.<profile>.user_to` / `callee``to_user`
247+
- `param.search.<profile>.call_id` / `callid` (string) → `call_id`
153248
- `timestamp.from` / `timestamp.to` → time range
154249

155-
Prefer the flat query parameters above for new integrations.
250+
Prefer the flat query parameters above for new integrations. For Homer 7-style `callid` **arrays**, use [flat Call-ID links](#external-apps) instead.
156251

157252
---
158253

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ingest, DuckLake storage, Node (FlightSQL), and Coordinator (REST API).
1717
|-------|--------|
1818
| First-time setup | [Config wizard](WIZARD.md) |
1919
| CLI search | [Search CLI](SEARCH.md) |
20-
| Dashboard search & mappings | [URL search](SEARCH_URL.md) · [Mappings & fields](SEARCH_MAPPINGS_AND_FIELDS.md) |
20+
| Dashboard search & mappings | [URL search](SEARCH_URL.md) · [External app Call-ID links](SEARCH_URL.md#external-apps) · [Mappings & fields](SEARCH_MAPPINGS_AND_FIELDS.md) |
2121
| REST API | [Coordinator](COORDINATOR.md) · [OpenAPI (Swagger)](swagger/index.html) |
2222
| Storage | [Architecture](STORAGE_ARCHITECTURE.md) · [Policies](STORAGE_POLICIES.md) |
2323
| Performance | [Ingest tuning](INGEST_PERFORMANCE.md) · [DuckDB tuning](DUCKDB_TUNING.md) |

docs/untested/MIGRATION_HOMER7.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,23 @@ left off — no duplicates, no gaps.
185185
due to homer-core's TTL — chunk the time range with `--since` / `--until`
186186
if needed.
187187

188+
## Share / drill-down URLs (homer-ui → Homer 11)
189+
190+
Homer 7 homer-ui links often look like:
191+
192+
```text
193+
http://homer:9080/search/result?{"timestamp":{"from":...,"to":...},"param":{"search":{"1_call":{"callid":["..."]}}}}=
194+
```
195+
196+
In Homer 11:
197+
198+
| Homer 7 | Homer 11 equivalent |
199+
|---------|---------------------|
200+
| `/search/result?{json}=` on UI port | `https://<coordinator>/?call_id=...&from=...&to=...#dashboard` (user logged in) |
201+
| homer-app search/share API (POST) | `POST /api/v4/transactions/view/link` + redirect to `/export/view/<uuid>` |
202+
203+
Full examples and API-token flows: [Dashboard URL search — external applications](../SEARCH_URL.md#external-apps).
204+
188205
## Caveats
189206

190207
- **Custom widget configurations** in v7 dashboards do not transfer

0 commit comments

Comments
 (0)