Skip to content

Commit e4bc852

Browse files
committed
Fixed sipcmdline example.
1 parent 27b3389 commit e4bc852

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

examples/sipcmdline/Program.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
// dotnet run -- --s uac -d [email protected] -v
6161
// If successful a count of the RTP packets will be displayed:
6262
// RTP packet received from 212.79.111.155:13818, ssrc 314111075, seqnum 23320, count 48
63+
//
64+
// Check RTP connectivity via a TURN server:
65+
// dotnet run -- -d [email protected] -s uac -v --turn "turn:yourserver;username;password"
6366
//-----------------------------------------------------------------------------
6467

6568
using System;
@@ -468,18 +471,7 @@ private static async Task<bool> InitiateCallTaskAsync(SIPTransport sipTransport,
468471
{
469472
logger.LogDebug($"Setting TURN server {options.TurnServerUrl} on the user agent client.");
470473
var turnClient = new TurnClient(options.TurnServerUrl);
471-
472-
var relayEndPoint = await echoMediaSession.AudioStream.TrySetRelayEndPoint(turnClient, options.Timeout);
473-
474-
if (relayEndPoint != null)
475-
{
476-
echoMediaSession.OnRemoteDescriptionChanged += (sdp) =>
477-
{
478-
var createPermissionResult = turnClient.CreatePermission(echoMediaSession.AudioStream.DestinationEndPoint);
479-
480-
logger.LogInformation($"TURN create permission result for {echoMediaSession.AudioStream.DestinationEndPoint}: {createPermissionResult}.");
481-
};
482-
}
474+
await echoMediaSession.AudioStream.UseTurn(echoMediaSession, turnClient, default, options.Timeout);
483475
}
484476

485477
echoMediaSession.OnRtpPacketReceived += RtpMediaPacketReceived;

examples/sipcmdline/Properties/launchSettings.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)