title: Get Twilio phone number Friendly Name when forwarding SMS message using Twilio Functions
body: <p>I would like to pass along the Twilio phone number's Friendly Name when I forward the SMS message to another phone number. (The Friendly Name is a property assigned to a Twilio number when it is purchased.)</p>
  
  <p>This is <strong>not</strong> the same as "Send Branded SMS Messages Using Twilio Alphanumeric Sender ID" described <a href="https://stackoverflow.com/a/29510549/">here</a> and <a href="https://www.twilio.com/blog/2015/08/send-branded-sms-messages-using-twilio-alphanumeric-sender-id.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I am operating in the USA where the above is not supported, and I am OK including the "Friendly Name" in the body of the forwarded message (or the subject line of the email). Also, The "Friendly Name" is not associated with the original sender of the message as in the above examples, but instead is associated with my Twilio numbers. Hope that's all clear.</p>
  
  <p>I am using this example code:</p>
  
  <p><a href="https://support.twilio.com/hc/en-us/articles/223134287-Forwarding-SMS-messages-to-another-phone-number" rel="nofollow noreferrer">Forwarding SMS messages to another phone number – Twilio Support</a> </p>
  
  <p>Three parameters are passed into the function:</p>
  
  <pre><code>exports.handler = function(context, event, callback) {
  </code></pre>
  
  <p><code>context</code> includes environment variables I configure. <code>callback</code> isn't relevant to this question. And for the <code>event</code> parameter, we have these properties:</p>
  
  <pre><code>AccountSid
  ApiVersion
  Body
  From
  FromCity
  FromCountry
  FromState
  FromZip
  MessageSid
  NumMedia
  NumSegments
  SmsMessageSid
  SmsSid
  SmsStatus
  To
  ToCity
  ToCountry
  ToState
  ToZip
  </code></pre>
  
  <p>Using <a href="https://support.twilio.com/hc/en-us/articles/115007737928-Building-apps-with-Twilio-Functions-Beta-" rel="nofollow noreferrer">Twilio Functions</a>, I want to obtain Friendly Name, which is not a property of <code>event</code>. Is it possible to obtain the Friendly Name through one of the other properties? If so, how?</p>
  
  <p>UPDATE: from <a href="https://www.twilio.com/docs/voice/api/outgoing-caller-ids" rel="nofollow noreferrer">this Twilio doc</a> I see a clue that I can possibly get Friendly Name from AccountSid.<strong>something</strong>.outgoing_caller_id.friendlyName</p>
  
  <p>I can't quite understand how to do that in a Twilio function. I tried using:</p>
  
  <pre><code>context.getTwilioClient();
  </code></pre>
  
  <p>The docs say that "will return an initialized REST client that you can use to make calls to the Twilio REST API." However, it returns an empty httpClient object along with strings for username, password and accountSID. I was expecting a populated object from which I could obtain the phone number's Friendly Name.</p>
  
  <p>As an aside, I would like to ask what objects get passed into the <code>event</code> parameter. In what circumstances would the <code>event</code> parameter contain different properties from those I listed above?</p>