PortSIP VoIP/IMS SDK for Android User Manual

estrapadetubacityMobile - Wireless

Dec 10, 2013 (3 years and 6 months ago)

1,875 views
















PortSIP VoIP/IMS SDK for Android User Manual
Compatibles with android 2.3 and later

http://www.portsip.com

v3.0, Sep 02, 2013




















PortSIP VoIP/IMS SDK for Android User Manual

2


NOTICE

© 2006-2013 PortSIP Solutions, Inc. All intellectual property rights in this publication are
owned by PortSIP Solutions, Inc. and are protected by United States copyright laws, other
applicable copyright laws, and international treaty provisions. PortSIP Solutions, Inc. retains
all rights not expressly granted.

This publication is PortSIP confidential. No part of this publication may be reproduced in any
form whatsoever or used to make any derivative work without prior written approval by
PortSIP Solutions, Inc.

PortSIP Solutions, Inc. reserves the right to revise this publication and make changes without
obligation to notify any person of such revisions or changes. PortSIP Solutions, Inc. may make
improvements or changes in the product(s) and/or the program(s) described in this
documentation at any time.

Unless otherwise indicated, PortSIP registered trademarks are registered in the United States
and other territories. All registered trademarks recognized.

For further information contact PortSIP Solutions, Inc.















PortSIP VoIP/IMS SDK for Android User Manual

3


Table of Contents

NOTICE

........................................................................................................................................................................................ 2
Machine Requirements

...................................................................................................................................................................... 4
Device Requirements

......................................................................................................................................................................... 4
Requirements Table

............................................................................................................................................................................ 4
OVERVIEW, Q & A

....................................................................................................................................................................... 5
THE CORE SDK

........................................................................................................................................................................... 7
1.

E
VENT
L
ISTENER

.................................................................................................................................................................................. 7
1.1 Register events

............................................................................................................................................................................. 7
1.2 Calls events

................................................................................................................................................................................... 8
1.3 Transfer events

........................................................................................................................................................................... 10
1.4 Instant Message/Presence events

........................................................................................................................................... 12
2.

SDK
FUNCTIONS

................................................................................................................................................................................. 14
2.1 Initialize and register functions

.............................................................................................................................................. 14
2.2 Audio/Video codec functions

................................................................................................................................................... 18
2.3 Audio/video device functions

.................................................................................................................................................. 20
2.4 Audio effect functions

.............................................................................................................................................................. 21
2.5 Video setting functions

............................................................................................................................................................. 22
2.6 Call functions

............................................................................................................................................................................. 23
2.7 Instant Message/Presence functions

...................................................................................................................................... 27



PortSIP VoIP/IMS SDK for Android User Manual

4


Machine Requirements
Development using the PortSIP VoIP/IMS SDK for Android requires an Android device running Android System
(SDK 2.3 or higher).

Device Requirements
Applications built with PortSIP VoIP/IMS SDK for Android can be run on Android devices. These devices must be
running Android 2.3 or higher. We strongly recommend that
you test your applications on actual devices to ensure that they work as expected and perform well. Testing on
the simulator alone does not provide a good measure of how the application will perform on the physical
device.

Requirements Table

Android OS Android 2.3(GingerBread)or higher
Development environment Eclipse/Myeclipse,JDK 1.6, Android SDK
Android SDK version Android 2.3 or higher
Android version Android 2.3 or higher
Android Device HTC, Samsung, Google, Motorola, Huawei, etc.





PortSIP VoIP/IMS SDK for Android User Manual

5

Overview, Q & A
Download sample project
This document describe the functions and callback events supported by PortSIP VoIP/IMS SDK libraries.
All samples of the PortSIP VoIP/IMS SDK are available at:
http://www.portsip.com/downloads.html


Q: How to compile and test the sample project ?
[Answer]
1. Download the Sample project and evaluation SDK at
PortSIP Web site
then extract it to a directory.
2. Open the Eclipse, Import sample project
3. Build the sample.
4. Test it.

Q: How to create a new project with the PortSIP VoIP/IMS SDK?
[Answer]

