From: Chad Phillips Date: Thu, 26 Jul 2018 18:51:27 +0000 (-0500) Subject: FS-11281: Verto.newCall dialog callback overrides should be set before invite X-Git-Tag: v1.8.2~1^2~64^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f96f669c2fe7f133164aab735b412bef794d932;p=thirdparty%2Ffreeswitch.git FS-11281: Verto.newCall dialog callback overrides should be set before invite Verto.newCall() permits passing custom callback functions per call that override the default dialog callbacks inherited from the Verto object. However, they are currently set after calling the invite() function, and it's possible that some of these callbacks could be called during the invite() function's execution. To avoid a race condition, move setting these custom callbacks on the dialog to happen before calling invite(). --- diff --git a/html5/verto/js/src/jquery.verto.js b/html5/verto/js/src/jquery.verto.js index c913ca4140..2092a6616b 100644 --- a/html5/verto/js/src/jquery.verto.js +++ b/html5/verto/js/src/jquery.verto.js @@ -465,12 +465,12 @@ var dialog = new $.verto.dialog($.verto.enum.direction.outbound, this, args); - dialog.invite(); - if (callbacks) { dialog.callbacks = callbacks; } + dialog.invite(); + return dialog; };