> 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/apis-and-integration/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](https://github.com/telcobridges-main/tmedia-wiki/tree/main/reference/transmission/caf-working-with-cmc-call-legs/README.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](https://github.com/telcobridges-main/tmedia-wiki/tree/main/reference/api/caf-working-with-caf-call-legs/README.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](https://github.com/telcobridges-main/tmedia-wiki/tree/main/reference/api/caf-call-legs-resync/README.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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/apis-and-integration/caf-working-with-call-legs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
