Can we have this approach? `{` "rule": { ...
# ask-ai
b
Can we have this approach?
{
"rule": { "dispatchRuleIndividual": { "roomPrefix": "call-" } }, "hidePhoneNumber": true, "trunkIds": ["ST_fj4X5vtDuCuw", "ST_7uxDBNReo7fx"], "name": "Farm Equipment SIP Dispatch" }
t
Thanks for reaching out, Samuel. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether that JSON approach is valid for a SIP dispatch rule. Short answer: mostly yes, with one change. Acknowledging your snippet: you want an individual dispatch rule that creates per-call rooms with prefix
call-
, tied to two trunks, and named "Farm Equipment SIP Dispatch". What to change • Remove `hidePhoneNumber`: dispatch rules do not support a
hidePhoneNumber
property. That field is not valid and will be ignored or cause an error. • Keep
name
,
trunkIds
, and
rule.dispatchRuleIndividual.roomPrefix
— those are supported. Corrected example
Copy code
{
  "name": "Farm Equipment SIP Dispatch",
  "trunkIds": [
    "ST_fj4X5vtDuCuw",
    "ST_7uxDBNReo7fx"
  ],
  "rule": {
    "dispatchRuleIndividual": {
      "roomPrefix": "call-"
    }
  }
}
If you need to hide or mask caller numbers, that must be handled outside the dispatch rule (for example: at participant creation with the appropriate flag, in your agent logic to avoid exposing PII, or via SIP trunk/provider settings). Would you like guidance on implementing caller-number masking in agent sessions or participant creation? Sources: sip | livekit/livekit_composite | DeepWiki | examples/bank-ivr | livekit/livekit_composite | DeepWiki | Preserving Caller ID During SIP Transfers in LiveKit Agents
b
Actually, room_name has the phone number.. I need to hide it for PII compliance.
t
Thanks — I hear you: the room name currently contains the phone number and you need it removed for PII compliance. Quick facts: • LiveKit SIP dispatch rules use
dispatchRuleIndividual.roomPrefix
to form room names (e.g.,
call-abc123
). LiveKit does not put full phone numbers into room names by default. • If a phone number appears in your
room_name
, that is coming from custom logic in your dispatch/agent code or participant creation flow, not the dispatch-rule schema. What you can do (options): • Use a static or random
roomPrefix
(e.g.,
"call-"
or
"session-"
) so room names never include PII. • Stop inserting caller number into the room name in your dispatch/agent code — generate a random suffix or use a UUID. • Anonymize the SIP participant
identity
when creating participants (do not set it to the phone number). • If you need to keep the phone number for backend use, store it in participant attributes/metadata but never surface it in room names, UI labels, or logs. To help you fix this, please tell me: 1. Where your current room name is being set — in the SIP dispatch rule, agent logic, or another service? 2. If agent code sets the room name, share the snippet (or describe the logic) that constructs the room name. I’ll give the exact change you need to stop including the phone number and produce anonymized room names. Sources: sip | livekit/livekit_composite | DeepWiki | SIP Lifecycle Management Agent | LiveKit docs
b
I've dispatch rule like this: { "sipDispatchRuleId": "SDR_4NLHQjvuJuVc", "rule": { "dispatchRuleIndividual": { "roomPrefix": "call-" } }, "trunkIds": [ "PN_PPN_z6pD7h4TMG2b" ], "name": "xAI Voice", "roomConfig": { "agents": [ { "agentName": "farming-telephony-agent-xAI" } ] } } It bleeds out full phone number as room name: call-_+918903872893_QuYxXjNDszyL
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!