1. Download the
Sample project and evaluation SDK
and extract it to a directory
2. Run the Eclipse and create a new Android Project
3. Import all files and directory under directory “PortSipSample\src\com\portsip” except the directory
“test”. Please ensure all files package name remain unchanged.
4. Add the file libportsipcore.so under directory “PortSipSample\libs\armeabi” to your Android project.
5. Now Create you Activity, and import the following class example:


import com.portsip.PortSipEnumDefine;
import com.portsip.PortSipErrorcode;
import com.portsip.PortSipSdk;

you need declare PortSipSdk type instance mPortSIPSDK inorde to use SDK.


6. Add the followed code to you Activity.
static {
System.loadLibrary("portsipcore");
}
7. Make you activity implements OnregisterListener and add unimplemented methods, likes below:



@Override
public int onRegisterSuccess(int statusCode, String statusText) {
//todo: if you regeiste success ,it comes here.
return 0;
}
PortSIP VoIP/IMS SDK for Android User Manual

6


@Override
public int onRegisterFailure(int statusCode, String statusText) {
//todo: if you regeiste failed ,it comes here.
return 0;
}

Then ,call mPortSIPSDK.setOnRegisterListener(this);

Of cause,you can implement other listener interface declared in calss PortSipSdk add add them just
like this.


8. Initialize sdk, call initialize to init sdk
9. Build

























PortSIP VoIP/IMS SDK for Android User Manual

7


The Core SDK
1. Event Listener
1.1 Register events
public int onRegisterSuccess(int statusCode, String statusText);

When register to SIP Server was successfully registers, this event will be fired.
Parameters
statusCode - SIP response status code.
statusText - SIP response reason phrase.



public int onRegisterFailure(int statusCode, String statusText);

When register to SIP server was failed, this event will be fired.
Parameters
statusCode - SIP response status code.
statusText - SIP response reason phrase.


public void setOnRegisterListener(OnRegisterListener listener)

Set the register event handle.
Parameters
listener
- an
OnRegisterListener
to process registers message.






PortSIP VoIP/IMS SDK for Android User Manual

8

1
.2 Calls events
public int onInviteIncoming(int sessionId, String caller,
String callerDisplayName, String callee,
String calleeDisplayName, int mediaType);

When an incoming call is detected, this event will fire.
Parameters
sessionId - The session ID of this call conversation
caller - The caller of incoming call
callerDisplayName - The display name of caller
callee - The callee of incoming call
calleeDisplayName - The display name of callee
mediaType - Incoming call media type. 1- audio, 2- video, 3- audio and video


Public int onInviteTrying(int sessionId, String caller, String callee);

If the outgoing call was processing, this event fired.
Parameters
sessionId - The session ID of this call conversation.
caller - The caller.
callee - The callee.


public int onInviteRinging(int sessionId, boolean hasEarlyMedia);

If the outgoing call was ringing, then this event fired.
Parameters
sessionId - The session ID of this call conversation
hasEarlyMedia - If this parameter value is true, then the call has the early media detected and you do not need
to play a ring tone on the local computer. If value is false, then early media detection is
unavailable and you must play a ringing tone on the local computer to alert for call ringing.



PortSIP VoIP/IMS SDK for Android User Manual

9



public int onInviteUpdated(int sessionId, int mediaType);

This event will be fired when remote party updated this call.
Parameters
sessionId - The session ID of this call conversation
mediaType - Incoming call media type. 1- audio, 2- video, 3- audio and video



public int onRemoteHold(int sessionId);

If the remote party was place the call on hold, then this event fired.
Parameters
sessionId - The session ID of this call conversation.



public int onRemoteUnHold(int sessionId);

If the remote party was un-hold the call, then this event fired.
Parameters
sessionId - The session ID of this call conversation



public int onInviteAnswered(int sessionId, int statusCode, String statusText);

If the remote party was answered the call, then this event fired.
Parameters
sessionId - The session ID of this call conversation
statusCode - The answer code.
statusText - The answer reason.


PortSIP VoIP/IMS SDK for Android User Manual

10



public int onInviteClosed(int sessionId, int statusCode, String statusText);

If the remote party was closed the call, then this event fired.
Parameters
sessionId - The session ID of this call conversation
statusCode - The close code.
statusText - The close reason.


