POST /api/v0.0.1/inbound/query?token={token}&type={type}
名称 | 是否必需 | 类型 | 描述 |
inboundid | 是 | Int | 外线来电编号。注: 从 PBX 发送的通话报告中获取 inboundid 的值。 |
名称 | 类型 | 描述 |
inbound | Object | 来电,由外线呼入的外部通话。 |
inboundid | Int | 外线来电编号,通过该参数对来电进行转接、查询、挂断等操作。 |
from | String | 主叫号码。 |
to | String | 被叫号码。 |
callee | Object | 来电的通话方,可能为分机、IVR、去电。 |
trunk | String | 呼入时通过的中继名。 |
status | String |
通话状态
|
请求示例
POST /api/v0.0.1/inbound/query?token=813b621cfe8eecf445a2ce1f4a079ffe&type=json HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
{
"inboundid":"1589879501.901"
}
POST /api/v0.0.1/inbound/query?token=813b621cfe8eecf445a2ce1f4a079ffe&type=xml HTTP/1.1
Content-Type:application/xml; charset=utf-8
Host: 172.16.6.150
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<inboundid>1589879501.901</inboundid>
</xml>
响应示例
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
"status": "Success",
"inbound": [
{
"inboundid": "1589881290.963",
"from": "103",
"to": "101",
"trunk": "to-18-16-2",
"callee": {
"extid": "101"
},
"status": "Talking"
}
]
}
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<status>Success</status>
<inbound>
<inboundid>1589881290.963</inboundid>
<from>103</from>
<to>101</to>
<trunk>to-18-16-2</trunk>
<callee>
<extid>101</extid>
</callee>
<status>Talking</status>
</inbound>
</xml>