Skip to content

Commit c850a5a

Browse files
committed
chore: support listupdate when updating dispatch rule
1 parent a74bdcb commit c850a5a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

livekit-api/livekit/api/sip_service.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ async def update_dispatch_rule_fields(
607607
self,
608608
rule_id: str,
609609
*,
610-
trunk_ids: Optional[list[str]] = None,
610+
trunk_ids: Optional[ListUpdate | list[str]] = None,
611611
rule: Optional[SIPDispatchRule] = None,
612612
name: Optional[str] = None,
613613
metadata: Optional[str] = None,
@@ -624,6 +624,14 @@ async def update_dispatch_rule_fields(
624624
attributes=attributes,
625625
trunk_ids=ListUpdate(set=trunk_ids) if trunk_ids else None,
626626
)
627+
if trunk_ids is not None:
628+
if isinstance(trunk_ids, ListUpdate):
629+
update.trunk_ids.set.extend(trunk_ids.set)
630+
update.trunk_ids.add.extend(trunk_ids.add)
631+
update.trunk_ids.remove.extend(trunk_ids.remove)
632+
else:
633+
update.trunk_ids.set.extend(trunk_ids)
634+
627635
return await self._client.request(
628636
SVC,
629637
"UpdateSIPDispatchRule",

0 commit comments

Comments
 (0)