Event listening on JITSI External API

I am JITSIMeetExternalAPI(…) and my code is as follows…

function initJitsiMeet() {

  if(!isJitsiVideo && custJitsiAPI == undefined) {
    console.log('Initializing Jitsi Meet...');
    var domain = "meet.jit.si";
    var options = {
        roomName: "click4help",
        width: 500,
        height: 400,
        parentNode: document.getElementById("click4help-video"),
        interfaceConfigOverwrite: {TOOLBAR_BUTTONS: ['hangup','microphone', 'camera']}
    custJitsiAPI= new JitsiMeetExternalAPI(domain, options);
    custJitsiAPI.executeCommand('displayName', 'Customer');
    custJitsiAPI.executeCommand('subject', 'Instant Video Session');

    //custJitsiAPI.addListener('readyToClose', () => {console.log('call hung up fron add Listener Event');});
    custJitsiAPI.addEventListener('readyToClose',  function(){
                                              console.log('call hung up fron add Event Listener Event');
                                              alert('call hung up fron add Event Listener Event');
    //custJitsiAPI.on('readyToClose', () => {console.log('call hung up fron ON event');});
    isJitsiVideo = true;

As i understand from docs, i think “readyToClose” is the event that gets fired after call is HANG UP. So i would like to listen for that even so that clean up the session by calling api.dispose()

But the event “readyToClose” is not getting fired and as you can see in the code snippet, i am trying 3 different options (api.addListener(); api.addEventListner() and api.on()) to listen to the event but none of them is getting fired.

Pls. suggest where i am going wrong and if there is anything basic / obvious i am overlooking please.

thanks in advance

I just tested in my local example (just modifying https://github.com/jitsi/jitsi-meet/blob/master/doc/examples/api.html)

api.on('readyToClose', () => {

It is fired once I hit hangup and dismiss/submit the feedback.