]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11281: Verto.newCall dialog callback overrides should be set before invite
authorChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 18:51:27 +0000 (13:51 -0500)
committerChad Phillips <chad@apartmentlines.com>
Thu, 26 Jul 2018 18:51:27 +0000 (13:51 -0500)
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().

html5/verto/js/src/jquery.verto.js

index c913ca41404ed45275a15b18f2f97e0e22fd99ed..2092a6616be6b8aebce83c07654683914761c9a7 100644 (file)
 
         var dialog = new $.verto.dialog($.verto.enum.direction.outbound, this, args);
 
-        dialog.invite();
-
         if (callbacks) {
             dialog.callbacks = callbacks;
         }
 
+        dialog.invite();
+
         return dialog;
     };