这是本文档旧的修订版!
用户在挂断电话之后,主动推送挂断信息到开发者服务器上,使开发者服务器得知该电话已经挂断,此接口会推送通话时长和开始及结束时间点,便于开发者服务器对客户进行费用结算工作。
• 请求地址
需要第三方自行配置URL地址。
• 请求包体
属性 | 类型 | 约束 | 说明 |
---|---|---|---|
event | string | 必选 | 值为:callhangup |
callid | string | 必选 | 呼叫的唯一标识(沿用原来机制,由sdk组件生成) |
accountid | string | 必选 | 开发者账号id |
appid | string | 必选 | 应用id |
confid | string | 必选 | 群聊id (仅语音群聊场景) |
calltype | int | 必选 | 1:免费 |
callertype | int | 必选 | 主叫号码类型,0:Client账号,1:普通电话,2:userid |
callernum | String | 必选 | 用户绑定的号码 |
displaynum | String | 必选 | 用户显号号码 |
caller | String | 必选 | 主叫号码 普通电话:18612345678 Client号码:60000000000017 |
calledtype | int | 必选 | 被叫号码类型,0:Client账号,1:普通电话,2:userid |
called | string | 必选 | 被叫号码 普通电话:18612345678 Client号码:60000000000017 |
starttime | string | 必选 | 开始通话时间。时间格式如:2014-06-16 16:47:28 |
stoptime | string | 必选 | 结束通话时间。时间格式如:2014-06-16 17:31:14 |
length | int | 必选 | 通话时长(s) |
recordurl | String | 可选 | 通话录音完整下载地址,默认为空。 |
userData | string | 可选 | 用户自定义数据字符串,最大长度128字节 |
reason | int | 必选 | 挂机原因描述,0:正常挂断;1:余额不足;2:媒体超时;3:无法接通;4:拒接; 5:超时未接;6:拒接或超时未接;7:平台服务器网络错误;8:用户请求取消通话; 9:第三方鉴权错误;255:其他原因。 |
subreason | int | 可选 | 挂机原因补充描述,1:主叫挂断;2:被叫挂断;目前当reason=0时有效。 |
• XML请求示例
POST /coolweb/callhangup HTTP/1.1 Host: 172.16.10.32:8080 Content-Type:text/xml;charset=utf-8 Accept:application/xml Content-Length: 515 <?xml version="1.0"?> <request> <event>callhangup</event> <callid>60000000000008mRrDm254582</callid> <accountid>aae25ec101fc12087516bc6564d0aa73</accountid> <appid>0e0ad5c8ba5c4225b9eff2f4c0259196</appid> <calltype>0</calltype> <callertype>0</callertype> <caller>60000000000008</caller> <calledtype>1</calledtype> <called>18612345678</called> <length>8</length> <starttime>2014-07-11 10:29:27</starttime> <stoptime>2014-07-11 10:29:35</stoptime> <userData>18612345678</userData> <reason>0</reason> </request>
• 响应包体
属性 | 类型 | 约束 | 说明 |
---|---|---|---|
retcode | int | 必选 | 返回错误码,0:成功,非0:失败 |
reason | String | 可选 | 原因描述 |
• XML响应示例
<?xml version="1.0" encoding="UTF-8"?> <response> <retcode>0</retcode> <reason>100013</reason> </response>