• Articles
  • Api Documentation
Search Results for

    Show / Hide Table of Contents
    • SipLib.Body
      • BodyParser
      • ContentTypes
      • MessageContentsContainer
      • MultipartBinaryBodyBuilder
      • SipBodyBuilder
    • SipLib.Channels
      • AcceptCertificateDelegate
      • AcceptConnectionDelegate
      • DscpSettings
      • LogInvalidSipMessageDelegate
      • LogSipRequestDelegate
      • LogSipResponseDelegate
      • Qos
      • SIPChannel
      • SIPConnection
      • SIPConnectionDisconnectedDelegate
      • SIPConnectionsEnum
      • SIPMessageReceivedDelegate
      • SIPTCPChannel
      • SIPTLSChannel
      • SIPUDPChannel
      • SipConnectionFailedDelegate
      • SipRequestReceivedDelegate
      • SipResponseReceivedDelegate
      • SipTransactionCompleteDelegate
      • WindowsQos
    • SipLib.Collections
      • ThreadSafeGenericList<T>
    • SipLib.Core
      • ByteBufferInfo
      • CallProperties
      • Crypto
      • HTTPDigest
      • IPSocket
      • SIPAuthenticationHeader
      • SIPAuthorisationDigest
      • SIPAuthorisationHeadersEnum
      • SIPCallInfoHeader
      • SIPConstants
      • SIPContactHeader
      • SIPEndPoint
      • SIPEscape
      • SIPFrag
      • SIPFromHeader
      • SIPGeolocationHeader
      • SIPHeader
      • SIPHeaders
      • SIPMessage
      • SIPMessageTypesEnum
      • SIPMethods
      • SIPMethodsEnum
      • SIPPaiHeader
      • SIPParameters
      • SIPPpiHeader
      • SIPProtocolsEnum
      • SIPProtocolsType
      • SIPReplacesParameter
      • SIPRequest
      • SIPResponse
      • SIPResponseStatusCodes
      • SIPResponseStatusCodesEnum
      • SIPRoute
      • SIPRouteSet
      • SIPSchemesEnum
      • SIPSchemesType
      • SIPToHeader
      • SIPURI
      • SIPUserField
      • SIPValidationException
      • SIPValidationFieldsEnum
      • SIPViaHeader
      • SIPViaSet
      • SipUtils
      • TypeExtensions
    • SipLib.Dtls
      • AlertLevelsEnum
      • AlertTypesEnum
      • DtlsClientUdpTransport
      • DtlsServerUdpTransport
      • DtlsSrtpClient
      • DtlsSrtpServer
      • DtlsSrtpTransport
      • DtlsUtils
      • IDtlsSrtpPeer
      • IPacketTransformer
      • ITransformEngine
      • NetConvert
      • RTCDtlsFingerprint
      • RawPacket
      • SrtcpCryptoContext
      • SrtpPolicy
      • SrtpTransformEngine
      • SrtpTransformer
    • SipLib.Logging
      • SipLogger
    • SipLib.Media
      • ALawDecoder
      • ALawEncoder
      • AudioDestination
      • AudioDestinationDelegate
      • AudioSampleData
      • AudioSamplesReadyDelegate
      • AudioSource
      • Band
      • DtmfDigitReceivedDelegate
      • FileAudioSource
      • G722Codec
      • G722CodecState
      • G722Decoder
      • G722Encoder
      • G722Flags
      • HighResolutionTimer
      • HighResolutionTimerDelegate
      • IAudioDecoder
      • IAudioEncoder
      • IAudioSampleSource
      • MediaPortManager
      • MediaPortSettings
      • MediaTypes
      • MsrpEncryptionEnum
      • MuLawDecoder
      • MuLawEncoder
      • PcmaDecoder
      • PcmaEncoder
      • PcmuDecoder
      • PcmuEncoder
      • PortRange
      • RtpEncryptionEnum
    • SipLib.Msrp
      • ByteRangeHeader
      • CpimMessage
      • MsrpCompletionStatus
      • MsrpConnection
      • MsrpConnectionStatusDelegate
      • MsrpMessage
      • MsrpMessageDeliveryFailedDelegate
      • MsrpMessageReceivedDelegate
      • MsrpMessageSentDelegate
      • MsrpMessageType
      • MsrpPathHeader
      • MsrpStatusHeader
      • MsrpStreamParser
      • MsrpTextMessageReceivedDelegate
      • MsrpUri
      • ReportReceivedDelegate
    • SipLib.Network
      • IpUtils
    • SipLib.RealTimeText
      • RttCharactersReceivedDelegate
      • RttParameters
      • RttReceiver
      • RttRtpSendDelegate
      • RttSender
    • SipLib.Rtp
      • ByePacket
      • DtlsHandshakeFailedDelegate
      • DtmfEventEnum
      • DtmfPacket
      • JitterStatistics
      • MeanOpinionScore
      • ReceiveStatisticsReadyDelegate
      • ReceiverReport
      • ReportBlock
      • RtcpCompoundPacket
      • RtcpHeader
      • RtcpPacketReceivedDelegate
      • RtcpPacketSentDelegate
      • RtcpPacketType
      • RtpChannel
      • RtpPacket
      • RtpPacketReceivedDelegate
      • RtpPacketSentDelegate
      • RtpReceiveStatistics
      • RtpUtils
      • SdesChunk
      • SdesItem
      • SdesItemType
      • SdesPacket
      • SenderInfo
      • SenderReport
    • SipLib.RtpCrypto
      • AesFunctions
      • CryptoAttribute
      • CryptoContext
      • CryptoSuites
      • InlineParams
      • MasterKeys
      • RocVals
      • RocValues
      • SRtpErrorsEnum
      • SRtpUtils
      • SessionKeys
      • SrtpDecryptor
      • SrtpEncryptor
      • SrtpLabelItem
      • SrtpTransformBase
    • SipLib.Sdp
      • ConnectionData
      • MediaDescription
      • MediaDirectionEnum
      • Origin
      • RtpMapAttribute
      • Sdp
      • SdpAnswerSettings
      • SdpAttribute
      • SdpUtils
      • SetupType
    • SipLib.Threading
      • QueuedActionWorkerTask
    • SipLib.Transactions
      • ClientInviteTransaction
      • ClientNonInviteTransaction
      • ServerInviteTransaction
      • ServerNonInviteTransaction
      • SipTimers
      • SipTransactionBase
      • SipTransport
      • TransactionRequestReceivedDelegate
      • TransactionResponseReceivedDelegate
      • TransactionStateEnum
      • TransactionTerminationReasonEnum
    • SipLib.Video
      • H264Depacketiser
      • H264Packetiser
      • H264Packetiser.H264Nal
      • H264RtpReceiver
      • H264RtpSender
      • RtpSendDelegate
      • RtpVP8Header
      • VP8RtpReceiver
      • VP8RtpSender
      • VideoRtpReceiver
      • VideoRtpSender

    Class IPSocket

    Class containing various utility functions for sockets.

    Inheritance
    object
    IPSocket
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SipLib.Core
    Assembly: SipLib.dll
    Syntax
    public class IPSocket

    Fields

    | Edit this page View Source

    MaxPort

    Specifies the maximum acceptable value for the IPEndPoint Port property.

    Declaration
    public const int MaxPort = 65535
    Field Value
    Type Description
    int
    | Edit this page View Source

    MinPort

    Specifies the minimum acceptable value for the IPEndPoint Port property.

    Declaration
    public const int MinPort = 0
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetIPEndPoint(string)

    Returns an IPv4 end point from a socket address in 10.0.0.1:5060 format.

    Declaration
    public static IPEndPoint GetIPEndPoint(string IPSocket)
    Parameters
    Type Name Description
    string IPSocket
    Returns
    Type Description
    IPEndPoint
    | Edit this page View Source

    GetSocketString(IPEndPoint)

    This code is based on the IPEndPoint.ToString method in the dotnet source code at https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/System/Net/IPEndPoint.cs. If/when that feature makes it into .NET Standard this method can be replaced.

    Declaration
    public static string GetSocketString(IPEndPoint endPoint)
    Parameters
    Type Name Description
    IPEndPoint endPoint
    Returns
    Type Description
    string
    | Edit this page View Source

    IsIPAddress(string)

    (convenience method) check if string can be parsed as IPAddress

    Declaration
    public static bool IsIPAddress(string socket)
    Parameters
    Type Name Description
    string socket

    string to check

    Returns
    Type Description
    bool

    true/false

    | Edit this page View Source

    IsPrivateAddress(string)

    Checks the Contact SIP URI host and if it is recognised as a private address it is replaced with the socket the SIP message was received on.

    Private address space blocks RFC 1597. 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255

    Declaration
    public static bool IsPrivateAddress(string host)
    Parameters
    Type Name Description
    string host
    Returns
    Type Description
    bool
    | Edit this page View Source

    Parse(string, int)

    Parses an endpoint string into an IPEndPoint

    Declaration
    public static IPEndPoint Parse(string endpointstring, int defaultport = -1)
    Parameters
    Type Name Description
    string endpointstring
    int defaultport
    Returns
    Type Description
    IPEndPoint
    | Edit this page View Source

    Parse(string, out string, out int)

    Check if endpointstring contains a hostname or ip-address and ip-port accepts IPv4 and IPv6 and IPv6 mapped IPv4 addresses return detected values in host and port adapted from: http://stackoverflow.com/questions/2727609/best-way-to-create-ipendpoint-from-string

    Declaration
    public static bool Parse(string endpointstring, out string host, out int port)
    Parameters
    Type Name Description
    string endpointstring

    string to check

    string host

    host-portion of endpointstring, if host can be parsed as I PAddress, then host is IPAddress.ToString

    int port

    port-portion of endpointstring

    Returns
    Type Description
    bool

    true if host-portion of endpoint string is valid ip-address

    Remarks

    rj2: I had the requirement of parsing an IPEndpoint with IPv6, v4 and hostnames and getting them as string and int

    Exceptions
    Type Condition
    ArgumentException

    if endpointstring is null/empty

    FormatException

    if host looks like ip-address but can't be parsed

    | Edit this page View Source

    ParsePortFromSocket(string)

    For IPv6 addresses with port the string format is of the form: [2a02:8084:6981:7880:54a9:d238:b2ee:ceb]:6060 Without a port the form is: 2a02:8084:6981:7880:54a9:d238:b2ee:ceb

    Declaration
    public static int ParsePortFromSocket(string socket)
    Parameters
    Type Name Description
    string socket

    The socket string to check

    Returns
    Type Description
    int

    The socket string's explicit port number or 0 if it does not have one.

    | Edit this page View Source

    TryParseIPEndPoint(string, out IPEndPoint?)

    This code is based on the IPEndPoint.TryParse method in the dotnet source code at https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/System/Net/IPEndPoint.cs. If/when that feature makes it into .NET Standard this method can be replaced.

    Declaration
    public static bool TryParseIPEndPoint(string s, out IPEndPoint? result)
    Parameters
    Type Name Description
    string s

    The end point string to parse.

    IPEndPoint result

    If the parse is successful this output parameter will contain the IPv4 or IPv6 end point.

    Returns
    Type Description
    bool

    Returns true if the string could be successfully parsed as an IPv4 or IPv6 end point. False if not.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX