If you are integrating SightCall using Front Libraries integration to build a custom console and you encounters the "ERROR TypeError: Cannot read properties of null (reading 'postMessage') at window.SightCallConsole.hangup" error when trying to hang up the call, then it indicates you have a wrong code sequence in your code during hanging up process. One common root cause is if your code combine both console.hangup() function and console.close() function in the same event handler.
To fix this issue, you need to modify your code so that the console.hangup() function and the console.close() function are in two separate event handlers. For example:
if (this.callStatus === AGENT_CALL_STATUS.IN_PROGRESS)
{
this.sightcallConsole.hangup();
}
if (this.callStatus === AGENT_CALL_STATUS.TERMINATED)
{
this.sightcallConsole.close();
}
Otherwise, as soon as console.hangup() function is called, the console is no longer able to receive call hang up / termination acknowledgement from SightCall (because console.close() function already hide / close the console at that time), which causes the error above.