PortSIP VoIP SDK Manual for Android  16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
Functions
Refer functions

Functions

int com.portsip.PortSipSdk.refer (long sessionId, String referTo)
 
int com.portsip.PortSipSdk.attendedRefer (long sessionId, long replaceSessionId, String referTo)
 
int com.portsip.PortSipSdk.attendedRefer2 (long sessionId, long replaceSessionId, String replaceMethod, String target, String referTo)
 
int com.portsip.PortSipSdk.outOfDialogRefer (long replaceSessionId, String replaceMethod, String target, String referTo)
 
long com.portsip.PortSipSdk.acceptRefer (long referId, String referSignaling)
 
int com.portsip.PortSipSdk.rejectRefer (long referId)
 

Detailed Description

Function Documentation

◆ refer()

int com.portsip.PortSipSdk.refer ( long  sessionId,
String  referTo 
)

Transfer the current call to another callee.

Parameters
sessionIdThe session ID of the call.
referToTarget 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:testuser12@sip.portsip.com");
You can refer to the video on Youtube at:
https://www.youtube.com/watch?v=_2w9EGgr3FY, which will demonstrate how to complete the transfer.

◆ attendedRefer()

int com.portsip.PortSipSdk.attendedRefer ( long  sessionId,
long  replaceSessionId,
String  referTo 
)

Make an attended refer.

Parameters
sessionIdThe session ID of the call.
replaceSessionIdSession ID of the replace call.
referToTarget 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:
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.

◆ attendedRefer2()

int com.portsip.PortSipSdk.attendedRefer2 ( long  sessionId,
long  replaceSessionId,
String  replaceMethod,
String  target,
String  referTo 
)

Make an attended refer.

Parameters
sessionIdThe session ID of the call.
replaceSessionIdThe session ID of the session to be replaced.
replaceMethodThe SIP method name to be added in the "Refer-To" header, usually INVITE or BYE.
targetThe target to which the REFER message will be sent.
referToThe 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.

◆ outOfDialogRefer()

int com.portsip.PortSipSdk.outOfDialogRefer ( long  replaceSessionId,
String  replaceMethod,
String  target,
String  referTo 
)

Make an attended refer.

Parameters
replaceSessionIdThe session ID of the session which will be replaced.
replaceMethodThe SIP method name which will be added in the "Refer-To" header, usually INVITE or BYE.
targetThe target to which the REFER message will be sent.
referToThe 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.

◆ acceptRefer()

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
referIdThe ID of REFER request that comes from onReceivedRefer callback event.
referSignalingThe 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;

◆ rejectRefer()

int com.portsip.PortSipSdk.rejectRefer ( long  referId)

Reject the REFER request.

Parameters
referIdThe 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.