GeneSIPs 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package GeneSIPs --version 1.0.3                
NuGet\Install-Package GeneSIPs -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GeneSIPs" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GeneSIPs --version 1.0.3                
#r "nuget: GeneSIPs, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GeneSIPs as a Cake Addin
#addin nuget:?package=GeneSIPs&version=1.0.3

// Install GeneSIPs as a Cake Tool
#tool nuget:?package=GeneSIPs&version=1.0.3                

GeneSIPS

GeneSIPS is a simplistic library for bulk generation of SIPs datagrams.

Methodology

Since SIP Datagrams are really just text structures following IETF documents https://tools.ietf.org/html/rfc3261 and https://tools.ietf.org/html/rfc2046, the primary goal of this library is to build the structure of the message in string format such that it can be encoded and piped into a UDP Client.

Generation

Each class and its subclass will contain a public faker object. While the library has "general" rules defined, you can also build your own Faker<T> objects and pass them to each class as a constructor to override the default value.

Testing

Each class (Or Line in the message) will contain its own Regex value to test for validity. As such you can bulk generate data, and then validate each line (and then the entire message) against the regex.

Usage

The first case is just generating a datagram:

 SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();

This will provide you an actual Datagram object. If you want the raw datagram converted to test, you can just call ToString() on the object:

string Datagram = TestMessage.ToString()

Custom Fakers

I'm in the process of implementing static faker settings across all objects, but let's look at the SIPMessage object. The below allows you to create a custom Faker for the entire object that, in this case, leaves the Body null:

Faker<SIPMessage> CustomFaker = new Faker<SIPMessage>()
                .StrictMode(false)
                .RuleFor(o => o.Body, f => null)
                .RuleFor(o => o.RequestLine, f => RequestLine.Faker.Generate(1).First())
                .RuleFor(o => o.Header, f => MessageHeader.Faker.Generate(1).First());

SIPMessage.SetCustomFaker(CustomFaker);
SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();           

Bulk Generation

If you're looking at bulk-generating datagrams, you will do it via Faker.Generate(x). As a heads up, initial benchmarking was able to produce 50,000 in 2.2 seconds. Can probably be tuned down, but should also be implemented in parallel if you need large volumes.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 2.2

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.8 777 2/13/2019
1.0.7 626 1/28/2019
1.0.6 667 1/20/2019
1.0.5 669 1/20/2019
1.0.4 676 1/20/2019
1.0.3 695 1/20/2019
1.0.2 705 1/18/2019
1.0.1 678 1/18/2019
1.0.0 715 1/16/2019

Updated with tests and starts for de-serialization of response datagrams