PortSIP VoIP SDK Manual for iOS  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) - PortSIPSDK::refer:referTo:
 Refer the current call to another one.
More...
 
(int) - PortSIPSDK::attendedRefer:replaceSessionId:referTo:
 Make an attended refer. More...
 
(int) - PortSIPSDK::attendedRefer2:replaceSessionId:replaceMethod:target:referTo:
 Make an attended refer with specified request line and specified method embedded into the "Refer-To" header. More...
 
(int) - PortSIPSDK::outOfDialogRefer:replaceMethod:target:referTo:
 Send an out of dialog REFER to replace the specified call. More...
 
(long) - PortSIPSDK::acceptRefer:referSignaling:
 Once the REFER request accepted, a new call will be made if called this function. The function is usually called after onReceivedRefer callback event. More...
 
(int) - PortSIPSDK::rejectRefer:
 Reject the REFER request. More...
 

Detailed Description

Function Documentation

◆ refer:referTo:()

- (int) refer: (long)  sessionId
referTo: (NSString *)  referTo 

Refer the current call to another one.

Parameters
sessionIdThe session ID of the call.
referToTarget of the refer. It could 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
[myVoIPSdk refer:sessionId referTo:@"sip:testuser12@sip.portsip.com"];
You can watch the video on YouTube at https://www.youtube.com/watch?v=_2w9EGgr3FY. It will demonstrate the transfer.

◆ attendedRefer:replaceSessionId:referTo:()

- (int) attendedRefer: (long)  sessionId
replaceSessionId: (long)  replaceSessionId
referTo: (NSString *)  referTo 

Make an attended refer.

Parameters
sessionIdThe session ID of the call.
replaceSessionIdSession ID of the replaced call.
referToTarget 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 for more details, or you can watch the video on YouTube at https://www.youtube.com/watch?v=_2w9EGgr3FY, which will demonstrate the transfer.

◆ attendedRefer2:replaceSessionId:replaceMethod:target:referTo:()

- (int) attendedRefer2: (long)  sessionId
replaceSessionId: (long)  replaceSessionId
replaceMethod: (NSString *)  replaceMethod
target: (NSString *)  target
referTo: (NSString *)  referTo 

Make an attended refer with specified request line and specified method embedded into the "Refer-To" header.

Parameters
sessionIdSession ID of the call.
replaceSessionIdSession ID of the replaced call.
replaceMethodThe SIP method name which will be embedded in the "Refer-To" header, usually INVITE or BYE.
targetThe target to which the REFER message will be sent. It appears in the "Request Line" of REFER message.
referToTarget of the refer that appears in the "Refer-To" header. 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 refer to the sample project source code for more details. Or you can watch the video on YouTube at https://www.youtube.com/watch?v=_2w9EGgr3FY. It will demonstrate the transmission.

◆ outOfDialogRefer:replaceMethod:target:referTo:()

- (int) outOfDialogRefer: (long)  replaceSessionId
replaceMethod: (NSString *)  replaceMethod
target: (NSString *)  target
referTo: (NSString *)  referTo 

Send an out of dialog REFER to replace the specified call.

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

◆ acceptRefer:referSignaling:()

- (long) acceptRefer: (long)  referId
referSignaling: (NSString *)  referSignaling 

Once the REFER request accepted, a new call will be made if called this function. 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 that is greater than 0 to the new call for REFER, otherwise returns a specific error code that is less than 0.

◆ rejectRefer:()

- (int) 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.