IrisRtcAudioSession Class Reference

Inherits from IrisRtcJingleSession : NSObject
Declared in IrisRtcAudioSession.h

Overview

The IrisRtcAudioSession is a class used to create and manage the audio session ie pstn call.

This class provides the following apis

1) creating the pstn session : api createWithRoomId:participantId:sourceTelephoneNum:targetTelephoneNumber:notificationData:stream:delegate:error: can be used for creating session.creating session involves in getting the room Id from Iris backend by REST API call and creates session using room id.

2) joining the pstn session : api joinWithSessionId:roomToken:roomTokenExpiryTime:stream:delegate:error: can be used for joining session.Joining session involves in joining the room using room id which is recieved in notification.

3) api hold will be used to holde the call

4) api unhold will be used to unhold the call

5) api mergeSession: will be used in merging the active session with session on hold

6) api close used to close session

  preferedCodecType

private variable used to set the Audio codec preference. Default will be set to OPUS.

@property (nonatomic) IrisRtcSdkAudioCodecType preferedCodecType

Discussion

private variable used to set the Audio codec preference. Default will be set to OPUS.

Declared In

IrisRtcAudioSession.h

  isVideoBridgeEnable

private variable set isVideoBridgeEnable as true to make calls using videobridge.

@property BOOL isVideoBridgeEnable

Discussion

private variable set isVideoBridgeEnable as true to make calls using videobridge.

Declared In

IrisRtcAudioSession.h

– createWithRoomId:participantId:_sourceTelephoneNum:_targetTelephoneNumber:notificationData:stream:sessionConfig:delegate:error:

This method is called to create and start pstn/audio session which involves getting the room id from server and creating the room using the room id.

- (BOOL)createWithRoomId:(NSString *)roomId participantId:(NSString *)participantId _sourceTelephoneNum:(NSString *)sourceTN _targetTelephoneNumber:(NSString *)targetTN notificationData:(NSString *)notificationData stream:(IrisRtcStream *)stream sessionConfig:(IrisRtcSessionConfig *)sessionConfig delegate:(id<IrisRtcAudioSessionDelegate>)delegate error:(NSError **)outError

Parameters

roomId

Room Id of the already created room for the participants involved

participantId

Participant Id

sourceTN

Contains source 10 digit telephone number.

targetTN

Contains target 10 digit telephone number.

notificationData

notificationData

stream

local audio stream.

sessionConfig

IrisRtcSessionConfig object for setting additional optional session configuaration parameters.

delegate

delegate object for IrisRtcAudioSession,used to receive the callbacks.

outError

Provides error code and basic error description when any exception occured in api call.

Discussion

This method is called to create and start pstn/audio session which involves getting the room id from server and creating the room using the room id.

Declared In

IrisRtcAudioSession.h

– createWithTN:_sourceTelephoneNum:notificationData:stream:sessionConfig:delegate:error:

This method is called to create and start pstn/audio session which involves in creating the room using the target and source phone number

- (BOOL)createWithTN:(NSString *)targetTN _sourceTelephoneNum:(NSString *)sourceTN notificationData:(NSString *)notificationData stream:(IrisRtcStream *)stream sessionConfig:(IrisRtcSessionConfig *)sessionConfig delegate:(id<IrisRtcAudioSessionDelegate>)delegate error:(NSError **)outError

Parameters

targetTN

Contains target 10 digit telephone number.

sourceTN

Contains source 10 digit telephone number.

notificationData

notificationData

stream

local audio stream.

sessionConfig

IrisRtcSessionConfig object for setting additional optional session configuaration parameters.

delegate

delegate object for IrisRtcAudioSession,used to receive the callbacks.

outError

Provides error code and basic error description when any exception occured in api call.

Discussion

This method is called to create and start pstn/audio session which involves in creating the room using the target and source phone number

Declared In

IrisRtcAudioSession.h

