![]() |
PortSIP VoIP SDK Manual for Android
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 | |
void | com.portsip.PortSipSdk.CreateCallManager (Context context) |
void | com.portsip.PortSipSdk.DeleteCallManager () |
int | com.portsip.PortSipSdk.initialize (int enum_transport, String localIP, int localSIPPort, int enum_LogLevel, String LogPath, int maxLines, String agent, int audioDeviceLayer, int videoDeviceLayer, String TLSCertificatesRootPath, String TLSCipherList, boolean verifyTLSCertificate, String dnsServers) |
int | com.portsip.PortSipSdk.setInstanceId (String instanceId) |
int | com.portsip.PortSipSdk.setUser (String userName, String displayName, String authName, String password, String userDomain, String SIPServer, int SIPServerPort, String STUNServer, int STUNServerPort, String outboundServer, int outboundServerPort) |
void | com.portsip.PortSipSdk.removeUser () |
remove user account info. | |
int | com.portsip.PortSipSdk.registerServer (int expires, int retryTimes) |
int | com.portsip.PortSipSdk.refreshRegistration (int expires) |
int | com.portsip.PortSipSdk.unRegisterServer () |
int | com.portsip.PortSipSdk.setLicenseKey (String key) |
void com.portsip.PortSipSdk.CreateCallManager | ( | Context | context | ) |
Create the callback handlers.
context | The context of application. |
void com.portsip.PortSipSdk.DeleteCallManager | ( | ) |
Release the callback Handlers.
int com.portsip.PortSipSdk.initialize | ( | int | enum_transport, |
String | localIP, | ||
int | localSIPPort, | ||
int | enum_LogLevel, | ||
String | LogPath, | ||
int | maxLines, | ||
String | agent, | ||
int | audioDeviceLayer, | ||
int | videoDeviceLayer, | ||
String | TLSCertificatesRootPath, | ||
String | TLSCipherList, | ||
boolean | verifyTLSCertificate, | ||
String | dnsServers | ||
) |
Initialize the SDK.
enum_transport | Transport for SIP signaling, which can be set as: ENUM_TRANSPORT_UDP, ENUM_TRANSPORT_TCP, ENUM_TRANSPORT_TLS, ENUM_TRANSPORT_PERS. The ENUM_TRANSPORT_PERS_UDP is the private PortSIP transport for anti-SIP blocking, which must work with the PERS. ENUM_TRANSPORT_PERS. The ENUM_TRANSPORT_PERS_TCP is the private PortSIP transport for anti-SIP blocking, which must work with the PERS. |
localIP | The local PC IP address (for example: 192.168.1.108). It will be used for sending and receiving SIP messages and RTP packets. If the local IP is provided in IPv6 format, the SDK will use IPv6. If you want the SDK to choose correct network interface (IP) automatically, please use "0.0.0.0" for IPv4, or "::" for IPv6. |
localSIPPort | The listening port for SIP message transmission, for example 5060. |
enum_LogLevel | Set the application log level. The SDK will generate "PortSIP_Log_datatime.log" file if the log is enabled. ENUM_LOG_LEVEL_NONE ENUM_LOG_LEVEL_DEBUG ENUM_LOG_LEVEL_ERROR ENUM_LOG_LEVEL_WARNING ENUM_LOG_LEVEL_INFO ENUM_LOG_LEVEL_DEBUG |
LogPath | The path for storing log file. The path (folder) specified MUST be existent. |
maxLines | Theoretically, unlimited count of lines are supported depending on the device capability. For SIP client, it is recommended to limit it as ranging 1 - 100. |
agent | The User-Agent header to be inserted in to SIP messages. |
audioDeviceLayer | Specifies the audio device layer that should be using: 0 = Use the OS defaulted device. 1 = Virtual device, usually use this for the device that has no sound device installed. |
videoDeviceLayer | Specifies the video device layer that should be using: 0 = Use the OS defaulted device. 1 = Use Virtual device, usually use this for the device that has no camera installed. |
TLSCertificatesRootPath | Specify the TLS certificate path, from which the SDK will load the certificates automatically. Note: On Windows, this path will be ignored, and SDK will read the certificates from Windows certificates stored area instead. |
TLSCipherList | Specify the TLS cipher list. This parameter is usually passed as empty so that the SDK will offer all available ciphers. |
verifyTLSCertificate | Indicate if SDK will verify the TLS certificate or not. By setting to false, the SDK will not verify the validity of TLS certificate. |
dnsServers | Additional Nameservers DNS servers. Value null indicates system DNS Server. Multiple servers will be split by ";", e.g "8.8.8.8;8.8.4.4" |
int com.portsip.PortSipSdk.setInstanceId | ( | String | instanceId | ) |
Set the instance Id, the outbound instanceId((RFC5626) ) used in contact headers.
instanceId | The SIP instance ID. If this function is not called, the SDK will generate an instance ID automatically. The instance ID MUST be unique on the same device (device ID or IMEI ID is recommended). Recommend to call this function to set the ID on Android devices. |
int com.portsip.PortSipSdk.setUser | ( | String | userName, |
String | displayName, | ||
String | authName, | ||
String | password, | ||
String | userDomain, | ||
String | SIPServer, | ||
int | SIPServerPort, | ||
String | STUNServer, | ||
int | STUNServerPort, | ||
String | outboundServer, | ||
int | outboundServerPort | ||
) |
Set user account info.
userName | Account (username) of the SIP, usually provided by an IP-Telephony service provider. |
displayName | The name displayed. You can set it as your like, such as "James Kend". It's optional. |
authName | Authorization user name (usually equal to the username). |
password | User's password. It's optional. |
userDomain | User domain; this parameter is optional, which allows to transfer an empty string if you are not using the domain. |
SIPServer | SIP proxy server IP or domain, for example xx.xxx.xx.x or sip.xxx.com. |
SIPServerPort | Port of the SIP proxy server, for example 5060. |
STUNServer | Stun server for NAT traversal. It's optional and can be used to transfer empty string to disable STUN. |
STUNServerPort | STUN server port. It will be ignored if the outboundServer is empty. |
outboundServer | Outbound proxy server, for example sip.domain.com. It's optional and allows to transfer an empty string if not using the outbound server. |
outboundServerPort | Outbound proxy server port, it will be ignored if the outboundServer is empty. |
int com.portsip.PortSipSdk.registerServer | ( | int | expires, |
int | retryTimes | ||
) |
Register to SIP proxy server (login to server)
expires | Time interval for registration refreshment, in seconds. The maximum of supported value is 3600. It will be inserted into SIP REGISTER message headers. |
retryTimes | The maximum of retry attempts if failed to refresh the registration. By setting to <= 0, the attempt will be disabled and onRegisterFailure callback will be triggered when facing retry failure. |
int com.portsip.PortSipSdk.refreshRegistration | ( | int | expires | ) |
Refresh the registration manually after successfully registered.
expires | Time interval for registration refreshment, in seconds. The maximum of supported value is 3600. It will be inserted into SIP REGISTER message headers. |
int com.portsip.PortSipSdk.unRegisterServer | ( | ) |
Un-register from the SIP proxy server.
int com.portsip.PortSipSdk.setLicenseKey | ( | String | key | ) |
Set the license key. It must be called before setUser function.
key | The SDK license key. Please purchase from PortSIP. |