Synchronously sends a message. The session
should be in connected state. This method is not recommended for a
UI thread.
Namespace:
Microsoft.Rtc.Signaling
Assembly: Microsoft.Rtc.Collaboration(in Microsoft.Rtc.Collaboration.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function SendMessage ( _ messageType As MessageType, _ sessionTarget As RealTimeAddress, _ contentType As ContentType, _ body As Byte(), _ signalingHeaders As IEnumerable( Of SignalingHeader) _ ) As SipResponseData |
C# |
---|
public SipResponseData SendMessage( MessageType messageType, RealTimeAddress sessionTarget, ContentType contentType, byte[] body, IEnumerable< SignalingHeader> signalingHeaders ) |
Visual C++ |
---|
public: SipResponseData^ SendMessage( MessageType messageType, RealTimeAddress^ sessionTarget, ContentType^ contentType, array< unsigned char>^ body, IEnumerable< SignalingHeader^>^ signalingHeaders ) |
JavaScript |
---|
function sendMessage( messageType, sessionTarget, contentType, body, signalingHeaders); |
Parameters
- messageType
- Type:
Microsoft.Rtc.Signaling
.
.
::
.
MessageType
The message type.
- sessionTarget
- Type:
Microsoft.Rtc.Signaling
.
.
::
.
RealTimeAddress
The target to send the message.
- contentType
- Type:
ContentType
The content type describing the body. If null text/plain, UTF-8 is assumed.
- body
- Type:
array<
Byte
>
[]
()
[]
The body for the data.
- signalingHeaders
- Type:
IEnumerable
<
(Of
<
(
SignalingHeader
>
)
>
)
The headers provided for this invite.
Return Value
The response data.Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when a non-null is expected for an argument. The argument name for which a non-null is expected is part of the exception message. |
ObjectDisposedException | Thrown when the session object is already disposed. |
Microsoft.Rtc.Signaling . . :: . FailureResponseException | Thrown when the server or remote participant returns an error. The response code in the exception should give more information about the error. |
Microsoft.Rtc.Signaling . . :: . RealTimeException | Encompasses an SIP error or failure cases encountered during sending the message - SIP Transport error, SIP Authentication, and credential-related errors. |