打电话接口.md
5.42 KB
1. 通话请求接口
接口地址:/callcenter/app/call/{targetId}/{fishcardId}?access_token=token
Request Method:GET
Request params:
参数名 | 是否必须 | 说明 | 参数类型 |
---|---|---|---|
targetId | 是 | 被叫的用户id | Long |
fishcardId | 是 | 鱼卡id | Long |
access_token | 是 | 系统当前登录用户的token | String |
Response Body:
成功建立通话连接:
{
"data": {
"callSid": "16090510160925480001030600243044",
"telephoneNum":"010-xxxxx"
}
},
"returnCode": 200,
"returnMsg": "success"
}
系统异常:
{
"returnCode": 500,
"returnMsg": "系统内部异常!"
}
用户信息有误:
{
"returnCode": 400,
"returnMsg": "用户信息有误!"
}
非上课时间,无法使用通话功能:
{
"returnCode": 400,
"returnMsg": "非上课时间,无法使用通话功能!"
}
老师未绑定手机号:
{
"returnCode": 400,
"returnMsg": "您还未绑定手机号,无法电话联系学生,请继续视频呼叫!"
}
学生未绑定手机号:
{
"returnCode": 400,
"returnMsg": "学生未绑定手机号,无法电话联系学生,请继续视频呼叫!"
}
无通讯子账户:
{
"returnCode": 400,
"returnMsg": "无通讯子账户,请联系管理员!"
}
呼叫请求的参数有误:
{
"returnCode": 400,
"returnMsg": "呼叫请求的参数有误,请联系管理员!"
}
2. 客服呼叫
接口地址:/callcenter/app/callService?access_token=token
Request Method:GET
Request params:
参数名 | 是否必须 | 说明 | 参数类型 |
---|---|---|---|
access_token | 是 | 系统当前登录用户的token | String |
Response Body:
成功建立通话连接:
{
"data": {
"callSid": "16090510160925480001030600243044",
"telephoneNum":"010-xxxxx"
}
},
"returnCode": 200,
"returnMsg": "success"
}
系统异常:
{
"returnCode": 500,
"returnMsg": "系统内部异常!"
}
用户信息有误:
{
"returnCode": 400,
"returnMsg": "用户信息有误!"
}
用户未绑定手机号:
{
"returnCode": 400,
"returnMsg": "您还未绑定手机号,请用手机拨打客服电话!"
}
获取不到客服电话:
{
"returnCode": 400,
"returnMsg": "无法获取电话号码,请用手机拨打客服电话!"
}
无通讯子账户:
{
"returnCode": 400,
"returnMsg": "无通讯子账户,请联系管理员!"
}
呼叫请求的参数有误:
{
"returnCode": 400,
"returnMsg": "呼叫请求的参数有误,请联系管理员!"
}
3. 取消呼叫
接口地址:/callcenter/app/callCancel/{callSid}?access_token=token
Request Method:GET
Request params:
参数名 | 是否必须 | 说明 | 参数类型 |
---|---|---|---|
callSid | 是 | 当前通话的唯一标识 | String |
access_token | 是 | 系统当前登录用户的token | String |
Response Body:
成功取消呼叫:
{
"data": {
"isSuccess": "success"
}
},
"returnCode": 200,
"returnMsg": "success"
}
系统异常:
{
"returnCode": 500,
"returnMsg": "系统内部异常!"
}
用户信息有误:
{
"returnCode": 400,
"returnMsg": "用户信息有误!"
}
取消呼叫失败:
{
"returnCode": 400,
"returnMsg": "取消呼叫失败!"
}
4. 获取通话状态
接口地址:/callcenter/app/callState/{callSid}?access_token=token
Request Method:GET
Request params:
参数名 | 是否必须 | 说明 | 参数类型 |
---|---|---|---|
callSid | 是 | 当前通话的唯一标识 | String |
access_token | 是 | 系统当前登录用户的token | String |
Response Body:
请求通话:
{
"data": {
"stateType": "1"
}
},
"returnCode": 200,
"returnMsg": "success"
}
响铃(等待接听):
{
"data": {
"stateType": "2"
}
},
"returnCode": 200,
"returnMsg": "success"
}
建立通话(被叫已接听):
{
"data": {
"stateType": "3"
}
},
"returnCode": 200,
"returnMsg": "success"
}
通话结束:
{
"data": {
"stateType": "4"
}
},
"returnCode": 200,
"returnMsg": "success"
}
系统异常:
{
"returnCode": 500,
"returnMsg": "系统内部异常!"
}
5. 获取客服电话
接口地址:/callcenter/app/calledPhoneNum?access_token=token
Request Method:GET
Request params:
参数名 | 是否必须 | 说明 | 参数类型 |
---|---|---|---|
access_token | 是 | 系统当前登录用户的token | String |
Response Body:
获取到客服电话号码:
{
"data": {
"calledPhoneNum": "010-xxxx"
}
},
"returnCode": 200,
"returnMsg": "success"
}
用户信息有误:
{
"returnCode": 400,
"returnMsg": "用户信息有误!"
}
无法获取电话号码:
{
"returnCode": 400,
"returnMsg": "无法获取电话号码,请用手机拨打客服电话!"
}
系统异常:
{
"returnCode": 500,
"returnMsg": "系统内部异常!"
}