 
     func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
         NSLog("provider:performStartCallAction:")
-
-        guard let accessToken = fetchAccessToken() else {
-            action.fail()
-            return
-        }
-
-        TwilioVoice.sharedInstance().configureAudioSession()
-
-        call = TwilioVoice.sharedInstance().call(accessToken, params: [:], delegate: self)
-
-        guard let call = call else {
-            NSLog("Failed to start outgoing call")
-            action.fail()
-            return
-        }
-
-        call.uuid = action.callUUID
-
+        
         toggleUIState(isEnabled: false)
         startSpin()
 
-        action.fulfill(withDateStarted: Date())
+        TwilioVoice.sharedInstance().configureAudioSession()
+        
+        provider.reportOutgoingCall(with: action.callUUID, startedConnectingAt: Date())
+        
+        self.performVoiceCall(uuid: action.callUUID, client: "") { (success) in
+            if (success) {
+                provider.reportOutgoingCall(with: action.callUUID, connectedAt: Date())
+                action.fulfill()
+            } else {
+                action.fail()
+            }
+        }
     }
 
     func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {

        //      completion block of the `reportNewIncomingCallWithUUID:update:completion:` method instead of in
        //      `provider:performAnswerCallAction:` per the WWDC examples.
        // TwilioVoice.sharedInstance().configureAudioSession()

        guard let call = self.callInvite?.accept(with: self) else {
            action.fail()
            return
        }
        
        self.callInvite = nil

        call.uuid = action.callUUID
        action.fulfill()
    }


        NSLog("callDidConnect:")
        
        self.call = call
        self.callKitCompletionCallback!(true)
        self.callKitCompletionCallback = nil
        
        self.placeCallButton.setTitle("Hang Up", for: .normal)
        
