Oussema Aroua
Oussema Aroua

Reputation: 5339

Twilio : Twilio was unable to parse the provided XML Document

i'm trying to use programming voice in android application using this example link.

I hosted the python file and everything and and I changed the 'twiMLParams' in the quickstart code

 twiMLParams.put("To", "oussema");
 twiMLParams.put("From", "me");
 twiMLParams.put("Caller", "oussema");
 twiMLParams.put("Called", "me");
 activeCall = Voice.call(VoiceChat.this, TWILIO_ACCESS_TOKEN, twiMLParams, callListener);

I got this error : Twilio was unable to parse the provided XML Document. What's I'm doing wrong here ? the problem is server side not client,

Upvotes: 1

Views: 404

Answers (1)

Oussema Aroua
Oussema Aroua

Reputation: 5339

[Solved] : Thanks to Twilio support

android code :

 twiMLParams.put("From:","leme" );
 twiMLParams.put("To:", "oussema");
 activeCall = Voice.call(VoiceChat.this, TWILIO_ACCESS_TOKEN, twiMLParams, callListener);

Python code :

IDENTITY = request.values.get('To:', None)
CALLER_ID = request.values.get('From:', None)
client = Client(api_key, api_key_secret, account_sid)
return str('<?xml version="1.0" encoding="UTF-8"?><Response><Dial><Client>' + IDENTITY + '</Client></Dial></Response>')

Upvotes: 1

Related Questions