Skip to content

Commit

Permalink
added krisp_enabled and other options to SipServiceClient (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao authored Feb 13, 2025
1 parent e281f89 commit 75f2efb
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
livekit-server-sdk (0.8.0)
livekit-server-sdk (0.8.3)
google-protobuf (>= 3.21.0, < 4.0)
jwt (>= 2.2.3, < 3.0)
rack (>= 2.2.3)
Expand All @@ -21,7 +21,7 @@ GEM
google-protobuf (3.25.4)
jwt (2.8.2)
base64
logger (1.6.1)
logger (1.6.5)
method_source (1.0.0)
net-http (0.4.1)
uri
Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_agent_dispatch_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_agent_dispatch_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_agent_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_agent_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_egress_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_egress_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_ingress_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_ingress_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_metrics_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_metrics_pb.rb'

Expand Down
3 changes: 2 additions & 1 deletion lib/livekit/proto/livekit_models_pb.rb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_models_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_models_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_room_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_room_pb.rb'

Expand Down
4 changes: 3 additions & 1 deletion lib/livekit/proto/livekit_sip_pb.rb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_sip_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_sip_pb.rb'

Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/proto/livekit_webhook_twirp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code generated by protoc-gen-twirp_ruby 1.11.0, DO NOT EDIT.
# Code generated by protoc-gen-twirp_ruby 1.10.0, DO NOT EDIT.
require 'twirp'
require_relative 'livekit_webhook_pb.rb'

Expand Down
43 changes: 30 additions & 13 deletions lib/livekit/sip_service_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ def create_sip_inbound_trunk(
auth_password: nil,
# optional, include these SIP X-* headers in 200 OK responses.
headers: nil,
# optional map SIP X-* headers from INVITE to SIP participant attributes.
headers_to_attributes: nil
# optional, map SIP X-* headers from INVITE to SIP participant attributes.
headers_to_attributes: nil,
# optional, map SIP response headers from INVITE to sip.h.* participant attributes automatically.
include_headers: Proto::SIPHeaderOptions::SIP_NO_HEADERS,
# optional, enable Krisp for this trunk
krisp_enabled: false
)
request = Proto::CreateSIPInboundTrunkRequest.new(
trunk: Proto::SIPInboundTrunkInfo.new(
Expand All @@ -43,7 +47,9 @@ def create_sip_inbound_trunk(
auth_username: auth_username,
auth_password: auth_password,
headers: headers,
headers_to_attributes: headers_to_attributes
headers_to_attributes: headers_to_attributes,
include_headers: include_headers,
krisp_enabled: krisp_enabled
)
)
self.rpc(
Expand Down Expand Up @@ -172,31 +178,42 @@ def create_sip_participant(
sip_trunk_id,
sip_call_to,
room_name,
# Optional SIP From number to use. If empty, trunk number is used.
from_number: nil,
# Optional identity of the participant in LiveKit room
participant_identity: nil,
# Optional name of the participant in LiveKit room
participant_name: nil,
# Optional metadata of the participant in LiveKit room
participant_metadata: nil,
# Optional, send following DTMF digits (extension codes) when making a call.
# Character 'w' can be used to add a 0.5 sec delay.
dtmf: nil,
play_ringtone: nil, # deprecated, use play_dialtone
play_dialtone: nil,
hide_phone_number: nil
# Optional, play dialtone for the participant
play_dialtone: false,
# Optional, hide phone number from participant attributes
hide_phone_number: nil,
# Optional, ringing timeout in seconds
ringing_timeout: nil,
# Optional, max call duration in seconds
max_call_duration: nil,
# Optional, enable Krisp for this call
krisp_enabled: false
)

if (play_ringtone == true || play_dialtone == true)
play_dialtone = true
play_ringtone = true
end

request = Proto::CreateSIPParticipantRequest.new(
sip_trunk_id: sip_trunk_id,
sip_call_to: sip_call_to,
sip_number: from_number,
room_name: room_name,
participant_identity: participant_identity,
participant_name: participant_name,
participant_metadata: participant_metadata,
dtmf: dtmf,
play_ringtone: play_ringtone,
play_dialtone: play_dialtone,
hide_phone_number: hide_phone_number,
ringing_timeout: ringing_timeout,
max_call_duration: max_call_duration,
krisp_enabled: krisp_enabled
)
self.rpc(
:CreateSIPParticipant,
Expand Down
2 changes: 1 addition & 1 deletion lib/livekit/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LiveKit
VERSION = "0.8.2"
VERSION = "0.8.3"
end
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 54 files
+22 −0 CHANGELOG.md
+28 −29 go.mod
+116 −58 go.sum
+1 −1 infra/link.pb.go
+5 −4 ingress/token.go
+7 −0 livekit/attrs.go
+1 −1 livekit/livekit_agent.pb.go
+1 −1 livekit/livekit_agent_dispatch.pb.go
+508 −174 livekit/livekit_analytics.pb.go
+1 −1 livekit/livekit_egress.pb.go
+1 −1 livekit/livekit_ingress.pb.go
+1 −1 livekit/livekit_internal.pb.go
+1 −1 livekit/livekit_metrics.pb.go
+827 −760 livekit/livekit_models.pb.go
+1 −1 livekit/livekit_room.pb.go
+447 −432 livekit/livekit_rtc.pb.go
+1,259 −895 livekit/livekit_sip.pb.go
+224 −174 livekit/livekit_sip.twirp.go
+1 −1 livekit/livekit_webhook.pb.go
+73 −0 livekit/sip.go
+16 −0 livekit/sip_test.go
+1 −1 package.json
+20 −0 packages/javascript/CHANGELOG.md
+2 −2 packages/javascript/package.json
+48 −48 pnpm-lock.yaml
+33 −2 protobufs/livekit_analytics.proto
+9 −0 protobufs/livekit_models.proto
+1 −0 protobufs/livekit_rtc.proto
+67 −1 protobufs/livekit_sip.proto
+4 −1 protobufs/rpc/sip.proto
+10 −6 renovate.json
+1 −1 rpc/agent.pb.go
+1 −1 rpc/agent_dispatch.pb.go
+1 −1 rpc/analytics.pb.go
+1 −1 rpc/egress.pb.go
+1 −1 rpc/ingress.pb.go
+1 −1 rpc/io.pb.go
+1 −1 rpc/keepalive.pb.go
+1 −1 rpc/participant.pb.go
+1 −1 rpc/room.pb.go
+1 −1 rpc/roommanager.pb.go
+1 −1 rpc/signal.pb.go
+1 −0 rpc/sip.go
+17 −5 rpc/sip.pb.go
+62 −60 rpc/sip.psrpc.go
+5 −2 rpc/sip_test.go
+33 −1 sip/sip.go
+94 −9 sip/sip_test.go
+172 −0 utils/xtwirp/errors.go
+27 −0 utils/xtwirp/errors_test.go
+27 −0 utils/xtwirp/handler.go
+38 −0 utils/xtwirp/headers.go
+19 −0 utils/xtwirp/options.go
+53 −0 utils/xtwirp/timeout.go

0 comments on commit 75f2efb

Please sign in to comment.