PortSIP VoIP SDK Manual for Windows  16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
Functions
Presence events

Functions

Int32 PortSIP.SIPCallbackEvents.onPresenceRecvSubscribe (Int32 callbackIndex, Int32 callbackObject, Int32 subscribeId, String fromDisplayName, String from, String subject)
 
Int32 PortSIP.SIPCallbackEvents.onPresenceOnline (Int32 callbackIndex, Int32 callbackObject, String fromDisplayName, String from, String stateText)
 
Int32 PortSIP.SIPCallbackEvents.onPresenceOffline (Int32 callbackIndex, Int32 callbackObject, String fromDisplayName, String from)
 
Int32 PortSIP.SIPCallbackEvents.onRecvMessage (Int32 callbackIndex, Int32 callbackObject, Int32 sessionId, String mimeType, String subMimeType, byte[] messageData, Int32 messageDataLength)
 
Int32 PortSIP.SIPCallbackEvents.onRecvOutOfDialogMessage (Int32 callbackIndex, Int32 callbackObject, String fromDisplayName, String from, String toDisplayName, String to, String mimeType, String subMimeType, byte[] messageData, Int32 messageDataLength)
 
Int32 PortSIP.SIPCallbackEvents.onSendMessageSuccess (Int32 callbackIndex, Int32 callbackObject, Int32 sessionId, Int32 messageId)
 
Int32 PortSIP.SIPCallbackEvents.onSendMessageFailure (Int32 callbackIndex, Int32 callbackObject, Int32 sessionId, Int32 messageId, String reason, Int32 code)
 
Int32 PortSIP.SIPCallbackEvents.onSendOutOfDialogMessageSuccess (Int32 callbackIndex, Int32 callbackObject, Int32 messageId, String fromDisplayName, String from, String toDisplayName, String to)
 
Int32 PortSIP.SIPCallbackEvents.onSendOutOfDialogMessageFailure (Int32 callbackIndex, Int32 callbackObject, Int32 messageId, String fromDisplayName, String from, String toDisplayName, String to, String reason, Int32 code)
 

Detailed Description

Function Documentation

◆ onPresenceRecvSubscribe()

Int32 PortSIP.SIPCallbackEvents.onPresenceRecvSubscribe ( Int32  callbackIndex,
Int32  callbackObject,
Int32  subscribeId,
String  fromDisplayName,
String  from,
String  subject 
)

This event will be triggered when receiving the SUBSCRIBE request from a contact.

Parameters
subscribeIdThe ID of SUBSCRIBE request.
fromDisplayNameThe display name of contact.
fromThe contact who sends the SUBSCRIBE request.
subjectThe subject of the SUBSCRIBE request.

◆ onPresenceOnline()

Int32 PortSIP.SIPCallbackEvents.onPresenceOnline ( Int32  callbackIndex,
Int32  callbackObject,
String  fromDisplayName,
String  from,
String  stateText 
)

When the contact is online or changes presence status, this event will be triggered.

Parameters
fromDisplayNameThe display name of contact.
fromThe contact who sends the SUBSCRIBE request.
stateTextThe presence status text.

◆ onPresenceOffline()

Int32 PortSIP.SIPCallbackEvents.onPresenceOffline ( Int32  callbackIndex,
Int32  callbackObject,
String  fromDisplayName,
String  from 
)

When the contact goes offline, this event will be triggered.

Parameters
fromDisplayNameThe display name of contact.
fromThe contact who sends the SUBSCRIBE request

◆ onRecvMessage()

Int32 PortSIP.SIPCallbackEvents.onRecvMessage ( Int32  callbackIndex,
Int32  callbackObject,
Int32  sessionId,
String  mimeType,
String  subMimeType,
byte []  messageData,
Int32  messageDataLength 
)

This event will be triggered when receiving a MESSAGE message in dialog.

Parameters
sessionIdThe session ID of the call.
mimeTypeThe message mime type.
subMimeTypeThe message sub mime type.
messageDataThe received message body. It can be text or binary data.
messageDataLengthThe length of "messageData".

◆ onRecvOutOfDialogMessage()

Int32 PortSIP.SIPCallbackEvents.onRecvOutOfDialogMessage ( Int32  callbackIndex,
Int32  callbackObject,
String  fromDisplayName,
String  from,
String  toDisplayName,
String  to,
String  mimeType,
String  subMimeType,
byte []  messageData,
Int32  messageDataLength 
)

This event will be triggered when receiving a MESSAGE message out of dialog. For example: pager message.

Parameters
fromDisplayNameThe display name of sender.
fromThe message sender.
toDisplayNameThe display name of recipient.
toThe recipient.
mimeTypeThe message mime type.
subMimeTypeThe message sub mime type.
messageDataThe received message body. It can be text or binary data.
messageDataLengthThe length of "messageData".

◆ onSendMessageSuccess()

Int32 PortSIP.SIPCallbackEvents.onSendMessageSuccess ( Int32  callbackIndex,
Int32  callbackObject,
Int32  sessionId,
Int32  messageId 
)

If the message is sent successfully in dialog, this event will be triggered.

Parameters
sessionIdThe session ID of the call.
messageIdThe message ID. It's equal to the return value of sendMessage function.

◆ onSendMessageFailure()

Int32 PortSIP.SIPCallbackEvents.onSendMessageFailure ( Int32  callbackIndex,
Int32  callbackObject,
Int32  sessionId,
Int32  messageId,
String  reason,
Int32  code 
)

If the message fails to be sent out of dialog, this event will be triggered.

Parameters
sessionIdThe session ID of the call.
messageIdThe message ID. It's equal to the return value of sendMessage function.
reasonThe failure reason.
codeFailure code.

◆ onSendOutOfDialogMessageSuccess()

Int32 PortSIP.SIPCallbackEvents.onSendOutOfDialogMessageSuccess ( Int32  callbackIndex,
Int32  callbackObject,
Int32  messageId,
String  fromDisplayName,
String  from,
String  toDisplayName,
String  to 
)

If the message is sent succeeded out of dialog, this event will be triggered.

Parameters
messageIdThe message ID. It's equal to the return value of SendOutOfDialogMessage function.
fromDisplayNameThe display name of message sender.
fromThe message sender.
toDisplayNameThe display name of message recipient.
toThe message receiver.

◆ onSendOutOfDialogMessageFailure()

Int32 PortSIP.SIPCallbackEvents.onSendOutOfDialogMessageFailure ( Int32  callbackIndex,
Int32  callbackObject,
Int32  messageId,
String  fromDisplayName,
String  from,
String  toDisplayName,
String  to,
String  reason,
Int32  code 
)

If the message was sent failure out of dialog, this event will be triggered.

Parameters
messageIdThe message ID. It's equal to the return value of SendOutOfDialogMessage function.
fromDisplayNameThe display name of message sender
fromThe message sender.
toDisplayNameThe display name of message recipient.
toThe message recipient.
reasonThe failure reason.
codeThe failure code.