Files
protocol/livekit/attrs.go
David Zhao e0c49d3c9d Support for key/value attributes on Participant (#733)
* Support for key/value attributes on Participant

Key/value attributes lets us:
* allow various components to provide more information about the participant (i.e. SIP including the phone number)
* allow Agents to communicate their own status to the end user via RTC
* enable applications to update specific fields without overriding others

* generated protobuf

* Attribute support for SIP.

* generated protobuf

* generated protobuf

* allow specifying attributes during token generation

* Remove sip prefix and rename phone number attrs.

* regenerate protos

* update tests

* add kv attrs to sip token

* add attribute test

* changeset

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Denys Smirnov <dennwc@pm.me>
2024-06-19 22:27:09 -07:00

20 lines
961 B
Go

package livekit
// Names of participant attributes for SIP.
const (
// AttrSIPPrefix is shared for all SIP attributes.
AttrSIPPrefix = "sip."
// AttrSIPCallID attribute contains LiveKit SIP call ID.
AttrSIPCallID = AttrSIPPrefix + "callID"
// AttrSIPTrunkID attribute contains LiveKit SIP Trunk ID used for the call.
AttrSIPTrunkID = AttrSIPPrefix + "trunkID"
// AttrSIPDispatchRuleID attribute contains LiveKit SIP DispatchRule ID used for the inbound call.
AttrSIPDispatchRuleID = AttrSIPPrefix + "ruleID"
// AttrSIPTrunkNumber attribute contains number associate with LiveKit SIP Trunk.
// This attribute will be omitted if HidePhoneNumber is set.
AttrSIPTrunkNumber = AttrSIPPrefix + "trunkPhoneNumber"
// AttrSIPPhoneNumber attribute contains number external to LiveKit SIP (caller for inbound and called number for outbound).
// This attribute will be omitted if HidePhoneNumber is set.
AttrSIPPhoneNumber = AttrSIPPrefix + "phoneNumber"
)