Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lemon-ducks-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"agent-dispatch": patch
"livekit-server-sdk": patch
---

Add support for destination_country in outbound trunk
2 changes: 1 addition & 1 deletion examples/agent-dispatch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"dotenv": "^16.4.5",
"livekit-server-sdk": "workspace:*",
"@livekit/protocol": "^1.30.0"
"@livekit/protocol": "^1.39.0"
},
"devDependencies": {
"@types/node": "^20.10.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/livekit-server-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"@bufbuild/protobuf": "^1.7.2",
"@livekit/protocol": "^1.38.0",
"@livekit/protocol": "^1.39.0",
"camelcase-keys": "^9.0.0",
"jose": "^5.1.2"
},
Expand Down
19 changes: 16 additions & 3 deletions packages/livekit-server-sdk/src/SipClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export interface CreateSipInboundTrunkOptions {
export interface CreateSipOutboundTrunkOptions {
metadata?: string;
transport: SIPTransport;
destinationCountry?: string;
/** @deprecated - use `authUsername` instead */
auth_username?: string;
authUsername?: string;
Expand Down Expand Up @@ -176,7 +177,7 @@ export interface SipDispatchRuleUpdateOptions {
attributes?: { [key: string]: string };
}

export interface SipTrunkUpdateOptions {
export interface SipInboundTrunkUpdateOptions {
numbers?: ListUpdate;
allowedAddresses?: ListUpdate;
allowedNumbers?: ListUpdate;
Expand All @@ -186,6 +187,17 @@ export interface SipTrunkUpdateOptions {
metadata?: string;
}

export interface SipOutboundTrunkUpdateOptions {
numbers?: ListUpdate;
allowedAddresses?: ListUpdate;
allowedNumbers?: ListUpdate;
authUsername?: string;
authPassword?: string;
destinationCountry?: string;
name?: string;
metadata?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is metadata used for for outbound?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is defined on the Outbound trunk, but I can't find any usage of it. Intent may have been to set a default value for the ParticipantMetadata, but I'm not sure.

}

export interface TransferSipParticipantOptions {
playDialtone?: boolean;
headers?: { [key: string]: string };
Expand Down Expand Up @@ -331,6 +343,7 @@ export class SipClient extends ServiceBase {
headers: opts.headers,
headersToAttributes: opts.headersToAttributes,
includeHeaders: opts.includeHeaders,
destinationCountry: opts.destinationCountry,
}),
}).toJson();

Expand Down Expand Up @@ -562,7 +575,7 @@ export class SipClient extends ServiceBase {
*/
async updateSipInboundTrunkFields(
sipTrunkId: string,
fields: SipTrunkUpdateOptions,
fields: SipInboundTrunkUpdateOptions,
): Promise<SIPInboundTrunkInfo> {
const req = new UpdateSIPInboundTrunkRequest({
sipTrunkId,
Expand Down Expand Up @@ -621,7 +634,7 @@ export class SipClient extends ServiceBase {
*/
async updateSipOutboundTrunkFields(
sipTrunkId: string,
fields: SipTrunkUpdateOptions,
fields: SipOutboundTrunkUpdateOptions,
): Promise<SIPOutboundTrunkInfo> {
const req = new UpdateSIPOutboundTrunkRequest({
sipTrunkId,
Expand Down
21 changes: 7 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.