> For the complete documentation index, see [llms.txt](https://prosbcdocs.telcobridges.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prosbcdocs.telcobridges.com/telecom-references/developer-reference/caf/caf-working-with-call-legs.md).

# CAF: Working With Call Legs

TelcoBridges Toolpack framework offers two API layers to manipulate call legs and audio mixers (conferences).

We recommend that developers use the CAF API layer, because it offers higher-level functionality, which accelerates application development.

### CMC API layer

The lower-level API is based on classes *CTBCMCLeg* and *CTBCMCMixer*. These classes allow receiving leg or mixer events (answered, digit collected, terminating, etc.), and sending requests to perform actions (answer, play, terminate, etc.).

The following page explains how to work with CTBCMCLeg directly, for lower-level applications that don't want the convenience of the CAF Call framework

[Working with CMC Call Legs](/telecom-references/developer-reference/caf/caf-working-with-cmc-call-legs.md)

### CAF API layer

A higher-level API uses the base classes *CTBCMCLeg* and *CTBCMCMixer*, but adds the following functionalities:

* Simplification of call legs creations through single functions (*AddIncoming*, *AddOutgoing*, *CreateMixer*)
* Centralizing reception of events from call legs and mixers in to a single "Call Flow" (*CTBCAFCallFlow*), which deals with inter-relations between legs and mixers.
* Auto-destruction of call legs (*CTBCMCLeg*) and mixers (*CTBCMCMixer*) through usage of "smart" pointers.
* Auto-destruction of the call flow (*CTBCAFCallFlow*) upon destruction of last leg/mixer.

The following page explains how to work with CAF Call leg framework (CTBCAFCallLeg, CTBCAFCallFlow, CTBCAFCallBehavior, etc...)

[Working with CAF Call Legs and behaviors](/telecom-references/developer-reference/caf/caf-working-with-caf-call-legs.md)

The following page provides more details on call legs re-synchronization between toolpack\_engine application and user "CAF" application:

[Re-synchronizing CAF call legs](/telecom-references/developer-reference/caf/caf-call-legs-resync.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/developer-reference/caf/caf-working-with-call-legs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