public void setOnCallListener(OnCallListener listener)

Set the calling event handle.
Parameters
listener
- an
OnCallListener
instance to process calling message.


1.3 Transfer events
public int onTransferTrying(int sessionId);

When the refer call is processing, this event fired.
Parameters
sessionId - The session ID of this call conversation.



public int onTransferRinging(int sessionId);

When the refer call is ringing, this event fired.
Parameters
sessionId - The session ID of this call conversation.


PortSIP VoIP/IMS SDK for Android User Manual

11



public int onPASVTransferSuccess(int sessionId);

When the refer call is succeeds, this event will be fired. The PASV means Passive. For example: A established the call
with B, now A transfer B to C, C accepted this refer call, B will received this event. A will received
ACTVTransferSuccess event.
Parameters
sessionId - The session ID of this call conversation.



public int onPASVTransferFailure(int sessionId, int statusCode, String statusText);

When the refer call is failed, this event will be fired. The PASV means Passive. For example: A established the call with
B, now A transfer B to C, C rejected this refer call, B will received this event. A will received ACTVTransferFailure
event.
Parameters
sessionId - The session ID of this call conversation
statusCode - The failure code.
statusText - The failure reason.




public int onACTVTransferSuccess(int sessionId);

When the refer call is succeeds, this event will be fired. The ACTV means Active. For example: A established the call
with B, now A transfer B to C, C accepted this refer call, A will received this event. B will received
PASVTransferSuccess event.
Parameters
sessionId - The session ID of this call conversation





PortSIP VoIP/IMS SDK for Android User Manual

12



public int onACTVTransferFailure(int sessionId, int statusCode, String statusText);

When the refer call is failed, this event will be fired. The ACTV means Active. For example: A established the call with
B, now A transfer B to C, C rejected this refer call, A will received this event. B will received PASVTransferFailure
event.
Parameters
sessionId - The session ID of this call conversation
statusCode - The failure code.
statusText - The failure reason.


public void setOnTransferListener(OnTransferListener listener)

Set the transfer event handle.
Parameters
listener
- an
OnTransferListener
instance to process transfer message



1.4 Instant Message/Presence events
public int onRecvMessage(String from, String fromDisplayName,
String message, int length, String contentType)

This event will be fired when received the MESSAGE message.
Parameters
from - The message sender
displayName - The display name of contact.

message - The message content.
Length - The message length.
contentType - The message content type.



PortSIP VoIP/IMS SDK for Android User Manual

13



public int onSendMessageSuccess(long messageId)

This event will be fired when send the message succeeds.
Parameters
messageId - The Send Message ID.


public int onSendMessageFailure(long messageId, int statusCode, String statusText)

This event will be fired when send the message failed.
Parameters
messageId - The Send Message ID.
statusCode - The failure code
statusText - The failure reason.


public int onPresenceRecvNotify(String subscriptionState,
String contentType, String content, int contentLength);

When the contact is changed presence status, this event will be fired.
Parameters
subscriptionState - The Subscription status. active/pending/inactive
contentType - The content type.
content - The content body.

contentLength - The content length.


public void setOnIMListener(OnIMListener listener)

Set the IM event handle
Parameters
listener
- an
OnIMListener
instance to process IM message


PortSIP VoIP/IMS SDK for Android User Manual

14


2. SDK functions
2.1 Initialize and register functions
public int initialize(Context context,int enum_transport, String agent,
String STUNServer, int STUNServerPort)

To initialize the SIP core SDK.
Parameters
context - Context instance
transportType - Transport of SIP, it can be set as TRANSPORT_UDP, TRANSPORT_TLS, TRANSPORT_TCP.
agent - The User-Agent header to insert in messages.
STUNServer - Stun server, it’s optional and can be pass empty string if you are not use STUN server.
STUNServerPort - Stun server port, it will be ignored if the STUNServer is empty.
Return Values

If the function succeeds, the return value is 0. If the function fails, the return value is a specific error code can be
found in PortSipErrorcode.java file.
Remarks


If want to use the TLS transport, you have to install the root certificate, usually the certificate was issued by your ITSP.


