Parameter
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.
Attributes
Attribute | Data Type | Description |
---|---|---|
name required | string | The name or key of the parameter. |
value required | string | The value of the parameter. |
Example Usage
<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.