私は次のものを作成したい:
- 回線番号、たとえば 741-SUPPORT (ほんの一例) としましょう。人々が電話をかけることができます。
- 誰かが電話をかけてきたら、テキストを聞いてもらい (私は を使用します
<Say>
)、その電話を私の番号に転送します。 - 電話がかかってきたら、この電話がその回線からのものであることを通知するテキストを聞きたいと思います。0 を押して電話を受け入れるか、他の番号を押して電話を拒否することができます。
- 私が受け入れる場合、両方の通話が接続されます。それ以外の場合、発信者はメッセージを残すことができるはずです。
私がこれまでに行ったこと:
発信者が 741-SUPPORT に電話をかけたときに使用される最初の TWIML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice" language="en-US">
This call is being recorded.
Please hold on, your are being connected.
</Say>
<Dial action="CallEnded.php" timeout="15" timeLimit="600" callerId="+1741SUPPORT" record="record-from-answer">
<Number action="JoinCall.php">+PRIVATE NUMBER HERE</Number>
</Dial>
</Response>
JoinCall.php
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather timeout="10" numDigits="1" action="CallAccepted.php">
<Say voice="alice" language="en-US">
You have an incomming call from 741SUPPORT.
Press 0 to accept the call, press any other number to reject the call.
</Say>
</Gather>
</Response>
CallAccepted.php
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<?php if ($_POST['Digits'] == '0') { ?>
<Say voice="alice" language="en-US">
Call accepted.
This call is being recorded.
</Say>
<?php } else { ?>
<Say voice="alice" language="en-US">
Call will be rejected.
</Say>
<Hangup/>
<?php } ?>
</Response>
CallEnded.php
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice" language="en-US">
<?php if ($_POST['DialCallStatus'] != 'completed') { ?>
We had issues connecting the call, please try again later.
<?php } else { ?>
Thanks for your call. Goodbye!
<?php } ?>
</Say>
</Response>
だから私は知りたいです:
- すべてのロジックが実行されている間、発信者側で保留音楽を再生するにはどうすればよいですか?
- 通話を切断し、発信者にメッセージを残すように依頼するにはどうすればよいですか?