– joinWithSessionId:roomToken:roomTokenExpiryTime:stream:rtcServer:sessionConfig:delegate:error:

This method is called to join pstn/audio session which involves joining the room using the room id recieved in notification.

- (BOOL)joinWithSessionId:(NSString *)sessionId roomToken:(NSString *)roomToken roomTokenExpiryTime:(NSInteger)roomTokenExpiry stream:(IrisRtcStream *)stream rtcServer:(NSString *)rtcServer sessionConfig:(IrisRtcSessionConfig *)sessionConfig delegate:(id<IrisRtcAudioSessionDelegate>)delegate error:(NSError **)outError

Parameters

sessionId

room name that needs to be joined which is recieved in notification.

roomToken

rooomtoken which is received in notification.

stream

local audio stream.

rtcServer

rtcServerURL.

sessionConfig

IrisRtcSessionConfig object for setting additional optional session configuaration parameters.

delegate

delegate object for IrisRtcAudioSession,used to receive the callbacks

outError

Provides error code and basic error description when any exception occured in api call.

roomTokenExpiryTime

rommtokenexpiry which is received in notification.

Discussion

This method is called to join pstn/audio session which involves joining the room using the room id recieved in notification.

Declared In

IrisRtcAudioSession.h

– setUserProfile:

setting up user profile information.

- (void)setUserProfile:(IrisRtcUserProfile *)userProfile

Parameters

userProfile

userprofile information.

Discussion

setting up user profile information.

Declared In

IrisRtcAudioSession.h

– hold

This method is called to hold the pstn session

- (void)hold

Discussion

This method is called to hold the pstn session

Declared In

IrisRtcAudioSession.h

– unhold

This method is called to unhold the pstn session

- (void)unhold

Discussion

This method is called to unhold the pstn session

Declared In

IrisRtcAudioSession.h

+ activateAudio

This method is called to activate audio while using callkit. Need to call this API in provider(_:didActivate:) delegate.

+ (void)activateAudio

Discussion

This method is called to activate audio while using callkit. Need to call this API in provider(_:didActivate:) delegate.

Declared In

IrisRtcAudioSession.h

+ deactivateAudio

This method is called to deactivate audio while using callkit. Need to call this API in provider(_:didDeactivate:) delegate.

+ (void)deactivateAudio

Discussion

This method is called to deactivate audio while using callkit. Need to call this API in provider(_:didDeactivate:) delegate.

Declared In

IrisRtcAudioSession.h

– getStreamQuality:

This method is called to get stream quality

- (void)getStreamQuality:(NSError **)outError

Parameters

outError

Provides error code and basic error description when any exception occured in api call.

Discussion

This method is called to get stream quality

Declared In

IrisRtcAudioSession.h

– mergeSession:

This method is called to merge the active session with the held session for PSTN call.

- (BOOL)mergeSession:(IrisRtcAudioSession *)heldSession

Parameters

heldSession

session which is on hold.

Discussion

This method is called to merge the active session with the held session for PSTN call.

Declared In

IrisRtcAudioSession.h

– insertDTMFtone:

This method is used for sending dtmf tones.

- (void)insertDTMFtone:(IrisDTMFInputType)tone

Discussion

This method is used for sending dtmf tones.

Declared In

IrisRtcAudioSession.h

– close

This method is called to close the session

- (void)close

Discussion

This method is called to close the session

Declared In

IrisRtcAudioSession.h

+ reject:toId:traceId:server:error:

This method is called to reject call

+ (BOOL)reject:(NSString *)roomId toId:(NSString *)toId traceId:(NSString *)traceId server:(NSString *)server error:(NSError **)outError

Parameters

roomId

Room Id of the already created room

toId

Taget routing Id

traceId

Trace Id.

server

RTC server URL.

outError

Provides error code and basic error description when any exception occured in api call.

Discussion

This method is called to reject call

Declared In

IrisRtcAudioSession.h