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
Audio and video functions

Functions

Int32 PortSIP.PortSIPLib.addSupportedMimeType (String methodName, String mimeType, String subMimeType)
 Set the SDK to receive the SIP messages that include special mime type. More...
 
Int32 PortSIP.PortSIPLib.setAudioSamples (Int32 ptime, Int32 maxPtime)
 Set the audio capture sample. More...
 

Detailed Description

Function Documentation

◆ addSupportedMimeType()

Int32 PortSIP.PortSIPLib.addSupportedMimeType ( String  methodName,
String  mimeType,
String  subMimeType 
)

Set the SDK to receive the SIP messages that include special mime type.

Parameters
methodNameMethod name of the SIP message, such as INVITE, OPTION, INFO, MESSAGE, UPDATE, ACK etc. For more details please read the RFC3261.
mimeTypeThe mime type of SIP message.
subMimeTypeThe sub mime type of SIP message.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
By default, PortSIP VoIP SDK supports these media types (mime types) below for incoming SIP messages:
"message/sipfrag" in NOTIFY message.
"application/simple-message-summary" in NOTIFY message.
"text/plain" in MESSAGE message.
"application/dtmf-relay" in INFO message.
"application/media_control+xml" in INFO message.
The SDK allows to receive SIP messages that include above mime types. Now if remote side send an INFO SIP message with its "Content-Type" header value "text/plain". SDK will reject this INFO message, as "text/plain" of INFO message is not included in the default support list. How should we enable the SDK to receive the SIP INFO message that includes "text/plain" mime type? The answer is addSupportedMimyType:
addSupportedMimeType("INFO", "text", "plain");
If we want to receive the NOTIFY message with "application/media_control+xml", please:
addSupportedMimeType("NOTIFY", "application", "media_control+xml");
For more details about the mime type, please visit this website: http://www.iana.org/assignments/media-types/

◆ setAudioSamples()

Int32 PortSIP.PortSIPLib.setAudioSamples ( Int32  ptime,
Int32  maxPtime 
)

Set the audio capture sample.

Parameters
ptimeIt should be a multiple of 10 between 10 - 60 (with 10 and 60 inclusive).
maxPtimeFor the "maxptime" attribute, it should be a multiple of 10 between 10 - 60 (with 10 and 60 inclusive). It cannot be less than "ptime".
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
It will appear in the SDP of INVITE and 200 OK message as "ptime and "maxptime" attribute.