From 1ef5d114f5158ac4d5fcf971c7cdfd82b113802a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 30 Jun 2014 00:00:35 +0500 Subject: [PATCH] adjust ringing var --- html5/verto/demo/verto.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/html5/verto/demo/verto.js b/html5/verto/demo/verto.js index fee1effc6e..1aa29f8558 100644 --- a/html5/verto/demo/verto.js +++ b/html5/verto/demo/verto.js @@ -130,12 +130,17 @@ var callbacks = { onDialogState: function(d) { cur_call = d; + if (d.state == $.verto.enum.state.ringing) { + ringing = true; + } else { + ringing = false; + } + switch (d.state) { case $.verto.enum.state.ringing: display("Call From: " + d.cidString()); $("#ansbtn").click(function() { - ringing = false; cur_call.answer({ useStereo: $("#use_stereo").is(':checked') }); @@ -143,19 +148,15 @@ var callbacks = { }); $("#declinebtn").click(function() { - ringing = false; cur_call.hangup(); $('#dialog-incoming-call').dialog('close'); }); - - ringing = true; goto_dialog("incoming-call"); $("#dialog-incoming-call-txt").text("Incoming call from: " + d.cidString()); if (d.params.wantVideo) { $("#vansbtn").click(function() { - ringing = false; $("#use_vid").prop("checked", true); cur_call.answer({ useVideo: true, @@ -190,6 +191,9 @@ var callbacks = { onWSLogin: function(v, success) { display(""); + cur_call = null; + ringing = false; + if (success) { online(true);