OBJECTIVE using the Twilio Framework:
- place an outbound call
- present 3 questions and record 3 voice response
- transcribe text from the call from the 3 voice responses
- use the # key to signal answer to each question and to move forward
CURRENTLY WORKING:
Python Code calling daisy-chained TwiML hosted via TWiML Bins
3 questions being asked
the call is recorded and can be listened to via Twilio console
PROBLEMS/WHAT IS NOT WORKING:
- there is no transcribed text from the call.
- there is noticeable time delay in calling the TwiML via the TwiML bin.
- the #key does not progress to the next question
Any suggestions appreciated:
from twilio.rest import Client
account_sid = 'XXXXXXXXXXXXXXXX'
auth_token = 'XXXXXXXXXXXXXXXX'
client = Client(account_sid, auth_token)
call = client.calls.create(
url='http://www.companyname.com/Auditor/MessageName.xml',
to="+61437231327",
from_='+61437231327',
record=True
)
print(call.sid)
print(call.status)
#print(call.transcription_text)
print(call.uri)
-------- TWIML hosted website MessageName.xml ---------------
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">Collecting Name </Say>
<Gather input="speech" timeout="3" numDigits="1" action="https://handler.twilio.com/twiml/someTwilBinURLID">
<Say>Please say Name. Press # when complete</Say>
</Gather>
</Response>
-------- TwimlBin TWIML - 2nd required voice response ---------------
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech" finishOnKey="#" timeout="3" numDigits="1" action="https://handler.twilio.com/twiml/someTwilBinURLIDForNextVoice">
<Say>Please say how old you are. Press # when complete</Say>
</Gather>
</Response>
-------- TwimlBin TWIML -3rd required voice response ---------------
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech" finishOnKey="#" timeout="3" numDigits="1">
<Say>Please say what your location is. Press # when complete</Say>
</Gather>
</Response>