acoustic-spring-24340
09/21/2025, 6:54 PMtall-airline-16756
09/21/2025, 6:54 PMtall-airline-16756
09/21/2025, 6:54 PMrule field in your configuration explicitly defines one of the supported dispatch rule types. Here are the options you can use:
• Direct Dispatch Rule: This sends all callers into a specific room. For example:
{
"rule": {
"dispatchRuleDirect": {
"roomName": "open-room"
}
},
"name": "My dispatch rule"
}
• Caller Dispatch Rule (Individual): This creates a new room for each caller. Here's how it looks:
{
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
},
"name": "My dispatch rule"
}
• Callee Dispatch Rule: This places callers into rooms based on the called number. Example:
{
"rule": {
"dispatchRuleCallee": {
"roomPrefix": "number-",
"randomize": false
}
},
"name": "My dispatch rule"
}
From what you shared, it seems like you’re using the dispatchRuleIndividual type correctly, which is great! Just double-check that the overall structure matches the expected format exactly. If you’re still seeing the error, it might help to review the JSON syntax carefully and make sure there aren’t any extra or conflicting rule types accidentally included.
Sources: SIP dispatch rule | LiveKit Docs | cmd/lk/sip.go | protobufs/livekit_sip.protoacoustic-spring-24340
09/21/2025, 7:51 PMtall-airline-16756
09/21/2025, 7:51 PMrule field is set to one of the supported types (DispatchRuleDirect, DispatchRuleIndividual, or DispatchRuleCallee).
• Malformed JSON or API Request: Make sure your JSON is correctly structured and includes all the necessary fields. For example, roomName is required when using DispatchRuleDirect.
• Incorrect Use of SDKs or CLI: If you're using the CLI, try to avoid setting conflicting flags like both --direct and --caller at the same time.
• Validation Failure: The CreateSIPDispatchRuleRequest needs a valid rule field. If it’s missing or null, this error can pop up.
Could you please double-check your configuration to ensure the rule field is correctly defined? If the problem continues, it would be really helpful to know whether you're using the CLI, SDK, or API directly. That way, I can guide you more precisely and get this sorted out together.
Sources: livekit/livekit_sip.pb.go | SIP dispatch rule | LiveKit Docs | SIP APIs | LiveKit Docs | cmd/lk/sip.goacoustic-spring-24340
09/21/2025, 8:06 PMtall-airline-16756
09/21/2025, 8:06 PMlk sip dispatch create dispatch-rule.json
In this case, dispatch-rule.json is the file where you'll have your dispatch rule configuration. Just make sure the JSON file is set up correctly and includes a valid rule type, like dispatchRuleDirect, dispatchRuleIndividual, or dispatchRuleCallee.
If you’d rather define the rule right in the command without using a JSON file, you can use these handy flags:
• `--name`: To give your dispatch rule a name
• `--trunks`: To list the trunk IDs
• `--direct <room-name>`: For a direct dispatch rule
• `--caller <prefix>`: For an individual caller dispatch rule
• `--callee <prefix>`: For a callee dispatch rule (you can also add --randomize to add a random suffix to room names)
For example, if you want to create a direct dispatch rule, you could use:
lk sip dispatch create --name "Sales Dispatch" --trunks "ST_46zZZBU8zjTs" --direct "open-room"
If you have any questions or need a hand with this, just let me know—I'm here to help!
Sources: Inbound calls with Twilio Voice | LiveKit Docs | Accepting incoming calls | LiveKit Docs | Accepting incoming calls | LiveKit Docs | autocomplete/fish_autocomplete