Skip to content

telephony ​

← All modules

3 endpoints.

POST /api/v1/telephony/dial ​

Dial

Ring ctx.user's extension, then bridge into body.number on pickup.

Request body

json
{
  "properties": {
    "number": {
      "type": "string",
      "title": "Number"
    }
  },
  "type": "object",
  "required": [
    "number"
  ],
  "title": "DialIn"
}

200 — Successful Response

json
{
  "additionalProperties": true,
  "type": "object",
  "title": "Response Dial Api V1 Telephony Dial Post"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

GET /api/v1/telephony/incoming ​

Incoming

The calls just answered on this user's own extension, newest first, each with the customer the number belongs to (or None for an unknown caller).

Read from the PBX's own books (PBX_BOOKS) — the same schema the live agent's events are written to, where the staff's PBX extensions and the customers those numbers belong to live. Deliberately NOT the request/session site: events are stored once on the PBX books, so a user viewing another site (or a superuser on the hub) still gets the popup.

Scoped by extension AND domain: extension numbers repeat across the box's customer domains (a hundred of them have a 102), so the number alone would pop another org's call.

200 — Successful Response

json
{
  "additionalProperties": true,
  "type": "object",
  "title": "Response Incoming Api V1 Telephony Incoming Get"
}

POST /api/v1/telephony/worker/answered ​

Worker Answered

Record an answered extension leg. Idempotent on call_uuid — an event socket reconnect replays CHANNEL_ANSWER, and that must not double-pop.

Written to the PBX's own books (PBX_BOOKS), the same schema the transcription pipeline stores calls in — the posting host (portal.lubb.co.za -> site lubb_portal -> schema lubb) is NOT where the calls belong.

Request body

json
{
  "properties": {
    "call_uuid": {
      "type": "string",
      "title": "Call Uuid"
    },
    "domain": {
      "type": "string",
      "title": "Domain"
    },
    "extension": {
      "type": "string",
      "title": "Extension"
    },
    "direction": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Direction"
    },
    "other_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Other Number"
    }
  },
  "type": "object",
  "required": [
    "call_uuid",
    "domain",
    "extension"
  ],
  "title": "AnsweredIn"
}

200 — Successful Response

json
{
  "additionalProperties": true,
  "type": "object",
  "title": "Response Worker Answered Api V1 Telephony Worker Answered Post"
}

422 — Validation Error

json
{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Lubb Business Documentation