Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging Dev into Main #175

Merged
merged 11 commits into from
Feb 10, 2022
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ env:

jobs:
build:

env:
DOTNET_NOLOGO: true
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.401'
dotnet-version: |
2.0.x
2.1.x
2.2.x
3.1.x
5.0.x
6.0.x
- name: Clean
run: dotnet clean OpenTok.sln --configuration ${{ env.CONFIGURATION }} && dotnet nuget locals all --clear
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016 TokBox, Inc.
Copyright (c) 2014-2022 TokBox, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 20 additions & 0 deletions OpenTok/DialAuth.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace OpenTokSDK
{
/// <summary>
/// Used to set the username and password to be used in the <see cref="OpenTok.Dial"/> method.
/// These are used in the SIP INVITE​ request for HTTP digest authentication, if it is required
/// by your SIP platform. See the <see cref="DialOptions"/> class.
/// </summary>
public class DialAuth
{
/// <summary>
/// The username.
/// </summary>
public string Username { get; set; }

/// <summary>
/// The password.
/// </summary>
public string Password { get; set; }
}
}
54 changes: 54 additions & 0 deletions OpenTok/DialOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System.Collections.Generic;

namespace OpenTokSDK
{
/// <summary>
/// Used to define options for the the <see cref="OpenTok.Dial"/> method. These are
/// custom headers to be added to the SIP ​INVITE​ request initiated from OpenTok to
/// your SIP platform.
/// </summary>
public class DialOptions
{
/// <summary>
/// A dictionary of custom headers to be added to the SIP ​INVITE​ request initiated
/// from OpenTok to your SIP platform.
/// </summary>
public Dictionary<string, object> Headers { get; set; }

/// <summary>
/// Contains the username and password to be used in the the SIP INVITE​ request.
/// </summary>
public DialAuth Auth { get; set; }

/// <summary>
/// Indicates whether the media must be transmitted encrypted (​true​) or not (​false​, the default).
/// </summary>
public bool? Secure { get; set; }

/// <summary>
/// The number or string that will be sent to the final SIP number as the caller.
/// </summary>
/// <remarks>
/// This must be a string in the form of "from@example.com", where <c>from</c> can be a string or a number. If it is set
/// to a number (for example, "14155550101@example.com"), it will show up as the incoming number on PSTN phones.
/// If it is undefined or set to a string (for example, "joe@example.com"), +00000000 will show up as the incoming
/// number on PSTN phones.
/// </remarks>
public string From { get; set; }

/// <summary>
/// Whether the SIP call will include video (​true​) or not (​false​, the default).
/// </summary>
/// <remarks>With video included, the SIP client's video is included in the OpenTok stream
/// that is sent to the OpenTok session. The SIP client will receive a single composed video of the published streams
/// in the OpenTok session.</remarks>
public bool? Video { get; set; }

/// <summary>
/// Whether the SIP endpoint observes
/// <a href="https://tokbox.com/developer/guides/moderation/#force_mute">force mute moderation</a>
/// (true) or not (false, the default).
/// </summary>
public bool? ObserveForceMute { get; set; }
}
}
23 changes: 23 additions & 0 deletions OpenTok/Exception/OpenTokArgumentException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;

namespace OpenTokSDK.Exception
{
/// <summary>
/// Defines an exception object thrown when an invalid argument is passed into a method.
/// </summary>
public class OpenTokArgumentException : ArgumentException
{
/// <inheritdoc cref="ArgumentException"/>
public OpenTokArgumentException(string message)
:base(message)
{

}

/// <inheritdoc cref="ArgumentException"/>
public OpenTokArgumentException(string message, string paramName)
: base(message, paramName)
{
}
}
}
59 changes: 6 additions & 53 deletions OpenTok/Exception/OpenTokException.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenTokSDK.Exception
namespace OpenTokSDK.Exception
{
/// <summary>
/// Defines exceptions in the OpenTok SDK.
/// </summary>
public class OpenTokException : System.Exception
{

/// <summary>
/// Construct opentok exception
/// </summary>

/// <inheritdoc cref="Exception"/>
public OpenTokException()
{
}
Expand All @@ -23,15 +16,15 @@ public OpenTokException()
/// </summary>
/// <param name="message"></param>
public OpenTokException(string message)
: base(message){}
: base(message) { }

/// <summary>
/// Construct OpenTokException with a message and an inner exception
/// </summary>
/// <param name="message"></param>
/// <param name="exception"></param>
public OpenTokException(string message, System.Exception exception)
: base(message, exception){}
: base(message, exception) { }

/// <summary>
/// Get's the message of the exception
Expand All @@ -51,44 +44,4 @@ public System.Exception GetException()
return InnerException;
}
}

/// <summary>
/// Defines an exception object thrown when an invalid argument is passed into a method.
/// </summary>
public class OpenTokArgumentException : OpenTokException
{
/// <summary>
/// Constructor. Do not use.
/// </summary>
/// <param name="message"></param>
public OpenTokArgumentException(string message)
: base(message)
{
}
}

/// <summary>
/// Defines an exception object thrown when a REST API call results in an error response.
/// </summary>
public class OpenTokWebException : OpenTokException
{
/// <summary>
/// Constructor. Do not use.
/// </summary>
/// <param name="message"></param>
/// <param name="exception"></param>
public OpenTokWebException(string message, System.Exception exception)
: base(message, exception)
{
}

/// <summary>
/// Constructor. Do not use.
/// </summary>
/// <param name="message"></param>
public OpenTokWebException(string message)
: base(message)
{
}
}
}
27 changes: 27 additions & 0 deletions OpenTok/Exception/OpenTokWebException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace OpenTokSDK.Exception
{
/// <summary>
/// Defines an exception object thrown when a REST API call results in an error response.
/// </summary>
public class OpenTokWebException : OpenTokException
{
/// <summary>
/// Constructor. Do not use.
/// </summary>
/// <param name="message"></param>
/// <param name="exception"></param>
public OpenTokWebException(string message, System.Exception exception)
: base(message, exception)
{
}

/// <summary>
/// Constructor. Do not use.
/// </summary>
/// <param name="message"></param>
public OpenTokWebException(string message)
: base(message)
{
}
}
}
Loading