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
NIC and local IP functions

Functions

Int32 PortSIP.PortSIPLib.getNICNums ()
 Get the Network Interface Card numbers. More...
 
Int32 PortSIP.PortSIPLib.getLocalIpAddress (Int32 index, StringBuilder ip, Int32 ipSize)
 Get the local IP address by Network Interface Card index. More...
 
Int32 PortSIP.PortSIPLib.setUser (String userName, String displayName, String authName, String password, String sipDomain, String sipServerAddr, Int32 sipServerPort, String stunServerAddr, Int32 stunServerPort, String outboundServerAddr, Int32 outboundServerPort)
 Set user account info. More...
 
void PortSIP.PortSIPLib.removeUser ()
 Remove the user. It will un-register from SIP server given that the user is already registered.
 
Int32 PortSIP.PortSIPLib.setInstanceId (String uuid)
 Set outbound (RFC5626) instanceId to be used in contact headers. More...
 
Int32 PortSIP.PortSIPLib.registerServer (Int32 expires, Int32 retryTimes)
 Register to SIP proxy server (login to server). More...
 
Int32 PortSIP.PortSIPLib.unRegisterServer ()
 Un-register from the SIP proxy server. More...
 
Int32 PortSIP.PortSIPLib.enableRport (Boolean enable)
 Enable/disable rport(RFC3581). More...
 
Int32 PortSIP.PortSIPLib.enableEarlyMedia (Boolean enable)
 Enable/disable Early Media. More...
 
Int32 PortSIP.PortSIPLib.enableReliableProvisional (Boolean enable)
 Enable/disable PRACK. More...
 
Int32 PortSIP.PortSIPLib.enable3GppTags (Boolean enable)
 Enable/disable the 3Gpp tags, including "ims.icsi.mmtel" and "g.3gpp.smsip". More...
 
void PortSIP.PortSIPLib.enableCallbackSendingSignaling (Boolean enable)
 Enable/disable callback the sent SIP messages. More...
 
void PortSIP.PortSIPLib.enableCallbackReceivedSignaling (Boolean enable)
 Enable/disable callback the received SIP messages. More...
 
Int32 PortSIP.PortSIPLib.setRtpCallback (Int32 callbackObject, Boolean enable)
 Set the RTP callbacks to allow access to the sent and received RTP packets. More...
 

Detailed Description

Function Documentation

◆ getNICNums()

Int32 PortSIP.PortSIPLib.getNICNums ( )

Get the Network Interface Card numbers.

Returns
If the function succeeds, it will return the NIC numbers which is greater than or equal to 0. If the function fails, it will return a specific error code.

◆ getLocalIpAddress()

Int32 PortSIP.PortSIPLib.getLocalIpAddress ( Int32  index,
StringBuilder  ip,
Int32  ipSize 
)

Get the local IP address by Network Interface Card index.

Parameters
indexThe IP address index. For example, if the PC has two NICs, and we wish to obtain the second NIC IP. Set this parameter to 1 and the first NIC IP index is 0.
ipThe buffer that is used to receive the IP.
ipSizeThe IP buffer size, which cannot be less than 32 bytes.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setUser()

Int32 PortSIP.PortSIPLib.setUser ( String  userName,
String  displayName,
String  authName,
String  password,
String  sipDomain,
String  sipServerAddr,
Int32  sipServerPort,
String  stunServerAddr,
Int32  stunServerPort,
String  outboundServerAddr,
Int32  outboundServerPort 
)

Set user account info.

