将TWILIO PHONE NUMBERS映射到用户

时间:2017-02-16 09:46:34

标签: twilio

我怎么能用php中的用户手机号码来映射twilio手机号码。你能给我举例或代码。

我以前做过的工作。 基本上我正在进行蒙面数字整合 1.从twilio购买no 1.创建twmil app和webhook url,这是php页面 2.并配置购买否

当用户拨打twilio时,没有打电话给我的desicre no

我的php文件代码

    <pre>

header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
include_once("DataBase.php");
include_once("../function.php");

$file = 'calls.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= "call data == ".json_decode($_REQUEST)."\n";
// Write the contents back to the file
file_put_contents($file, $current);



$CallData = $DataBase->Select_Row(array("to_email","id","from_email"), "calls_twilio","isCalled!='1' order by id desc");
$to_email=$CallData->to_email;
$id=$CallData->id;
$from_email=$CallData->from_email;

$userFrom = $DataBase->Select_Row(array("txtb_contactno"), "tbluser", "txtb_email='$from_email'");
$userTo = $DataBase->Select_Row(array("txtb_contactno"), "tbluser", "txtb_email='$to_email'");

$from_No = $userFrom->txtb_contactno;
$toNo = $userTo->txtb_contactno;
$SenderNo=$Global_SETTINGS_ARRAY["twilio_call_from_no"];
mysql_query("update calls_twilio set isCalled='1' where id = '$id'");

<Response>
    <Pause length="1"/>
    <Dial callerId="<?=$SenderNo?>"><?=$toNo?></Dial>
</Response>
    </pre>

当我打电话给我的webhook网址时,我想发送一些额外的参数 请注意我不想使用voip电话 但我想像超人那样对掩蔽系统进行编号

谢谢

0 个答案:

没有答案