freeswitch-webrtc-bench
WebRTC benchmark for FreeSWITCH.
About
Freeswitch-webrtc-bench is a loading test tool like sipp and winsip, but mainly focus on SIP signalling over websocket and media via WebRTC. It is built on go-sip-ua/gosip/pion/webrtc and is pure Go.
There is a web client rztrtcsdk created by me that you can use to test WebRTC with freeswitch-webrtc-bench.
Usage
-
Compile
go build .
-
Create a call profile
There are some example call profiles in the examples directory that you can modify with reference to the Call Profile description.
-
Run the test
Run the UAS first,
./freeswitch-webrtc-bench -p examples/uas.json
Then in another console, run the UAC,
./freeswitch-webrtc-bench -p examples/uac.json
After the test is done, there will be some log files generated.
Call Profile
Here is the call profile structure defined in Go. You can find some example call profiles in the examples directory.
type CallProfile struct {
LogType string `json:"logtype"`
LogDir string `json:"logdir"`
CallDetailsInLog bool `json:"calldetailsinlog"`
CallDetailsFile bool `json:"calldetailsfile"`
SdpInCallDetails bool `json:"sdpincalldetails"`
LocalIP string `json:"localip"`
LocalPorts string `json:"localports"`
InternalLocalPorts []string
Transport string `json:"transport"`
ServerIP string `json:"serverip"`
ServerPort string `json:"serverport"`
ICEURLs string `json:"iceurls"`
ICEUsername string `json:"iceusername"`
ICECredential string `json:"icecredential"`
Role string `json:"role"`
Accounts string `json:"accounts"`
InternalAccounts []string
Passwords string `json:"passwords"`
InternalPasswords []string
CalledParties string `json:"calledparties"`
InternalCalledParties []string
MaxConcurrentCalls int `json:"maxconcurrentcalls"`
TotalCalls int `json:"totalcalls"`
CallDuration int `json:"callduration"`
CallsPerBatch int `json:"callsperbatch"`
BatchInterval int `json:"batchinterval"`
MediaType string `json:"mediatype"`
AudioFile string `json:"audiofile"`
VideoFile string `json:"videofile"`
VideoFileFps int `json:"videofilefps"`
DumpMedia bool `json:"dumpmedia"`
SavedAudioFile string `json:"savedaudiofile"`
SavedVideoFile string `json:"savedvideofile"`
}
Notes
There is an issue Change findMatchingCipherSuite when pion/dtls and FreeSWITCH interoperate. I've modified the code in the vendor directory, but if you run go mod vendor
command, you might need to modify it again manually.
@@ -11,9 +11,9 @@ func findMatchingSRTPProfile(a, b []SRTPProtectionProfile) (SRTPProtectionProfil
return 0, false
}
-func findMatchingCipherSuite(a, b []CipherSuite) (CipherSuite, bool) { //nolint
- for _, aSuite := range a {
- for _, bSuite := range b {
+func findMatchingCipherSuite(remote, local []CipherSuite) (CipherSuite, bool) { //nolint
+ for _, aSuite := range local {
+ for _, bSuite := range remote {
if aSuite.ID() == bSuite.ID() {
return aSuite, true
}
Limits
Acknowledgement