问题
I have a multi-step Call in function but I want both calls to run through the same script. I'm not sure if it can be achieved by nesting gather tags. First is it possible to nest the gather tags like this?
<gather action="page.php?step=1">
<say>Enter ID #</say>
<gather action="page.php?step=2">
<say>Pres 1 to do blah blah</say>
</gather>
</gather>
Second is can I add a variable to the action attribute in the <Gather> tag. It doesn't seem to be working for me.
回答1:
Twilio Evangelist here.
If you change the method of your Gather action method to GET, it might be easier for you:
<Gather action="page.php?step=2" method="GET">
<Say>Pres 1 to do blah blah</Say>
</Gather>
Also, in the example above you have a <Gather> inside of a <Gather>, which isn't supported.
I'm not sure how PHP does routing, but I've tended towards using the URL rather than a query:
<Gather action="/next_step/1"> ... </Gather>
or
<Gather action="/next_step/456"> ... </Gather>
Hope this helps!
来源:https://stackoverflow.com/questions/19121392/is-it-possible-to-add-additional-variables-to-the-action-attribute-in-the-gather