Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
307d53b1
Commit
307d53b1
authored
Mar 15, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容联云2
parent
6a1318aa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
15 deletions
+87
-15
RongPhone.php
application/api_broker/controller/RongPhone.php
+20
-7
RongDemo.php
application/api_broker/untils/RongDemo.php
+30
-7
common.php
application/common.php
+6
-0
route.php
application/route.php
+5
-1
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+26
-0
No files found.
application/api_broker/controller/RongPhone.php
View file @
307d53b1
...
...
@@ -16,32 +16,44 @@ class RongPhone extends Basic
*/
public
function
rBindAXB
(){
$data
=
array
();
$Rong
=
new
RongDemo
();
$code
=
$Rong
->
statusCode
;
$phone_a
=
'18521714341'
;
$phone_x
=
'17080219070'
;
$phone_b
=
'13524893873'
;
$r
=
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
,
'0755'
);
echo
$r
;
$data
[
'data'
]
=
json_decode
(
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
,
'0755'
),
true
);
$data
[
'msg'
]
=
$code
[
$data
[
'data'
][
'statusCode'
]];
$data2
=
json_encode
(
$data
);
echo
$data2
;
}
/**
* 解绑AXB
*/
public
function
rongReleaseNumber
(){
$Rong
=
new
RongDemo
();
$mappingId
=
'NME20
2201803141649196111669110810
817080219070'
;
$mappingId
=
'NME20
1201803141740516611729495567
817080219070'
;
$r
=
$Rong
->
releaseNumber
(
$mappingId
);
echo
$r
;
}
//
回调
public
function
callStateNotify
Url
(){
//
话单通知
public
function
rongBilledInfrom
Url
(){
$params
=
$this
->
request
->
param
();
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall.txt'
,
$str
,
FILE_APPEND
);
}
//录音通知
public
function
rongRecordingInfromUrl
(){
}
//状态通知
public
function
rongStatusInfromUrl
(){
}
}
\ No newline at end of file
application/api_broker/untils/RongDemo.php
View file @
307d53b1
...
...
@@ -35,6 +35,23 @@ class RongDemo
];
public
$test_phone
=
'17080219070'
;
public
$sign
=
''
;
public
$statusCode
=
[
'000000'
=>
'成功'
,
'300001'
=>
'参数错误'
,
'300002'
=>
'验证错误'
,
'301101'
=>
'无号码资源'
,
'301201'
=>
'内部存储异常'
,
'301401'
=>
'无空闲号码'
,
'301402'
=>
'分配失败'
,
'301501'
=>
'类型号码未配置'
,
'301633'
=>
'找不到应用'
,
'320201'
=>
'号码已解绑'
,
'320400'
=>
'参数异常'
,
'320402'
=>
'号码已使用'
,
'320500'
=>
'落地异常'
,
'309000'
=>
'其它错误'
,
];
function
__construct
(){
...
...
@@ -52,9 +69,9 @@ class RongDemo
{
$data
=
$this
->
components
;
//生成签名
echo
$data
[
'accountSid'
]
.
$data
[
'authToken'
]
.
$time
;
echo
'<br>'
;
echo
$sign
=
strtoupper
(
md5
(
$data
[
'accountSid'
]
.
$data
[
'authToken'
]
.
$time
));
$data
[
'accountSid'
]
.
$data
[
'authToken'
]
.
$time
;
$sign
=
strtoupper
(
md5
(
$data
[
'accountSid'
]
.
$data
[
'authToken'
]
.
$time
));
return
$sign
;
}
...
...
@@ -99,7 +116,7 @@ class RongDemo
"CURLOPT_SSL_VERIFYPEER"
=>
0
,
"CURLOPT_SSL_VERIFYHOST"
=>
2
,
];
echo
$url
;
//
echo $url;
$response
=
$curl
->
post
(
$url
,
$data
);
return
$response
;
...
...
@@ -126,9 +143,9 @@ echo $url;
'bNumber'
=>
$bNumber
,
'servingNumber'
=>
$xNumber
,
'areaCode'
=>
$areaCode
,
'callStateNotifyUrl'
=>
CURRENT_URL
.
"broker/callStateNotifyUrl
"
,
'cdrNotifyUrl'
=>
CURRENT_URL
.
"broker/callStateNotifyUrl
"
,
'recordNotifyUrl'
=>
CURRENT_URL
.
"broker/callStateNotifyUrl
"
,
'callStateNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport
"
,
'cdrNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport
"
,
'recordNotifyUrl'
=>
"https://pre.tonglianjituan.com/task/addReport
"
,
];
$result
=
$this
->
sendCurl
(
$url
,
$post_data
,
$Authorization
);
...
...
@@ -168,4 +185,9 @@ echo $url;
}
\ No newline at end of file
application/common.php
View file @
307d53b1
...
...
@@ -121,6 +121,12 @@ function hide_customer_phone($phone)
}
//打印
function
prt
(
$arr
){
echo
"<pre/>"
;
print_r
(
$arr
);
}
/**^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$
* 验证手机号是否正确
* zhuwei 2017-10-18 17:28:01
...
...
application/route.php
View file @
307d53b1
...
...
@@ -256,6 +256,9 @@ Route::group('task',[
'addReport'
=>
[
'task/PrivacyNumber/addReport'
,
[
'method'
=>
'get|post'
]],
//阿里大于隐私号码回调
'queryRecordFile'
=>
[
'task/PrivacyNumber/queryRecordFile'
,
[
'method'
=>
'get'
]],
//下载录音
'releaseNumber'
=>
[
'task/PrivacyNumber/releaseNumber'
,
[
'method'
=>
'get'
]],
//释放号码
'rongBilledInfromUrl'
=>
[
'task/PrivacyNumber/rongBilledInfromUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[话单通知]
'rongRecordingInfromUrl'
=>
[
'task/PrivacyNumber/rongRecordingInfromUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[录音通知]
'rongStatusInfromUrl'
=>
[
'task/PrivacyNumber/rongStatusInfromUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[状态通知]
]);
Route
::
group
(
'broker'
,
[
...
...
@@ -282,8 +285,9 @@ Route::group('broker', [
'updateBindAXB'
=>
[
'api_broker/CellPhone/updateBindAXB'
,
[
'method'
=>
'post'
]
],
//更新绑定关系隐私号码
/*****容联隐私号*******/
'rBindAXB'
=>
[
'api_broker/RongPhone/rBindAXB'
,
[
'method'
=>
'post | get'
]
],
//隐私号码【绑定】
'callStateNotifyUrl'
=>
[
'api_broker/RongPhone/callStateNotifyUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调
'rongReleaseNumber'
=>
[
'api_broker/RongPhone/rongReleaseNumber'
,
[
'method'
=>
'post | get'
]
],
//隐私号码【解绑】
//商铺
'getShopList'
=>
[
'api_broker/Shop/getShopList'
,
[
'method'
=>
'get|post'
]
],
'getShopDetail'
=>
[
'api_broker/Shop/getShopDetail'
,
[
'method'
=>
'get'
]
],
...
...
application/task/controller/PrivacyNumber.php
View file @
307d53b1
...
...
@@ -114,4 +114,29 @@ class PrivacyNumber
Log
::
write
(
json_encode
(
$id
),
'AliYunReleaseNumber'
);
//记录日志
return
;
}
//话单通知
public
function
rongBilledInfromUrl
(){
$params
=
Request
::
instance
()
->
param
();
prt
(
$params
);
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall1.txt'
,
$str
,
FILE_APPEND
);
}
//录音通知
public
function
rongRecordingInfromUrl
(){
$params
=
Request
::
instance
()
->
param
();
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall2.txt'
,
$str
,
FILE_APPEND
);
}
//状态通知
public
function
rongStatusInfromUrl
(){
$params
=
Request
::
instance
()
->
param
();
$str
=
date
(
'Y-m-d h:i:s'
)
.
' '
.
var_export
(
$params
,
true
);
file_put_contents
(
'Rongcall3.txt'
,
$str
,
FILE_APPEND
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment