Open
Description
Issue:
When creating an outbound trunk the numbers
attribute is enforced as required by this; however, when initiating calls via the sip_create_participant
of the livekit api you can use any arbitrary number regardless of its inclusion in this number list.
Possible Fix:
- validate inbound api creations against the numbers list
- allow nullable numbers param
Step to reproduce:
- Create an outbound trunk
from livekit import api
OUTBOUND_TRUNK = CreateSIPOutboundTrunkRequest(
trunk=SIPOutboundTrunkInfo(
name="Outbound trunk",
numbers=["15555555555"], # Placeholder number
address=..., # Telephony sip auth/address
auth_username=...,
auth_password=...
)
)
async with api.LiveKitAPI() as client:
outbound_trunk = await client.sip.create_sip_outbound_trunk(OUTBOUND_TRUNK)
- Create SIP participant
from livekit import api
client = api.LiveKitAPI()
call_response: livekit_api.SIPParticipantInfo = await client.sip.create_sip_participant(
livekit_api.CreateSIPParticipantRequest(
room_name=call.id,
sip_trunk_id=<TRUNK_ID_FROM_STEP_ONE>,
sip_call_to=<NUMBER_TO_CALL>,
participant_identity=<ARBITRARY_ID>,
sip_number=<SOME_RANDOM_NUMBER_THAT_IS_DIFFERENT_FROM_15555555555>,
)
)
- Observe that this was successful despite a misalignment of
numbers
andsip_number
This may be a misunderstanding of the expected behaviour on my part, but it seems that numbers
being a required field during creation isn't strictly enforced during participant addition. The work around I am presently using is the put an arbitrary number into the numbers field, but would be nice to have that be an optional field given it doesn't seem to do anything.
TIA!
Metadata
Metadata
Assignees
Labels
No labels