0
votes

I have an API which first creates a call to a number using the C# wrapper, lets say the receiver is +1000000001

var call = CallResource.Create(new PhoneNumber("+1000000001"),
                        new PhoneNumber("MYVERIFIEDNUMBER"),
                        url: new Uri("https://api.com/answered"),
                        method: HttpMethod.Get,
                        client: _client,
                        sendDigits: ""
                        );

When answered the TWIML returned from https://api.com/answered is

<?xml version="1.0" encoding="utf-8"?>
<Response>
  <Gather action="https://api.com/connect/6AE3045C0D024F1896BF7ECFCB2FC40A" method="GET">
    <Say voice="alice" loop="0" language="en">Press any key to connect to John Doe, , </Say>
  </Gather>
</Response>

This should result in an infinite loop in the voice of "alice" for the SAY verb being repeated to the receiver at +1000000001 but it is a male robotic voice and it only repeats once then drops the call. This is first part of the issue.

The second part is the GATHER verb does nothing. I should be able to press a touch tone phone and have the url https://api.com/connect/6AE3045C0D024F1896BF7ECFCB2FC40A return

<?xml version="1.0" encoding="utf-8"?>
<Response>
  <Dial>client:6AE3045C0D024F1896BF7ECFCB2FC40A</Dial>
  <Hangup></Hangup>
</Response>

which it does on the GET request but I can never get to it because of the GATHER issue

The third part is does this look correct to dial a client app?

<Dial>client:6AE3045C0D024F1896BF7ECFCB2FC40A</Dial>

Thanks for any advice

1
You have loop="0" which makes it only play once. Also language="en" isn't a valid language option. I presume you want language="en-US"jmalenfant
Somebody correct me if I'm wrong but I think you're wrong on both counts. twilio.com/docs/voice/twiml/say#attributes-loop seems to suggest that loop="0" will cause an infinite loop until hung up. I also tried this 6 months ago and it looped infinitely, well within reason - I think it lasted around 20 minutes. Any more required further SAY verbs. twilio.com/docs/voice/twiml/say#attributes-language suggests 'The default is English with an American accent (en)' & also 'select English with an American accent (en)'user1919214
Looks like you're correct on the loop. But for the language, as the doc says, "en" is for "man" or "woman". The default for Alice is en-US so you can leave the language attribute off if that's the one you want.jmalenfant

1 Answers

0
votes

Looks like Alice defaults to en-US so you can leave the language attribute off. Also, can you make sure you are returning TwiML with the right MIME type, https://www.twilio.com/docs/voice/twiml#twilio-understands-mime-types.

Client is used inorrectly, refer to the TwiML syntax here, https://www.twilio.com/docs/voice/client/twiml.

Let me know if that addresses the issue.