質問
Twilioで代替アクションを使うのですか?私がしようとしていることは特定の鍵を捉えることです(*)。このキーを押すと、デフォルトのものではなく別のことがあります。これが私が現在持っているものです:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather finishOnKey="*" action="/another_thing" method="POST">
<Say>Hi this is the initial message</Say>
</Gather>
<Say>Hi this is the default message. Please enter a 3 digit number</Say>
<Gather numDigits="3" action="/save_number" method="POST" />
</Response>
.
基本的に*キーを押すとanother_thing
ルートに送信したいです。しかし、*キーを押すと現在起こっているのは、ギャザーの下の動詞の動詞に行くことです。それで、それは私の予想の代わりにHi this is the default message. Please enter a 3 digit number
と言いますかそれはanother_thing
に行き、それがそこにあるものは何でも出力します。
これはTwilioで可能ですか、または私は何か悪いことをしていますか?助けてください。事前にありがとう!
これが私がanother_path
のために持っているものであるならば:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hey whats up!</Say>
</Response>
. 解決
Twilio Evangelistここで。
だから、あなたは正しいトラックにいます。デフォルトのメッセージには別のTWIMLルートを使用する必要があります。その後、すべてが問題ないはずです。 numDigits
の代わりにfinishOnKey
を使用することをお勧めします。 finishOnKey
を使用している場合は、実際にはその文字を送信しません。 <Gather>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather numDigits="1" action="/another_thing" method="POST">
<Say>Hi this is the initial message</Say>
</Gather>
</Response>
.
あなたの/another_thing
ルートでは、Twilioによって送信されたDigits
パラメータを調べて、何をすべきかを判断できます。キーを押さなかった場合:
<Response>
<Say>Hi this is the default message. Please enter a 3 digit number</Say>
<Gather numDigits="3" action="/save_number" method="POST" />
</Response>
.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hey whats up!</Say>
</Response>
.
所属していません StackOverflow