What are the commands to update outbound trunk, in...
# ask-ai
m
What are the commands to update outbound trunk, inbound trunk, and dispatch rule? I want specifically update the names
🤗 1
t
Thanks for reaching out, Kush. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To update the names of outbound trunks, inbound trunks, and dispatch rules, you can use the following commands: Outbound Trunk Name Update: • Using direct flag approach:
lk sip outbound update --id <sip-trunk-id> --name "My updated outbound trunk"
Inbound Trunk Name Update: • Using direct flag approach:
lk sip inbound update --id <sip-trunk-id> --name "My updated inbound trunk"
Dispatch Rule Name Update: • Using direct flag approach:
lk sip dispatch update --id <sip-dispatch-rule-id> --name "My updated dispatch rule"
For more complex updates, you can use JSON files to specify additional fields. Let me know if you need further assistance! Sources: SIP outbound trunk | LiveKit Docs | autocomplete/fish_autocomplete
m
i want to update a SIP trunk for a dispatch rule how do I do that?
t
If you want to update the SIP trunk for a dispatch rule, here’s a handy command you can use: Command: •
lk sip dispatch update --id <dispatch-rule-id> --trunks "<trunk-id1>, <trunk-id2>"
This will update the trunk IDs linked to your dispatch rule. Just swap out
<dispatch-rule-id>
with the ID of the rule you’re updating, and replace
<trunk-id1>, <trunk-id2>
with the SIP trunk IDs you want to connect. Feel free to reach out if you want me to walk you through it or if you have any other questions! Sources: livekit/livekit_sip.pb.go | SIP APIs | LiveKit Docs
m
I keep getting "missing rule" when I try to create a dispatch rule which doesn't make sense.
t
Hey there! The "missing rule" error usually pops up when the required
rule
field isn’t properly included in your dispatch rule creation request. Could you double-check if you’re specifying the
rule
field, like
dispatch_rule_direct
or
dispatch_rule_individual
, in your request? If you can, please share the structure or a snippet of the code you’re using to create the dispatch rule—I'd love to help you figure this out!
m
Copy code
{
  "name": "inbound dispatch rule",
  "rule": {
    "dispatchRuleIndividual": {
      "roomPrefix": "voice_assistant_room_inbound_+###########"
    }
  },
  "trunk_ids": [
    "ST_*******"
  ],
  "roomConfig": {
    "agents": [
      {
        "agentName": "voice-agent"
      }
    ]
  }
}
t
Your JSON structure for creating the dispatch rule looks pretty good! The "missing rule" error might pop up if there’s something off with the field names or how they’re organized. Here are a few things you might want to double-check: 1. Make sure the field
dispatchRuleIndividual
is properly nested under
rule
. From what I see, it looks correct in your JSON. 2. Take a look at the
roomPrefix
value. It shouldn’t have any invalid characters. For example, swapping out
"voice_assistant_room_inbound_+###########"
for a clean prefix like
"voice_assistant_room_inbound_"
could help. 3. Double-check the
trunk_ids
array to confirm the trunk ID is valid and actually exists in your system. 4. Also, see if the
roomConfig
field is supported by your API version. If you’re unsure, try temporarily removing it to see if the rule creation goes through. Once you’ve tried these tweaks, give creating the dispatch rule another shot. And if it’s still giving you trouble, just let me know—I’m here to help!