I have created an application using https://www.twilio.com/docs/howto/twilio-client-browser-soft-phone as the template. I am trying to log the CallSid for incoming and outgoing
Well, the connection.parameters you are getting is empty and you can check this by plugging console.dir(connection)
However, the reason is : Twilio does not populate parameters on outgoing connections for twilio.js V: 1.1 only for incoming connection so please use twilio.js 1.2 to make it works :)
Using TwilioJS 1.2 as recommended by adnanonline is the correct option. This version sets all appropriate parameters for you to access.
//static.twilio.com/libs/twiliojs/1.2/twilio.min.js