Parameters
userNameAccount (User name) of the SIP. Usually provided by an IP-Telephony service provider.
displayNameThe display name of user. You can set it as your like, such as "James Kend". It's optional.
authNameAuthorization user name (usually equal to the username).
passwordThe password of user. It's optional.
localIpThe local computer IP address to be bound. For example: 192.168.1.108. It will be used for sending and receiving SIP message and RTP packet. If pass this IP as the IPv6 format, the SDK will use IPv6.
localSipPortThe SIP message transport listener port. For example: 5060.
userDomainUser domain; this parameter is optional that allows to pass an empty string if you are not using the domain.
sipServerSIP proxy server IP or domain. For example: xx.xxx.xx.x or sip.xxx.com.
sipServerPortPort of the SIP proxy server. For example: 5060.
stunServerStun server used for NAT traversal. It's optional and can pass empty string to disable STUN.
stunServerPortSTUN server port. It will be ignored if the outboundServer is empty.
outboundServerOutbound proxy server. For example: sip.domain.com. It's optional and allows to pass a empty string if not using outbound server.
outboundServerPortOutbound proxy server port, it will be ignored if the outboundServer is empty.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setInstanceId()

Int32 PortSIP.PortSIPLib.setInstanceId ( String  uuid)

Set outbound (RFC5626) instanceId to be used in contact headers.

Parameters
uuidThe ID that will appear in the contact header. Please make sure it's a unique ID.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ registerServer()

Int32 PortSIP.PortSIPLib.registerServer ( Int32  expires,
Int32  retryTimes 
)

Register to SIP proxy server (login to server).

Parameters
expiresRegistration refresh Interval in seconds with maximum 3600. It will be inserted into SIP REGISTER message headers.
retryTimesThe retry times if failed to refresh the registration. If it's set to be less than or equal to 0, the retry will be disabled and onRegisterFailure callback triggered when retry failed.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code. If registration to server succeeded, onRegisterSuccess will be triggered, otherwise onRegisterFailure triggered.

◆ unRegisterServer()

Int32 PortSIP.PortSIPLib.unRegisterServer ( )

Un-register from the SIP proxy server.

Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ enableRport()

Int32 PortSIP.PortSIPLib.enableRport ( Boolean  enable)

Enable/disable rport(RFC3581).

Parameters
enableSet to true to enable the SDK to support rport. By default it is enabled.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ enableEarlyMedia()

Int32 PortSIP.PortSIPLib.enableEarlyMedia ( Boolean  enable)

Enable/disable Early Media.

Parameters
enableSet to true to enable the SDK to support Early Media. By default Early Media is disabled.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ enableReliableProvisional()

Int32 PortSIP.PortSIPLib.enableReliableProvisional ( Boolean  enable)

Enable/disable PRACK.

Parameters
enableSet to true to enable the SDK to support PRACK. The PRACK is disabled by default.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ enable3GppTags()

Int32 PortSIP.PortSIPLib.enable3GppTags ( Boolean  enable)

Enable/disable the 3Gpp tags, including "ims.icsi.mmtel" and "g.3gpp.smsip".

Parameters
enableSet to true to enable SDK to support 3Gpp tags.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ enableCallbackSendingSignaling()

void PortSIP.PortSIPLib.enableCallbackSendingSignaling ( Boolean  enable)

Enable/disable callback the sent SIP messages.

Parameters
enableSet as true to enable callback the sent SIP messages, or false to disable. Once enabled, the "onSendingSignaling" event will be triggered when the SDK sends a SIP message.

◆ enableCallbackReceivedSignaling()

void PortSIP.PortSIPLib.enableCallbackReceivedSignaling ( Boolean  enable)

Enable/disable callback the received SIP messages.

Parameters
enableSet as true to enable callback the received SIP messages, or false to disable. Once enabled, the "onReceivedSignaling" event will be triggered when the SDK receives a SIP message.

◆ setRtpCallback()

Int32 PortSIP.PortSIPLib.setRtpCallback ( Int32  callbackObject,
Boolean  enable 
)

Set the RTP callbacks to allow access to the sent and received RTP packets.

Parameters
callbackObjectThe callback object that you passed in can be accessed once the callback function triggered.
enableSet to true to enable the RTP callback for received and sent RTP packets. The onSendingRtpPacket and onReceivedRtpPacket events will be triggered.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.