Reputation: 51
I am developing a simple application in C# which
I was able to make a call but not able to receive the user input Or status, I tried finishOnKey()
but that didn't work, and it always provides status as completed. I didn't get much help from Twilio code sample, can someone redirect to correct article or provide the code to accomplish above.
Upvotes: 1
Views: 822
Reputation: 73057
Twilio developer evangelist here.
Once a call is answered successfully, it doesn't matter how the call is finished, the final status it reaches will be "completed". You can see more about Twilio call statuses in this documentation. You can see that the final call statuses could be:
If you are using <Gather>
to take the user input, you should ensure you have set the action
attribute to a URL in your application. That URL will receive a new webhook request when the user presses a digit. For example:
<Response>
<Gather action="/gather_results" digits="1">
<Say>... your content goes here ...</Say>
</Gather>
</Response>
With the above TwiML a user would only have to press 1 key before the call is moved to the next stage and the webhook '/gather_results'.
The request to the /gather_results
endpoint would include a body with a Digits
parameter. If the user pressed "*" then the body of the request would include Digits=*
, if the user pressed "1" then it would include Digits=1
. You could then choose to do whatever you like with those results, including hanging up the call or recording the submitted digits.
Let me know if this helps at all.
Upvotes: 1