Skip to content

Instantly share code, notes, and snippets.

@hasham2
Created May 20, 2015 07:21
Show Gist options
  • Select an option

  • Save hasham2/231f8cd79b2113ea418e to your computer and use it in GitHub Desktop.

Select an option

Save hasham2/231f8cd79b2113ea418e to your computer and use it in GitHub Desktop.
This is how call session is being initiated however the parameter has passed to method does not contain required values
# this is where call session is started from but the parameter hash does
# contain the required key / values
def startCallSession(data)
@current_call.callSessionId = data['sessionId']
updateCallStatus('call started')
callScreen = InCallScreen.new(nav_bar: false, modal: true)
callScreen.connectWith(data['sessionId'], andToken: data['token'])
callScreen.client_time_available = data['fromSecondsAvailable']
App.delegate.presentModal(callScreen)
end
# Apparently the didAccept method calls the startCallSession in Call Manager class
def didAccept
SystemSounds.stop()
CC.notifier.show('Accepting Call')
request = SocketTimerRequest.alloc.init(CommClear::SocketManager::Event::CALL_ACCEPT, @incomingCallData) do |msg|
CC.notifier.dismiss
User.current.goBusy
parent_screen.dismissViewControllerAnimated(true, completion: lambda {
# here is start Call Session is being called from
CC.callManager.startCallSession(msg)
})
end
request.fireWithTimeout(30) do
CC.notifier.dismiss
User.current.goOnline
CC.callManager.callAcceptFailed
close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment