session.initialize
Negotiate the audio codec and initialize a real-time voice session.
Parameters
| Field | Type | Presence | Constraints | Description |
|---|---|---|---|---|
application | AppInfo | required | — | Application that owns the call flow. |
call | CallInfo | required | — | Call being bridged into the session. |
audio_codec_offerings | AudioCodec[] | required | — | Audio codecs offered by the voice peer. |
metadata | object | nullable | — | Free-form session metadata; the field is present and may be null. |
Result
| Field | Type | Presence | Constraints | Description |
|---|---|---|---|---|
audio_codec | AudioCodec | nullable | — | Selected codec; the field is present and may be null. |
Referenced types
AppInfo
| Field | Type | Presence | Constraints | Description |
|---|---|---|---|---|
id | string | required | — | Application or graph-node identifier. |
AudioCodec
| Field | Type | Presence | Constraints | Description |
|---|---|---|---|---|
id | string | required | — | Codec identifier such as L16/8000/1. |
name | string | required | — | Codec name such as L16. |
sample_rate | integer | required | — | Sample rate in hertz. |
bit_depth | integer | required | — | Number of bits per sample. |
channels | integer | required | — | Number of audio channels. |
CallInfo
| Field | Type | Presence | Constraints | Description |
|---|---|---|---|---|
id | string | required | — | Call identifier. |
session_id | string | required | — | Session identifier owned by the voice peer. |
from | string | required | — | Caller address or number. |
to | string | required | — | Callee address or number. |
Example: canonical
Parameters
{
"application": {
"id": "app-1"
},
"call": {
"id": "call-1",
"session_id": "session-1",
"from": "+12025550100",
"to": "+12025550101"
},
"audio_codec_offerings": [
{
"id": "L16/8000/1",
"name": "L16",
"sample_rate": 8000,
"bit_depth": 16,
"channels": 1
}
],
"metadata": null
}
Result
{
"audio_codec": null
}