public int setUserInfo(String userName, String displayName,
String authName, String password, int localSIPPort,
String userDomain, String SIPServer, int SIPServerPort,
String outboundServer, int outboundServerPort)


Set the user information into SDK.
Parameters
username - Account(User name) of the SIP, usually provided by an IP-Telephony service provider.
displayName - The display name of user name, you can set it as you like, likes: “James Kend”. It’s optional.
authName - Authorization user name (usually equals the username).
Password - Password.
localSIPPort - The SIP message transport listener port(for example: 5060).
userDomain - User domain; this parameter is optional and can be pass NULL if you are not use domain.
SIPServer - SIP proxy server IP or domain(for example: xx.xxx.xx.x or sip.xxx.com).

PortSIP VoIP/IMS SDK for Android User Manual

15


SIPServer Port - Port of the SIP proxy server, (for example: 5060).
outboundServer - Outbound proxy server (for example: sip.domain.com), it’s optional and can be pass NULL if
you are not use outbound server.
outboundServerPort - Outbound proxy server port, it will be ignored if the outboundServer is empty.
Return Values

If the function succeeds, the return value is 0. If the function fails, the return value is a specific error code can be
found in PortSipErrorcode.java file.


public native void unInitializeSDK();

Un-initialize the SIP Core SDK and release resources.


public native void setLicenseKey(String key);

Set the license key into SDK.
Parameters
key - The license key, provide by PortSIP Solutions, Inc. (
http://www.portsip.com
)


public native String getVersion();

The getVersion function returns the current version number of the SDK.
Parameters
Return Value
A string description the sdk-core version


public native int enableSessionTimer(int timerSeconds);

This function allows to periodically refresh Session Initiation Protocol (SIP) sessions by sending repeated INVITE
requests. The repeated INVITE requests, or re-INVITEs, are sent during an active call leg to allow user agents
(UA) or proxies to determine the status of a SIP session. Without this keepalive mechanism, proxies that

PortSIP VoIP/IMS SDK for Android User Manual

16


remember incoming and outgoing requests (stateful proxies) may continue to retain call state needlessly. If a
UA fails to send a BYE message at the end of a session or if the BYE message is lost because of network problems,
a stateful proxy does not know that the session has ended. The re-INVITES ensure that active sessions stay
active and completed sessions are terminated.
Parameters
timerSeconds - The value of the refresh interval in seconds. Minimum requires 90 seconds.
Return Value

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.


public native void disableSessionTimer();

Disable the session timer.


public native void enableDnsDiscovery(boolean state);

To enable/disable DNS Discovery.
Parameters
state - If the value is set to YES, then DNS Discovery is enabled. If set to NO, is disabled.


public native void setSrtpPolicy(int enum_srtppolicy);

Set the SRTP policy..
Parameters
srtpPolicy - The SRTP policy is defined as:


If set the policy as SRTP_POLICY_NONE, the SDK can receive the encrypted call(SRTP) and
unencrypted call both, but can’t place outgoing encrypted call.
If set the policy as SRTP_POLICY_FORCE, the SDK just allows receive encrypted Call and
place outgoing encrypted call only.
If set the policy as SRTP_POLICY_PREFER, the SDK allows receive encrypted and uncrypted
call, and allows place outgoing encrypted call and unencrypted call


PortSIP VoIP/IMS SDK for Android User Manual

17



public native int setRtpPortRange(int minimumRtpPort, int maximumRtpPort);


This function allows set the RTP ports range for audio and video streaming.

Parameters
minimumRtpPort - The minimum RTP port for stream.
maximumRtpPort - The maximum RTP port for stream.
Return Values

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.


public native int setAudioSamples(int ptime, int maxptime);

This function set the audio capture sample which will be appears in the SDP of INVITE and 200 OK message as “ptime”
attribute.

Parameters
ptime - It’s should be a multiple of 10, and between 10 and 60(included 10 and 60).
Return Values
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.





public native void setAMROctetAligned(boolean state);

Set AMR-nb, AMR-wb octet-align.
Parameters
State - if YES octet-aligned operation will be used, if NO Bandwidth-efficient operation is employed, default is NO.


