@@ -24,10 +24,11 @@ import (
2424
2525 "github.com/frostbyte73/core"
2626 "github.com/icholy/digest"
27- msdk "github.com/livekit/media-sdk"
2827 "github.com/pkg/errors"
2928 "golang.org/x/exp/maps"
3029
30+ msdk "github.com/livekit/media-sdk"
31+
3132 "github.com/livekit/media-sdk/dtmf"
3233 "github.com/livekit/media-sdk/sdp"
3334 "github.com/livekit/media-sdk/tones"
@@ -64,14 +65,15 @@ type sipOutboundConfig struct {
6465}
6566
6667type outboundCall struct {
67- c * Client
68- log logger.Logger
69- state * CallState
70- cc * sipOutbound
71- media * MediaPort
72- started core.Fuse
73- stopped core.Fuse
74- closing core.Fuse
68+ c * Client
69+ log logger.Logger
70+ state * CallState
71+ cc * sipOutbound
72+ media * MediaPort
73+ started core.Fuse
74+ stopped core.Fuse
75+ closing core.Fuse
76+ jitterBuf bool
7577
7678 mu sync.RWMutex
7779 mon * stats.CallMonitor
@@ -87,18 +89,22 @@ func (c *Client) newCall(ctx context.Context, conf *config.Config, log logger.Lo
8789 if sipConf .ringingTimeout <= 0 {
8890 sipConf .ringingTimeout = defaultRingingTimeout
8991 }
92+ jitterBuf := SelectValueBool (conf .EnableJitterBuffer , conf .EnableJitterBufferProb )
93+ room .JitterBuf = jitterBuf
9094
9195 tr := TransportFrom (sipConf .transport )
9296 contact := c .ContactURI (tr )
9397 if sipConf .host == "" {
9498 sipConf .host = contact .GetHost ()
9599 }
96100 call := & outboundCall {
97- c : c ,
98- log : log ,
99- sipConf : sipConf ,
100- state : state ,
101+ c : c ,
102+ log : log ,
103+ sipConf : sipConf ,
104+ state : state ,
105+ jitterBuf : jitterBuf ,
101106 }
107+ c .log = c .log .WithValues ("jitterBuf" , call .jitterBuf )
102108 call .cc = c .newOutbound (log , id , URI {
103109 User : sipConf .from ,
104110 Host : sipConf .host ,
@@ -124,7 +130,7 @@ func (c *Client) newCall(ctx context.Context, conf *config.Config, log logger.Lo
124130 Ports : conf .RTPPort ,
125131 MediaTimeoutInitial : c .conf .MediaTimeoutInitial ,
126132 MediaTimeout : c .conf .MediaTimeout ,
127- EnableJitterBuffer : c . conf . EnableJitterBuffer ,
133+ EnableJitterBuffer : call . jitterBuf ,
128134 }, RoomSampleRate )
129135 if err != nil {
130136 call .close (errors .Wrap (err , "media failed" ), callDropped , "media-failed" , livekit .DisconnectReason_UNKNOWN_REASON )
0 commit comments