diff --git a/services/nginx/app/modules/bird/bird.md b/services/nginx/app/modules/bird/bird.md new file mode 100644 index 00000000..a768146e --- /dev/null +++ b/services/nginx/app/modules/bird/bird.md @@ -0,0 +1,61 @@ +# Bird Module + +This module provides Bird API integration for voice calls and number management. + +## Endpoints + +### Voice calls +- `POST /bird/voice/calls` + - Permission: `modules_bird_voice_calls_create` + - Required: `workspaceId`, `channelId` + - Body: passthrough to Bird call create API (except `workspaceId` and `channelId`). + +- `GET /bird/voice/calls` + - Permission: `modules_bird_voice_calls_list` + - Required query: `workspaceId`, `channelId` + - Query params are passed through to Bird. + +- `GET /bird/voice/calls/{id}` + - Permission: `modules_bird_voice_calls_get` + - Required query: `workspaceId`, `channelId` + +- `POST /bird/voice/calls/{id}/hangup` + - Permission: `modules_bird_voice_calls_hangup` + - Required: `workspaceId`, `channelId` + +- `POST /bird/voice/calls/test-outbound` + - Permission: `modules_bird_voice_calls_test_outbound` + - Required: `workspaceId`, `channelId` + - Places an outbound call to the fixed test number `+45 42 33 11 28` (`+4542331128`), polls call state, and sends hangup when state is `accepted` or `ongoing`. + - Optional tuning params: + - `pollIntervalSeconds` (default `2`) + - `maxPollSeconds` (default `30`) + - `hangupCause` + +### Numbers +- `GET /bird/numbers` + - Permission: `modules_bird_numbers_list` + - Optional query: `workspaceId` (if not configured) + - Query params are passed through to Bird. + +- `GET /bird/numbers/{id}` + - Permission: `modules_bird_numbers_get` + - Optional query: `workspaceId` (if not configured) + +- `DELETE /bird/numbers/{id}` + - Permission: `modules_bird_numbers_delete` + - Optional query/body: `workspaceId` (if not configured) + - Releases/deletes a number if supported by Bird account policy. + +## Logging + +Bird requests are logged through `logs_o` with module `bird`, including: +- Request start (`BIRD_HTTP_REQUEST`) +- Response status (`BIRD_HTTP_RESPONSE`) +- API or transport errors (`BIRD_HTTP_ERROR`, `BIRD_HTTP_CURL_ERROR`) +- Test outbound flow events (`BIRD_TEST_OUTBOUND_CALL_*`) + +## Notes + +- Bird credentials and base URL are configured in Bird module config. +- Route handlers enforce workspace/channel requirements before outbound API calls. diff --git a/services/nginx/app/modules/bird/config/bird_channelId_c.php b/services/nginx/app/modules/bird/config/bird_channelId_c.php new file mode 100644 index 00000000..c571c3c5 --- /dev/null +++ b/services/nginx/app/modules/bird/config/bird_channelId_c.php @@ -0,0 +1,31 @@ +