i
PortSIP VoIP SDK Manual for Android
Version 19.4
5/21/24
ii
Table of Contents
Welcome to PortSIP VoIP SDK For Android .......................................................................................... 2
Getting Started .......................................................................................................................................... 2
Contents .................................................................................................................................................... 2
SDK User Manual ..................................................................................................................................... 2
Website ..................................................................................................................................................... 2
Support ...................................................................................................................................................... 2
Installation Prerequisites ........................................................................................................................... 2
Frequently Asked Questions ..................................................................................................................... 3
1. Where can I download the PortSIP VoIP SDK for test? .............................................................. 3
2. How can I compile the sample project? ........................................................................................ 3
3. How can I create a new project with PortSIP VoIP SDK? ........................................................... 3
4. How can I test the P2P call (without SIP server)? ........................................................................ 3
5. Is the SDK thread safe? ................................................................................................................. 4
Module Index ............................................................................................................................................ 5
Hierarchical Index ..................................................................................................................................... 6
Class Index ................................................................................................................................................ 7
Module Documentation ............................................................................................................................ 8
SDK Callback events ........................................................................................................................ 8
Register events .................................................................................................................................. 9
Call events ....................................................................................................................................... 10
Refer events .................................................................................................................................... 14
Signaling events .............................................................................................................................. 16
MWI events ..................................................................................................................................... 17
DTMF events .................................................................................................................................. 18
INFO/OPTIONS message events ................................................................................................... 19
Presence events ............................................................................................................................... 20
audio device changed,Play audio and video file finished events .................................................... 23
RTP callback events ........................................................................................................................ 25
SDK functions ................................................................................................................................. 27
Initialize and register functions ....................................................................................................... 28
Audio and video codecs functions .................................................................................................. 32
Additional settings functions .......................................................................................................... 35
Access SIP message header functions ............................................................................................ 41
Audio and video functions .............................................................................................................. 44
Call functions .................................................................................................................................. 48
Refer functions ................................................................................................................................ 52
Send audio and video stream functions .......................................................................................... 55
RTP packets, Audio stream and video stream callback .................................................................. 57
Record functions ............................................................................................................................. 58
Play audio and video file and RTMP/RTSP stream functions ........................................................ 60
Conference functions ...................................................................................................................... 62
RTP and RTCP QOS functions ...................................................................................................... 64
RTP statistics functions .................................................................................................................. 66
Audio effect functions ..................................................................................................................... 67
Send OPTIONS/INFO/MESSAGE functions ................................................................................. 68
Class Documentation .............................................................................................................................. 73
com.portsip.PortSipEnumDefine.AUDIOCODEC ......................................................................... 73
com.portsip.PortSipEnumDefine.AudioDevice .............................................................................. 74
com.portsip.OnPortSIPEvent .......................................................................................................... 75
com.portsip.PortSIPCameraCapturer .............................................................................................. 77
com.portsip.PortSipEnumDefine .................................................................................................... 78
com.portsip.PortSipErrorcode ......................................................................................................... 80
com.portsip.PortSipSdk .................................................................................................................. 83
com.portsip.PortSIPVideoRenderer ................................................................................................ 87
Index ....................................................................................................................................................... 88
1
2
Welcome to PortSIP VoIP SDK For Android
Create your SIP-based application for multiple platforms (iOS, Android, Windows, Mac OS
and Linux) with our SDK.
The rewarding PortSIP VoIP SDK is a powerful and versatile set of tools that dramatically
accelerate SIP application development. It includes a suite of stacks, SDKs, and some Sample
projects, with each of them enables developers to combine all the necessary components to
create an ideal development environment for every application's specific needs.
The PortSIP VoIP SDK complies with IETF and 3GPP standards, and is IMS-compliant
(3GPP/3GPP2, TISPAN and PacketCable 2.0). These high performance SDKs provide
unified API layers for full user control and flexibility.
Getting Started
You can download PortSIP VoIP SDK Sample projects at our Website. Samples include
demos for VC++, C#, VB.NET, Delphi XE, Xcode (for iOS and Mac OS), Android Studio
with the sample project source code provided (with SDK source code exclusive). The sample
projects demonstrate how to create a powerful SIP application with our SDK easily and
quickly.
Contents
The sample package for downloading contains almost all of materials for PortSIP VoIP SDK:
documentation, Dynamic/Static libraries, sources, headers, datasheet, and everything else a
SDK user might need!
SDK User Manual
To be started with, it is recommended to read the documentation of PortSIP VoIP SDK, SDK
User Manual page, which gives a brief description of each API function.
Website
Some general interest or often changing PortSIP SDK information will be posted on the
PortSIP website in real time. The release contains links to the site, so while browsing you
may see occasional broken links if you are not connected to the Internet. To be sure
everything needed for using the PortSIP VoIP SDK has been contained within the release.
Support
Please send email to our Support team if you need any help.
Installation Prerequisites
To use PortSIP VoIP/IMS SDK for Android for development, SDK version with later than
API-16 is required.
3
Frequently Asked Questions
1. Where can I download the PortSIP VoIP SDK for test?
All sample projects of the PortSIP VoIP SDK can be found and downloaded at:
https://www.portsip.com/download-portsip-voip-sdk/
https://www.PortSIP.com/portsip-voip-sdk
2. How can I compile the sample project?
1. Download the sample project from PortSIP website.
2. Extract the .zip file.
3. Open the project by your Android studio:
4. Compile the sample project directly.
3. How can I create a new project with PortSIP VoIP SDK?
1. Download the sample project and evaluation SDK and extract it to a specified directory
2. Run Android Studio and create a new Android Application Project
3. Copy all files form libs directory under extracted directory to the libs directory of your new
application.
4. Import the dependent class form the SDK. For example: import com.portsip.OnPortSIPEvent;
import com.portsip.PortSipSdk;
5. Inherit the interface OnPortSIPEvent to process the callback events.
6. Initialize SDK. For example: mPortSIPSDK = new PortSipSdk();
mPortSIPSDK.setOnPortSIPEvent(instanceofOnPortSIPEvent);
mPortSIPSDK.CreateCallManager(context); mPortSIPSDK.initialize(...); For more details please
refer to the Sample project source code.
4. How can I test the P2P call (without SIP server)?
1. Download and extract the SDK sample project ZIP file into local. Compile and run the
"P2PSample" project.
2. Run the P2Psample on two devices. For example, run it on device A and device B, and IP address
for A is 192.168.1.10, IP address for B is 192.168.1.11.
3. Enter a user name and password on A. For example, enter user name 111, and password aaa (you
can enter anything for the password as the SDK will ignore it). Enter a user name and password on
B. For example, enter user name 222, and password aaa.
4. Click the "Initialize" button on A and B. If the default port 5060 is already in use, the P2PSample
will prompt "Initialize failure". In case of this, please click the "Uninitialize" button and change
the local port, and click the "Initialize" button again.
5. The log box will appear "Initialized" if the SDK is successfully initialized.
6. To make call from A to B, enter "sip:[email protected].11" and click "Dial" button; while to make
call from B to A, enter "sip:[email protected]".
Note: If the local sip port is changed to other port, for example, A is using local port 5080,
and B is using local port 6021, to make call from A to B, please enter
"sip:[email protected]:6021" and dial; while to make call from B to A, enter
"sip:[email protected]:5080".
4
5. Is the SDK thread safe?
Yes, the SDK is thread safe. You can call any of the API functions without the need to
consider the multiple threads.
Note: the SDK allows to call API functions in callback events directly - except for the
"onAudioRawCallback", "onVideoRawCallback", "onRTPPacketCallback" callbacks.
5
Module Index
Modules
Here is a list of all modules:
SDK Callback events ................................................................................................................................ 8
Register events ................................................................................................................................... 9
Call events ....................................................................................................................................... 10
Refer events ..................................................................................................................................... 14
Signaling events ............................................................................................................................... 16
MWI events ..................................................................................................................................... 17
DTMF events ................................................................................................................................... 18
INFO/OPTIONS message events .................................................................................................... 19
Presence events ................................................................................................................................ 20
audio device changed,Play audio and video file finished events .................................................... 23
RTP callback events ........................................................................................................................ 25
SDK functions ........................................................................................................................................ 27
Initialize and register functions ....................................................................................................... 28
Audio and video codecs functions ................................................................................................... 32
Additional settings functions ........................................................................................................... 35
Access SIP message header functions ............................................................................................. 41
Audio and video functions ............................................................................................................... 44
Call functions ................................................................................................................................... 48
Refer functions ................................................................................................................................ 52
Send audio and video stream functions ........................................................................................... 55
RTP packets, Audio stream and video stream callback .................................................................. 57
Record functions .............................................................................................................................. 58
Play audio and video file and RTMP/RTSP stream functions ........................................................ 60
Conference functions ....................................................................................................................... 62
RTP and RTCP QOS functions ....................................................................................................... 64
RTP statistics functions ................................................................................................................... 66
Audio effect functions ..................................................................................................................... 67
Send OPTIONS/INFO/MESSAGE functions ................................................................................. 68
6
Hierarchical Index
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
com.portsip.PortSipEnumDefine.AUDIOCODEC ................................................................................ 73
com.portsip.PortSipEnumDefine.AudioDevice ...................................................................................... 74
AppRTCAudioManager.AudioManagerEvents
com.portsip.PortSipSdk ................................................................................................................... 83
com.portsip.OnPortSIPEvent .................................................................................................................. 75
com.portsip.PortSipEnumDefine ............................................................................................................ 78
com.portsip.PortSipErrorcode ................................................................................................................ 80
CapturerObserver
com.portsip.PortSIPCameraCapturer .............................................................................................. 77
SurfaceViewRenderer
com.portsip.PortSIPVideoRenderer ................................................................................................ 87
7
Class Index
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
com.portsip.PortSipEnumDefine.AUDIOCODEC ........................................................................ 73
com.portsip.PortSipEnumDefine.AudioDevice .............................................................................. 74
com.portsip.OnPortSIPEvent .......................................................................................................... 75
com.portsip.PortSIPCameraCapturer ........................................................................................... 77
com.portsip.PortSipEnumDefine .................................................................................................... 78
com.portsip.PortSipErrorcode ........................................................................................................ 80
com.portsip.PortSipSdk ................................................................................................................... 83
com.portsip.PortSIPVideoRenderer ............................................................................................... 87
8
Module Documentation
SDK Callback events
Modules
l Register events
l Call events
l Refer events
l Signaling events
l MWI events
l DTMF events
l INFO/OPTIONS message events
l Presence events
l audio device changed,Play audio and video file finished events
l RTP callback events
Detailed Description
SDK Callback events
9
Register events
Functions
l void com.portsip.OnPortSIPEvent.onRegisterSuccess (String reason, int code, String sipMessage)
l void com.portsip.OnPortSIPEvent.onRegisterFailure (String reason, int code, String sipMessage)
Detailed Description
Register events
Function Documentation
void com.portsip.OnPortSIPEvent.onRegisterSuccess (String reason, int code,
String sipMessage)
When successfully registered to server, this event will be triggered.
Parameters
reason
The status text.
code
The status code.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onRegisterFailure (String reason, int code, String
sipMessage)
If failed to register to SIP server, this event will be triggered.
Parameters
reason
The status text.
code
The status code.
sipMessage
The SIP message received.
10
Call events
Functions
l void com.portsip.OnPortSIPEvent.onInviteIncoming (long sessionId, String callerDisplayName,
String caller, String calleeDisplayName, String callee, String audioCodecs, String videoCodecs,
boolean existsAudio, boolean existsVideo, String sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteTrying (long sessionId)
l void com.portsip.OnPortSIPEvent.onInviteSessionProgress (long sessionId, String audioCodecs,
String videoCodecs, boolean existsEarlyMedia, boolean existsAudio, boolean existsVideo, String
sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteRinging (long sessionId, String statusText, int
statusCode, String sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteAnswered (long sessionId, String callerDisplayName,
String caller, String calleeDisplayName, String callee, String audioCodecs, String videoCodecs,
boolean existsAudio, boolean existsVideo, String sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteFailure (long sessionId, String callerDisplayName,
String caller, String calleeDisplayName, String callee, String reason, int code, String sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteUpdated (long sessionId, String audioCodecs, String
videoCodecs, String screenCodecs, boolean existsAudio, boolean existsVideo, boolean
existsScreen, String sipMessage)
l void com.portsip.OnPortSIPEvent.onInviteConnected (long sessionId)
l void com.portsip.OnPortSIPEvent.onInviteBeginingForward (String forwardTo)
l void com.portsip.OnPortSIPEvent.onInviteClosed (long sessionId, String sipMessage)
l void com.portsip.OnPortSIPEvent.onDialogStateUpdated (String BLFMonitoredUri, String
BLFDialogState, String BLFDialogId, String BLFDialogDirection)
l void com.portsip.OnPortSIPEvent.onRemoteHold (long sessionId)
l void com.portsip.OnPortSIPEvent.onRemoteUnHold (long sessionId, String audioCodecs, String
videoCodecs, boolean existsAudio, boolean existsVideo)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onInviteIncoming (long sessionId, String
callerDisplayName, String caller, String calleeDisplayName, String callee, String
audioCodecs, String videoCodecs, boolean existsAudio, boolean existsVideo,
String sipMessage)
When a call is coming, this event will be triggered.
Parameters
sessionId
The session ID of the call.
callerDisplayNam
e
The display name of caller
caller
The caller.
calleeDisplayNam
e
The display name of callee.
callee
The callee.
audioCodecs
The matched audio codecs. It's separated by "#" if there are more than one
codecs.
videoCodecs
The matched video codecs. It's separated by "#" if there are more than one
codecs.
existsAudio
By setting to true, it means that this call include the audio.
11
existsVideo
By setting to true, it means that this call include the video.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onInviteTrying (long sessionId)
If the outgoing call is being processed, this event will be triggered.
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onInviteSessionProgress (long sessionId, String
audioCodecs, String videoCodecs, boolean existsEarlyMedia, boolean
existsAudio, boolean existsVideo, String sipMessage)
Once the caller received the "183 session progress" message, this event would be
triggered.
Parameters
sessionId
The session ID of the call.
audioCodecs
The matched audio codecs. It's separated by "#" if there are more than one
codecs.
videoCodecs
The matched video codecs. It's separated by "#" if there are more than one
codecs.
existsEarlyMedia
By setting to true it means the call has early media.
existsAudio
By setting to true it means this call include the audio.
existsVideo
By setting to true it means this call include the video.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onInviteRinging (long sessionId, String
statusText, int statusCode, String sipMessage)
If the outgoing call is ringing, this event will be triggered.
Parameters
sessionId
The session ID of the call.
statusText
The status text.
statusCode
The status code.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onInviteAnswered (long sessionId, String
callerDisplayName, String caller, String calleeDisplayName, String callee, String
audioCodecs, String videoCodecs, boolean existsAudio, boolean existsVideo,
String sipMessage)
If the remote party answered the call, this event would be triggered.
Parameters
sessionId
The session ID of the call.
callerDisplayNam
e
The display name of caller
caller
The caller.
calleeDisplayNam
e
The display name of callee.
callee
The callee.
audioCodecs
The matched audio codecs. It's separated by "#" if there are more than one
codecs.
videoCodecs
The matched video codecs. It's separated by "#" if there are more than one
codecs.
existsAudio
By setting to true, this call includes the audio.
existsVideo
By setting to true, this call includes the video.
sipMessage
The SIP message received.
12
void com.portsip.OnPortSIPEvent.onInviteFailure (long sessionId, String
callerDisplayName, String caller, String calleeDisplayName, String callee, String
reason, int code, String sipMessage)
This event will be triggered if the outgoing or incoming call fails.
Parameters
sessionId
The session ID of the call.
callerDisplayNam
e
The display name of caller
l
caller
The caller.
l
calleeDisplayNam
e
The display name of callee.
l
callee
The callee.
reason
The failure reason.
code
The failure code.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onInviteUpdated (long sessionId, String
audioCodecs, String videoCodecs, String screenCodecs, boolean existsAudio,
boolean existsVideo, boolean existsScreen, String sipMessage)
This event will be triggered when remote party updates the call.
Parameters
sessionId
The session ID of the call.
audioCodecs
The matched audio codecs. It's separated by "#" if there are more than one
codecs.
videoCodecs
The matched video codecs. It's separated by "#" if there are more than one
codecs.
screenCodecs
The matched screen codecs. It's separated by "#" if there are more than one
codecs.
existsAudio
By setting to true, this call includes the audio.
existsVideo
By setting to true, this call includes the video.
existsScreen
By setting to true, this call includes the screen shared.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onInviteConnected (long sessionId)
This event will be triggered when UAC sent/UAS received ACK (the call is connected).
Some functions (hold, updateCall etc...) can be called only after the call connected,
otherwise the functions will return error.
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onInviteBeginingForward (String forwardTo)
If the enableCallForward method is called and a call is incoming, the call will be
forwarded automatically and this event will be triggered.
Parameters
forwardTo
The target SIP URI of the call forwarding.
void com.portsip.OnPortSIPEvent.onInviteClosed (long sessionId, String
sipMessage)
This event is triggered once remote side ends the call.
13
Parameters
sessionId
The session ID of the call.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onDialogStateUpdated (String BLFMonitoredUri,
String BLFDialogState, String BLFDialogId, String BLFDialogDirection)
If a user subscribed and his dialog status monitored, when the monitored user is holding a
call or is being rang, this event will be triggered.
Parameters
BLFMonitoredUri
the monitored user's URI
BLFDialogState
- the status of the call
BLFDialogId
- the id of the call
BLFDialogDirecti
on
- the direction of the call
void com.portsip.OnPortSIPEvent.onRemoteHold (long sessionId)
If the remote side places the call on hold, this event will be triggered.
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onRemoteUnHold (long sessionId, String
audioCodecs, String videoCodecs, boolean existsAudio, boolean existsVideo)
If the remote side un-holds the call, this event will be triggered
Parameters
sessionId
The session ID of the call.
audioCodecs
The matched audio codecs. It's separated by "#" if there are more than one
codec.
videoCodecs
The matched video codecs. It's separated by "#" if there are more than one
codec.
existsAudio
By setting to true, this call includes the audio.
existsVideo
By setting to true, this call includes the video.
14
Refer events
Functions
l void com.portsip.OnPortSIPEvent.onReceivedRefer (long sessionId, long referId, String to, String
from, String referSipMessage)
l void com.portsip.OnPortSIPEvent.onReferAccepted (long sessionId)
l void com.portsip.OnPortSIPEvent.onReferRejected (long sessionId, String reason, int code)
l void com.portsip.OnPortSIPEvent.onTransferTrying (long sessionId)
l void com.portsip.OnPortSIPEvent.onTransferRinging (long sessionId)
l void com.portsip.OnPortSIPEvent.onACTVTransferSuccess (long sessionId)
l void com.portsip.OnPortSIPEvent.onACTVTransferFailure (long sessionId, String reason, int
code)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onReceivedRefer (long sessionId, long referId,
String to, String from, String referSipMessage)
This event will be triggered once received a REFER message.
Parameters
sessionId
The session ID of the call.
referId
The ID of the REFER message. Pass it to acceptRefer or rejectRefer
to
The refer target.
from
The sender of REFER message.
referSipMessage
The SIP message of "REFER". Pass it to "acceptRefer" function.
void com.portsip.OnPortSIPEvent.onReferAccepted (long sessionId)
This callback will be triggered once remote side calls "acceptRefer" to accept the REFER
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onReferRejected (long sessionId, String reason,
int code)
This callback will be triggered once remote side calls "rejectRefer" to reject the REFER
Parameters
sessionId
The session ID of the call.
reason
Reject reason.
code
Reject code.
void com.portsip.OnPortSIPEvent.onTransferTrying (long sessionId)
When the refer call is being processed, this event will be triggered.
Parameters
sessionId
The session ID of the call.
15
void com.portsip.OnPortSIPEvent.onTransferRinging (long sessionId)
When the refer call is ringing, this event will be triggered.
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onACTVTransferSuccess (long sessionId)
When the refer call succeeds, this event will be triggered. The ACTV means Active. For
example, A establishes the call with B, A transfers B to C, C accepts the refer call, and A
will receive this event.
Parameters
sessionId
The session ID of the call.
void com.portsip.OnPortSIPEvent.onACTVTransferFailure (long sessionId, String
reason, int code)
When the refer call fails, this event will be triggered. The ACTV means Active. For
example, A establish the call with B, A transfers B to C, C rejects this refer call, and A
will receive this event.
Parameters
sessionId
The session ID of the call.
reason
The error reason.
code
The error code.
16
Signaling events
Functions
l void com.portsip.OnPortSIPEvent.onReceivedSignaling (long sessionId, String message)
l void com.portsip.OnPortSIPEvent.onSendingSignaling (long sessionId, String message)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onReceivedSignaling (long sessionId, String
message)
This event will be triggered when receiving a SIP message. This event is disabled by
default. To enable, use enableCallbackSignaling.
Parameters
sessionId
The session ID of the call.
message
The received SIP message.
void com.portsip.OnPortSIPEvent.onSendingSignaling (long sessionId, String
message)
This event will be triggered when sent a SIP message. This event is disabled by default.
To enable, use enableCallbackSignaling.
Parameters
sessionId
The session ID of the call.
message
The sent SIP message.
17
MWI events
Functions
l void com.portsip.OnPortSIPEvent.onWaitingVoiceMessage (String messageAccount, int
urgentNewMessageCount, int urgentOldMessageCount, int newMessageCount, int
oldMessageCount)
l void com.portsip.OnPortSIPEvent.onWaitingFaxMessage (String messageAccount, int
urgentNewMessageCount, int urgentOldMessageCount, int newMessageCount, int
oldMessageCount)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onWaitingVoiceMessage (String messageAccount,
int urgentNewMessageCount, int urgentOldMessageCount, int newMessageCount,
int oldMessageCount)
If there is the waiting voice message (MWI), this event will be triggered.
Parameters
messageAccount
Voice message account
urgentNewMessag
eCount
Count of new urgent messages.
urgentOldMessage
Count
Count of history urgent message.
newMessageCount
Count of new messages.
oldMessageCount
Count of history messages.
void com.portsip.OnPortSIPEvent.onWaitingFaxMessage (String messageAccount,
int urgentNewMessageCount, int urgentOldMessageCount, int newMessageCount,
int oldMessageCount)
If there is waiting fax message (MWI), this event will be triggered.
Parameters
messageAccount
Fax message account
urgentNewMessag
eCount
Count of new urgent messages.
urgentOldMessage
Count
Count of history urgent messages.
newMessageCount
Count of new messages.
oldMessageCount
Count of old messages.
18
DTMF events
Functions
l void com.portsip.OnPortSIPEvent.onRecvDtmfTone (long sessionId, int tone)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onRecvDtmfTone (long sessionId, int tone)
This event will be triggered when receiving a DTMF tone from remote side.
Parameters
sessionId
Session ID of the call.
tone
Description
The DTMF tone 0.
The DTMF tone 1.
The DTMF tone 2.
The DTMF tone 3.
The DTMF tone 4.
The DTMF tone 5.
The DTMF tone 6.
The DTMF tone 7.
The DTMF tone 8.
The DTMF tone 9.
The DTMF tone *.
The DTMF tone #.
The DTMF tone A.
The DTMF tone B.
The DTMF tone C.
The DTMF tone D.
The DTMF tone FLASH.
19
INFO/OPTIONS message events
Functions
l void com.portsip.OnPortSIPEvent.onRecvOptions (String optionsMessage)
l void com.portsip.OnPortSIPEvent.onRecvInfo (String infoMessage)
l void com.portsip.OnPortSIPEvent.onRecvNotifyOfSubscription (long subscribeId, String
notifyMessage, byte[] messageData, int messageDataLength)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onRecvOptions (String optionsMessage)
This event will be triggered when receiving the OPTIONS message.
Parameters
optionsMessage
The received whole OPTIONS message in text format.
void com.portsip.OnPortSIPEvent.onRecvInfo (String infoMessage)
This event will be triggered when receiving the INFO message.
Parameters
infoMessage
The whole INFO message received in text format.
void com.portsip.OnPortSIPEvent.onRecvNotifyOfSubscription (long subscribeId,
String notifyMessage, byte[] messageData, int messageDataLength)
This event will be triggered when receiving a NOTIFY message of the subscription.
Parameters
subscribeId
The ID of SUBSCRIBE request.
notifyMessage
The received INFO message in text format.
messageData
The received message body. It's can be either text or binary data.
messageDataLengt
h
The length of "messageData".
20
Presence events
Functions
l void com.portsip.OnPortSIPEvent.onPresenceRecvSubscribe (long subscribeId, String
fromDisplayName, String from, String subject)
l void com.portsip.OnPortSIPEvent.onPresenceOnline (String fromDisplayName, String from,
String stateText)
l void com.portsip.OnPortSIPEvent.onPresenceOffline (String fromDisplayName, String from)
l void com.portsip.OnPortSIPEvent.onRecvMessage (long sessionId, String mimeType, String
subMimeType, byte[] messageData, int messageDataLength)
l void com.portsip.OnPortSIPEvent.onRecvOutOfDialogMessage (String fromDisplayName, String
from, String toDisplayName, String to, String mimeType, String subMimeType, byte[]
messageData, int messageDataLength, String sipMessage)
l void com.portsip.OnPortSIPEvent.onSendMessageSuccess (long sessionId, long messageId, String
sipMessage)
l void com.portsip.OnPortSIPEvent.onSendMessageFailure (long sessionId, long messageId, String
reason, int code, String sipMessage)
l void com.portsip.OnPortSIPEvent.onSendOutOfDialogMessageSuccess (long messageId, String
fromDisplayName, String from, String toDisplayName, String to, String sipMessage)
l void com.portsip.OnPortSIPEvent.onSendOutOfDialogMessageFailure (long messageId, String
fromDisplayName, String from, String toDisplayName, String to, String reason, int code, String
sipMessage)
l void com.portsip.OnPortSIPEvent.onSubscriptionFailure (long subscribeId, int statusCode)
l void com.portsip.OnPortSIPEvent.onSubscriptionTerminated (long subscribeId)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onPresenceRecvSubscribe (long subscribeId,
String fromDisplayName, String from, String subject)
This event will be triggered when receiving the SUBSCRIBE request from a contact.
Parameters
subscribeId
The ID of SUBSCRIBE request.
fromDisplayName
The display name of contact.
from
The contact who sends the SUBSCRIBE request.
subject
The subject of the SUBSCRIBE request.
void com.portsip.OnPortSIPEvent.onPresenceOnline (String fromDisplayName,
String from, String stateText)
When the contact is online or changes presence status, this event will be triggered.
Parameters
fromDisplayName
The display name of contact.
from
The contact who sends the SUBSCRIBE request.
stateText
The presence status text.
void com.portsip.OnPortSIPEvent.onPresenceOffline (String fromDisplayName,
String from)
When the contact is offline, this event will be triggered.
21
Parameters
fromDisplayName
The display name of contact.
from
The contact who sends the SUBSCRIBE request
void com.portsip.OnPortSIPEvent.onRecvMessage (long sessionId, String
mimeType, String subMimeType, byte[] messageData, int messageDataLength)
This event will be triggered when receiving a MESSAGE message in dialog.
Parameters
sessionId
The session ID of the call.
mimeType
The message mime type.
subMimeType
The message sub mime type.
messageData
The received message body. It can be text or binary data. Use the mimeType
and subMimeType to differentiate them. For example, if the mimeType is
"text" and subMimeType is "plain", "messageData" is text message body. If
the mimeType is "application" and subMimeType is "vnd.3gpp.sms",
"messageData" is binary message body.
messageDataLengt
h
The length of "messageData".
void com.portsip.OnPortSIPEvent.onRecvOutOfDialogMessage (String
fromDisplayName, String from, String toDisplayName, String to, String
mimeType, String subMimeType, byte[] messageData, int messageDataLength,
String sipMessage)
This event will be triggered when receiving a MESSAGE message out of dialog. For
example pager message.
Parameters
fromDisplayName
The display name of sender.
from
The message sender.
toDisplayName
The display name of receiver.
to
The receiver.
mimeType
The message mime type.
subMimeType
The message sub mime type.
messageData
The received message body. It can be text or binary data. Use the mimeType
and subMimeType to differentiate them. For example, if the mimeType is
"text" and subMimeType is "plain", "messageData" is text message body. If
the mimeType is "application" and subMimeType is "vnd.3gpp.sms",
"messageData" is binary message body.
messageDataLengt
h
The length of "messageData".
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onSendMessageSuccess (long sessionId, long
messageId, String sipMessage)
If the message is sent successfully in dialog, this event will be triggered.
Parameters
sessionId
The session ID of the call.
messageId
The message ID. It's equal to the return value of sendMessage function.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onSendMessageFailure (long sessionId, long
messageId, String reason, int code, String sipMessage)
If the message is failed to be sent out of dialog, this event will be triggered.
Parameters
sessionId
The session ID of the call.
22
messageId
The message ID. It's equal to the return value of sendMessage function.
reason
The failure reason.
code
Failure code.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onSendOutOfDialogMessageSuccess (long
messageId, String fromDisplayName, String from, String toDisplayName, String
to, String sipMessage)
If the message is sent successfully out of dialog, this event will be triggered.
Parameters
messageId
The message ID. It's equal to the return value of SendOutOfDialogMessage
function.
fromDisplayName
The display name of message sender.
from
The message sender.
toDisplayName
The display name of message receiver.
to
The message receiver.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onSendOutOfDialogMessageFailure (long
messageId, String fromDisplayName, String from, String toDisplayName, String
to, String reason, int code, String sipMessage)
If the message failed to be sent out of dialog, this event would be triggered.
Parameters
messageId
The message ID. It's equal to the return value of SendOutOfDialogMessage
function.
fromDisplayName
The display name of message sender
from
The message sender.
toDisplayName
The display name of message receiver.
to
The message receiver.
reason
The failure reason.
code
The failure code.
sipMessage
The SIP message received.
void com.portsip.OnPortSIPEvent.onSubscriptionFailure (long subscribeId, int
statusCode)
This event will be triggered on sending SUBSCRIBE failure.
Parameters
subscribeId
The ID of SUBSCRIBE request.
statusCode
The status code.
void com.portsip.OnPortSIPEvent.onSubscriptionTerminated (long subscribeId)
This event will be triggered when a SUBSCRIPTION is terminated or expired.
Parameters
subscribeId
The ID of SUBSCRIBE request.
23
audio device changed,Play audio and video file finished
events
Functions
l void com.portsip.OnPortSIPEvent.onPlayFileFinished (long sessionId, String fileName)
l void com.portsip.OnPortSIPEvent.onStatistics (long sessionId, String statistics)
l void com.portsip.OnPortSIPEvent.onAudioDeviceChanged (PortSipEnumDefine.AudioDevice
audioDevice, Set< PortSipEnumDefine.AudioDevice > devices)
l void com.portsip.OnPortSIPEvent.onAudioFocusChange (int focusChange)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onPlayFileFinished (long sessionId, String
fileName)
If called startPlayingFileToRemote function with no loop mode, this event will be
triggered once the file play finished.
Parameters
sessionId
The session ID of the call.
fileName
The play file name.
void com.portsip.OnPortSIPEvent.onStatistics (long sessionId, String statistics)
If called getStatistics function, this event will be triggered once the statistics get finished.
Parameters
sessionId
The session ID of the call.
statistics
The session call statistics.
void com.portsip.OnPortSIPEvent.onAudioDeviceChanged
(PortSipEnumDefine.AudioDevice audioDevice, Set<
PortSipEnumDefine.AudioDevice > devices)
fired When available audio devices changed or audio device currently in use changed.
Parameters
audioDevice
device currently in use
devices
devices useable. If a wired headset is connected, it should be the only possible
option. When no wired headset connected, the devices set may contain
speaker, earpiece, Bluetooth devices. can be set by
PortSipSdk#setAudioDevice to switch to current device.
void com.portsip.OnPortSIPEvent.onAudioFocusChange (int focusC h a n ge)
fired when the audio focus has been changed.
Parameters
focusChange
the type of focus change, one of AudioManager::AUDIOFOCUS_GAIN,
AudioManager::AUDIOFOCUS_LOSS,
AudioManager::AUDIOFOCUS_LOSS_TRANSIENT and
AudioManager::AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.
24
25
RTP callback events
Functions
l void com.portsip.OnPortSIPEvent.onRTPPacketCallback (long sessionId, int mediaType, int
enum_direction, byte[] RTPPacket, int packetSize)
l void com.portsip.OnPortSIPEvent.onAudioRawCallback (long sessionId, int enum_direction,
byte[] data, int dataLength, int samplingFreqHz)
l void com.portsip.OnPortSIPEvent.onVideoRawCallback (long sessionId, int enum_direction, int
width, int height, byte[] data, int dataLength)
Detailed Description
Function Documentation
void com.portsip.OnPortSIPEvent.onRTPPacketCallback (long sessionId, int
mediaType, int enum_direction, byte[] RTPPacket, int packetSize)
If enableRtpCallback function is called to enable the RTP callback, this event will be
triggered once a RTP packet is received or sent.
Parameters
sessionId
The session ID of the call.
mediaType
RTP packet media type, 0 for audio, 1 for video , 2 for screen.
enum_direction
RTP packet direction ENUM_DIRECTION_SEND,
ENUM_DIRECTION_RECV.
RTPPacket
The received or sent RTP packet.
packetSize
The size of the RTP packet in bytes.
Remarks
Donot call any SDK API functions in this event directly. If you want to call the API functions
or other code which is time-consuming, you should post a message to another thread and
execute SDK API functions or other code in another thread.
void com.portsip.OnPortSIPEvent.onAudioRawCallback (long sessionId, int
enum_direction, byte[] data, int dataLength, int samplingFreqHz)
This event will be triggered once receiving the audio packets if called
enableAudioStreamCallback function.
Parameters
sessionId
The session ID of the call.
enum_direction
The type passed in enableAudioStreamCallback function. Below types
allowed: ENUM_DIRECTION_SEND, ENUM_DIRECTION_RECV.
data
The memory of audio stream. It's in PCM format.
dataLength
The data size.
samplingFreqHz
The audio stream sample in HZ. For example, 8000 or 16000.
Remarks
Don't call any SDK API functions in this event directly. If you want to call the API
functions or other code which is time-consuming, you should post a message to another
thread and execute SDK API functions or other code in another thread.
26
See also
PortSipSdk::enableAudioStreamCallback
void com.portsip.OnPortSIPEvent.onVideoRawCallback (long sessionId, int
enum_direction, int width, int height, byte[] data, int dataLength)
This event will be triggered once receiving the video packets if
enableVideoStreamCallback function is called.
Parameters
sessionId
The session ID of the call.
enum_direction
The type which is passed in enableVideoStreamCallback function. Below
types allowed: ENUM_DIRECTION_SEND, ENUM_DIRECTION_RECV.
width
The width of video image.
height
The height of video image.
data
The memory of video stream. It's in YUV420 format, YV12.
dataLength
The data size.
See also
PortSipSdk::enableVideoStreamCallback
27
SDK functions
Modules
l Initialize and register functions
l Audio and video codecs functions
l Additional settings functions
l Access SIP message header functions
l Audio and video functions
l Call functions
l Refer functions
l Send audio and video stream functions
l RTP packets, Audio stream and video stream callback
l Record functions
l Play audio and video file and RTMP/RTSP stream functions
l Conference functions
l RTP and RTCP QOS functions
l RTP statistics functions
l Audio effect functions
l Send OPTIONS/INFO/MESSAGE functions
Detailed Description
28
Initialize and register functions
Functions
l 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)
l void com.portsip.PortSipSdk.unInitialize ()
l int com.portsip.PortSipSdk.setInstanceId (String instanceId)
l 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)
l void com.portsip.PortSipSdk.removeUser ()
remove user account info.
l int com.portsip.PortSipSdk.registerServer (int expires, int retryTimes)
l int com.portsip.PortSipSdk.refreshRegistration (int expires)
l int com.portsip.PortSipSdk.unRegisterServer (int waitMS)
l int com.portsip.PortSipSdk.setDisplayName (String displayName)
l int com.portsip.PortSipSdk.setLicenseKey (String key)
Detailed Description
Function Documentation
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.
Parameters
enum_transport
Transport for SIP signaling, which can be set as: ENUM_TRANSPORT_UDP,
ENUM_TRANSPORT_TCP, ENUM_TRANSPORT_TLS,
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.
29
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.
TLSCertificatesRo
otPath
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.
verifyTLSCertificat
e
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"
Returns
If the function succeeds, it returns value 0. If the function fails, it will return a specific error
code
void com.portsip.PortSipSdk.unInitialize ()
Un-initialize the SDK and release resources.
int com.portsip.PortSipSdk.setInstanceId (String instanceId)
Set the instance Id, the outbound instanceId((RFC5626) ) used in contact headers.
Parameters
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.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
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.
Parameters
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
30
to transfer an empty string if not using the outbound server.
outboundServerPo
rt
Outbound proxy server port, it will be ignored if the outboundServer is empty.
Returns
If this function succeeds, it will return value 0. If it fails, it will return a specific error code.
int com.portsip.PortSipSdk.registerServer (int expires, int retryTimes)
Register to SIP proxy server (login to server)
Parameters
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.
Returns
If this function succeeds, it will return value 0. If fails, it will return a specific error code.
If the registration to server succeeds, onRegisterSuccess will be triggered; otherwise
onRegisterFailure will be triggered.
int com.portsip.PortSipSdk.refreshRegistration (int expires)
Refresh the registration manually after successfully registered.
Parameters
expires
Time interval for registration refreshment, in seconds. The maximum of
supported value is 3600. It will be inserted into SIP REGISTER message
headers.
Returns
If this function succeeds, it will return value 0. If fails, it will return a specific error code.
If the registration to server succeeds, onRegisterSuccess will be triggered; otherwise
onRegisterFailure will be triggered.
int com.portsip.PortSipSdk.unRegisterServer (int waitMS)
Un-register from the SIP proxy server.
Parameters
waitMS
Wait for the server to reply that the un-registration is successful, waitMS is the
longest waiting milliseconds, 0 means not waiting.
Returns
If this function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setDisplayName (String displayName)
Set the display name of user.
Parameters
displayName
That will appear in the From/To Header.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
31
int com.portsip.PortSipSdk.setLicenseKey (String key)
Set the license key. It must be called before setUser function.
Parameters
key
The SDK license key. Please purchase from PortSIP.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
32
Audio and video codecs functions
Functions
l int com.portsip.PortSipSdk.addAudioCodec (int enum_audiocodec)
l int com.portsip.PortSipSdk.addVideoCodec (int enum_videocodec)
l boolean com.portsip.PortSipSdk.isAudioCodecEmpty ()
l boolean com.portsip.PortSipSdk.isVideoCodecEmpty ()
l int com.portsip.PortSipSdk.setAudioCodecPayloadType (int enum_audiocodec, int payloadType)
l int com.portsip.PortSipSdk.setVideoCodecPayloadType (int enum_videocodec, int payloadType)
l void com.portsip.PortSipSdk.clearAudioCodec ()
l void com.portsip.PortSipSdk.clearVideoCodec ()
l int com.portsip.PortSipSdk.setAudioCodecParameter (int enum_audiocodec, String sdpParameter)
l int com.portsip.PortSipSdk.setVideoCodecParameter (int enum_videocodec, String sdpParameter)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.addAudioCodec (int enum_audiocodec)
Enable an audio codec, and it will be shown in SDP.
Parameters
enum_audiocodec
Audio codec type, including: ENUM_AUDIOCODEC_G729,
ENUM_AUDIOCODEC_PCMA, ENUM_AUDIOCODEC_PCMU,
ENUM_AUDIOCODEC_GSM, ENUM_AUDIOCODEC_G722,
ENUM_AUDIOCODEC_ILBC, ENUM_AUDIOCODEC_AMR,
ENUM_AUDIOCODEC_AMRWB, ENUM_AUDIOCODEC_SPEEX,
ENUM_AUDIOCODEC_SPEEXWB, ENUM_AUDIOCODEC_ISACWB,
ENUM_AUDIOCODEC_ISACSWB, ENUM_AUDIOCODEC_OPUS,
ENUM_AUDIOCODEC_DTMF.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.addVideoCodec (int enum_videocodec)
Enable a video codec, and it will be shown in SDP.
Parameters
enum_videocodec
Video codec type. Supported types include ENUM_VIDEOCODEC_H264,
ENUM_VIDEOCODEC_VP8. ENUM_VIDEOCODEC_VP9.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
boolean com.portsip.PortSipSdk.isAudioCodecEmpty ()
Detect if the audio codecs are enabled.
Returns
If no audio codec enabled, it will return value true; otherwise it returns false.
33
boolean com.portsip.PortSipSdk.isVideoCodecEmpty ()
Detect if the video codecs are enabled.
Returns
If no video codec enabled, it will return value true; otherwise it returns false.
int com.portsip.PortSipSdk.setAudioCodecPayloadType (int enum_audiocodec, int
payloadType)
Set the RTP payload type for dynamic audio codec.
Parameters
enum_audiocodec
Audio codec types. Supported types include: ENUM_AUDIOCODEC_G729,
ENUM_AUDIOCODEC_PCMA, ENUM_AUDIOCODEC_PCMU,
ENUM_AUDIOCODEC_GSM, ENUM_AUDIOCODEC_G722,
ENUM_AUDIOCODEC_ILBC, ENUM_AUDIOCODEC_AMR,
ENUM_AUDIOCODEC_AMRWB, ENUM_AUDIOCODEC_SPEEX,
ENUM_AUDIOCODEC_SPEEXWB, ENUM_AUDIOCODEC_ISACWB,
ENUM_AUDIOCODEC_ISACSWB, ENUM_AUDIOCODEC_OPUS,
ENUM_AUDIOCODEC_DTMF
payloadType
The new RTP payload type that you want to set.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoCodecPayloadType (int enum_videocodec, int
payloadType)
Set the RTP payload type for dynamic video codec.
Parameters
enum_videocodec
Video codec type. Supported types include: ENUM_VIDEOCODEC_H264,
ENUM_VIDEOCODEC_VP8. ENUM_VIDEOCODEC_VP9.
payloadType
The new RTP payload type that you want to set.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.clearAudioCodec ()
Remove all the enabled audio codecs.
void com.portsip.PortSipSdk.clearVideoCodec ()
Remove all the enabled video codecs.
int com.portsip.PortSipSdk.setAudioCodecParameter (int enum_audiocodec, String
sdpParameter)
Set the codec parameter for audio codec.
Parameters
enum_audiocodec
Audio codec type. Supported types include: ENUM_AUDIOCODEC_G729,
ENUM_AUDIOCODEC_PCMA, ENUM_AUDIOCODEC_PCMU,
ENUM_AUDIOCODEC_GSM, ENUM_AUDIOCODEC_G722,
ENUM_AUDIOCODEC_ILBC, ENUM_AUDIOCODEC_AMR,
ENUM_AUDIOCODEC_AMRWB, ENUM_AUDIOCODEC_SPEEX,
ENUM_AUDIOCODEC_SPEEXWB, ENUM_AUDIOCODEC_ISACWB,
ENUM_AUDIOCODEC_ISACSWB, ENUM_AUDIOCODEC_OPUS,
ENUM_AUDIOCODEC_DTMF
34
sdpParameter
The parameter is in string format.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
See also
PortSipEnumDefine
Remarks
Example:
setAudioCodecParameter(AUDIOCODEC_AMR, "mode-set=0; octet-align=1;
robust-sorting=0")
int com.portsip.PortSipSdk.setVideoCodecParameter (int enum_videocodec, String
sdpParameter)
Set the codec parameter for video codec.
Parameters
enum_videocodec
Video codec types. Supported types include: ENUM_VIDEOCODEC_H264,
ENUM_VIDEOCODEC_VP8. ENUM_VIDEOCODEC_VP9.
sdpParameter
The parameter is in string format.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
Example:
setVideoCodecParameter(PortSipEnumDefine.ENUM_VIDEOCODEC_H264,
"profile-level-id=420033; packetization-mode=0");
35
Additional settings functions
Functions
l String com.portsip.PortSipSdk.getVersion ()
l int com.portsip.PortSipSdk.enableRport (boolean enable)
l int com.portsip.PortSipSdk.enableEarlyMedia (boolean enable)
Enable/disable rport(RFC3581).
l int com.portsip.PortSipSdk.enablePriorityIPv6Domain (boolean enable)
l int com.portsip.PortSipSdk.setUriUserEncoding (String character, boolean enable)
l int com.portsip.PortSipSdk.setReliableProvisional (int mode)
l int com.portsip.PortSipSdk.enable3GppTags (boolean enable)
l void com.portsip.PortSipSdk.enableCallbackSignaling (boolean enableSending, boolean
enableReceived)
l void com.portsip.PortSipSdk.setSrtpPolicy (int enum_srtppolicy)
l int com.portsip.PortSipSdk.setRtpPortRange (int minimumRtpPort, int maximumRtpPort)
l int com.portsip.PortSipSdk.enableCallForward (boolean forBusyOnly, String forwardTo)
l int com.portsip.PortSipSdk.disableCallForward ()
l int com.portsip.PortSipSdk.enableSessionTimer (int timerSeconds)
l void com.portsip.PortSipSdk.disableSessionTimer ()
l void com.portsip.PortSipSdk.setDoNotDisturb (boolean state)
l void com.portsip.PortSipSdk.enableAutoCheckMwi (boolean state)
l int com.portsip.PortSipSdk.setRtpKeepAlive (boolean state, int keepAlivePayloadType, int
deltaTransmitTimeMS)
l int com.portsip.PortSipSdk.setKeepAliveTime (int keepAliveTime)
l int com.portsip.PortSipSdk.setAudioSamples (int ptime, int maxptime)
l int com.portsip.PortSipSdk.addSupportedMimeType (String methodName, String mimeType,
String subMimeType)
Detailed Description
Function Documentation
String com.portsip.PortSipSdk.getVersion ()
Get the version number of the current SDK.
Returns
String with version description
int com.portsip.PortSipSdk.enableRport (boolean enable)
Enable/Disable rport(RFC3581).
Parameters
enable
enable Set 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.
int com.portsip.PortSipSdk.enableEarlyMedia (boolean enable)
36
Enable/disable rport(RFC3581).
Parameters
enable
Set 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. Enable/Disable Early Media.
Parameters
enable
Set to true to enable the SDK support Early Media. By default the 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.
int com.portsip.PortSipSdk.enablePriorityIPv6Domain (boolean enable)
Enable/disable which allows specifying the preferred protocol when a domain supports
both IPV4 and IPV6 simultaneously.
Parameters
enable
Set to true to enable priority IPv6 Domain. with the default priority being
IPV4.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setUriUserEncoding (String character, boolean enable)
Modifies the default URI user character needs to be escaped.
Parameters
character
The character to be modified, set one character at a time.
enable
Whether escaping is required, true for allowing escaping, false for disabling
escaping.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setReliableProvisional (int mode)
Enable/Disable PRACK.
Parameters
mode
Modes work as follows: 0 - Never, Disable PRACK,By default the PRACK is
disabled. 1 - SupportedEssential, Only send reliable provisionals if sending a
body and far end supports. 2 - Supported, Always send reliable provisionals if
far end supports. 3 - Required Always send reliable provisionals.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.enable3GppTags (boolean enable)
Enable/disable the 3Gpp tags, including "ims.icsi.mmtel" and "g.3gpp.smsip".
37
Parameters
enable
Set to true to enable 3Gpp tags for SDK.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.enableCallbackSignaling (boolean enableSending,
boolean enableReceived)
Enable/disable the callback of the SIP messages.
Parameters
enableSending
Set as true to enable to callback the sent SIP messages, or false to disable.
Once enabled, the "onSendingSignaling" event will be triggered when the
SDK sends a SIP message.
enableReceived
Set as true to enable to callback the received SIP messages, or false to disable.
Once enabled, the "onReceivedSignaling" event will be triggered when the
SDK receives a SIP message.
void com.portsip.PortSipSdk.setSrtpPolicy (int enum_srtppolicy)
Set the SRTP policy.
Parameters
enum_srtppolicy
The SRTP policy.allow: ENUM_SRTPPOLICY_NONE,
ENUM_SRTPPOLICY_FORCE, ENUM_SRTPPOLICY_PREFER.
int com.portsip.PortSipSdk.setRtpPortRange (int minimumRtpPort, int
maximumRtpPort)
This function allows to set the RTP port range for audio and video streaming.
Parameters
minimumRtpPort
The minimum RTP port.
maximumRtpPort
The maximum RTP port.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
The port range ((max - min) / maxCallLines) should be greater than 4.
int com.portsip.PortSipSdk.enableCallForward (boolean forBusyOnly, String
forwardTo)
Enable call forwarding.
Parameters
forBusyOnly
If this parameter is set to true, the SDK will forward incoming calls when the
user is currently busy. If set it to false, SDK will forward all incoming calls.
forwardTo
The target to which the call will be forwarded. It must be in the format of
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.disableCallForward ()
Disable the call forwarding. The SDK will not forward any incoming call when this
function is called.
38
Returns
If the function succeeds, it will not return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.enableSessionTimer (int timerSeconds)
This function allows to periodically refresh Session Initiation Protocol (SIP) sessions by
sending repeated INVITE requests.
Parameters
timerSeconds
The value of the refresh interval in seconds. A minimum of 90 seconds
required.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
The repeated INVITE requests, or re-INVITEs, are sent during an active call log to allow user
agents (UA) or proxies to determine the status of a SIP session. Without this keep-alive
mechanism, proxies that remember incoming and outgoing requests (stateful proxies) may
continue to retain call state in vain. If a UA fails to send a BYE message at the end of a
session, or if the BYE message is lost due to network problems, a stateful proxy will not know
that the session has ended. The re-INVITES ensure that active sessions stay active and
completed sessions are terminated.
void com.portsip.PortSipSdk.disableSessionTimer ()
Disable the session timer.
void com.portsip.PortSipSdk.setDoNotDisturb (boolean state)
Enable/disable the "Do not disturb" status.
Parameters
state
If it is set to true, the SDK will reject all incoming calls.
void com.portsip.PortSipSdk.enableAutoCheckMwi (boolean state)
Enable/disable the "Auto Check MWI" status.
Parameters
state
If it is set to true, the SDK will check Mwi automatically.
int com.portsip.PortSipSdk.setRtpKeepAlive (boolean state, int
keepAlivePayloadType, int deltaTransmitTimeMS)
Enable or disable to send RTP keep-alive packet when the call is ongoing.
Parameters
state
When it's set to true, it's allowed to send the keep-alive packet during the
conversation;
keepAlivePayload
Type
The payload type of the keep-alive RTP packet. It's usually set to 126.
deltaTransmitTime
MS
The interval for sending keep-alive RTP packet, in millisecond. Recommended
value ranges 15000 - 300000.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
39
int com.portsip.PortSipSdk.setKeepAliveTime (int keepAliveTime)
Enable or disable to send SIP keep-alive packet.
Parameters
keepAliveTime
This is the time interval for SIP keep-alive, in seconds. When it is set to 0, the
SIP keep-alive will be disabled. Recommended value is 30 or 50.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setAudioSamples (int ptime, int maxptime)
Set the audio capture sample, which will be present in the SDP of INVITE and 200 OK
message as "ptime and "maxptime" attribute.
Parameters
ptime
It should be a multiple of 10 between 10 - 60 (included 10 and 60).
maxptime
The "maxptime" attribute should be a multiple of 10 between 10 - 60 (included
10 and 60). It can't 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.
int com.portsip.PortSipSdk.addSupportedMimeType (String methodName, String
mimeType, String subMimeType)
Set the SDK to receive SIP messages that include special mime type.
Parameters
methodName
Method name of the SIP message, such as INVITE, OPTION, INFO,
MESSAGE, UPDATE, ACK etc. For more details please refer to RFC3261.
mimeType
The mime type of SIP message.
subMimeType
The 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
In default, PortSIP VoIP SDK supports media types (mime types) included in the below
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. <br> "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, because "text/plain" of INFO message is not included in
the default type list. How should we enable the SDK to receive SIP INFO messages that
include "text/plain" mime type? The answer is addSupportedMimyType:
addSupportedMimeType("INFO", "text", "plain");
If the user wishes to receive the NOTIFY message with "application/media_control+xml",
it should be set as below:
addSupportedMimeType("NOTIFY", "application", "media_control+xml");
For more details about the mime type, please visit:
http://www.iana.org/assignments/media-types/
40
41
Access SIP message header functions
Functions
l String com.portsip.PortSipSdk.getSipMessageHeaderValue (String sipMessage, String
headerName)
l long com.portsip.PortSipSdk.addSipMessageHeader (long sessionId, String methodName, int
msgType, String headerName, String headerValue)
l int com.portsip.PortSipSdk.removeAddedSipMessageHeader (long addedSipMessageId)
l void com.portsip.PortSipSdk.clearAddedSipMessageHeaders ()
l long com.portsip.PortSipSdk.modifySipMessageHeader (long sessionId, String methodName, int
msgType, String headerName, String headerValue)
l int com.portsip.PortSipSdk.removeModifiedSipMessageHeader (long modifiedSipMessageId)
l void com.portsip.PortSipSdk.clearModifiedSipMessageHeaders ()
Detailed Description
Function Documentation
String com.portsip.PortSipSdk.getSipMessageHeaderValue (String sipMessage,
String headerName)
Access the SIP header of SIP message.
Parameters
sipMessage
The SIP message.
headerName
The header of which user wishes to access the SIP message.
Returns
String. The SIP header of SIP message.
long com.portsip.PortSipSdk.addSipMessageHeader (long sessionId, String
methodName, int msgType, String headerName, String headerValue)
Add the SIP Message header into the specified outgoing SIP message.
Parameters
sessionId
Add the header to the SIP message with the specified session Id only. By
setting to -1, it will be added to all messages.
methodName
Add the header to the SIP message with specified method name only. For
example: "INVITE", "REGISTER", "INFO" etc. If "ALL" specified, it will
add all SIP messages.
msgType
1 refers to apply to the request message, 2 refers to apply to the response
message, 3 refers to apply to both request and response.
headerName
The header name which will appear in SIP message.
headerValue
The custom header value.
Returns
If the function succeeds, it will return the addedSipMessageId , which is greater than 0. If the
function fails, it will return a specific error code.
int com.portsip.PortSipSdk.removeAddedSipMessageHeader (long
addedSipMessageId)
Remove the headers (custom header) added by addSipMessageHeader.
42
Parameters
addedSipMessageI
d
The addedSipMessageId return by addSipMessageHeader.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.clearAddedSipMessageHeaders ()
Clear the added extension headers (custom headers)
Remarks
For example, we have added two custom headers into every outgoing SIP message and want
to have them removed.
addSipMessageHeader(-1,"ALL",3,"Blling", "usd100.00");
addSipMessageHeader(-1,"ALL",3,"ServiceId", "8873456");
clearAddedSipMessageHeaders();
If this function is called, the added extension headers will no longer appear in outgoing SIP
message.
long com.portsip.PortSipSdk.modifySipMessageHeader (long sessionId, String
methodName, int msgType, String headerName, String headerValue)
Modify the special SIP header value for every outgoing SIP message.
Parameters
sessionId
The header to the SIP message with the specified session Id. By setting to -1, it
will be added to all messages.
methodName
Modify the header to the SIP message with specified method name only. For
example: "INVITE", "REGISTER", "INFO" etc. If "ALL" specified, it will
add all SIP messages.
msgType
1 refers to apply to the request message, 2 refers to apply to the response
message, 3 refers to apply to both request and response.
headerName
The SIP header name of which the value will be modified.
headerValue
The heaver value to be modified.
Returns
If the function succeeds, it will return modifiedSipMessageId, which is greater than 0. If the
function fails, it will return a specific error code.
Remarks
Example: modify "Expires" header and "User-Agent" header value for every outgoing SIP
message:
modifySipMessageHeader(-1,"ALL",3, "Expires", "1000");
modifySipMessageHeader(-1,"ALL",3, "User-Agent", "MyTest Softphone 1.0");
int com.portsip.PortSipSdk.removeModifiedSipMessageHeader (long
modifiedSipMessageId)
Remove the headers (custom header) added by modifiedSipMessageId.
Parameters
modifiedSipMessa
geId
The modifiedSipMessageId return by modifySipMessageHeader.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
43
void com.portsip.PortSipSdk.clearModifiedSipMessageHeaders ()
Clear the modify headers value. Once cleared, it will no longer modify every outgoing
SIP message header values.
Remarks
Example: modify two headers value for every outgoing SIP message and then clear it:
modifySipMessageHeader(-1,"ALL",3, "Expires", "1000");
modifySipMessageHeader(-1,"ALL",3, "User-Agent", "MyTest Softphone 1.0");
cleaModifyHeaders();
44
Audio and video functions
Functions
l int com.portsip.PortSipSdk.setVideoDeviceId (int deviceId)
l int com.portsip.PortSipSdk.setVideoOrientation (int rotation)
l int com.portsip.PortSipSdk.enableVideoHardwareCodec (boolean enableHWEncoder, boolean
enableHWDecoder)
l int com.portsip.PortSipSdk.setVideoResolution (int width, int height)
l int com.portsip.PortSipSdk.setAudioBitrate (long sessionId, int enum_audiocodec, int bitrateKbps)
l int com.portsip.PortSipSdk.setVideoBitrate (long sessionId, int bitrateKbps)
l int com.portsip.PortSipSdk.setVideoFrameRate (long sessionId, int frameRate)
l int com.portsip.PortSipSdk.sendVideo (long sessionId, boolean send)
l int com.portsip.PortSipSdk.setRemoteVideoWindow (long sessionId, PortSIPVideoRenderer
renderer)
l int com.portsip.PortSipSdk.setRemoteScreenWindow (long sessionId, PortSIPVideoRenderer
renderer)
l void com.portsip.PortSipSdk.displayLocalVideo (boolean state, boolean mirror,
PortSIPVideoRenderer renderer)
l int com.portsip.PortSipSdk.setVideoNackStatus (boolean state)
l int com.portsip.PortSipSdk.setChannelOutputVolumeScaling (long sessionId, int scaling)
l int com.portsip.PortSipSdk.setChannelInputVolumeScaling (long sessionId, int scaling)
l void com.portsip.PortSipSdk.enableAudioManager (boolean state)
l Set< PortSipEnumDefine.AudioDevice > com.portsip.PortSipSdk.getAudioDevices ()
l int com.portsip.PortSipSdk.setAudioDevice (PortSipEnumDefine.AudioDevice defaultDevice)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.setVideoDeviceId (int deviceId)
Set the video device that will be used for video call.
Parameters
deviceId
Device ID (index) for video device (camera).
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoOrientation (int rotation)
Setting the video Device Orientation.
Parameters
rotation
Device Orientation for video device (camera), e.g 0,90,180,270.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.enableVideoHardwareCodec (boolean enableHWEncoder,
boolean enableHWDecoder)
Set enable/disable video Hardware codec.
45
Parameters
enableHWEncoder
If it is set to true, the SDK will use video hardware encoder when available.
By default it is true.
enableHWDecoder
If it is set to true, the SDK will use video hardware decoder when available.
By default it is true.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoResolution (int width, int height)
Set the video capturing resolution.
Parameters
width
Video resolution, width
height
Video resolution, height
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setAudioBitrate (long sessionId, int enum_audiocodec,
int bitrateKbps)
Set the audio bitrate.
Parameters
sessionId
The session ID of the call.
enum_audiocodec
Audio codec type allowed: ENUM_AUDIOCODEC_OPUS
bitrateKbps
The Audio bitrate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoBitrate (long sessionId, int bitrateKbps)
Set the video bitrate.
Parameters
sessionId
The session ID of the call.
bitrateKbps
The video bitrate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoFrameRate (long sessionId, int frameRate)
Set the video frame rate. Usually you do not need to call this function to set the frame rate
since the SDK uses default frame rate.
Parameters
sessionId
The session ID of the call.
frameRate
The frame rate value, with its minimum of 5, and maximum value of 30. The
greater the value is, the better video quality enabled and more bandwidth
required;
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
46
int com.portsip.PortSipSdk.sendVideo (long sessionId, boolean send)
Send the video to remote side.
Parameters
sessionId
The session ID of the call.
send
Set to true to send the video, or false to stop sending.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setRemoteVideoWindow (long sessionId,
PortSIPVideoRenderer renderer)
Set the window for a session that is used for displaying the received remote video image.
Parameters
sessionId
The session ID of the call.
renderer
SurfaceView a SurfaceView for displaying the received remote video image.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setRemoteScreenWindow (long sessionId,
PortSIPVideoRenderer renderer)
Set the window for a session that is used for displaying the received remote screen image.
Parameters
sessionId
The session ID of the call.
renderer
SurfaceView a SurfaceView for displaying the received remote screen image.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.displayLocalVideo (boolean state, boolean mirror,
PortSIPVideoRenderer renderer)
Start/stop displaying the local video image.
Parameters
state
Set to true to display local video image.
mirror
Set to true to display the mirror image of local video.
renderer
SurfaceView a SurfaceView for displaying local video image from camera.
int com.portsip.PortSipSdk.setVideoNackStatus (boolean state)
Enable/disable the NACK feature (rfc6642) which helps to improve the video quality.
Parameters
state
Set to true to enable.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setChannelOutputVolumeScaling (long sessionId, int
scaling)
Set a volume |scaling| to be applied to the outgoing signal of a specific audio channel.
47
Parameters
sessionId
The session ID of the call.
scaling
Valid scale ranges [0, 1000]. Default is 100.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setChannelInputVolumeScaling (long sessionId, int
scaling)
Set a volume |scaling| to be applied to the microphone signal of a specific audio channel.
Parameters
sessionId
The session ID of the call.
scaling
Valid scale ranges [0, 1000]. Default is 100.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.enableAudioManager (boolean state)
enable/disable sdk audio manager,when enable sdk will auto manager audio device
input/output. if the state is enabled, the onAudioDeviceChanged event will be triggered
when available audio devices changed or audio device currently in use changed .
Parameters
state
@true enable sdk audio manager @false disable audio manager
Set<PortSipEnumDefine.AudioDevice> com.portsip.PortSipSdk.getAudioDevices ()
Get current set of available/selectable audio devices.
Returns
Current set of available/selectable audio devices.
int com.portsip.PortSipSdk.setAudioDevice (PortSipEnumDefine.AudioDevice
defaultDevice)
Set the audio device that will used for audio call. For Android and iOS, switch between
earphone and Loudspeaker allowed.
Parameters
defaultDevice
Set to true the SDK use loudspeaker for audio call, this just available for
mobile platform only.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
48
Call functions
Functions
l long com.portsip.PortSipSdk.call (String callee, boolean sendSdp, boolean videoCall)
l int com.portsip.PortSipSdk.rejectCall (long sessionId, int code)
l int com.portsip.PortSipSdk.hangUp (long sessionId)
l int com.portsip.PortSipSdk.answerCall (long sessionId, boolean videoCall)
l int com.portsip.PortSipSdk.updateCall (long sessionId, boolean enableAudio, boolean
enableVideo)
l int com.portsip.PortSipSdk.hold (long sessionId)
l int com.portsip.PortSipSdk.unHold (long sessionId)
l int com.portsip.PortSipSdk.muteSession (long sessionId, boolean muteIncomingAudio, boolean
muteOutgoingAudio, boolean muteIncomingVideo, boolean muteOutgoingVideo)
l int com.portsip.PortSipSdk.forwardCall (long sessionId, String forwardTo)
l long com.portsip.PortSipSdk.pickupBLFCall (String replaceDialogId, boolean videoCall)
l int com.portsip.PortSipSdk.sendDtmf (long sessionId, int enum_dtmfMethod, int code, int
dtmfDuration, boolean playDtmfTone)
Detailed Description
Function Documentation
long com.portsip.PortSipSdk.call (String callee, boolean sendSdp, boolean
videoCall)
Make a call
Parameters
callee
The callee. It can be a name only or full SIP URI, for example: user001 or
sip:[email protected] or sip:user002@sip.yourdomain.com:5068
sendSdp
If it is set to false, the outgoing call will not include the SDP in INVITE
message.
videoCall
If it is set to true and at least one video codec was added, the outgoing call will
include the video codec into SDP. Otherwise no video codec will be added into
outgoing SDP.
Returns
If the function succeeds, it will return the session ID of the call, which is greater than 0. If the
function fails, it will return a specific error code.
Note: the function success just means the outgoing call is processing, you need to detect the
call final state in onInviteTrying, onInviteRinging, onInviteFailure callback events.
int com.portsip.PortSipSdk.rejectCall (long sessionId, int code)
rejectCall Reject the incoming call.
Parameters
sessionId
The session ID of the call.
code
Reject code, for example, 486, 480 etc.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
49
int com.portsip.PortSipSdk.hangUp (long sessionId)
hangUp Hang up the call.
Parameters
sessionId
Session ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.answerCall (long sessionId, boolean videoCall)
answerCall Answer the incoming call.
Parameters
sessionId
The session ID of call.
videoCall
If the incoming call is a video call and the video codec is matched, set to true
to answer the video call.
If set to false, the answer call does not include video codec answer anyway.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.updateCall (long sessionId, boolean enableAudio,
boolean enableVideo)
updateCall Use the re-INVITE to update the established call.
Parameters
sessionId
The session ID of call.
enableAudio
Set to true to allow the audio in updated call, or false to disable audio in
updated call.
enableVideo
Set to true to allow the video in update call, or false to disable video in updated
call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return specific error
code.
Remarks
Example usage:
Example 1: A called B with the audio only, and B answered A, there would be an audio
conversation between A and B. Now A want to see B through video, A could use these
functions to fulfill it.
clearVideoCodec();
addVideoCodec(VIDEOCODEC_H264);
updateCall(sessionId, true, true);
Example 2: Remove video stream from the current conversation.
updateCall(sessionId, true, false);
int com.portsip.PortSipSdk.hold (long sessionId)
To place a call on hold.
Parameters
sessionId
The session ID of call.
50
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.unHold (long sessionId)
Take off hold.
Parameters
sessionId
The session ID of call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.muteSession (long sessionId, boolean
muteIncomingAudio, boolean muteOutgoingAudio, boolean muteIncomingVideo,
boolean muteOutgoingVideo)
Mute the specified audio or video session.
Parameters
sessionId
The session ID of the call.
muteIncomingAudi
o
Set it to true to mute incoming audio stream. Once set, remote side audio
cannot be heard.
muteOutgoingAudi
o
Set it to true to mute outgoing audio stream. Once set, the remote side cannot
hear the audio.
muteIncomingVide
o
Set it to true to mute incoming video stream. Once set, remote side video
cannot be seen.
muteOutgoingVide
o
Set it to true to mute outgoing video stream, the remote side cannot see the
video.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.forwardCall (long sessionId, String forwardTo)
Forward call to another one when receiving the incoming call.
Parameters
sessionId
The session ID of the call.
forwardTo
Target of the forward. It can be either "sip:[email protected]" or
"number".
Returns
If the function succeeds, it will return value 0. If the function fails, it will return value a
specific error code.
long com.portsip.PortSipSdk.pickupBLFCall (String replaceDialogId, boolean
videoCall)
This function will be used for picking up a call based on the BLF (Busy Lamp Field)
status.
Parameters
replaceDialogId
The ID of the call which will be pickup. It comes with onDialogStateUpdated
callback.
videoCall
Indicates pickup video call or audio call
51
Returns
If the function succeeds, it will return a session ID that is greater than 0 to the new call,
otherwise returns a specific error code that is less than 0.
Remarks
The scenario is:
1. User 101 subscribed the user 100's call status: sendSubscription(mSipLib, "100",
"dialog");
2. When 100 holds a call or 100 is ringing, onDialogStateUpdated callback will be triggered,
and 101 will receive this callback. Now 101 can use pickupBLFCall function to pick the
call rather than 100 to talk with caller.
int com.portsip.PortSipSdk.sendDtmf (long sessionId, int enum_dtmfMethod, int
code, int dtmfDuration, boolean playDtmfTone)
Send DTMF tone.
Parameters
sessionId
The session ID of the call.
enum_dtmfMethod
DTMF tone could be sent via two methods: DTMF_RFC2833 or
DTMF_INFO. The DTMF_RFC2833 is recommend.
code
The DTMF tone. Values include:
Description
The DTMF tone 0.
The DTMF tone 1.
The DTMF tone 2.
The DTMF tone 3.
The DTMF tone 4.
The DTMF tone 5.
The DTMF tone 6.
The DTMF tone 7.
The DTMF tone 8.
The DTMF tone 9.
The DTMF tone *.
The DTMF tone #.
The DTMF tone A.
The DTMF tone B.
The DTMF tone C.
The DTMF tone D.
The DTMF tone FLASH.
Parameters
dtmfDuration
The DTMF tone samples. Recommended value 160.
playDtmfTone
Set to true the SDK play local DTMF tone sound during send DTMF.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
52
Refer functions
Functions
l int com.portsip.PortSipSdk.refer (long sessionId, String referTo)
l int com.portsip.PortSipSdk.attendedRefer (long sessionId, long replaceSessionId, String referTo)
l int com.portsip.PortSipSdk.attendedRefer2 (long sessionId, long replaceSessionId, String
replaceMethod, String target, String referTo)
l int com.portsip.PortSipSdk.outOfDialogRefer (long replaceSessionId, String replaceMethod,
String target, String referTo)
l long com.portsip.PortSipSdk.acceptRefer (long referId, String referSignaling)
l int com.portsip.PortSipSdk.rejectRefer (long referId)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.refer (long sessionId, String referTo)
Transfer the current call to another callee.
Parameters
sessionId
The session ID of the call.
referTo
Target callee of the transfer. It can be either "sip:number@sipserver.com" or
"number".
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
refer(sessionId, "sip:[email protected]");
You can refer to the video on Youtube at:
https://www.youtube.com/watch?v=_2w9EGgr3FY, which will demonstrate how to
complete the transfer.
int com.portsip.PortSipSdk.attendedRefer (long sessionId, long replaceSessionId,
String referTo)
Make an attended refer.
Parameters
sessionId
The session ID of the call.
replaceSessionId
Session ID of the replace call.
referTo
Target callee of the refer. It can be either "sip:number@sipserver.com" or
"number".
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
Please read the sample project source code to get more details, or you can refer to the video on
YouTube at:
53
https://www.youtube.com/watch?v=_2w9EGgr3FY
Note: Please use Windows Media Player to play the AVI file, which demonstrates how to
complete the transfer.
int com.portsip.PortSipSdk.attendedRefer2 (long sessionId, long replaceSessionId,
String replaceMethod, String target, String referTo)
Make an attended refer.
Parameters
sessionId
The session ID of the call.
replaceSessionId
The session ID of the session to be replaced.
replaceMethod
The SIP method name to be added in the "Refer-To" header, usually INVITE
or BYE.
target
The target to which the REFER message will be sent.
referTo
The URI to be added into the "Refer-To" header.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.outOfDialogRefer (long replaceSessionId, String
replaceMethod, String target, String referTo)
Make an attended refer.
Parameters
replaceSessionId
The session ID of the session which will be replaced.
replaceMethod
The SIP method name which will be added in the "Refer-To" header, usually
INVITE or BYE.
target
The target to which the REFER message will be sent.
referTo
The URI which will be added into the "Refer-To" header.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
long com.portsip.PortSipSdk.acceptRefer (long referId, String referSignaling)
By accepting the REFER request, a new call will be made if this function is called. The
function is usually called after onReceivedRefer callback event.
Parameters
referId
The ID of REFER request that comes from onReceivedRefer callback event.
referSignaling
The SIP message of REFER request that comes from onReceivedRefer
callback event.
Returns
If the function succeeds, it will return a session ID greater than 0 to the new call for REFER;
otherwise it will return a specific error code less than 0;
int com.portsip.PortSipSdk.rejectRefer (long referId)
Reject the REFER request.
Parameters
referId
The ID of REFER request that comes from onReceivedRefer callback event.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
54
55
Send audio and video stream functions
Functions
l int com.portsip.PortSipSdk.enableSendPcmStreamToRemote (long sessionId, boolean state, int
streamSamplesPerSec)
l int com.portsip.PortSipSdk.sendPcmStreamToRemote (long sessionId, byte[] data, int dataLength)
l int com.portsip.PortSipSdk.enableSendVideoStreamToRemote (long sessionId, boolean state)
l int com.portsip.PortSipSdk.sendVideoStreamToRemote (long sessionId, byte[] data, int
dataLength, int width, int height)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.enableSendPcmStreamToRemote (long sessionId,
boolean state, int streamSamplesPerSec)
Enable the SDK send PCM stream data to remote side from another source instead of
microphone. This function MUST be called first to send the PCM stream data to another
side.
Parameters
sessionId
The session ID of call.
state
Set to true to enable the send stream, or false to disable.
streamSamplesPer
Sec
The PCM stream data sample, in seconds. For example 8000 or 16000.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.sendPcmStreamToRemote (long sessionId, byte[] data,
int dataLength)
Send the audio stream in PCM format from another source instead of audio device
capturing (microphone).
Parameters
sessionId
Session ID of the call conversation.
data
The PCM audio stream data. It must be 16bit, mono.
dataLength
The size of data.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
Usually we should use it like below:
enableSendPcmStreamToRemote(sessionId, true, 16000);
sendPcmStreamToRemote(sessionId, data, dataSize);
You can't have too much audio data at one time as we have 100ms audio buffer only. Once
you put too much, data will be lost. It is recommended to send 20ms audio data every 20ms.
56
int com.portsip.PortSipSdk.enableSendVideoStreamToRemote (long sessionId,
boolean state)
Enable the SDK to send video stream data to remote side from another source instead of
camera.
This function MUST be called first to send the video stream data to another side.
Parameters
sessionId
The session ID of call.
state
Set to true to enable the send stream, or false to disable.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.sendVideoStreamToRemote (long sessionId, byte[] data,
int dataLength, int width, int height)
Send the video stream in i420 from another source instead of video device capturing
(camera).
Before calling this function, you MUST call the enableSendVideoStreamToRemote
function.
Parameters
sessionId
Session ID of the call conversation.
data
The video stream data. It must be in i420 format.
dataLength
The size of data.
width
The width of the video image.
height
The height of video image.
Returns
If the function succeeds, it will return value is 0. If the function fails, it will return a specific
error code.
57
RTP packets, Audio stream and video stream callback
Functions
l long com.portsip.PortSipSdk.enableRtpCallback (long sessionId, int mediaType, int
directionMode)
l void com.portsip.PortSipSdk.enableAudioStreamCallback (long sessionId, boolean enable, int
enum_direction)
l void com.portsip.PortSipSdk.enableVideoStreamCallback (long sessionId, int enum_direction)
Detailed Description
functions
Function Documentation
long com.portsip.PortSipSdk.enableRtpCallback (long sessionId, int mediaType, int
directionMode)
Set the RTP callbacks to allow access to the sent and received RTP packets.
Parameters
sessionId
The session ID of the call.
mediaType
RTP packet media type, 0 for audio, 1 for video , 2 for screen.
directionMode
RTP packet direction, 0 for sending, 1 for receiving.
Returns
If the function succeeds, it will return value is 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.enableAudioStreamCallback (long sessionId, boolean
enable, int enum_direction)
Enable/disable the audio stream callback. The onAudioRawCallback event will be
triggered if the callback is enabled.
Parameters
sessionId
The session ID of call.
enable
Set to true to enable audio stream callback, or false to stop the callback.
enum_direction
The audio stream callback mode. Supported modes include
ENUM_DIRECTION_NONE, ENUM_DIRECTION_SEND,
ENUM_DIRECTION_RECV ENUM_DIRECTION_SEND_RECV.
void com.portsip.PortSipSdk.enableVideoStreamCallback (long sessionId, int
enum_direction)
Enable/disable the video stream callback, the onVideoRawCallback event will be
triggered if the callback is enabled.
Parameters
sessionId
The session ID of call.
enum_direction
The video stream callback mode. Supported modes include
ENUM_DIRECTION_NONE, ENUM_DIRECTION_SEND,
ENUM_DIRECTION_RECV, ENUM_DIRECTION_SEND_RECV.
58
Record functions
Functions
l int com.portsip.PortSipSdk.startRecord (long sessionId, String recordFilePath, String
recordFileName, boolean appendTimeStamp, int audioChannels, int enum_fileFormat, int
enum_audioRecordMode, int enum_videoRecordMode)
l int com.portsip.PortSipSdk.stopRecord (long sessionId)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.startRecord (long sessionId, String recordFilePath,
String recordFileName, boolean appendTimeStamp, int audioChannels, int
enum_fileFormat, int enum_audioRecordMode, int enum_videoRecordMode)
Start recording the call.
Parameters
sessionId
The session ID of call conversation.
recordFilePath
The file path to save record file. It must be existent.
recordFileName
The file name of record file. For example audiorecord.wav or videorecord.avi.
appendTimeStamp
Set to true to append the timestamp to the name of the recording file.
audioChannels
Set to record file audio channels, 1 - mono 2 - stereo.
enum_fileFormat
The record file format, allow below values:
ENUM_FILE_FORMAT_WAVE = 1, ///< The record audio file is WAVE
format.
ENUM_FILE_FORMAT_AMR =2, ///< The record audio file is in AMR
format with all voice data compressed by AMR codec.
ENUM_FILE_FORMAT_MP3 = 3;///< The record audio file is in MP3
format.
ENUM_FILE_FORMAT_MP4 = 4;///< The record video file is in MP4(AAC
and H264) format.
enum_audioRecor
dMode
The audio record mode, allow below values:
ENUM_RECORD_MODE_NONE = 0, ///< Not Record.
ENUM_RECORD_MODE_RECV = 1, ///< Only record the received data.
ENUM_RECORD_MODE_SEND, ///< Only record send data.
ENUM_RECORD_MODE_BOTH ///< Record both received and sent data.
enum_videoRecord
Mode
Allow to set video record mode. Support to record received and/or sent video.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.stopRecord (long sessionId)
Stop recording.
Parameters
sessionId
The session ID of call conversation.
59
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
60
Play audio and video file and RTMP/RTSP stream functions
Functions
l int com.portsip.PortSipSdk.startPlayingFileToRemote (long sessionId, String fileUrl, boolean loop,
int playAudio)
l int com.portsip.PortSipSdk.stopPlayingFileToRemote (long sessionId)
l int com.portsip.PortSipSdk.startPlayingFileLocally (String fileUrl, boolean loop,
PortSIPVideoRenderer renderer)
l int com.portsip.PortSipSdk.stopPlayingFileLocally ()
l void com.portsip.PortSipSdk.audioPlayLoopbackTest (boolean enable)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.startPlayingFileToRemote (long sessionId, String fileUrl,
boolean loop, int playAudio)
Play an local file or RTSP/RTMP stream to remote party.
Parameters
sessionId
Session ID of the call.
fileUrl
The url or filepath, such as "/mnt/sdcard/test.avi".
loop
Set to false to stop playing video file when it is ended, or true to play it
repeatedly.
playAudio
0 - Not play file audio. 1 - Play file audio. 2 - Play file audio mix with Mic.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.stopPlayingFileToRemote (long sessionId)
Stop play file to remote side.
Parameters
sessionId
Session ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.startPlayingFileLocally (String fileUrl, boolean loop,
PortSIPVideoRenderer renderer)
Play an local file or RTSP/RTMP stream.
Parameters
fileUrl
The url or filepath, such as "/mnt/sdcard/test.avi".
loop
Set to false to stop playing video file when it is ended, or true to play it
repeatedly.
renderer
SurfaceView a SurfaceView for displaying the play image.
61
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.stopPlayingFileLocally ()
Stop play file locally.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.audioPlayLoopbackTest (boolean enable)
Used for testing loopback for the audio device.
Parameters
enable
Set to true to start testing audio loopback test; or set to false to stop.
62
Conference functions
Functions
l int com.portsip.PortSipSdk.createAudioConference ()
l int com.portsip.PortSipSdk.createVideoConference (PortSIPVideoRenderer
conferenceVideoWindow, int videoWidth, int videoHeight, int layout)
l void com.portsip.PortSipSdk.destroyConference ()
l int com.portsip.PortSipSdk.setConferenceVideoWindow (PortSIPVideoRenderer
conferenceVideoWindow)
l int com.portsip.PortSipSdk.joinToConference (long sessionId)
l int com.portsip.PortSipSdk.removeFromConference (long sessionId)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.createAudioConference ()
Create an audio conference. It will fail if the existing conference is not ended yet.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.createVideoConference (PortSIPVideoRenderer
conferenceVideoWindow, int videoWidth, int videoHeight, int layout)
Create a video conference. It will fail if the existing conference is not ended yet.
Parameters
conferenceVideoW
indow
SurfaceView The window used for displaying the conference video.
videoWidth
Width of conference video resolution
videoHeight
Height of conference video resolution
layout
Conference Video layout, default is 0 - Adaptive. 0 - Adaptive(1,3,5,6) 1 -
Only Local Video 2 - 2 video,PIP 3 - 2 video, Left and right 4 - 2 video, Up
and Down 5 - 3 video 6 - 4 split video 7 - 5 video
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
void com.portsip.PortSipSdk.destroyConference ()
End the exist conference.
int com.portsip.PortSipSdk.setConferenceVideoWindow (PortSIPVideoRenderer
conferenceVideoWindow)
Set the window for a conference that is used for displaying the received remote video
image.
Parameters
conferenceVideoW
SurfaceView The window which is used for displaying the conference video
63
indow
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.joinToConference (long sessionId)
Join a session into existing conference. If the call is in hold, it will be un-hold
automatically.
Parameters
sessionId
Session ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.removeFromConference (long sessionId)
Remove a session from an existing conference.
Parameters
sessionId
Session ID of the call.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
64
RTP and RTCP QOS functions
Functions
l int com.portsip.PortSipSdk.setAudioRtcpBandwidth (long sessionId, int BitsRR, int BitsRS, int
KBitsAS)
l int com.portsip.PortSipSdk.setVideoRtcpBandwidth (long sessionId, int BitsRR, int BitsRS, int
KBitsAS)
l int com.portsip.PortSipSdk.enableAudioQos (boolean state)
l int com.portsip.PortSipSdk.enableVideoQos (boolean state)
l int com.portsip.PortSipSdk.setVideoMTU (int mtu)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.setAudioRtcpBandwidth (long sessionId, int BitsRR, int
BitsRS, int KBitsAS)
Set the audio RTCP bandwidth parameters as RFC3556.
Parameters
sessionId
Set the audio RTCP bandwidth parameters as RFC3556.
BitsRR
The bits for the RR parameter.
BitsRS
The bits for the RS parameter.
KBitsAS
The Kbits for the AS parameter.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoRtcpBandwidth (long sessionId, int BitsRR, int
BitsRS, int KBitsAS)
Set the video RTCP bandwidth parameters as the RFC3556.
Parameters
sessionId
The session ID of call conversation.
BitsRR
The bits for the RR parameter.
BitsRS
The bits for the RS parameter.
KBitsAS
The Kbits for the AS parameter.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.enableAudioQos (boolean state)
Set the DSCP (differentiated services code point) value of QoS (Quality of Service) for
audio channel.
Parameters
state
Set to YES to enable audio QoS and DSCP value will be 46; or NO to disable
audio QoS and DSCP value will be 0.
65
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.enableVideoQos (boolean state)
Set the DSCP(differentiated services code point) value of QoS(Quality of Service) for
video channel.
Parameters
state
Set to YES to enable video QoS and DSCP value will be 34; or NO to disable
video QoS and DSCP value will be 0.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setVideoMTU (int mtu)
Set the MTU size for video RTP packet.
Parameters
mtu
Set MTU value. Allow values range 512 - 65507. Default is 14000.
Returns
If the function succeeds, the return value is 0. If the function fails, the return value is a
specific error code.
66
RTP statistics functions
Functions
l int com.portsip.PortSipSdk.getStatistics (long sessionId)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.getStatistics (long sessionId)
Obtain the statistics of channel. the event onStatistics will be triggered.
Parameters
sessionId
The session ID of call conversation.
Returns
If the function succeeds, it will return value is 0. If the function fails, it will return a specific
error code.
67
Audio effect functions
Functions
l void com.portsip.PortSipSdk.enableVAD (boolean state)
l void com.portsip.PortSipSdk.enableAEC (boolean state)
l void com.portsip.PortSipSdk.enableCNG (boolean state)
l void com.portsip.PortSipSdk.enableAGC (boolean state)
l void com.portsip.PortSipSdk.enableANS (boolean state)
Detailed Description
Function Documentation
void com.portsip.PortSipSdk.enableVAD (boolean state)
Enable/disable Voice Activity Detection(VAD).
Parameters
state
Set to true to enable VAD, or false to disable.
void com.portsip.PortSipSdk.enableAEC (boolean state)
Enable/disable AEC (Acoustic Echo Cancellation).
Parameters
state
Set to true to enable AEC, or false to disable.
void com.portsip.PortSipSdk.enableCNG (boolean state)
Enable/disable Comfort Noise Generator(CNG).
Parameters
state
Set to true to enable CNG, or false to disable.
void com.portsip.PortSipSdk.enableAGC (boolean state)
Enable/disable Automatic Gain Control(AGC).
Parameters
state
Set to true to enable AEC, or false to disable.
void com.portsip.PortSipSdk.enableANS (boolean state)
Enable/disable Audio Noise Suppression(ANS).
Parameters
state
Set to true to enable ANS, or false to disable.
68
Send OPTIONS/INFO/MESSAGE functions
Functions
l int com.portsip.PortSipSdk.sendOptions (String to, String sdp)
l int com.portsip.PortSipSdk.sendInfo (long sessionId, String mimeType, String subMimeType,
String infoContents)
l long com.portsip.PortSipSdk.sendMessage (long sessionId, String mimeType, String
subMimeType, byte[] message, int messageLength)
l long com.portsip.PortSipSdk.sendOutOfDialogMessage (String to, String mimeType, String
subMimeType, boolean isSMS, byte[] message, int messageLength)
l long com.portsip.PortSipSdk.setPresenceMode (int mode)
l long com.portsip.PortSipSdk.setDefaultSubscriptionTime (int secs)
l long com.portsip.PortSipSdk.setDefaultPublicationTime (int secs)
l long com.portsip.PortSipSdk.presenceSubscribe (String contact, String subject)
l int com.portsip.PortSipSdk.presenceTerminateSubscribe (long subscribeId)
l int com.portsip.PortSipSdk.presenceAcceptSubscribe (long subscribeId)
l int com.portsip.PortSipSdk.presenceRejectSubscribe (long subscribeId)
l int com.portsip.PortSipSdk.setPresenceStatus (long subscribeId, String statusText)
l long com.portsip.PortSipSdk.sendSubscription (String to, String eventName)
Send a SUBSCRIBE message to subscribe an event.
l int com.portsip.PortSipSdk.terminateSubscription (long subscribeId)
Detailed Description
Function Documentation
int com.portsip.PortSipSdk.sendOptions (String to, String sdp)
Send OPTIONS message.
Parameters
to
The recipient of OPTIONS message.
sdp
The SDP of OPTIONS message. It's optional if user does not want to send the
SDP with OPTIONS message.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return value a
specific error code.
int com.portsip.PortSipSdk.sendInfo (long sessionId, String mimeType, String
subMimeType, String infoContents)
Send a INFO message to remote side in dialog.
Parameters
sessionId
The session ID of call.
mimeType
The mime type of INFO message.
subMimeType
The sub mime type of INFO message.
infoContents
The contents that will 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.
69
long com.portsip.PortSipSdk.sendMessage (long sessionId, String mimeType,
String subMimeType, byte[] message, int messageLength)
Send a MESSAGE message to remote side in dialog.
Parameters
sessionId
The session ID of call.
mimeType
The mime type of MESSAGE message.
subMimeType
The sub mime type of MESSAGE message.
message
The contents that will be sent with MESSAGE message. Binary data allowed.
messageLength
The 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 that is less than 0.
Remarks
Example 1: Send a plain text message. Note: to send other languages text, please use the
UTF8 to encode the message before sending.
sendMessage(sessionId, "text", "plain", "hello",6);
Example 2: Send a binary message.
sendMessage(sessionId, "application", "vnd.3gpp.sms", binData, binDataSize);
long com.portsip.PortSipSdk.sendOutOfDialogMessage (String to, String mimeType,
String subMimeType, boolean isSMS, byte[] message, int messageLength)
Send a out of dialog MESSAGE message to remote side.
Parameters
to
The message receiver. Likes sip:[email protected]
mimeType
The mime type of MESSAGE message.
subMimeType
The sub mime type of MESSAGE message.
isSMS
Set to YES to specify "messagetype=SMS" in the To line, or NO to disable.
message
The contents that will be sent with MESSAGE message. Binary data allowed.
messageLength
The 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 that is less than 0.
Remarks
Example 1: Send a plain text message. Note: to send other languages text, please use the
UTF8 to encode the message before sending.
sendOutOfDialogMessage("sip:[email protected]", "text", "plain", "hello", 6);
Example 2: Send a binary message.
sendOutOfDialogMessage("sip:[email protected]","application",
"vnd.3gpp.sms", binData, binDataSize);
long com.portsip.PortSipSdk.setPresenceMode (int mode)
Indicate the SDK uses the P2P mode for presence or presence agent mode.
Parameters
mode
0 - P2P mode; 1 - Presence Agent mode. Default is P2P mode.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
70
Remarks
Since presence agent mode requires the PBX/Server support the PUBLISH, please ensure you
have your server and PortSIP PBX support this feature. For more details please visit:
https://www.portsip.com/portsip-pbx
long com.portsip.PortSipSdk.setDefaultSubscriptionTime (int secs)
Set the default expiration time to be used when creating a subscription.
Parameters
secs
The default expiration time of subscription.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
long com.portsip.PortSipSdk.setDefaultPublicationTime (int secs)
Set the default expiration time to be used when creating a publication.
Parameters
secs
The default expiration time of publication.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
long com.portsip.PortSipSdk.presenceSubscribe (String contact, String subject)
Send a SUBSCRIBE message for presence to a contact.
Parameters
contact
The target contact, it must be in the format of sip:[email protected].
subject
This subject text will be inserted into the SUBSCRIBE message. For example:
"Hello, I'm Jason".
The subject maybe is in UTF8 format. You should use UTF8 to decode it.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.presenceTerminateSubscribe (long subscribeId)
Terminate the given presence subscription.
Parameters
subscribeId
The ID of the subscription.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.presenceAcceptSubscribe (long subscribeId)
Accept the presence SUBSCRIBE request which received from contact.
Parameters
subscribeId
Subscription ID. When receiving a SUBSCRIBE request from contact, the
event onPresenceRecvSubscribe will be triggered. The event includes the
subscription ID.
71
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.presenceRejectSubscribe (long subscribeId)
Reject a presence SUBSCRIBE request received from contact.
Parameters
subscribeId
Subscription ID. When receiving a SUBSCRIBE request from contact, the
event onPresenceRecvSubscribe will be triggered. The event inclues the
subscription ID.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
int com.portsip.PortSipSdk.setPresenceStatus (long subscribeId, String statusText)
Send a NOTIFY message to contact to notify that presence status is
online/offline/changed.
Parameters
subscribeId
Subscription ID. When receiving a SUBSCRIBE request from contact, the
event onPresenceRecvSubscribe that includes the Subscription ID will be
triggered.
statusText
The state text of presence status. For example: "I'm here", offline must use
"offline"
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
long com.portsip.PortSipSdk.sendSubscription (String to, String eventName)
Send a SUBSCRIBE message to subscribe an event.
Parameters
to
The user/extension will be subscribed.
eventName
The event name to be subscribed.
Returns
If the function succeeds, it will return the ID of that SUBSCRIBE which is greater than 0. If
the function fails, it will return a specific error code which is less than 0.
Remarks
Example 1, below code indicates that user/extension 101 is subscribed to MWI (Message
Waiting notifications) for checking his voicemail: int32 mwiSubId =
sendSubscription("sip:[email protected]", "message-summary");
Example 2, to monitor a user/extension call status, You can use code:
sendSubscription(mSipLib, "100", "dialog"); Extension 100 refers to the user/extension to
be monitored. Once being monitored, when extension 100 hold a call or is ringing, the
onDialogStateUpdated callback will be triggered.
int com.portsip.PortSipSdk.terminateSubscription (long subscribeId)
Terminate the given subscription.
72
Parameters
subscribeId
The ID of the subscription.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific
error code.
Remarks
For example, if you want stop check the MWI, use below code:
terminateSubscription(mwiSubId);
73
Class Documentation
com.portsip.PortSipEnumDefine.AUDIOCODEC Interface
Reference
The documentation for this interface was generated from the following file:
l PortSipEnumDefine.java
74
com.portsip.PortSipEnumDefine.AudioDevice Enum
Reference
Public Attributes
l SPEAKER_PHONE
l WIRED_HEADSET
l EARPIECE
l BLUETOOTH
l NONE
Detailed Description
AudioDevice list possible audio devices that we currently support.
The documentation for this enum was generated from the following file:
l PortSipEnumDefine.java
75
com.portsip.OnPortSIPEvent Interface Reference
Public Member Functions
l void onRegisterSuccess (String reason, int code, String sipMessage)
l void onRegisterFailure (String reason, int code, String sipMessage)
l void onInviteIncoming (long sessionId, String callerDisplayName, String caller, String
calleeDisplayName, String callee, String audioCodecs, String videoCodecs, boolean existsAudio,
boolean existsVideo, String sipMessage)
l void onInviteTrying (long sessionId)
l void onInviteSessionProgress (long sessionId, String audioCodecs, String videoCodecs, boolean
existsEarlyMedia, boolean existsAudio, boolean existsVideo, String sipMessage)
l void onInviteRinging (long sessionId, String statusText, int statusCode, String sipMessage)
l void onInviteAnswered (long sessionId, String callerDisplayName, String caller, String
calleeDisplayName, String callee, String audioCodecs, String videoCodecs, boolean existsAudio,
boolean existsVideo, String sipMessage)
l void onInviteFailure (long sessionId, String callerDisplayName, String caller, String
calleeDisplayName, String callee, String reason, int code, String sipMessage)
l void onInviteUpdated (long sessionId, String audioCodecs, String videoCodecs, String
screenCodecs, boolean existsAudio, boolean existsVideo, boolean existsScreen, String
sipMessage)
l void onInviteConnected (long sessionId)
l void onInviteBeginingForward (String forwardTo)
l void onInviteClosed (long sessionId, String sipMessage)
l void onDialogStateUpdated (String BLFMonitoredUri, String BLFDialogState, String
BLFDialogId, String BLFDialogDirection)
l void onRemoteHold (long sessionId)
l void onRemoteUnHold (long sessionId, String audioCodecs, String videoCodecs, boolean
existsAudio, boolean existsVideo)
l void onReceivedRefer (long sessionId, long referId, String to, String from, String
referSipMessage)
l void onReferAccepted (long sessionId)
l void onReferRejected (long sessionId, String reason, int code)
l void onTransferTrying (long sessionId)
l void onTransferRinging (long sessionId)
l void onACTVTransferSuccess (long sessionId)
l void onACTVTransferFailure (long sessionId, String reason, int code)
l void onReceivedSignaling (long sessionId, String message)
l void onSendingSignaling (long sessionId, String message)
l void onWaitingVoiceMessage (String messageAccount, int urgentNewMessageCount, int
urgentOldMessageCount, int newMessageCount, int oldMessageCount)
l void onWaitingFaxMessage (String messageAccount, int urgentNewMessageCount, int
urgentOldMessageCount, int newMessageCount, int oldMessageCount)
l void onRecvDtmfTone (long sessionId, int tone)
l void onRecvOptions (String optionsMessage)
l void onRecvInfo (String infoMessage)
l void onRecvNotifyOfSubscription (long subscribeId, String notifyMessage, byte[] messageData,
int messageDataLength)
l void onPresenceRecvSubscribe (long subscribeId, String fromDisplayName, String from, String
subject)
l void onPresenceOnline (String fromDisplayName, String from, String stateText)
l void onPresenceOffline (String fromDisplayName, String from)
l void onRecvMessage (long sessionId, String mimeType, String subMimeType, byte[]
messageData, int messageDataLength)
l void onRecvOutOfDialogMessage (String fromDisplayName, String from, String toDisplayName,
String to, String mimeType, String subMimeType, byte[] messageData, int messageDataLength,
String sipMessage)
l void onSendMessageSuccess (long sessionId, long messageId, String sipMessage)
76
l void onSendMessageFailure (long sessionId, long messageId, String reason, int code, String
sipMessage)
l void onSendOutOfDialogMessageSuccess (long messageId, String fromDisplayName, String from,
String toDisplayName, String to, String sipMessage)
l void onSendOutOfDialogMessageFailure (long messageId, String fromDisplayName, String from,
String toDisplayName, String to, String reason, int code, String sipMessage)
l void onSubscriptionFailure (long subscribeId, int statusCode)
l void onSubscriptionTerminated (long subscribeId)
l void onPlayFileFinished (long sessionId, String fileName)
l void onStatistics (long sessionId, String statistics)
l void onAudioDeviceChanged (PortSipEnumDefine.AudioDevice audioDevice, Set<
PortSipEnumDefine.AudioDevice > devices)
l void onAudioFocusChange (int focusChange)
l void onRTPPacketCallback (long sessionId, int mediaType, int enum_direction, byte[] RTPPacket,
int packetSize)
l void onAudioRawCallback (long sessionId, int enum_direction, byte[] data, int dataLength, int
samplingFreqHz)
l void onVideoRawCallback (long sessionId, int enum_direction, int width, int height, byte[] data,
int dataLength)
The documentation for this interface was generated from the following file:
l OnPortSIPEvent.java
77
com.portsip.PortSIPCameraCapturer Class Reference
Inherits CapturerObserver.
Public Member Functions
l void InitializeVideoCapturer (Context applicationContext)
l void UnInitializeVideoCapturer ()
l void switchCamera (int newDeviceId)
l void onCapturerStarted (boolean success)
l void onCapturerStopped ()
l void onFrameCaptured (VideoFrame frame)
Public Attributes
l CameraVideoCapturer capturer
Member Function Documentation
void com.portsip.PortSIPCameraCapturer.onCapturerStarted (boolean success)
Notify if the capturer have been started successfully or not.
void com.portsip.PortSIPCameraCapturer.onCapturerStopped ()
Notify that the capturer has been stopped.
void com.portsip.PortSIPCameraCapturer.onFrameCaptured (VideoFrame frame)
Delivers a captured frame.
The documentation for this class was generated from the following file:
l PortSIPCameraCapturer.java
78
com.portsip.PortSipEnumDefine Class Reference
Classes
l interface AUDIOCODEC
l enum AudioDevice
Static Public Attributes
l static final int ENUM_AUDIOCODEC_G729 = 18
l static final int ENUM_AUDIOCODEC_PCMA = 8
l static final int ENUM_AUDIOCODEC_PCMU = 0
l static final int ENUM_AUDIOCODEC_GSM = 3
l static final int ENUM_AUDIOCODEC_G722 = 9
l static final int ENUM_AUDIOCODEC_ILBC = 97
l static final int ENUM_AUDIOCODEC_AMR = 98
l static final int ENUM_AUDIOCODEC_AMRWB = 99
l static final int ENUM_AUDIOCODEC_SPEEX = 100
l static final int ENUM_AUDIOCODEC_SPEEXWB =102
l static final int ENUM_AUDIOCODEC_ISACWB = 103
l static final int ENUM_AUDIOCODEC_ISACSWB =104
l static final int ENUM_AUDIOCODEC_OPUS =105
l static final int ENUM_AUDIOCODEC_DTMF = 101
l static final int ENUM_VIDEOCODEC_NONE = -1
l static final int ENUM_VIDEOCODEC_I420 = 133
l static final int ENUM_VIDEOCODEC_H264 = 125
l static final int ENUM_VIDEOCODEC_VP8 = 120
l static final int ENUM_VIDEOCODEC_VP9 = 122
l static final int ENUM_SRTPPOLICY_NONE = 0
l static final int ENUM_SRTPPOLICY_FORCE = 1
l static final int ENUM_SRTPPOLICY_PREFER = 2
l static final int ENUM_TRANSPORT_UDP = 0
l static final int ENUM_TRANSPORT_TLS = 1
l static final int ENUM_TRANSPORT_TCP = 2
l static final int ENUM_LOG_LEVEL_NONE = -1
l static final int ENUM_LOG_LEVEL_ERROR = 1
l static final int ENUM_LOG_LEVEL_WARNING = 2
l static final int ENUM_LOG_LEVEL_INFO = 3
l static final int ENUM_LOG_LEVEL_DEBUG = 4
l static final int ENUM_DTMF_MOTHOD_RFC2833 = 0
l static final int ENUM_DTMF_MOTHOD_INFO = 1
l static final int ENUM_DIRECTION_NONE = 0
l static final int ENUM_DIRECTION_SEND_RECV = 1
l static final int ENUM_DIRECTION_SEND = 2
l static final int ENUM_DIRECTION_RECV = 3
l static final int ENUM_RECORD_MODE_NONE = 0
l static final int ENUM_RECORD_MODE_RECV = 1
l static final int ENUM_RECORD_MODE_SEND = 2
l static final int ENUM_RECORD_MODE_BOTH = 3
l static final int ENUM_FILE_FORMAT_WAVE = 1
The record audio file is in WAVE format.
l static final int ENUM_FILE_FORMAT_AMR = 2
The record audio file is in AMR format - all voice data are compressed by AMR codec. Mono.
l static final int ENUM_FILE_FORMAT_MP3 = 3
The record audio file is in MP3 format.
79
l static final int ENUM_FILE_FORMAT_MP4 = 4
The record video file is in MP4(AAC and H264) format.
Member Data Documentation
final int com.portsip.PortSipEnumDefine.ENUM_VIDEOCODEC_NONE = -1[static]
Used in startRecord only
final int com.portsip.PortSipEnumDefine.ENUM_VIDEOCODEC_I420 = 133[static]
Used in startRecord only
final int com.portsip.PortSipEnumDefine.ENUM_DIRECTION_SEND_RECV =
1[static]
both received and sent
final int com.portsip.PortSipEnumDefine.ENUM_DIRECTION_SEND = 2[static]
Only the sent
final int com.portsip.PortSipEnumDefine.ENUM_DIRECTION_RECV = 3[static]
Only the received
final int com.portsip.PortSipEnumDefine.ENUM_RECORD_MODE_NONE = 0[static]
Not Recorded.
final int com.portsip.PortSipEnumDefine.ENUM_RECORD_MODE_RECV = 1[static]
Only record the received data.
final int com.portsip.PortSipEnumDefine.ENUM_RECORD_MODE_SEND = 2[static]
Only record the sent data.
final int com.portsip.PortSipEnumDefine.ENUM_RECORD_MODE_BOTH = 3[static]
Record both received and sent data.
The documentation for this class was generated from the following file:
l PortSipEnumDefine.java
80
com.portsip.PortSipErrorcode Class Reference
Static Public Attributes
l static final int ECoreErrorNone = 0
l static final int INVALID_SESSION_ID = -1
l static final int ECoreAlreadyInitialized = -60000
l static final int ECoreNotInitialized = -60001
l static final int ECoreSDKObjectNull = -60002
l static final int ECoreArgumentNull = -60003
l static final int ECoreInitializeWinsockFailure = -60004
l static final int ECoreUserNameAuthNameEmpty = -60005
l static final int ECoreInitiazeStackFailure = -60006
l static final int ECorePortOutOfRange = -60007
l static final int ECoreAddTcpTransportFailure = -60008
l static final int ECoreAddTlsTransportFailure = -60009
l static final int ECoreAddUdpTransportFailure = -60010
l static final int ECoreNotSupportMediaType = -60011
l static final int ECoreNotSupportDTMFValue = -60012
l static final int ECoreAlreadyRegistered = -60021
l static final int ECoreSIPServerEmpty = -60022
l static final int ECoreExpiresValueTooSmall = -60023
l static final int ECoreCallIdNotFound = -60024
l static final int ECoreNotRegistered = -60025
l static final int ECoreCalleeEmpty = -60026
l static final int ECoreInvalidUri = -60027
l static final int ECoreAudioVideoCodecEmpty = -60028
l static final int ECoreNoFreeDialogSession = -60029
l static final int ECoreCreateAudioChannelFailed = -60030
l static final int ECoreSessionTimerValueTooSmall = -60040
l static final int ECoreAudioHandleNull = -60041
l static final int ECoreVideoHandleNull = -60042
l static final int ECoreCallIsClosed = -60043
l static final int ECoreCallAlreadyHold = -60044
l static final int ECoreCallNotEstablished = -60045
l static final int ECoreCallNotHold = -60050
l static final int ECoreSipMessaegEmpty = -60051
l static final int ECoreSipHeaderNotExist = -60052
l static final int ECoreSipHeaderValueEmpty = -60053
l static final int ECoreSipHeaderBadFormed = -60054
l static final int ECoreBufferTooSmall = -60055
l static final int ECoreSipHeaderValueListEmpty = -60056
l static final int ECoreSipHeaderParserEmpty = -60057
l static final int ECoreSipHeaderValueListNull = -60058
l static final int ECoreSipHeaderNameEmpty = -60059
l static final int ECoreAudioSampleNotmultiple = -60060
l static final int ECoreAudioSampleOutOfRange = -60061
l static final int ECoreInviteSessionNotFound = -60062
l static final int ECoreStackException = -60063
l static final int ECoreMimeTypeUnknown = -60064
l static final int ECoreDataSizeTooLarge = -60065
l static final int ECoreSessionNumsOutOfRange = -60066
l static final int ECoreNotSupportCallbackMode = -60067
l static final int ECoreNotFoundSubscribeId = -60068
l static final int ECoreCodecNotSupport = -60069
l static final int ECoreCodecParameterNotSupport = -60070
l static final int ECorePayloadOutofRange = -60071
l static final int ECorePayloadHasExist = -60072
l static final int ECoreFixPayloadCantChange = -60073
81
l static final int ECoreCodecTypeInvalid = -60074
l static final int ECoreCodecWasExist = -60075
l static final int ECorePayloadTypeInvalid = -60076
l static final int ECoreArgumentTooLong = -60077
l static final int ECoreMiniRtpPortMustIsEvenNum = -60078
l static final int ECoreCallInHold = -60079
l static final int ECoreNotIncomingCall = -60080
l static final int ECoreCreateMediaEngineFailure = -60081
l static final int ECoreAudioCodecEmptyButAudioEnabled = -60082
l static final int ECoreVideoCodecEmptyButVideoEnabled = -60083
l static final int ECoreNetworkInterfaceUnavailable = -60084
l static final int ECoreWrongDTMFTone = -60085
l static final int ECoreWrongLicenseKey = -60086
l static final int ECoreTrialVersionLicenseKey = -60087
l static final int ECoreOutgoingAudioMuted = -60088
l static final int ECoreOutgoingVideoMuted = -60089
l static final int ECoreFailedCreateSdp = -60090
l static final int ECoreTrialVersionExpired = -60091
l static final int ECoreStackFailure = -60092
l static final int ECoreTransportExists = -60093
l static final int ECoreUnsupportTransport = -60094
l static final int ECoreAllowOnlyOneUser = -60095
l static final int ECoreUserNotFound = -60096
l static final int ECoreTransportsIncorrect = -60097
l static final int ECoreCreateTransportFailure = -60098
l static final int ECoreTransportNotSet = -60099
l static final int ECoreECreateSignalingFailure = -60100
l static final int ECoreArgumentIncorrect = -60101
l static final int ECoreIVRObjectNull = -61001
l static final int ECoreIVRIndexOutOfRange = -61002
l static final int ECoreIVRReferFailure = -61003
l static final int ECoreIVRWaitingTimeOut = -61004
l static final int EAudioFileNameEmpty = -70000
l static final int EAudioChannelNotFound = -70001
l static final int EAudioStartRecordFailure = -70002
l static final int EAudioRegisterRecodingFailure = -70003
l static final int EAudioRegisterPlaybackFailure = -70004
l static final int EAudioGetStatisticsFailure = -70005
l static final int EAudioPlayFileAlreadyEnable = -70006
l static final int EAudioPlayObjectNotExist = -70007
l static final int EAudioPlaySteamNotEnabled = -70008
l static final int EAudioRegisterCallbackFailure = -70009
l static final int EAudioCreateAudioConferenceFailure = -70010
l static final int EAudioOpenPlayFileFailure = -70011
l static final int EAudioPlayFileModeNotSupport = -70012
l static final int EAudioPlayFileFormatNotSupport = -70013
l static final int EAudioPlaySteamAlreadyEnabled = -70014
l static final int EAudioCreateRecordFileFailure = -70015
l static final int EAudioCodecNotSupport = -70016
l static final int EAudioPlayFileNotEnabled = -70017
l static final int EAudioPlayFileUnknowSeekOrigin = -70018
l static final int EAudioCantSetDeviceIdDuringCall =-70019
l static final int EAudioVolumeOutOfRange =-70020
l static final int EVideoFileNameEmpty = -80000
l static final int EVideoGetDeviceNameFailure = -80001
l static final int EVideoGetDeviceIdFailure = -80002
l static final int EVideoStartCaptureFailure = -80003
l static final int EVideoChannelNotFound = -80004
l static final int EVideoStartSendFailure = -80005
l static final int EVideoGetStatisticsFailure = -80006
82
l static final int EVideoStartPlayAviFailure = -80007
l static final int EVideoSendAviFileFailure = -80008
l static final int EVideoRecordUnknowCodec = -80009
l static final int EVideoCantSetDeviceIdDuringCall = -80010
l static final int EVideoUnsupportCaptureRotate = -80011
l static final int VideoUnsupportCaptureResolution = -80012
l static final int ECameraSwitchTooOften = -80013
l static final int EMTUOutOfRange = -80014
l static final int EDeviceGetDeviceNameFailure = -90001
The documentation for this class was generated from the following file:
l PortSipErrorcode.java
83
com.portsip.PortSipSdk Class Reference
Inherits AppRTCAudioManager.AudioManagerEvents.
Classes
l class MainHandler
Public Member Functions
l void onAudioDeviceChanged (AppRTCAudioManager.AudioDevice innerAdioDevice, Set<
AppRTCAudioManager.AudioDevice > innerSet)
l void onAudioFocusChange (int focusChange)
l PortSipSdk (Context context)
l int 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)
l void unInitialize ()
l int setInstanceId (String instanceId)
l int setUser (String userName, String displayName, String authName, String password, String
userDomain, String SIPServer, int SIPServerPort, String STUNServer, int STUNServerPort,
String outboundServer, int outboundServerPort)
l void removeUser ()
remove user account info.
l int registerServer (int expires, int retryTimes)
l int refreshRegistration (int expires)
l int unRegisterServer (int waitMS)
l int setDisplayName (String displayName)
l int setLicenseKey (String key)
l int addAudioCodec (int enum_audiocodec)
l int addVideoCodec (int enum_videocodec)
l boolean isAudioCodecEmpty ()
l boolean isVideoCodecEmpty ()
l int setAudioCodecPayloadType (int enum_audiocodec, int payloadType)
l int setVideoCodecPayloadType (int enum_videocodec, int payloadType)
l void clearAudioCodec ()
l void clearVideoCodec ()
l int setAudioCodecParameter (int enum_audiocodec, String sdpParameter)
l int setVideoCodecParameter (int enum_videocodec, String sdpParameter)
l String getVersion ()
l int enableRport (boolean enable)
l int enableEarlyMedia (boolean enable)
Enable/disable rport(RFC3581).
l int enablePriorityIPv6Domain (boolean enable)
l int setUriUserEncoding (String character, boolean enable)
l int setReliableProvisional (int mode)
l int enable3GppTags (boolean enable)
l void enableCallbackSignaling (boolean enableSending, boolean enableReceived)
l void setSrtpPolicy (int enum_srtppolicy)
l int setRtpPortRange (int minimumRtpPort, int maximumRtpPort)
l int enableCallForward (boolean forBusyOnly, String forwardTo)
l int disableCallForward ()
l int enableSessionTimer (int timerSeconds)
l void disableSessionTimer ()
l void setDoNotDisturb (boolean state)
l void enableAutoCheckMwi (boolean state)
84
l int setRtpKeepAlive (boolean state, int keepAlivePayloadType, int deltaTransmitTimeMS)
l int setKeepAliveTime (int keepAliveTime)
l int setAudioSamples (int ptime, int maxptime)
l int addSupportedMimeType (String methodName, String mimeType, String subMimeType)
l String getSipMessageHeaderValue (String sipMessage, String headerName)
l long addSipMessageHeader (long sessionId, String methodName, int msgType, String
headerName, String headerValue)
l int removeAddedSipMessageHeader (long addedSipMessageId)
l void clearAddedSipMessageHeaders ()
l long modifySipMessageHeader (long sessionId, String methodName, int msgType, String
headerName, String headerValue)
l int removeModifiedSipMessageHeader (long modifiedSipMessageId)
l void clearModifiedSipMessageHeaders ()
l int setVideoDeviceId (int deviceId)
l int setVideoOrientation (int rotation)
l int enableVideoHardwareCodec (boolean enableHWEncoder, boolean enableHWDecoder)
l int setVideoResolution (int width, int height)
l int setAudioBitrate (long sessionId, int enum_audiocodec, int bitrateKbps)
l int setVideoBitrate (long sessionId, int bitrateKbps)
l int setVideoFrameRate (long sessionId, int frameRate)
l int sendVideo (long sessionId, boolean send)
l int setRemoteVideoWindow (long sessionId, PortSIPVideoRenderer renderer)
l int setRemoteScreenWindow (long sessionId, PortSIPVideoRenderer renderer)
l void displayLocalVideo (boolean state, boolean mirror, PortSIPVideoRenderer renderer)
l int setVideoNackStatus (boolean state)
l int setChannelOutputVolumeScaling (long sessionId, int scaling)
l int setChannelInputVolumeScaling (long sessionId, int scaling)
l void enableAudioManager (boolean state)
l Set< PortSipEnumDefine.AudioDevice > getAudioDevices ()
l int setAudioDevice (PortSipEnumDefine.AudioDevice defaultDevice)
l long call (String callee, boolean sendSdp, boolean videoCall)
l int rejectCall (long sessionId, int code)
l int hangUp (long sessionId)
l int answerCall (long sessionId, boolean videoCall)
l int updateCall (long sessionId, boolean enableAudio, boolean enableVideo)
l int hold (long sessionId)
l int unHold (long sessionId)
l int muteSession (long sessionId, boolean muteIncomingAudio, boolean muteOutgoingAudio,
boolean muteIncomingVideo, boolean muteOutgoingVideo)
l int forwardCall (long sessionId, String forwardTo)
l long pickupBLFCall (String replaceDialogId, boolean videoCall)
l int sendDtmf (long sessionId, int enum_dtmfMethod, int code, int dtmfDuration, boolean
playDtmfTone)
l int refer (long sessionId, String referTo)
l int attendedRefer (long sessionId, long replaceSessionId, String referTo)
l int attendedRefer2 (long sessionId, long replaceSessionId, String replaceMethod, String target,
String referTo)
l int outOfDialogRefer (long replaceSessionId, String replaceMethod, String target, String referTo)
l long acceptRefer (long referId, String referSignaling)
l int rejectRefer (long referId)
l int enableSendPcmStreamToRemote (long sessionId, boolean state, int streamSamplesPerSec)
l int sendPcmStreamToRemote (long sessionId, byte[] data, int dataLength)
l int enableSendVideoStreamToRemote (long sessionId, boolean state)
l int sendVideoStreamToRemote (long sessionId, byte[] data, int dataLength, int width, int height)
l long enableRtpCallback (long sessionId, int mediaType, int directionMode)
l void enableAudioStreamCallback (long sessionId, boolean enable, int enum_direction)
l void enableVideoStreamCallback (long sessionId, int enum_direction)
l int startRecord (long sessionId, String recordFilePath, String recordFileName, boolean
appendTimeStamp, int audioChannels, int enum_fileFormat, int enum_audioRecordMode, int
enum_videoRecordMode)
85
l int stopRecord (long sessionId)
l int startPlayingFileToRemote (long sessionId, String fileUrl, boolean loop, int playAudio)
l int stopPlayingFileToRemote (long sessionId)
l int startPlayingFileLocally (String fileUrl, boolean loop, PortSIPVideoRenderer renderer)
l int stopPlayingFileLocally ()
l void audioPlayLoopbackTest (boolean enable)
l int createAudioConference ()
l int createVideoConference (PortSIPVideoRenderer conferenceVideoWindow, int videoWidth, int
videoHeight, int layout)
l void destroyConference ()
l int setConferenceVideoWindow (PortSIPVideoRenderer conferenceVideoWindow)
l int joinToConference (long sessionId)
l int removeFromConference (long sessionId)
l int setAudioRtcpBandwidth (long sessionId, int BitsRR, int BitsRS, int KBitsAS)
l int setVideoRtcpBandwidth (long sessionId, int BitsRR, int BitsRS, int KBitsAS)
l int enableAudioQos (boolean state)
l int enableVideoQos (boolean state)
l int setVideoMTU (int mtu)
l int getStatistics (long sessionId)
l void enableVAD (boolean state)
l void enableAEC (boolean state)
l void enableCNG (boolean state)
l void enableAGC (boolean state)
l void enableANS (boolean state)
l int sendOptions (String to, String sdp)
l int sendInfo (long sessionId, String mimeType, String subMimeType, String infoContents)
l long sendMessage (long sessionId, String mimeType, String subMimeType, byte[] message, int
messageLength)
l long sendOutOfDialogMessage (String to, String mimeType, String subMimeType, boolean
isSMS, byte[] message, int messageLength)
l long setPresenceMode (int mode)
l long setDefaultSubscriptionTime (int secs)
l long setDefaultPublicationTime (int secs)
l long presenceSubscribe (String contact, String subject)
l int presenceTerminateSubscribe (long subscribeId)
l int presenceAcceptSubscribe (long subscribeId)
l int presenceRejectSubscribe (long subscribeId)
l int setPresenceStatus (long subscribeId, String statusText)
l long sendSubscription (String to, String eventName)
Send a SUBSCRIBE message to subscribe an event.
l int terminateSubscription (long subscribeId)
l void receiveSIPEvent (long sipCommand)
l void rtpPacketCallback (long sessionId, int mediaType, int directionMode, byte[] RTPPacket, int
packetSize)
l void audioRawCallback (long sessionId, int enum_audioCallbackMode, byte[] data, int
dataLength, int samplingFreqHz)
l void videoRawCallback (long sessionId, int enum_videoCallbackMode, int width, int height,
byte[] data, int dataLength)
l void setOnPortSIPEvent (OnPortSIPEvent l)
Protected Member Functions
l void finalize ()
Detailed Description
86
Author
PortSIP Solutions, Inc. All rights reserved.
Version
19
The documentation for this class was generated from the following file:
l PortSipSdk.java
87
com.portsip.PortSIPVideoRenderer Class Reference
Inherits SurfaceViewRenderer.
Classes
l enum ScalingType
Public Member Functions
l PortSIPVideoRenderer (Context context)
l PortSIPVideoRenderer (Context context, AttributeSet attrs)
l void setScalingType (ScalingType scalingType)
l void setVideoRotation (int rotation)
l void release ()
l void surfaceDestroyed (SurfaceHolder holder)
Detailed Description
Display the video stream on a SurfaceView.
Constructor & Destructor Documentation
com.portsip.PortSIPVideoRenderer.PortSIPVideoRenderer (Context context)
Standard View constructor. In order to render something, you must first call init().
com.portsip.PortSIPVideoRenderer.PortSIPVideoRenderer (Context context,
AttributeSet attrs)
Standard View constructor. In order to render something, you must first call init().
Member Function Documentation
void com.portsip.PortSIPVideoRenderer.setVideoRotation (int rotation)
Standard View constructor. In order to render something, you must first call init().
void com.portsip.PortSIPVideoRenderer.release ()
Block until any pending frame is returned and all GL resources released, even if an
interrupt occurs. If an interrupt occurs during release(), the interrupt flag will be set. This
function should be called before the Activity is destroyed and the EGLContext is still
valid. If you don't call this function, the GL resources might leak.
The documentation for this class was generated from the following file:
l PortSIPVideoRenderer.java
88
Index
acceptRefer
Refer functions, 53
Access SIP message header functions, 41
addSipMessageHeader, 41
clearAddedSipMessageHeaders, 42
clearModifiedSipMessageHeaders, 43
getSipMessageHeaderValue, 41
modifySipMessageHeader, 42
removeAddedSipMessageHeader, 41
removeModifiedSipMessageHeader, 42
addAudioCodec
Audio and video codecs functions, 32
Additional settings functions, 35
addSupportedMimeType, 39
disableCallForward, 37
disableSessionTimer, 38
enable3GppTags, 36
enableAutoCheckMwi, 38
enableCallbackSignaling, 37
enableCallForward, 37
enableEarlyMedia, 35
enablePriorityIPv6Domain, 36
enableRport, 35
enableSessionTimer, 38
getVersion, 35
setAudioSamples, 39
setDoNotDisturb, 38
setKeepAliveTime, 39
setReliableProvisional, 36
setRtpKeepAlive, 38
setRtpPortRange, 37
setSrtpPolicy, 37
setUriUserEncoding, 36
addSipMessageHeader
Access SIP message header functions, 41
addSupportedMimeType
Additional settings functions, 39
addVideoCodec
Audio and video codecs functions, 32
answerCall
Call functions, 49
attendedRefer
Refer functions, 52
attendedRefer2
Refer functions, 53
Audio and video codecs functions, 32
addAudioCodec, 32
addVideoCodec, 32
clearAudioCodec, 33
clearVideoCodec, 33
isAudioCodecEmpty, 32
isVideoCodecEmpty, 33
setAudioCodecParameter, 33
setAudioCodecPayloadType, 33
setVideoCodecParameter, 34
setVideoCodecPayloadType, 33
Audio and video functions, 44
displayLocalVideo, 46
enableAudioManager, 47
enableVideoHardwareCodec, 44
getAudioDevices, 47
sendVideo, 46
setAudioBitrate, 45
setAudioDevice, 47
setChannelInputVolumeScaling, 47
setChannelOutputVolumeScaling, 46
setRemoteScreenWindow, 46
setRemoteVideoWindow, 46
setVideoBitrate, 45
setVideoDeviceId, 44
setVideoFrameRate, 45
setVideoNackStatus, 46
setVideoOrientation, 44
setVideoResolution, 45
audio device changed,Play audio and video file
finished events, 23
onAudioDeviceChanged, 23
onAudioFocusChange, 23
onPlayFileFinished, 23
onStatistics, 23
Audio effect functions, 67
enableAEC, 67
enableAGC, 67
enableANS, 67
enableCNG, 67
enableVAD, 67
audioPlayLoopbackTest
Play audio and video file and
RTMP/RTSP stream functions, 61
call
Call functions, 48
Call events, 10
onDialogStateUpdated, 13
onInviteAnswered, 11
onInviteBeginingForward, 12
onInviteClosed, 12
onInviteConnected, 12
onInviteFailure, 12
onInviteIncoming, 10
onInviteRinging, 11
onInviteSessionProgress, 11
onInviteTrying, 11
onInviteUpdated, 12
onRemoteHold, 13
onRemoteUnHold, 13
Call functions, 48
answerCall, 49
call, 48
forwardCall, 50
hangUp, 49
hold, 49
muteSession, 50
89
pickupBLFCall, 50
rejectCall, 48
sendDtmf, 51
unHold, 50
updateCall, 49
clearAddedSipMessageHeaders
Access SIP message header functions, 42
clearAudioCodec
Audio and video codecs functions, 33
clearModifiedSipMessageHeaders
Access SIP message header functions, 43
clearVideoCodec
Audio and video codecs functions, 33
com.portsip.OnPortSIPEvent, 75
com.portsip.PortSIPCameraCapturer, 77
onCapturerStarted, 77
onCapturerStopped, 77
onFrameCaptured, 77
com.portsip.PortSipEnumDefine, 78
ENUM_DIRECTION_RECV, 79
ENUM_DIRECTION_SEND, 79
ENUM_DIRECTION_SEND_RECV, 79
ENUM_RECORD_MODE_BOTH, 79
ENUM_RECORD_MODE_NONE, 79
ENUM_RECORD_MODE_RECV, 79
ENUM_RECORD_MODE_SEND, 79
ENUM_VIDEOCODEC_I420, 79
ENUM_VIDEOCODEC_NONE, 79
com.portsip.PortSipEnumDefine.AUDIOCOD
EC, 73
com.portsip.PortSipEnumDefine.AudioDevice,
74
com.portsip.PortSipErrorcode, 80
com.portsip.PortSipSdk, 83
com.portsip.PortSIPVideoRenderer, 87
PortSIPVideoRenderer, 87
release, 87
setVideoRotation, 87
Conference functions, 62
createAudioConference, 62
createVideoConference, 62
destroyConference, 62
joinToConference, 63
removeFromConference, 63
setConferenceVideoWindow, 62
createAudioConference
Conference functions, 62
createVideoConference
Conference functions, 62
destroyConference
Conference functions, 62
disableCallForward
Additional settings functions, 37
disableSessionTimer
Additional settings functions, 38
displayLocalVideo
Audio and video functions, 46
DTMF events, 18
onRecvDtmfTone, 18
enable3GppTags
Additional settings functions, 36
enableAEC
Audio effect functions, 67
enableAGC
Audio effect functions, 67
enableANS
Audio effect functions, 67
enableAudioManager
Audio and video functions, 47
enableAudioQos
RTP and RTCP QOS functions, 64
enableAudioStreamCallback
RTP packets, Audio stream and video
stream callback, 57
enableAutoCheckMwi
Additional settings functions, 38
enableCallbackSignaling
Additional settings functions, 37
enableCallForward
Additional settings functions, 37
enableCNG
Audio effect functions, 67
enableEarlyMedia
Additional settings functions, 35
enablePriorityIPv6Domain
Additional settings functions, 36
enableRport
Additional settings functions, 35
enableRtpCallback
RTP packets, Audio stream and video
stream callback, 57
enableSendPcmStreamToRemote
Send audio and video stream functions,
55
enableSendVideoStreamToRemote
Send audio and video stream functions,
56
enableSessionTimer
Additional settings functions, 38
enableVAD
Audio effect functions, 67
enableVideoHardwareCodec
Audio and video functions, 44
enableVideoQos
RTP and RTCP QOS functions, 65
enableVideoStreamCallback
RTP packets, Audio stream and video
stream callback, 57
ENUM_DIRECTION_RECV
com.portsip.PortSipEnumDefine, 79
ENUM_DIRECTION_SEND
com.portsip.PortSipEnumDefine, 79
ENUM_DIRECTION_SEND_RECV
com.portsip.PortSipEnumDefine, 79
ENUM_RECORD_MODE_BOTH
com.portsip.PortSipEnumDefine, 79
ENUM_RECORD_MODE_NONE
com.portsip.PortSipEnumDefine, 79
ENUM_RECORD_MODE_RECV
com.portsip.PortSipEnumDefine, 79
90
ENUM_RECORD_MODE_SEND
com.portsip.PortSipEnumDefine, 79
ENUM_VIDEOCODEC_I420
com.portsip.PortSipEnumDefine, 79
ENUM_VIDEOCODEC_NONE
com.portsip.PortSipEnumDefine, 79
forwardCall
Call functions, 50
getAudioDevices
Audio and video functions, 47
getSipMessageHeaderValue
Access SIP message header functions, 41
getStatistics
RTP statistics functions, 66
getVersion
Additional settings functions, 35
hangUp
Call functions, 49
hold
Call functions, 49
INFO/OPTIONS message events, 19
onRecvInfo, 19
onRecvNotifyOfSubscription, 19
onRecvOptions, 19
initialize
Initialize and register functions, 28
Initialize and register functions, 28
initialize, 28
refreshRegistration, 30
registerServer, 30
setDisplayName, 30
setInstanceId, 29
setLicenseKey, 31
setUser, 29
unInitialize, 29
unRegisterServer, 30
isAudioCodecEmpty
Audio and video codecs functions, 32
isVideoCodecEmpty
Audio and video codecs functions, 33
joinToConference
Conference functions, 63
modifySipMessageHeader
Access SIP message header functions, 42
muteSession
Call functions, 50
MWI events, 17
onWaitingFaxMessage, 17
onWaitingVoiceMessage, 17
onACTVTransferFailure
Refer events, 15
onACTVTransferSuccess
Refer events, 15
onAudioDeviceChanged
audio device changed,Play audio and
video file finished events, 23
onAudioFocusChange
audio device changed,Play audio and
video file finished events, 23
onAudioRawCallback
RTP callback events, 25
onCapturerStarted
com.portsip.PortSIPCameraCapturer, 77
onCapturerStopped
com.portsip.PortSIPCameraCapturer, 77
onDialogStateUpdated
Call events, 13
onFrameCaptured
com.portsip.PortSIPCameraCapturer, 77
onInviteAnswered
Call events, 11
onInviteBeginingForward
Call events, 12
onInviteClosed
Call events, 12
onInviteConnected
Call events, 12
onInviteFailure
Call events, 12
onInviteIncoming
Call events, 10
onInviteRinging
Call events, 11
onInviteSessionProgress
Call events, 11
onInviteTrying
Call events, 11
onInviteUpdated
Call events, 12
onPlayFileFinished
audio device changed,Play audio and
video file finished events, 23
onPresenceOffline
Presence events, 20
onPresenceOnline
Presence events, 20
onPresenceRecvSubscribe
Presence events, 20
onReceivedRefer
Refer events, 14
onReceivedSignaling
Signaling events, 16
onRecvDtmfTone
DTMF events, 18
onRecvInfo
INFO/OPTIONS message events, 19
onRecvMessage
Presence events, 21
onRecvNotifyOfSubscription
INFO/OPTIONS message events, 19
onRecvOptions
INFO/OPTIONS message events, 19
onRecvOutOfDialogMessage
Presence events, 21
onReferAccepted
Refer events, 14
onReferRejected
Refer events, 14
onRegisterFailure
Register events, 9
91
onRegisterSuccess
Register events, 9
onRemoteHold
Call events, 13
onRemoteUnHold
Call events, 13
onRTPPacketCallback
RTP callback events, 25
onSendingSignaling
Signaling events, 16
onSendMessageFailure
Presence events, 21
onSendMessageSuccess
Presence events, 21
onSendOutOfDialogMessageFailure
Presence events, 22
onSendOutOfDialogMessageSuccess
Presence events, 22
onStatistics
audio device changed,Play audio and
video file finished events, 23
onSubscriptionFailure
Presence events, 22
onSubscriptionTerminated
Presence events, 22
onTransferRinging
Refer events, 15
onTransferTrying
Refer events, 14
onVideoRawCallback
RTP callback events, 26
onWaitingFaxMessage
MWI events, 17
onWaitingVoiceMessage
MWI events, 17
outOfDialogRefer
Refer functions, 53
pickupBLFCall
Call functions, 50
Play audio and video file and RTMP/RTSP
stream functions, 60
audioPlayLoopbackTest, 61
startPlayingFileLocally, 60
startPlayingFileToRemote, 60
stopPlayingFileLocally, 61
stopPlayingFileToRemote, 60
PortSIPVideoRenderer
com.portsip.PortSIPVideoRenderer, 87
Presence events, 20
onPresenceOffline, 20
onPresenceOnline, 20
onPresenceRecvSubscribe, 20
onRecvMessage, 21
onRecvOutOfDialogMessage, 21
onSendMessageFailure, 21
onSendMessageSuccess, 21
onSendOutOfDialogMessageFailure, 22
onSendOutOfDialogMessageSuccess, 22
onSubscriptionFailure, 22
onSubscriptionTerminated, 22
presenceAcceptSubscribe
Send OPTIONS/INFO/MESSAGE
functions, 70
presenceRejectSubscribe
Send OPTIONS/INFO/MESSAGE
functions, 71
presenceSubscribe
Send OPTIONS/INFO/MESSAGE
functions, 70
presenceTerminateSubscribe
Send OPTIONS/INFO/MESSAGE
functions, 70
Record functions, 58
startRecord, 58
stopRecord, 58
refer
Refer functions, 52
Refer events, 14
onACTVTransferFailure, 15
onACTVTransferSuccess, 15
onReceivedRefer, 14
onReferAccepted, 14
onReferRejected, 14
onTransferRinging, 15
onTransferTrying, 14
Refer functions, 52
acceptRefer, 53
attendedRefer, 52
attendedRefer2, 53
outOfDialogRefer, 53
refer, 52
rejectRefer, 53
refreshRegistration
Initialize and register functions, 30
Register events, 9
onRegisterFailure, 9
onRegisterSuccess, 9
registerServer
Initialize and register functions, 30
rejectCall
Call functions, 48
rejectRefer
Refer functions, 53
release
com.portsip.PortSIPVideoRenderer, 87
removeAddedSipMessageHeader
Access SIP message header functions, 41
removeFromConference
Conference functions, 63
removeModifiedSipMessageHeader
Access SIP message header functions, 42
RTP and RTCP QOS functions, 64
enableAudioQos, 64
enableVideoQos, 65
setAudioRtcpBandwidth, 64
setVideoMTU, 65
setVideoRtcpBandwidth, 64
RTP callback events, 25
onAudioRawCallback, 25
onRTPPacketCallback, 25
92
onVideoRawCallback, 26
RTP packets, Audio stream and video stream
callback, 57
enableAudioStreamCallback, 57
enableRtpCallback, 57
enableVideoStreamCallback, 57
RTP statistics functions, 66
getStatistics, 66
SDK Callback events, 8
SDK functions, 27
Send audio and video stream functions, 55
enableSendPcmStreamToRemote, 55
enableSendVideoStreamToRemote, 56
sendPcmStreamToRemote, 55
sendVideoStreamToRemote, 56
Send OPTIONS/INFO/MESSAGE functions,
68
presenceAcceptSubscribe, 70
presenceRejectSubscribe, 71
presenceSubscribe, 70
presenceTerminateSubscribe, 70
sendInfo, 68
sendMessage, 69
sendOptions, 68
sendOutOfDialogMessage, 69
sendSubscription, 71
setDefaultPublicationTime, 70
setDefaultSubscriptionTime, 70
setPresenceMode, 69
setPresenceStatus, 71
terminateSubscription, 71
sendDtmf
Call functions, 51
sendInfo
Send OPTIONS/INFO/MESSAGE
functions, 68
sendMessage
Send OPTIONS/INFO/MESSAGE
functions, 69
sendOptions
Send OPTIONS/INFO/MESSAGE
functions, 68
sendOutOfDialogMessage
Send OPTIONS/INFO/MESSAGE
functions, 69
sendPcmStreamToRemote
Send audio and video stream functions,
55
sendSubscription
Send OPTIONS/INFO/MESSAGE
functions, 71
sendVideo
Audio and video functions, 46
sendVideoStreamToRemote
Send audio and video stream functions,
56
setAudioBitrate
Audio and video functions, 45
setAudioCodecParameter
Audio and video codecs functions, 33
setAudioCodecPayloadType
Audio and video codecs functions, 33
setAudioDevice
Audio and video functions, 47
setAudioRtcpBandwidth
RTP and RTCP QOS functions, 64
setAudioSamples
Additional settings functions, 39
setChannelInputVolumeScaling
Audio and video functions, 47
setChannelOutputVolumeScaling
Audio and video functions, 46
setConferenceVideoWindow
Conference functions, 62
setDefaultPublicationTime
Send OPTIONS/INFO/MESSAGE
functions, 70
setDefaultSubscriptionTime
Send OPTIONS/INFO/MESSAGE
functions, 70
setDisplayName
Initialize and register functions, 30
setDoNotDisturb
Additional settings functions, 38
setInstanceId
Initialize and register functions, 29
setKeepAliveTime
Additional settings functions, 39
setLicenseKey
Initialize and register functions, 31
setPresenceMode
Send OPTIONS/INFO/MESSAGE
functions, 69
setPresenceStatus
Send OPTIONS/INFO/MESSAGE
functions, 71
setReliableProvisional
Additional settings functions, 36
setRemoteScreenWindow
Audio and video functions, 46
setRemoteVideoWindow
Audio and video functions, 46
setRtpKeepAlive
Additional settings functions, 38
setRtpPortRange
Additional settings functions, 37
setSrtpPolicy
Additional settings functions, 37
setUriUserEncoding
Additional settings functions, 36
setUser
Initialize and register functions, 29
setVideoBitrate
Audio and video functions, 45
setVideoCodecParameter
Audio and video codecs functions, 34
setVideoCodecPayloadType
Audio and video codecs functions, 33
setVideoDeviceId
Audio and video functions, 44
93
setVideoFrameRate
Audio and video functions, 45
setVideoMTU
RTP and RTCP QOS functions, 65
setVideoNackStatus
Audio and video functions, 46
setVideoOrientation
Audio and video functions, 44
setVideoResolution
Audio and video functions, 45
setVideoRotation
com.portsip.PortSIPVideoRenderer, 87
setVideoRtcpBandwidth
RTP and RTCP QOS functions, 64
Signaling events, 16
onReceivedSignaling, 16
onSendingSignaling, 16
startPlayingFileLocally
Play audio and video file and
RTMP/RTSP stream functions, 60
startPlayingFileToRemote
Play audio and video file and
RTMP/RTSP stream functions, 60
startRecord
Record functions, 58
stopPlayingFileLocally
Play audio and video file and
RTMP/RTSP stream functions, 61
stopPlayingFileToRemote
Play audio and video file and
RTMP/RTSP stream functions, 60
stopRecord
Record functions, 58
terminateSubscription
Send OPTIONS/INFO/MESSAGE
functions, 71
unHold
Call functions, 50
unInitialize
Initialize and register functions, 29
unRegisterServer
Initialize and register functions, 30
updateCall
Call functions, 49