2014-05-09 1 views
0

Twilio에서 SMS 보내기 Subaccounts (예 : 전역 적으로 메시지 번호가 가능합니다) 기능이 작동하지 않습니다. 여기 Zend Framework를 사용하여 Twilio API로 메시지를 보낼 수 없습니다.

가 보내는 메시지

public function notification($loggedUserId,$send_to){ 
    global $objSession; 
    $modelUser = new Application_Model_User();  
    $data = $modelUser->getTwilio('twilio',$loggedUserId); 
    // here in $data I got all data about subaccount 
    //by which a user is logged in and array i got is 
    /* 
    Array 
    (
    [twilio_id] => 1 
    [twilio_trainer_id] => 147 (its logged user id) 
    [twilio_phone] => +177*****09 
    [twilio_sid] => ACfd42**********709***b*********** 
    [twilio_token] => 88a*************************da** 
    [twilio_added] => 2014-04-29 19:42:14 
    )*/ 

    // Step 1: Set Library. 
    require_once(ROOT_PATH.'/library/twilio/Services/Twilio.php'); 
    // Step 2: set our AccountSid and AuthToken from www.twilio.com/user/account 
    $AccountSid = $data['twilio_sid']; 
    $AuthToken = $data['twilio_token']; 
    $twilioPhone = $data['twilio_phone']; 


    // Step 3: instantiate a new Twilio Rest Client 
    $client = new Services_Twilio($AccountSid, $AuthToken); 
    // Step 4: make an array of people we know, to send them a message. 
    // Feel free to change/add your own phone number and name here. 

    $peopleInfo = $this->objUser->getUserData($send_to); 
    //prd($peopleInfo['user_phone']); 

    // Step 5: Loop over all our friends. $number is a phone number above, and 
    // $name is the name next to it 


    if(!empty($peopleInfo['user_phone'])){ 
     $sms = $client->account->messages->sendMessage(
      // Step 6: Change the 'From' number below to be a valid Twilio number 
      // that you've purchased, or the (deprecated) Sandbox number 
      $twilioPhone, 
      // the number we are sending to - Any phone number 
      $peopleInfo['user_phone'], 
      // the sms body 
      "Hey , Monkey Party at 6PM. Bring Bananas!" 
     ); 
     // Display a confirmation message on the screen 
     echo "Sent Successufully "; 
    } 
    exit; 
} 

모든 것이 잘 실행되지만 메시지가 내 전화 번호에서 수신되지 않은 코드입니다. Sent Successfully이 인쇄되었지만 메시지를받지 못했습니다.

내가 뭘 잘못하고 있는지 누가 알 수 있습니까?

+0

Twilio 계정 페이지의 로그 확인 섹션. –

+0

@usef_ksa 내 Twilio 로그에 메시지가 없습니다. –

+0

@usef_ksa Twilio.php 클래스에서 문제가 있는지 확인합니다. $ client obj를 할당 한 후 – dixromos98

답변

0

Rock Rathore가 요청한대로

클래스 처리 지역 번호는 무엇입니까? 포맷이 필요한 건가요? 예를 들어, 0091 또는 91 또는 91을 주면 문제가됩니까? 다른 형식의 지역 번호를 보내거나 지역 번호에 대해 하나의 형식이 필요한 경우에도 클래스가 최종 번호를 형식화합니까?

관련 문제