Merge branch 'charlesmchen/webrtc/connectedSpeakerphone' into feature/webrtc

pull/1/head
Matthew Chen 9 years ago
commit 60c67793a7

@ -32,7 +32,7 @@ import Foundation
internal func stateDidChange(call: SignalCall, state: CallState) { internal func stateDidChange(call: SignalCall, state: CallState) {
AssertIsOnMainThread() AssertIsOnMainThread()
self.handleState(state) self.handleState(call:call)
} }
internal func muteDidChange(call: SignalCall, isMuted: Bool) { internal func muteDidChange(call: SignalCall, isMuted: Bool) {
@ -63,18 +63,18 @@ import Foundation
// MARK: - Service action handlers // MARK: - Service action handlers
public func handleState(_ state: CallState) { public func handleState(call: SignalCall) {
assert(Thread.isMainThread) assert(Thread.isMainThread)
Logger.verbose("\(TAG) in \(#function) new state: \(state)") Logger.verbose("\(TAG) in \(#function) new state: \(call.state)")
switch state { switch call.state {
case .idle: handleIdle() case .idle: handleIdle()
case .dialing: handleDialing() case .dialing: handleDialing()
case .answering: handleAnswering() case .answering: handleAnswering()
case .remoteRinging: handleRemoteRinging() case .remoteRinging: handleRemoteRinging()
case .localRinging: handleLocalRinging() case .localRinging: handleLocalRinging()
case .connected: handleConnected() case .connected: handleConnected(call:call)
case .localFailure: handleLocalFailure() case .localFailure: handleLocalFailure()
case .localHangup: handleLocalHangup() case .localHangup: handleLocalHangup()
case .remoteHangup: handleRemoteHangup() case .remoteHangup: handleRemoteHangup()
@ -104,12 +104,12 @@ import Foundation
startRinging() startRinging()
} }
private func handleConnected() { private func handleConnected(call: SignalCall) {
Logger.debug("\(TAG) \(#function)") Logger.debug("\(TAG) \(#function)")
stopRinging() stopRinging()
// disable start recording to transmit call audio. // disable start recording to transmit call audio.
setAudioSession(category: AVAudioSessionCategoryPlayAndRecord) ensureIsEnabled(call: call)
} }
private func handleLocalFailure() { private func handleLocalFailure() {

Loading…
Cancel
Save