trunks_response = await livekit_client.sip.list_si...
# ask-ai
s
trunks_response = await livekit_client.sip.list_sip_inbound_trunks() is this correct isahe of api from livekit.api import LiveKitAPI
t
Thanks for reaching out, elish. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The code snippet you provided is almost correct, but there is a small error in the method name. The correct method is
list_sip_inbound_trunk
(singular), not
list_sip_inbound_trunks
(plural). Here's the corrected code:
Copy code
from livekit.protocol.sip import ListSIPInboundTrunkRequest

# Basic usage - list all inbound trunks
trunks_response = await livekit_client.sip.list_sip_inbound_trunk(
    ListSIPInboundTrunkRequest()
)
Let me know if you need further assistance! Sources: livekit/livekit_sip.pb.go | SIP APIs | LiveKit Docs | livekit-api/livekit/api/sip_service.py
s
ListSIPInboundTrunk response: items { sip_trunk_id: "" name: "" numbers: "" } items { sip_trunk_id: "" name: "" numbers: "" } how can i delete one items which is not required?
t
To delete a specific SIP inbound trunk, you can use the DeleteSIPTrunk method from the LiveKit API. You'll just need the sip_trunk_id of the trunk you want to remove. Here’s a quick example in Node.js:
Copy code
const data = await this.rpc.request(
  svc,
  'DeleteSIPTrunk',
  new DeleteSIPTrunkRequest({ sipTrunkId }).toJson(),
  await this.authHeader({}, { admin: true }),
);
If you’re working with a different SDK or want a hand with anything else, just give me a shout!
s
is there cli command that start with lk to delete specific. dispatch rule?
t
Yes, there are CLI commands starting with lk that let you delete specific dispatch rules in LiveKit. Here’s a quick rundown: • Agent Dispatch Rules: To delete an agent dispatch rule, just use this command: `lk dispatch delete ROOM_NAME ID`Make sure to swap out
ROOM_NAME
with your actual room name and
ID
with the dispatch ID you want to remove. • SIP Dispatch Rules: If you need to delete a SIP dispatch rule, this is the command to use: `lk sip dispatch delete SIP_DISPATCH_RULE_ID`Just replace
SIP_DISPATCH_RULE_ID
with the correct ID for your SIP dispatch rule. Feel free to reach out if you want a hand with anything else! Sources: autocomplete/fish_autocomplete