2014-11-07 3 views
1

은 간단한 질문이지만, twilio로 레코드를 만들고 싶습니다.하지만이 작업은 효과가 없으며이 오류가 발생하지 않습니다.레코드가 Twiml에 없습니다.

숫자가 옵션 # 1 일 때 check()가 잘 작동합니다. 이제는 옵션 2가 작동하지 않아 이제는 BOLIVIA - SOUTH AMERICA에서 사용하고 있습니다. 여러 국가에서 음성 녹음이 작동하는 것을 이해했습니다. 나는 그것이 문제가되지 않을 것이라고 생각한다. 문서를 읽는 것이이 코드에 문제가되지는 않습니다. 숫자가 옵션 2 때 시험을 수행

twilioController.php

public function check() { 
    App::import('Vendor', 'Twilio', array('file' => 'Twilio'.DS.'Services'.DS.'Twilio.php')); 
    $response = new Services_Twilio_Twiml(); 
    $numero_cel = substr($this->request->data['From'],-8); 
    $callsid_cel = $this->request->data['CallSid']; 
    $this->loadModel('User'); 
    $this->loadModel('Numero'); 
    $exis_user= $this->User->find('first', array(
     'conditions'=> 
     array('celular'=>$numero_cel))); 

    if (isset($this->request->data['Digits'])) { 
      $input = $this->request->data['Digits']; 
      switch ($input) { 
      case 1: 
        $misses=$exis_user['User']['nombres'].' '.$exis_user['User']['apellidos']; 
         $numero = $this->Numero->find('all', array(
         'conditions'=> 
         array('user_id'=>$exis_user['User']['id']))); 
         $account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxx'; 
         $auth_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxx'; 
         $client = new Services_Twilio($account_sid, $auth_token); 

         foreach($numero as $var) 
         { 
          $client->account->messages->create(array(
           'To' => $var['Numero']['numero'], 
           'From' => "+12055189491", 
           'Body' => "hola ".$var['Numero']['nombre']." la Señora $misses esta en peligro comunicate con ella y ayudala.", 
          )); 
         } 
        break ; 



      case 2: 
        $this->request->data['Llamada']['CallSid']=$callsid_cel; 
         $this->request->data['Llamada']['from']=$numero_cel; 
         if ($this->Llamada->save($this->request->data)) { 
         } 
         $response->say("Empiece a grabar despues del tono", array('voice' => 'woman', 'language' => 'es')); 
         $response->record(array('maxLength' => 30,'action' => 'http://www.xxxxxxxxxx.bo/twilio/listen')); 
         $this->response->type('text/xml'); 
         $this->response->body($response); 
         return $this->response; 
       break ; 
       case 3: 
         $gather=$response->say("Empiece a grabar despues del tono", array('voice' => 'woman','language' => 'es')); 
         $response->record("hola", array('maxLength' => '30','action' => 'http://www.xxxxxxxxxx.bo/twilio/listen')); 
         $this->response->type('text/xml'); 
         $this->response->body($response); 
         return $this->response; 
        break ; 

      default: 

       $gather = $response->gather(array('numDigits' => 3, 'timeout' => '10')); 
       $gather->say("no selecciono un numero valido", 
         array('voice' => 'alice', 'language' => 'es')); 
       print $response ; 
       break ; 
      } 
     } else { 
       $response->say('Suspect access detected. Get out.', 
           array('voice' => 'alice', 'language' => 'es')); 
       print $response ; 
       exit ; 
     } 


} 

은, 다음이 출력입니다 :

<Response> 
    <Say voice="woman" language="es">Empiece a grabar despues del tono</Say> 
    <Record maxLength="30" action="http://www.xxxxxxxxx.bo/twilio/listen"/> 
</Response> 

하지만 그는 전화를했을 때 아무 일도 발생하지 않습니다. dont 일 및 기록 dont 일.

답변

0

괜찮 으면 기다려주세요. twilio ms의 페이지를 확인하는 데 40 초가 걸릴 수 있으며 어느 쪽이 더 높은지 확인하십시오.

관련 문제