Getting error: Uncaught TypeError: this.state.session.reject is not a function

Getting an error while trying to cancel the call but cannot cancel it as I’m getting error each time when I click the button in console. Error:

Uncaught TypeError: this.state.session.reject is not a function
    at Phone.clickEndCallButton (Phone.js:238:28)
    at onClick (Phone.js:413:35)
    at HTMLUnknownElement.callCallback (react-dom.development.js:1299:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:1338:16)
    at Object.invokeGuardedCallback (react-dom.development.js:1195:27)
    at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:1209:43)
    at executeDispatch (react-dom.development.js:1432:21)
    at Object.executeDispatchesInOrder (react-dom.development.js:1454:5)
    at executeDispatchesAndRelease (react-dom.development.js:1969:24)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:1980:10)
clickEndCallButton @ Phone.js:238
onClick @ Phone.js:413
callCallback @ react-dom.development.js:1299
invokeGuardedCallbackDev @ react-dom.development.js:1338
invokeGuardedCallback @ react-dom.development.js:1195
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:1209
executeDispatch @ react-dom.development.js:1432
executeDispatchesInOrder @ react-dom.development.js:1454
executeDispatchesAndRelease @ react-dom.development.js:1969
executeDispatchesAndReleaseTopLevel @ react-dom.development.js:1980
forEachAccumulated @ react-dom.development.js:1946
processEventQueue @ react-dom.development.js:2139
runEventQueueInBatch @ react-dom.development.js:2151
handleTopLevel @ react-dom.development.js:2161
handleTopLevelImpl @ react-dom.development.js:1800
batchedUpdates @ react-dom.development.js:13238
performFiberBatchedUpdates @ react-dom.development.js:1646
stackBatchedUpdates @ react-dom.development.js:1637
batchedUpdates @ react-dom.development.js:1651
batchedUpdatesWithControlledComponents @ react-dom.development.js:1664
dispatchEvent @ react-dom.development.js:1874
Show 19 more frames
Show lessUnderstand this errorAI
react-dom.development.js:1345 Uncaught Error: A cross-origin error was thrown. React doesn't have access to the actual error object in development.
    at Object.invokeGuardedCallbackDev (react-dom.development.js:1345:19)
    at Object.invokeGuardedCallback (react-dom.development.js:1195:27)
    at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:1209:43)
    at executeDispatch (react-dom.development.js:1432:21)
    at Object.executeDispatchesInOrder (react-dom.development.js:1454:5)
    at executeDispatchesAndRelease (react-dom.development.js:1969:24)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:1980:10)
    at Array.forEach (<anonymous>)
    at forEachAccumulated (react-dom.development.js:1946:9)
    at Object.processEventQueue (react-dom.development.js:2139:7)

I tried to log it to the console as I have seen it might be because of session is empty but it is not.