Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createSipParticipant Does not have an option to specify "Outgoing" Number to use #202

Open
mercuryyy opened this issue Oct 14, 2024 · 9 comments
Assignees
Labels
question Further information is requested SIP

Comments

@mercuryyy
Copy link

mercuryyy commented Oct 14, 2024

createSipParticipant(sipTrunkId, number, roomName, opts?): Promise

Does not have an option to pick which (own) number to use when dialing an outbound call?

What if we have 10 numbers assigned to 1 outgoing Trunk, we can't specify the number to use?

I'v looked at -

https://docs.livekit.io/server-sdk-js/classes/SipClient.html
+
https://github.com/livekit/node-sdks/blob/515f379a4e4d507c9f3db7b09b22881ec81c40ad/packages/livekit-server-sdk/src/SipClient.ts#L387

I think this is an important issues

Also please consider adding a update function to accommodate createSipInboundTrunk and createSipoutboundTrunk

Meaning using updateSipInboundTrunk, we wont have to delete the trunk every time we want to add a new phone number to it.

@AutoScrape123TX
Copy link

https://github.com/livekit/python-sdks/blob/main/livekit-protocol/livekit/protocol/sip.pyi livekit.protocol.sip.CreateSIPParticipantRequest

You have to use the SDK and call your livekit server to choose your caller-id 👍👍👍

@mercuryyy
Copy link
Author

class CreateSIPParticipantRequest(_message.Message):
    __slots__ = ("sip_trunk_id", "sip_call_to", "room_name", "participant_identity", "participant_name", "participant_metadata", "participant_attributes", "dtmf", "play_ringtone", "hide_phone_number")
    class ParticipantAttributesEntry(_message.Message):
        __slots__ = ("key", "value")
        KEY_FIELD_NUMBER: _ClassVar[int]
        VALUE_FIELD_NUMBER: _ClassVar[int]
        key: str
        value: str
        def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
    SIP_TRUNK_ID_FIELD_NUMBER: _ClassVar[int]
    SIP_CALL_TO_FIELD_NUMBER: _ClassVar[int]
    ROOM_NAME_FIELD_NUMBER: _ClassVar[int]
    PARTICIPANT_IDENTITY_FIELD_NUMBER: _ClassVar[int]
    PARTICIPANT_NAME_FIELD_NUMBER: _ClassVar[int]
    PARTICIPANT_METADATA_FIELD_NUMBER: _ClassVar[int]
    PARTICIPANT_ATTRIBUTES_FIELD_NUMBER: _ClassVar[int]
    DTMF_FIELD_NUMBER: _ClassVar[int]
    PLAY_RINGTONE_FIELD_NUMBER: _ClassVar[int]
    HIDE_PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int]
    sip_trunk_id: str
    sip_call_to: str
    room_name: str
    participant_identity: str
    participant_name: str
    participant_metadata: str
    participant_attributes: _containers.ScalarMap[str, str]
    dtmf: str
    play_ringtone: bool
    hide_phone_number: bool
    def __init__(self, sip_trunk_id: _Optional[str] = ..., sip_call_to: _Optional[str] = ..., room_name: _Optional[str] = ..., participant_identity: _Optional[str] = ..., participant_name: _Optional[str] = ..., participant_metadata: _Optional[str] = ..., participant_attributes: _Optional[_Mapping[str, str]] = ..., dtmf: _Optional[str] = ..., play_ringtone: bool = ..., hide_phone_number: bool = ...) -> None: ...

I dont see any field for caller-id?

It is the same as the node sdk i mentioned in the ticket, there is not option to choose the caller id, unless i stayed up way too late again and i cannot tell anymore.

@dennwc
Copy link
Contributor

dennwc commented Oct 16, 2024

The caller ID is controlled by the sip_trunk_id parameter, which points to a LiveKit SIP Outbound Trunk. That trunk may contain one or more phone numbers that will be used for the call (see numbers field).

@dennwc dennwc self-assigned this Oct 16, 2024
@dennwc dennwc added the question Further information is requested label Oct 16, 2024
@mercuryyy
Copy link
Author

mercuryyy commented Oct 16, 2024

@dennwc The issue is if the sip_trunk_id has 10 numbers assigned to it, there is no way to choose which specific number to use when starting an outbound call using "createSipParticipant"

@AutoScrape123TX comment was not related to the issue.

Should probably be tagged as Bug Or "Enhancement"

@dennwc
Copy link
Contributor

dennwc commented Oct 16, 2024

@mercuryyy That's right, if you need to select a specific number, you can make a separate Trunk with that number only. It works as intended, so I'm going to close this issue.

@dennwc dennwc closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
@mercuryyy
Copy link
Author

mercuryyy commented Oct 16, 2024

@dennwc

We have clients with 100 numbers on 1 Trunk, we would have to delete 100 trunk_ids if they need to change the trunk settings, and create 100 trunk_ids 1 for each number if they want to be able to chose which number to dial out from.

Was that not the point when you allowed 1 trunk_id to have multiple number, to avoid that?

It only makes sense that we can chose which number to use when dialing out from the trunk_id that already supports having multiple numbers

adding :

createSipParticipant(sipTrunkId, number, caller_id, roomName, opts?)

Added "caller_id" to the request, where caller_id = one of the numbers we added to the trunk_id

@dennwc dennwc reopened this Oct 16, 2024
@dennwc
Copy link
Contributor

dennwc commented Oct 16, 2024

That makes sense, we could change the API to allow picking a specific number in the short term.

In the longer term, I plan to redo the outbound trunks, so that they only include auth settings, etc. Other parameters could be passed directly in the CreateSIPParticipant.

@linear linear bot added the SIP label Oct 16, 2024
@mercuryyy
Copy link
Author

@dennwc Sound great.

Thank you!

@mercuryyy
Copy link
Author

mercuryyy commented Nov 11, 2024

Hey @dennwc any news/updates/plans on adding this to the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested SIP
Projects
None yet
Development

No branches or pull requests

3 participants