public native void enableICE(boolean state);

To enable/disable Interactive Connectivity Establishment (ICE).
Parameters
state - If the value is set to YES, then ICE is enabled. If set to NO, ICE is disabled.

PortSIP VoIP/IMS SDK for Android User Manual

18



public native int registerServer(int expires);

Register to SIP proxy server.
Parameters
expires - Registration refresh Interval.
Return Values

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.


public native void unRegisterServer();

To un-register from the SIP proxy server.


2.2 Audio/Video codec functions

public native void addAudioCodec(int enum_audiocodec);

Add an audio codec.
Parameters
enum_audiocodec - Audio codec type, defined in the PortSipEnumDefine.java file.




public native void clearVideoCodec();

Remove all added audio codecs.




PortSIP VoIP/IMS SDK for Android User Manual

19



public native boolean isAudioCodecEmpty();

Detect added audio codecs.
Return Values
If no audio codec set, the return value is true, otherwise is false.



public native void addVideoCodec(int enum_videocodec);

Adding a video codec.
Parameters
enum_videocodec - Video codec type, defined in the PortSipEnumDefine.java file.




public native void clearVideoCodec();

Remove all added video codecs.



public native boolean isVideoCodecEmpty();

Detect added video codecs.
Return Values
If no video codec set, the return value is true, otherwise is false.




PortSIP VoIP/IMS SDK for Android User Manual

20

2
.3 Audio/video device functions
public void setSpeekerOn(boolean bOn)

To set audio palyout device to use for the audio call.
Parameters
bOn
- If the value is set to YES, then use Speaker(Handsfree), If set to NO use headset
.
Default is NO.
Remark
Support switching audio device during the call.


public void switchSpeeker()

To toggle the speeker
Parameters


public void switchCamera()

To set video device to use for the video call.
Remarks
Toggle camera, if have more then one camare, else do nothing.


public native void setVideoOrientation(int orientation);

To set video Orientation to use for the video capture.
Parameters
orientation - video orientation degree 0~360




PortSIP VoIP/IMS SDK for Android User Manual

21

2
.4 Audio effect functions
public native void enableAEC(boolean state);

To enable/disable AEC (Acoustic Echo Cancellation).
Parameters
state - If the value is set to YES, then AEC is enabled. If set to NO, AEC is disabled



public native void enableVAD(boolean state);

To enable/disable Voice Activity Detection(VAD).
Parameters
state - If the value is set to YES, then VAD is enabled. If set to NO, VAD is disabled.



public native void enableCNG(boolean state);

To enable/disable Comfort Noise Generator(CNG).
Parameters
state - If the value is set to YES, then CNG is enabled. If set to NO, CNG is disabled.



public native void enableAGC(boolean state);

To enable/disable Automatic Gain Control(AGC).
Parameters
state - If the value is set to YES, then AGC is enabled. If set to NO, AGC is disabled.




PortSIP VoIP/IMS SDK for Android User Manual

22



public native void enableANS(boolean state);

To enable/disable Automatic Noise Suppression (ANS).
Parameters
state - If the value is set to YES, then ANS is enabled. If set to NO, ANS is disabled.


2.5 Video setting functions
public native void setVideoBitrate(int bitrateKbps);

Set video bit rate.
Parameters
bitrateKbps - The video bit rate in KBPS.


public native void setVideoFrameRate(int frameRate);

Set the video frame rate. Usually you do not need to call this function set the frame rate, the SDK using default frame rate.
Parameters
frameRate - The frame rate value, minimum is 5, maximum is 30. The bigger value will give you better video
quality but require more bandwidth;


public native void setVideoResolution(int enum_resulution);

Set the video capture resolution.
Parameters
resolution - Video resolution, defined in the PortSipEnumDefine.java file.
Remarks
Some device camera hasn’t support SVGA and XVGA, 720P, please read your device manual.


PortSIP VoIP/IMS SDK for Android User Manual

23



public void setLocalSurfaceHolder(SurfaceHolder holder)

Set the window that using to display the local video image.
Parameters
holder
- The view to display local video image from camera.


public void setRemoteSurfaceHolder(SurfaceHolder holder)

