応答がない場合、通話をボイスメールにリダイレクトしたいと考えています。コードは次のとおりです。
get '/inbound' do
CALLER_ID = 'caller_number'
to = 'dest_number'
r = Response.new()
r.addSpeak('Thanks for calling acme, if someone does not answer within 20 seconds you will be directed to voicemail')
r.addDial({'callerId' => CALLER_ID, 'timeout' => '20'}).addNumber(to)
r.addSpeak("The number you're trying is not reachable at the moment. You are being redirected to the voice mail")
r.addDial('action' => 'http://frozen-lake-7349.herokuapp.com/voicemail', 'method' => 'GET')
content_type 'text/xml'
r.to_xml()
end
これは、ボイスメールの URL に転送され、録音が行われるという点で部分的に機能しますが、通話に応答した場合、応答側が電話を切ると、フローは続行され、発信者はとにかくボイスメールにルーティングされます。当事者が話したので不要です。
それで、基本的にどこかにif句があるはずです:電話に応答した場合、ボイスメールに行かない場合、ハングアップで終了しますか?これどうやってするの?
ありがとう!