Skip to main content

session.initialize

voice → application

Negotiate the audio codec and initialize a real-time voice session.

Parameters​

FieldTypePresenceConstraintsDescription
applicationAppInforequired—Application that owns the call flow.
callCallInforequired—Call being bridged into the session.
audio_codec_offeringsAudioCodec[]required—Audio codecs offered by the voice peer.
metadataobjectnullable—Free-form session metadata; the field is present and may be null.

Result​

FieldTypePresenceConstraintsDescription
audio_codecAudioCodecnullable—Selected codec; the field is present and may be null.

Referenced types​

AppInfo​

FieldTypePresenceConstraintsDescription
idstringrequired—Application or graph-node identifier.

AudioCodec​

FieldTypePresenceConstraintsDescription
idstringrequired—Codec identifier such as L16/8000/1.
namestringrequired—Codec name such as L16.
sample_rateintegerrequired—Sample rate in hertz.
bit_depthintegerrequired—Number of bits per sample.
channelsintegerrequired—Number of audio channels.

CallInfo​

FieldTypePresenceConstraintsDescription
idstringrequired—Call identifier.
session_idstringrequired—Session identifier owned by the voice peer.
fromstringrequired—Caller address or number.
tostringrequired—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
}