Odd behavior of onTimeout parameter when passing call() an array of numbers


I am trying to write some code that will call one person and wait for an answer, and if that person doesn't pick up it will call another number. Here is my code:

call(numberList, { //numberList is an array of numbers

     callerID: clientNumber,

     onAnswer: function() {

          ask("suff", {

               choices: "3, yes",

               attempts: 3,

               onChoice: function() {

                    say("Transfering you to " + clientName + " now.");

                    transfer("+" + clientNumber, { });



     onTimeout: function() {

          call("+" + emergencyNumber,{

          callerID: "+" + clientNumber



     transfer("+" + clientNumber);



Now my problem is that this code works exactly as intended when numberList contains only 1 number. If it contains more, the onTimeout parameter seems to be missed entirely, even when none of the phones pick up.

Is there some sort of different behavior with onTimeout when call() is passed an array? Or is there a different workaround that anyone can suggest?


Please sign in to leave a comment.