• 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 SipUtils

    Static class containing various SIP related utility functions.

    Inheritance
    object
    SipUtils
    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 static class SipUtils

    Methods

    | Edit this page View Source

    AddEmergencyIdUrnCallInfoHeader(SIPRequest, string, string)

    Adds a Call-Info header to a SIP request containing a purpose parameter of emergency-IncidentId or emergency-CallId. See Sectionss 2.1.6 and 2.1.7 of NENA-STA-010.3.

    Declaration
    public static void AddEmergencyIdUrnCallInfoHeader(SIPRequest Req, string strIdUrn, string PurposeParam)
    Parameters
    Type Name Description
    SIPRequest Req

    SIPRequest to add the Call-Info header to.

    string strIdUrn

    String containing the Emergency ID URN built using the BuildEmergencyIdUrn() function. Must be a valid URN.

    string PurposeParam

    Purpose parameter to add to the Call-Info header. Must be either "emergency-CallId" or "emergency-IncidentId".

    | Edit this page View Source

    BuildAckRequest(SIPResponse, SIPChannel)

    Builds an ACK SIP Request message to send in response to a SIP response message. This method can be used to build an ACK request to send in response to a 200 OK response or a 4XX response message that requires an ACK request.

    Declaration
    public static SIPRequest BuildAckRequest(SIPResponse Res, SIPChannel SipChan)
    Parameters
    Type Name Description
    SIPResponse Res

    SIP response message to build the ACK request for.

    SIPChannel SipChan

    SIPChannel on which the SIP response was received.

    Returns
    Type Description
    SIPRequest

    Returns an ACK SIPRequest object.

    | Edit this page View Source

    BuildByeRequest(SIPRequest, SIPChannel, IPEndPoint, bool, int, SIPResponse)

    Builds a BYE SIPRequest for in incoming or an outgoing call.

    Declaration
    public static SIPRequest BuildByeRequest(SIPRequest InvReq, SIPChannel SipChan, IPEndPoint RemIpe, bool IncomingCall, int LastCSeqNumber, SIPResponse InviteOkResponse)
    Parameters
    Type Name Description
    SIPRequest InvReq

    Original INVITE message for the call.

    SIPChannel SipChan

    SIPChannel used to communicate with the remote endpoint.

    IPEndPoint RemIpe

    IPEndPoint to send the request to.

    bool IncomingCall

    If true then the call was an incoming call, i.e. the INVITE request was received. Else, the call was an outgoing call, i.e. the INVITE request was sent.

    int LastCSeqNumber

    Last CSeq number for the call dialog.

    SIPResponse InviteOkResponse

    OK message that was received in response to the INVITE request. This parameter is required if the call was an outgoing one and is currently on-line.

    Returns
    Type Description
    SIPRequest

    Returns a SIPRequest object containing the BYE or the CANCEL request.

    | Edit this page View Source

    BuildCancelRequest(SIPRequest, SIPChannel, IPEndPoint, int)

    Builds a BYE or a CANCEL for in incoming or an outgoing call.

    Declaration
    public static SIPRequest BuildCancelRequest(SIPRequest InvReq, SIPChannel SipChan, IPEndPoint RemIpe, int LastCSeqNumber)
    Parameters
    Type Name Description
    SIPRequest InvReq

    Original INVITE message for the call.

    SIPChannel SipChan

    SIPChannel used to communicate with the remote endpoint.

    IPEndPoint RemIpe

    IPEndPoint to send the request to.

    int LastCSeqNumber

    Last CSeq number for the call dialog.

    Returns
    Type Description
    SIPRequest

    Returns a SIPRequest object containing the BYE or the CANCEL request.

    | Edit this page View Source

    BuildEmergencyIdUrn(string, string)

    Builds a emergency URN identifier string used for a Call Identifier or a Incident Identifier. See Sectionss 2.1.6 and 2.1.7 of NENA-STA-010.3.

    Declaration
    public static string BuildEmergencyIdUrn(string IdType, string strElemId)
    Parameters
    Type Name Description
    string IdType

    Must be either "callid" or "incidentid"

    string strElemId

    Element Identifier of the element that is inserting the Call-Info header. For example: "bcf.state.pa.us".

    Returns
    Type Description
    string

    Returns a formatted Emergency Incident or Call ID URN.

    | Edit this page View Source

    BuildFingerprintAttr(X509Certificate2)

    Builds a fingerprint SDP attribute for a X.509 certificate. See RFC 4572.

    Declaration
    public static SdpAttribute BuildFingerprintAttr(X509Certificate2 Cert)
    Parameters
    Type Name Description
    X509Certificate2 Cert

    The X.509 certificate to build the attribute for.

    Returns
    Type Description
    SdpAttribute

    Returns the SdpAttribute object that can be added to the SDP.

    | Edit this page View Source

    BuildInDialogRequest(SIPMethodsEnum, SIPChannel, bool, SIPRequest, string, string, SIPResponse, ref int)

    Builds an in-dialog SIP request.

    Declaration
    public static SIPRequest BuildInDialogRequest(SIPMethodsEnum Method, SIPChannel SipChan, bool IncomingCall, SIPRequest InvReq, string LocalTag, string RemoteTag, SIPResponse InviteOkResponse, ref int LastCSeqNumber)
    Parameters
    Type Name Description
    SIPMethodsEnum Method

    Request method for the new in-dialog request

    SIPChannel SipChan

    SIPChannel that the call is on

    bool IncomingCall

    True if the original call was incoming or false if it was an outgoing call

    SIPRequest InvReq

    The original INVITE request

    string LocalTag

    The local tag for the SIP dialog

    string RemoteTag

    The remote tag for the SIP dialog

    SIPResponse InviteOkResponse

    The original OK response to the INVITE request

    int LastCSeqNumber

    The last CSeq number. This value is updated by this function.

    Returns
    Type Description
    SIPRequest

    Returns a new SIPRequest object.

    | Edit this page View Source

    BuildOkToByeOrCancel(SIPRequest, SIPEndPoint)

    Builds an OK response to a BYE or a CANCEL request.

    Declaration
    public static SIPResponse BuildOkToByeOrCancel(SIPRequest Req, SIPEndPoint RemIp)
    Parameters
    Type Name Description
    SIPRequest Req

    Request message to send the OK response to.

    SIPEndPoint RemIp

    Verified end point of the request originator.

    Returns
    Type Description
    SIPResponse

    Returns a 200 OK SIPResponse object.

    | Edit this page View Source

    BuildOkToInvite(SIPRequest, SIPChannel, string, string)

    Builds a 200 OK SIPResponse message for an INVITE request.

    Declaration
    public static SIPResponse BuildOkToInvite(SIPRequest InvReq, SIPChannel SipChan, string strBody, string strContentType)
    Parameters
    Type Name Description
    SIPRequest InvReq

    INVITE request message to build the response for.

    SIPChannel SipChan

    SIPChannel on which the INVITE message was received on and the 200 OK response will be sent on.

    string strBody

    Body of the 200 OK.

    string strContentType

    Value of the Content-Type header that describes the format of the message body. For example: "application/sdp" or "multipart/mixed; boundary=boundary1"

    Returns
    Type Description
    SIPResponse

    Returns a SIPResponse object containing the 200 OK response message.

    | Edit this page View Source

    BuildResponse(SIPRequest, SIPResponseStatusCodesEnum, string, SIPChannel, string?)

    Builds a SIP response message. A simple response is something like 100 Trying, 180 Ringing, or 404 Not Found that does not have a message body.

    Declaration
    public static SIPResponse BuildResponse(SIPRequest Sr, SIPResponseStatusCodesEnum StatCode, string ReasonPhrase, SIPChannel sipChannel, string? SipUserName)
    Parameters
    Type Name Description
    SIPRequest Sr

    The SIP request to respond to.

    SIPResponseStatusCodesEnum StatCode

    Status code to use for the response.

    string ReasonPhrase

    The response reason text. Required. Must not be empty or null.

    SIPChannel sipChannel

    Contains transport information. Must be the SIPChannel on which the request message was received.

    string SipUserName

    SIP user name to use for the User part of the SIPURI. Optional, may be null.

    Returns
    Type Description
    SIPResponse

    Returns a SIPResponse that can be sent.

    | Edit this page View Source

    GetCallInfoHeaderForPurpose(SIPHeader, string)

    Gets the SIPCallInfoHeader for the Call-Info header that has a specified purpose parameter.

    Declaration
    public static SIPCallInfoHeader? GetCallInfoHeaderForPurpose(SIPHeader Sh, string strPurpose)
    Parameters
    Type Name Description
    SIPHeader Sh

    SIPHeader object containing the SIP headers for the request or response to search in.

    string strPurpose

    Purpose parameter to search for.

    Returns
    Type Description
    SIPCallInfoHeader

    Returns a SIPCallInfoHeader object if the specified Call-Info header was found or null if it was not.

    | Edit this page View Source

    GetCallInfoHeaderForPurpose(SIPHeader, string, SIPSchemesEnum)

    Gets the SIPCallInfoHeader for the Call-Info header that has a specified purpose parameter.

    Declaration
    public static SIPCallInfoHeader? GetCallInfoHeaderForPurpose(SIPHeader Sh, string strPurpose, SIPSchemesEnum ExcludeScheme)
    Parameters
    Type Name Description
    SIPHeader Sh

    SIPHeader object containing the SIP headers for the request or response to search in.

    string strPurpose

    Purpose parameter to search for.

    SIPSchemesEnum ExcludeScheme

    Exclude headers with a URI scheme equal to this value.

    Returns
    Type Description
    SIPCallInfoHeader

    Returns a SIPCallInfoHeader object if the specified Call-Info header was found or null if it was not.

    | Edit this page View Source

    GetCallInfoValueForPurpose(SIPHeader, string)

    Returns the header value of a Call-Info header that has a specified "purpose=" header parameter.

    Declaration
    public static string? GetCallInfoValueForPurpose(SIPHeader Sh, string strPurpose)
    Parameters
    Type Name Description
    SIPHeader Sh

    SIPHeader object containing the SIP headers for the request or response to search in.

    string strPurpose

    Purpose parameter to search for.

    Returns
    Type Description
    string

    Returns the header value of the matching Call-Info header. Returns null if there is no Call-Info header with the specified purpose parameter.

    | Edit this page View Source

    GetPaiOrFromUri(SIPHeader)

    Gets the SIP URI from the P-Asserted-Identity header if present or from the From header if the the PAI header is not present.

    Declaration
    public static SIPURI GetPaiOrFromUri(SIPHeader Sh)
    Parameters
    Type Name Description
    SIPHeader Sh

    Input request headers

    Returns
    Type Description
    SIPURI

    Returns a copy of the SIPURI

    | Edit this page View Source

    GetRemoteSipUri(SIPHeader)

    Gets the URI of the remote party for an incoming call.

    Declaration
    public static SIPURI? GetRemoteSipUri(SIPHeader Hdr)
    Parameters
    Type Name Description
    SIPHeader Hdr

    The headers from the INVITE request of the incoming call.

    Returns
    Type Description
    SIPURI

    Returns the URI to send a request to for the call, such as a BYE or CANCEL request.

    Remarks

    This method returns the URI specified in the top Record-Route header if it has a "lr" parameter or the URI in Contact header. If there is no Contact header then this method returns the URI from the From header.

    | Edit this page View Source

    GetRemoteUri(SIPRequest)

    Gets the URI of the remote party for an incoming call. Only call this method for incoming calls.

    Declaration
    public static SIPURI? GetRemoteUri(SIPRequest InvReq)
    Parameters
    Type Name Description
    SIPRequest InvReq

    INVITE request of the incoming call.

    Returns
    Type Description
    SIPURI

    Returns the URI to send a request to for the call, such as a BYE or CANCEL request.

    Remarks

    This method returns the URI specified in the top Record-Route header if it has a "lr" parameter or the URI in Contact header. If there is no Contact header then this method returns the URI from the From header.

    | Edit this page View Source

    GetResponseReason(SIPResponseStatusCodesEnum)

    Returns a reason text statement given a SIPResponseStatusCodesEnum value

    Declaration
    public static string GetResponseReason(SIPResponseStatusCodesEnum Code)
    Parameters
    Type Name Description
    SIPResponseStatusCodesEnum Code

    Code to return a statement for.

    Returns
    Type Description
    string

    Returns a text string. Return "Unknown" if the input code not found.

    | Edit this page View Source

    GetSipFragResponseCode(string)

    Parses a SipFrag, checks for errors and returns the status code from the the SIP message fragment.

    Declaration
    public static int GetSipFragResponseCode(string SipFrag)
    Parameters
    Type Name Description
    string SipFrag

    String containing the sipfrag, for example: "SIP/2.0 200 OK"

    Returns
    Type Description
    int

    Returns the status code. Returns 0 if the sipfrag is not valid.

    | Edit this page View Source

    GetTopContactSipUri(SIPHeader)

    Gets the SIPURI of the top-most Contact header from a SIP request or a SIP response.

    Declaration
    public static SIPURI? GetTopContactSipUri(SIPHeader Hdr)
    Parameters
    Type Name Description
    SIPHeader Hdr

    SIPHeader containing the Contact header list.

    Returns
    Type Description
    SIPURI

    Returns the SIPURI of the top-most Contact header if there is one or null if there are no Contact header.

    | Edit this page View Source

    IsInDialog(SIPRequest)

    Determines of a request is in dialog or not.

    Declaration
    public static bool IsInDialog(SIPRequest Req)
    Parameters
    Type Name Description
    SIPRequest Req

    Input SIP INVITE request

    Returns
    Type Description
    bool

    Returns true if the request is in-dialog or false if it is not.

    | Edit this page View Source

    VerifyUdpEndPoint(SIPRequest, SIPEndPoint, SIPChannel)

    Checks for the case where a message is received on the UDP transport protocol and the top most Via header does not have an rport parameter but does have a port number that is different than the source port that the message was received on.

    Declaration
    public static SIPEndPoint VerifyUdpEndPoint(SIPRequest SipMsg, SIPEndPoint RemIp, SIPChannel SipChannel)
    Parameters
    Type Name Description
    SIPRequest SipMsg

    Received message.

    SIPEndPoint RemIp

    SIPEndPoint that the message was received from.///

    SIPChannel SipChannel

    SIPChannel that received the request message.

    Returns
    Type Description
    SIPEndPoint

    Returns the original end point if the transport protocol is not UDP or if it is UDP but the top most Via contains an rport parameter. Else returns a new endpoint constructed from the Sent By part of the Via header provided it has a port number specified. If not port number is specified, then the original end point is returned.

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