Skip to main content

Parameter

Definition

The Parameter noun is used to pass custom key/value pairs to a WebSocket server when streaming a call.

tip

See Stream for full details on streaming call audio via WebSockets.

Supported Attributes

AttributeData TypeDescription
name
required
stringThe name or key of the parameter.
value
required
stringThe value of the parameter.

Example

The following example shows how to use the Parameter noun to pass custom key/value pairs to a WebSocket server when streaming a call.

<Response>
<Start>
<Stream name="myStream" url="wss://example.com">
<Parameter name="FirstName" value="John"/>
<Parameter name="LastName" value="Cleese"/>
</Stream>
</Start>
</Response>

When the WebSocket server receives a Start Event, the message will include the Parameter data in start.customParameters.

{
"event": "start",
"sequenceNumber": 1,
"start": {
"callId": "7a9a4e28-1631-11ef-a79b-d4ce64f0cdf9",
"tracks": [
"inbound",
"outbound"
],
"mediaFormat": {
"encoding": "audio/x-mulaw",
"sampleRate": 8000
},
"customParameters": {
"RemoteParty": "Bob",
"FirstName": "Jane",
"LastName":"Doe"
}
}
}

Nesting Rules

  • You cannot nest any tags within Parameter.
  • You can nest Parameter within Stream.