Skip to content

Instantly share code, notes, and snippets.

@hatanaka-akihiro
hatanaka-akihiro / twilio_sms.xml
Last active February 25, 2022 07:02
Questetra BPM Suite add-on Sending SMS by Twilio
<?xml version="1.0" encoding="UTF-8"?>
<service-task-definition>
<engine-type>2</engine-type>
<last-modified>2018-07-24</last-modified>
<label>Sending SMS by Twilio</label>
<label locale="ja">SMS 送信 by Twilio</label>
<configs>
@hatanaka-akihiro
hatanaka-akihiro / gist:8996149
Created February 14, 2014 05:12
record.php
<?php
$url = $_REQUEST['RecordingUrl'];
//mail('hatanaka@questetra.com', 'RecordingUrl', $url);
@hatanaka-akihiro
hatanaka-akihiro / gist:8996145
Created February 14, 2014 05:11
transfer.php
<?php
require '../vendor/autoload.php';
$xml = new Services_Twilio_Twiml();
$xml->say('しばらくお待ち下さい。', array('language' => 'ja-jp'));
$xml->dial('+81xxxxxxxx', array(
'callerId' => '+81xxxxxxxx',
'record' => 'true',
'action' => 'http://158.199.192.79/hatanaka/record.php'
));
<?php
require '../vendor/autoload.php';
$AccountSid = 'xxxxxxxx';
$AuthToken = 'xxxxxxxx';
$client = new Services_Twilio($AccountSid, $AuthToken);
$From = '+81xxxxxxxx';
$To = '+81xxxxxxxx';
@hatanaka-akihiro
hatanaka-akihiro / gist:8995715
Created February 14, 2014 04:18
ivr_response.php
<?php
require '../vendor/autoload.php';
$Digits = (integer)$_REQUEST['Digits'];
$xml = new Services_Twilio_Twiml();
$text = <<<EOT
こんにちは。$Digits を押しましたね。
EOT;
$xml->say($text, array('language' => 'ja-jp'));
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather timeout="10" numDigits="1" action="http://158.199.192.79/hatanaka/ivr_response.php">
<Say language="ja-jp">数字を押してください。</Say>
</Gather>
</Response>
@hatanaka-akihiro
hatanaka-akihiro / gist:8995694
Created February 14, 2014 04:16
caller.php
<?php
require '../vendor/autoload.php';
$From = $_REQUEST['From'];
$xml = new Services_Twilio_Twiml();
$text = <<<EOT
こんにちは $From さん
EOT;
$xml->say($text, array('language' => 'ja-jp'));
@hatanaka-akihiro
hatanaka-akihiro / gist:8995682
Created February 14, 2014 04:15
hello2.php
<?php
require '../vendor/autoload.php';
$xml = new Services_Twilio_Twiml();
$xml->say('こんにちは', array('language' => 'ja-jp'));
header('Content-Type: text/xml; charset=UTF-8');
echo $xml;
@hatanaka-akihiro
hatanaka-akihiro / gist:8995667
Last active August 29, 2015 13:56
hello1.php
<?php
header('Content-Type: text/xml; charset=UTF-8');
?>
<Response>
<Say language="ja-jp">こんにちは</Say>
</Response>