Set the window for a session that using to display the received remote video image.
Parameters
holder - The view to display received remote video image.




2.6 Call functions
public long portSipCall(String callee, int enum_mediatype)

Make the call(invite).
Parameters
callee - The callee username(number), it can be “
sip:usernumber@sipserver.com
” or
“usernumber” only.
enum_mediatype
- The call media type. 1- audio, 2- video, 3- audio and video,you can find in PortSipEnumDefine;
errorCode - If the function succeeds, this parameter value is 0. If the function fails, this value is a specific error
code can be found in PortSIP_Errors.h file.
Return Value
If the function succeeds, the return value is a session ID to the cal; It returns an error code less than 0 if failres.






PortSIP VoIP/IMS SDK for Android User Manual

24



public native int rejectCall(long sessionId)

Reject incoming call.
Parameters
sessionId - Session ID of the call.
Return Values

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.



public int portSipAnswerCall(long sessionId)

Answer the incoming call.
Parameters
sessionId - Session ID of the call.
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.



public int portSipTerminateCall()

Terminate the conversation(Hang up the current call).
Parameters
void
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.




PortSIP VoIP/IMS SDK for Android User Manual

25



public int portSipHold()

To place current call on call.
Parameters
void
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.



public int portSipUnHold()

Take off current call hold.
Parameters
void
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.



public int portSipRefer(String referto)

Refer the call to another one.
Parameters
referTo - Target of the refer, it can be “
sip:number@sipserver.com
” or “number” only
Return Value

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.




PortSIP VoIP/IMS SDK for Android User Manual

26



Remarks
Example: transfer the call to sip:testuser12@sip.portsip.com:8000

portSipRefer
( “sip:testuser12@sip.portsip.com:8000”);
Or transfer the call to sip:test1@176.11.90.202:

portSipRefer
( “sip:test1@176.11.90.202”);




public native int sendDTMF(long sessionId, char code);

Send DTMF tone.
Parameters
sessionId - Session ID of the call.
code - DTMF Digit (1, 2, 3, 4, 5, ..... 0, *, #)
Return Value

If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.




public native void startVideoSending(boolean state)

Send/stop video stream to remote side.
Parameters
state - Set to true to start send video to remote side, false to stop send.








PortSIP VoIP/IMS SDK for Android User Manual

27


2.7 Instant Message/Presence functions
public native long sendOutOfDialogMessage(String to, String message,
int messageLength, String contentType);

Send out of dialog message with special content type.
Parameters
to - The message receiver. Likes
sip:receiver@portsip.com

messageBody - The contents that you want to send with MESSAGE message.
messageLength – The contents lenght.
contentType - The content type, default is "text/plain".
Return Value
If the function succeeds, the return value is message Id, if the return value < 0 is a specific error code can be
found in PortSipErrorcode.java file.
Remarks
About the content type details, please visit this website:
http://www.iana.org/assignments/media-types/

When remote received this message, the event
onSendMessageSuccess
will be fired, this event has inclued the
message Id.




public native long presenceSubscribeContact(String contact, String subject)

Send a SUBSCRIBE message for presence to a contact.
Parameters
contact - The target contact, it must likes sip:contact001@sip.portsip.com:
subject - This subject text will be insert into the SUBSCRIBE message. For example:”Hello, I’m Jason”.
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java fil




PortSIP VoIP/IMS SDK for Android User Manual

28



public native int presenceUnsubscribeContact(long subscribeId);

Unsubscribe a contact.
Parameters
subscribeId - The subscribe Id, get from
presenceSubscribeContact.

Return Value
If the function succeeds, the return value is SubscribeID, if the return value < 0 is a specific error code can be
found in PortSipErrorcode.java file.


public native int publishPresence(int enum_publication, String note);

Send a PUBLISH message to Server to publishing your presence information.
Parameters
status - The presence status you want to change.
note - Allows set your online status details, likes “on phone”, “do not disturb”, “away” etc.
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.


public native int unpublishPresence();

Stop publishing your presence information.
Return Value
If the function succeeds, the return value is 0, otherwise the return value is a specific error code can be found in
PortSipErrorcode.java file.