Hi folks, very new to Livekit and looking for guid...
# telephony
f
Hi folks, very new to Livekit and looking for guidance on the new Phone Numbers feature. Our FastAPI backend: 1. Creates a SIP dispatch rule with CreateSIPDispatchRule 2. Calls PhoneNumberService.UpdatePhoneNumber with that rule ID to bind a purchased number. Even after deleting any old rules, LiveKit consistently responds: LiveKit PhoneNumberService.UpdatePhoneNumber failed: {\"code\":\"internal\",\"msg\":\"twirp error unknown: failed to update phone number: SDR_UwN8SLib2aQc is a catch all dispatch rule. To prevent traffic to other numbers and trunks from being affected, those cannot be assigned via the phone number api. Use the dispatch rule APIs to make this change once you are sure that's what you want.\"}"} If we manually edit the rule in the Cloud console and choose the phone number under “Inbound routing,” the UI shows PN_xxx, but calls don’t go through and the next API save creates another rule that still looks catch-all. Questions: 1.Is there a way to make CreateSIPDispatchRule non–catch-all purely via API so UpdatePhoneNumber accepts it? 2.Can we supply the PN_xxx identifier during rule creation, or is the only supported flow to assign via the console/CLI? 3.Are there known limitations with the new Phone Number feature that would require sticking with traditional trunk setups for now? Any pointers or examples would be hugely appreciated, we’d love to let users assign workflows to purchased numbers with a single button. Thanks.
@refined-appointment-81829 @lively-winter-88668 kindly help with this
b
Hi @full-painter-90248 which API are you using ? I don't believe we've added support in our server sdks yet except go. That said, I don't think you'd need it. Ideally you should be able to use the PN_xxx identifier and create a dispatch rule. Is that not working ? In terms of limitations • Support is only for the US • You won't be able to use these phonenumbers and perform TransferSipParticipant on those calls. We will add that support once we support outbound use cases with Livekit directly
f
Thanks for the response. I’m using the PhoneNumber and SIP APIs, so calling the Twirp endpoints directly. The flow is: 1. CreateSIPDispatchRule (individual rule, metadata, etc.) 2. PhoneNumberService.UpdatePhoneNumber with the body: { "id": "PN_abc123", "sip_dispatch_rule_id": "SDR_xyz789" } LiveKit returns the catch-all error(meaning no trunks and phone numbers attached to the rule), which is why I assumed there was no way to bind the PN ID during rule creation. Is there an additional field that should be set in CreateSIPDispatchRule to reference the PN, or a different endpoint for attaching the number? The assumption here is that with the new phone number feature, phone numbers can be attached to dispatch rules for telephony instead of trunk id setups . So I’m looking for a way to do that through available APIs.
b
In this case, instead of 2, I'd recommend directly going with creating a dispatch rule with the
PN_abc123
in the trunk_ids attribute. It's not the most straightforward way but it works. The error you see is meant as a protection to prevent production outages.