无法检测IVR

时间:2019-06-02 18:48:11

标签: ivr nexmo

我们想通过电话会议提供导师与用户之间的交流功能,因此以下是步骤:

  1. 首先,我们将打电话给辅导老师。
  2. 例如,我们将向家教提问。请按1以开始与用户的通信。
  3. 一旦导师按1,然后在同一通话中将用户与导师加入。

     <?php
     require_once "vendor/autoload.php";
    
     $keypair = new \Nexmo\Client\Credentials\Keypair(
       file_get_contents('private.key__'),
       '############################'
     );
    
     $client = new \Nexmo\Client($keypair);
    
     $ncco = [
       [
         "action"=> "talk",
         "text"=> "Welcome to a Voice API I V R. ",
         "voiceName"=> "Amy",
         "bargeIn"=> false
       ],
       [
         "action"=> "talk",
         "text"=> "please press 1 to communicate with user",
         "voiceName"=> "Amy",
         "bargeIn"=> true
       ],
       [
         "action"=> "input",
         "submitOnHash"=> true,
         "eventUrl"=> ["https://studentzmojo.com/answer"]
       ]
     ];
     $call = new \Nexmo\Call\Call();
     $call->setTo('91XXXXXXXXX')
       ->setFrom('91XXXXXXXXX')
       ->setNcco($ncco);
    
     $response = $client->calls()->create($call);
     echo"<pre>";print_r($response);die;
    echo $response->getId();
    
    ?>
    

0 个答案:

没有答案