title: Twilio - Incoming calls not being processed (quickstart)
body: <p>I've sign up to start using Twilio and I'm trying to setup the quickstart (<a href="https://www.twilio.com/docs/voice/client/javascript/quickstart" rel="nofollow noreferrer">https://www.twilio.com/docs/voice/client/javascript/quickstart</a>) and it's almost working but incoming calls are not being received by:</p>
  
  <p>Client code (used on browser after getTokenCapabilities):</p>
  
  <pre><code>  Twilio.Device.incoming(function (conn) {
      log('Incoming connection from ' + conn.parameters.From);
      var archEnemyPhoneNumber = '+12093373517';
  
      if (conn.parameters.From === archEnemyPhoneNumber) {
        conn.reject();
        log('It\'s your nemesis. Rejected call.');
      } else {
        // accept the incoming connection and start two-way audio
        conn.accept();
      }
    });
  </code></pre>
  
  <p>Code on Twilio Function for voice calls (consoles are always printed and else condition is never called:</p>
  
  <pre><code>exports.handler = function(context, event, callback) {
      let twiml = new Twilio.twiml.VoiceResponse();
      console.log('entrou aqui');
      if(event.To) {
          console.log('entrou ali');
        // Wrap the phone number or client name in the appropriate TwiML verb
        // if is a valid phone number
        const attr = isAValidPhoneNumber(event.To) ? 'number' : 'client';
  
        const dial = twiml.dial({
          callerId: context.CALLER_ID,
        });
        dial[attr]({}, event.To);
      } else {
        twiml.say('Thanks for calling!');
      }
      console.log('callback');
       callback(null, twiml);
  };
  
  /**
  * Checks if the given value is valid as phone number
  * @param {Number|String} number
  * @return {Boolean}
  */
  function isAValidPhoneNumber(number) {
    return /^[\d\+\-\(\) ]+$/.test(number);
  }
  </code></pre>
  
  <p>I've include my phone number as Verified Caller ID, got a number from Twilio and create the functions using template Twilio Client Quickstart.</p>
  
  <p>On Twilio Client Quickstart, i've paste TwiML SID as TWIML_APP_SID and tried to use my phone number and the number from Twilio as CALLER_ID.</p>
  
  <p>Also I've changed VOICE URL on TwiML configuration and changed the VOICE URL on phone number from twilio configuration.</p>
  
  <p>Any ideas on what is missing or what is wrong? When I open on browser <em><a href="http://127.0.0.1:8080/" rel="nofollow noreferrer">http://127.0.0.1:8080/</a></em>, It's possible to make calls but I don't receive any call on browser when I call to twilio number.</p>