Twilio developer evangelist here.
That's weird, because that worked for me when I was answering your previous question.
What you can do instead is return a string that determines whether the caller is blocked and the use a split widget to choose.
So your code could look like this:
exports.handler = function(context, event, callback) {
// List all blocked phone numbers in quotes and E.164 formatting, separated by a comma
let numberBlock =["+17171234567"];
let blocked = true;
if (numberBlock.length > 0) {
if (numberBlock.indexOf(event.From) === -1) {
blocked = false;
}
}
if (blocked) {
callback(null, "blocked");
}
else {
callback(null, "accepted");
}
};
Then the studio flow would look like this:
That is, if the function returns "accepted" then the call moves on, otherwise that's the end of the flow.