0

I have an Australian Twilio number but when people call, they hear a very different sounding ring tone to what you normally hear when calling Australian phones. How do I change this in this section of Functions:

    const dial = twiml.dial(
      {
        action: '/handle-call',
        method: 'POST',
        timeout: 20
      }
    );
    dial.sip('me@example.sip.us1.twilio.com');

Edit: I've tried adding this to the function but I get a 500 error whenever someone tries calling (I've also enabled AUTH_TOKEN in context in the configuration settings).

exports.handler = function(context, event, callback) {
    const device = new Twilio.twiml.Device();
    device.setup(context.AUTH_TOKEN, {
        sounds: {
            incoming: 'http://url-to-sound-file.mp3'
        }
    });
    ...
Jake
  • 3,865
  • 5
  • 25
  • 58
  • Do you receive call on Twilio number or make call from Twilio number? – Chetan Jul 30 '19 at 01:15
  • Both. It's the inbound calls that I want changed - so the ring tone that people who call me hear before I answer. – Jake Jul 30 '19 at 01:24
  • https://stackoverflow.com/questions/29900057/is-it-possible-to-change-the-twilio-browser-client-ringtone – Chetan Jul 30 '19 at 01:28
  • It seems that answer is now deprecated by Twilio. Also, it doesn't explain how to add this to a function. – Jake Jul 30 '19 at 06:01

2 Answers2

0

Did you note the ringTone attribute?

TwiML™ Voice: https://www.twilio.com/docs/voice/twiml/dial#ringtone

Also, note the comment: "Note: ringTone will never be applied to calls to endpoints."

Alan
  • 10,465
  • 2
  • 8
  • 9
  • 1
    I didn't see that, but as it says I can't use it with sip endpoints which is a requirement. – Jake Jul 30 '19 at 09:51
0

Not exactly with functions but rather with TwiML Bins. Don't see much sense to copy paste from this article.

https://support.twilio.com/hc/en-us/articles/360024055153-Change-the-Hold-Music-with-Twilio-Flex

Stanislau Buzunko
  • 1,630
  • 1
  • 15
  • 27