拨号
This commit is contained in:
@@ -712,46 +712,44 @@ class UserFollow extends Controller
|
||||
\result($product_account_model->getUserAccount($id, $index));
|
||||
}
|
||||
|
||||
//拨打电话进行维护
|
||||
public function hujiao() {
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
$phone = $data['phone'];
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
$phone = $data['phone'];
|
||||
|
||||
$callers = ['1017'=>'15225139515','1029'=>'15713870747','1032'=>'15290427047'];
|
||||
$operaterids = ['1017','1029','1032'];
|
||||
$callers = ['1017'=>'15225139515','1029'=>'15713870747','1032'=>'15290427047'];
|
||||
$operaterids = ['1017','1029','1032'];
|
||||
|
||||
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
|
||||
die;
|
||||
}
|
||||
|
||||
$caller = $callers[$this->userinfo['OperaterID']];
|
||||
if (!in_array($this->userinfo['OperaterID'],$operaterids)) {
|
||||
die;
|
||||
}
|
||||
|
||||
$callee = $phone;
|
||||
$serviceNumber = '02361933764';
|
||||
|
||||
$header = [
|
||||
'Content-Type:application/json',
|
||||
'app_id:f39b78fb812f192e221b55b752267b2c',
|
||||
'timeStamp:'. time() * 1000
|
||||
];
|
||||
$caller = $callers[$this->userinfo['OperaterID']];
|
||||
|
||||
$callee = $phone;
|
||||
$serviceNumber = '';
|
||||
|
||||
$header = [
|
||||
'Content-Type:application/json',
|
||||
'app_id:f39b78fb812f192e221b55b752267b2c',
|
||||
'timeStamp:'. time() * 1000
|
||||
];
|
||||
|
||||
|
||||
$param = [
|
||||
'caller' =>$caller,
|
||||
'callee'=>$callee,
|
||||
'serviceNumber'=>$serviceNumber,
|
||||
'callBackUrl' =>"https://php-api.juip.com/api/hujiao/callback"
|
||||
|
||||
];
|
||||
$param = [
|
||||
'caller' =>$caller,
|
||||
'callee'=>$callee,
|
||||
'callBackUrl' =>"https://php-api.juip.com/api/hujiao/callback"
|
||||
|
||||
];
|
||||
|
||||
|
||||
$back_data = json_decode(linkcurl('https://yunyuzhineng.cn:8888/voice/v1/call-rs','POST',json_encode($param),$header,0));
|
||||
$back_data = json_decode(linkcurl('https://yunyuzhineng.cn:8888/voice/v1/call-rs','POST',json_encode($param),$header,0));
|
||||
|
||||
if ($back_data->code == 1000) {
|
||||
\result([],'呼叫成功');
|
||||
} else {
|
||||
\result([],'呼叫失败',30000);
|
||||
}
|
||||
|
||||
if ($back_data->code == 1000) {
|
||||
\result([],'呼叫成功');
|
||||
} else {
|
||||
\result([],'呼叫失败',30000);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user