PortSIP VoIP SDK Manual for iOS  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
Send OPTIONS/INFO/MESSAGE functions

Functions

(int) - PortSIPSDK::sendOptions:sdp:
 Send OPTIONS message. More...
 
(int) - PortSIPSDK::sendInfo:mimeType:subMimeType:infoContents:
 Send an INFO message to remote side in dialog. More...
 
(long) - PortSIPSDK::sendMessage:mimeType:subMimeType:message:messageLength:
 Send a MESSAGE message to remote side in dialog. More...
 
(long) - PortSIPSDK::sendOutOfDialogMessage:mimeType:subMimeType:isSMS:message:messageLength:
 Send an out of dialog MESSAGE message to remote side. More...
 

Detailed Description

Function Documentation

◆ sendOptions:sdp:()

- (int) sendOptions: (NSString *)  to
sdp: (NSString *)  sdp 

Send OPTIONS message.

Parameters
toThe recipient of OPTIONS message.
sdpThe SDP of OPTIONS message. It's optional if user does not wish to send the SDP with OPTIONS message.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ sendInfo:mimeType:subMimeType:infoContents:()

- (int) sendInfo: (long)  sessionId
mimeType: (NSString *)  mimeType
subMimeType: (NSString *)  subMimeType
infoContents: (NSString *)  infoContents 

Send an INFO message to remote side in dialog.

Parameters
sessionIdThe session ID of call.
mimeTypeThe mime type of INFO message.
subMimeTypeThe sub mime type of INFO message.
infoContentsThe contents to be sent with INFO message.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ sendMessage:mimeType:subMimeType:message:messageLength:()

- (long) sendMessage: (long)  sessionId
mimeType: (NSString *)  mimeType
subMimeType: (NSString *)  subMimeType
message: (NSData *)  message
messageLength: (int)  messageLength 

Send a MESSAGE message to remote side in dialog.

Parameters
sessionIdThe session ID of the call.
mimeTypeThe mime type of MESSAGE message.
subMimeTypeThe sub mime type of MESSAGE message.
messageThe contents to be sent with MESSAGE message. Binary data allowed.
messageLengthThe message size.
Returns
If the function succeeds, it will return a message ID that allows to track the message sending state in onSendMessageSuccess and onSendMessageFailure. If the function fails, it will return a specific error code less than 0.
Remarks
Example 1: Send a plain text message. Note: to send other languages text, please use the UTF-8 to encode the message before sending.
[myVoIPsdk sendMessage:sessionId mimeType:@"text" subMimeType:@"plain" message:data messageLength:dataLen];
Example 2: Send a binary message.
[myVoIPsdk sendMessage:sessionId mimeType:@"application" subMimeType:@"vnd.3gpp.sms" message:data messageLength:dataLen];

◆ sendOutOfDialogMessage:mimeType:subMimeType:isSMS:message:messageLength:()

- (long) sendOutOfDialogMessage: (NSString *)  to
mimeType: (NSString *)  mimeType
subMimeType: (NSString *)  subMimeType
isSMS: (BOOL)  isSMS
message: (NSData *)  message
messageLength: (int)  messageLength 

Send an out of dialog MESSAGE message to remote side.

Parameters
toThe message recipient, such as sip:recei.nosp@m.ver@.nosp@m.ports.nosp@m.ip.c.nosp@m.om.
mimeTypeThe mime type of MESSAGE message.
subMimeTypeThe sub mime type of MESSAGE message. isSMS Set to YES to specify "messagetype=SMS" in the To line, or NO to disable.
messageThe contents sent with MESSAGE message. Binary data allowed.
messageLengthThe message size.
Returns
If the function succeeds, it will return a message ID that allows to track the message sending state in onSendOutOfMessageSuccess and onSendOutOfMessageFailure. If the function fails, it will return a specific error code less than 0.
Remarks
Example 1: Send a plain text message. Note: to send text in other languages, please use UTF-8 to encode the message before sending.
[myVoIPsdk sendOutOfDialogMessage:@"sip:user1@sip.portsip.com" mimeType:@"text" subMimeType:@"plain" message:data messageLength:dataLen];
Example 2: Send a binary message.
[myVoIPsdk sendOutOfDialogMessage:@"sip:user1@sip.portsip.com" mimeType:@"application" subMimeType:@"vnd.3gpp.sms" isSMS:NO message:data messageLength:dataLen];