Skip to content
Tracon

VoiceSessionCost

Namespace Tracon · Assembly Tracon.Abstractions.dll

What one voice conversation cost.

public sealed record VoiceSessionCost : IEquatable<VoiceSessionCost>

objectVoiceSessionCost

IEquatable<VoiceSessionCost>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The total has two addends because the two voice paths bill differently: a provider-hosted live session bills by duration, while the conversation layer Tracon runs itself bills the synthesized characters.

The sum lives in VoiceSessionCost.Total and nowhere else. A bare decimal? forces every caller to decide which addend it meant, and a sum spelled out by hand in several places silently loses a term the day a third one arrives.

This is the cost of the voice connection only. Each delegated task also produces an ordinary runs row with its own token cost, which is deliberately not repeated here. A display that shows only this number under-reports; the honest figure is this cost plus the session’s run costs.

public VoiceSessionCost()

What the synthesized characters cost.

public decimal? CharacterCost { get; init; }

decimal?

The currency the amounts are in.

public string? Currency { get; init; }

string?

What the session’s duration cost.

public decimal? DurationCost { get; init; }

decimal?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(VoiceSessionCost? other)

other VoiceSessionCost?

bool

public override int GetHashCode()

int

public override string ToString()

string

Adds every priced addend.

public decimal? Total()

decimal?

The total, or null when nothing was priced — never 0, which would claim the conversation was free.

operator ==(VoiceSessionCost?, VoiceSessionCost?)

Section titled “ operator ==(VoiceSessionCost?, VoiceSessionCost?)”
public static bool operator ==(VoiceSessionCost? left, VoiceSessionCost? right)

left VoiceSessionCost?

right VoiceSessionCost?

bool

operator !=(VoiceSessionCost?, VoiceSessionCost?)

Section titled “ operator !=(VoiceSessionCost?, VoiceSessionCost?)”
public static bool operator !=(VoiceSessionCost? left, VoiceSessionCost? right)

left VoiceSessionCost?

right VoiceSessionCost?

bool