2017-01-24 1 views
1

우리는 궁극적으로 연락처 양식의 리드를 비즈니스 소유자와 연결하는 워크 플로를 만들려고합니다. 1) 납이 Unbounce와 Stamplay 통합을 사용하여 문의 양식 2)에 채워 리드은 "이제"연락, 또는 "나중에"를 원하는 경우를 묻는 문자를 수신, 다음과 같이번호 TWILIO 번호로 전화를 걸어 TWILM Bin

워크 플로입니다.

의 리드와 함께 가자는

3) 리드가 다음에 무엇을해야하는지 결정하기 위해은 webhook URL에 액세스 할, "이제"말한다 "이제"말했다.

이 특별한 경우, "지금"이라고 말하면 TWIML 저장소가 사업자에게 전화를 걸게됩니다. 업체 대표가 데리러 오지 않는 경우 '이름'과 '날짜/시간'이 포함 된 후속 텍스트를 보내 줄 것을 요청하는 텍스트를 보내줍니다.

4) 수석이이 정보가 포함 된 텍스트로 응답 한 다음 비즈니스 소유자와 리드는 약속에 대한 별도의 통지를받습니다.

사용자가 Twilio 번호로 직접 전화를 걸면이 전체 워크 플로를 성공적으로 수행 할 수있었습니다 (아직 도움이 필요한 키워드로 프로그램 적으로 프로그래밍하지 않은 경우).

호출이 오면 -> TWIML 빈

SMS를 수신한다
<?xml version="1.0" encoding="UTF-8"?> 
<Response> 
    <Pause length="4"/> 
    <Say>Please hold, while I connect your call.</Say> 
    <Pause length="4"/> 
    <Dial timeout="10"> business owner number </Dial> 
    <Pause length="4"/> 
    <Sms>I am currently unavailable. If you'd like me to get in touch, pls reply back with your name, and a time that would work best for you. Thanks, Adam</Sms> 
</Response> 

->으로 webhook URL

<?php 
// Require the bundled autoload file - the path may need to change 
// based on where you downloaded and unzipped the SDK 
require __DIR__ . '/twilio-php-master/Twilio/autoload.php'; 

// Use the REST API Client to make requests to the Twilio REST API 
use Twilio\Rest\Client; 

// Your Account SID and Auth Token from twilio.com/console 
$sid = 'xyz'; 
$token = 'xyz'; 
$client = new Client($sid, $token); 

$number = $_POST['From']; 
$body = $_POST['Body']; 

//Sends a message to the owner 
$sms = $client->account->messages->create(
    // Cell of owner 
    '12345', 
    array(
     // A Twilio phone number you purchased at twilio.com/console 
     'from' => "78900", 
     // Lead's reply sent to owner asNotification 
     'body' => "Hi <name>. You have a new lead. The information for this lead is: $body. You can contact them at $number" 
    ) 
); 

//Sends a message to the lead 
$sms = $client->account->messages->create(
    // Cell of Lead 
    $number, 
    array(
     // A Twilio phone number you purchased at twilio.com/console 
     'from' => "78900", 
     // Notification Message sent to Lead 
     'body' => "This is a confirmation that I have received your information, and will be in contact with you soon. Thanks, <name>." 
    ) 
); 

어디 리드 텍스트 데 문제가 발생하고 비즈니스 소유자와 리드 간 통화를 시작하려면 '지금'을 선택하십시오.

이것은 수신하고있는 것을 제외하고 내가 사용하려고 시도한 코드입니다. 11200- HTTP 검색 실패 논스톱. 나는 또한 $ client-> account-> calls-> create를 사용하려고 시도했다. 성공적으로 메시지를 보내는 데 사용되었다.

// Read TwiML at this URL when a call connects (attempt to connect to owner) 
$call = $client->calls->create(
    'lead-number', // Call this number 
    '78900', // From a valid Twilio number 
    array(
     'url' => TWIML Bin of Interest 
) 
); 

누구든지 내가 무엇을 할 수 있는지 알고 있습니까?

답변

0

체크 아웃 creating a dynamic response의 예 : 귀하의 경우는 "지금"에있는 경우에 대해 수정할 수 있습니다에서

<?php 
// Get the PHP helper library from twilio.com/docs/php/install 

require_once '/path/to/vendor/autoload.php'; // Loads the library 
use Twilio\Twiml; 

$response = new Twiml; 
$body = $_REQUEST['Body']; 

if($body == 'hello'){ 
    $response->message('Hi!'); 
}else if($body == 'bye'){ 
    $response->message('Goodbye'); 
} 
print $response; 

$body 당신이 당신의 코드가 잘 보이는 전화를 만들 수 있습니다. 11200 HTTP 검색 오류에 관해서

$call = $client->calls->create(
    "+1415XXXXXXX", "+1415XXXXXXX", 
    array("url" => "link_to_twiml_bin") 
); 

는 특히 possible solutions here를 살펴 :

확실히 웹 서버가 정적 자원 (URL이 참조하는 경우에 HTTP POST 요청을 허용합니다. xml 또는 .html 파일)

+0

이 Megan에 오신 것을 진심으로 감사드립니다. 그것을 확인합니다. –

관련 문제