Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
change dtls'flightinterval to 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
cnderrauber committed Jul 9, 2021
1 parent 2ef6dbd commit 1c7f300
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dtlstransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"crypto/rand"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"errors"
"fmt"
"strings"
Expand Down Expand Up @@ -213,6 +214,13 @@ func (t *DTLSTransport) startSRTP() error {
return fmt.Errorf("%w: %v", errDtlsKeyExtractionFailed, err)
}

t.log.Infof("local ctx master key&salt: %s ",
base64.StdEncoding.EncodeToString(append(srtpConfig.Keys.LocalMasterKey,
srtpConfig.Keys.LocalMasterSalt...)))
t.log.Infof("remote ctx master key&salt: %s ",
base64.StdEncoding.EncodeToString(append(srtpConfig.Keys.RemoteMasterKey,
srtpConfig.Keys.RemoteMasterSalt...)))

srtpSession, err := srtp.NewSessionSRTP(t.srtpEndpoint, srtpConfig)
if err != nil {
return fmt.Errorf("%w: %v", errFailedToStartSRTP, err)
Expand Down Expand Up @@ -305,6 +313,7 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
ClientAuth: dtls.RequireAnyClientCert,
LoggerFactory: t.api.settingEngine.LoggerFactory,
InsecureSkipVerify: true,
FlightInterval: 100 * time.Millisecond, // 握手消息重发时间
}, nil
}

Expand Down

0 comments on commit 1c7f300

Please sign in to comment.