Search code examples
vonage

How to listen session:success event in nexmo client js?


I follow tutorial here: https://developer.nexmo.com/client-sdk/tutorials/app-to-phone/client-sdk/app-to-phone/main-screen/javascript

listen session:success event with bellow script not working.

const status = $('.input');

app.on('session:success', () => {
 status.val('Ready to call.');
});

Is there any other event i can listen?


Solution

  • It seems i don't need to listen nexmo app event.

    Just check it with if condition.

    if (app.session.sessionReady) {
     callStatus.val("Ready for call.");
    }