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