REST API文档
话单管理
会议话单
信息说明:
参数 | 说明 |
---|---|
name | 会议名称 |
num | 会议号码 713556038-demo.xswitch.cn 根据此会议号控制会议各种操作 |
started_at | 会议开始时间 |
completed_at | 会议结束时间 |
meeting_id | 会议开始时间 |
completed_at | 会议结束时间 |
recurrent_meeting_id | 预约会议中周期性会议的 ID |
meeting_id | 预约会议 ID |
has_video | 是否有视频 |
uuid | 会议 UUID,唯一标识符 |
interval | 打包间隔 |
rate | 采样率 |
hostname | 主机 |
return_all_members | 所有参会人员 |
unjoined_members | 未参会 |
late_and_early_leave_members | 迟到早退 |
normal_joined_users | 准时参会 |
late_members | 仅迟到 |
early_leave_members | 仅早退 |
查看会议话单
- 请求 URL:
/api/conference_cdrs
默认查询 - 请求 URL:
/api/conference_cdrs?startDate=2023-03-01&endDate=2023-03-07&page=1&perPage=10
按开始、结束时间以及页码查询 - 请求方式:
GET
- Body 信息:参见信息说明。
- 返回值: code(200 即为正常),msg
- curl 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conference_cdrs
- 返回会议会议话单(示例):
{ "rowCount": 1, "page": 1, "data": [ { "name": "3000", "rate": 8000, "completed_at": "2024-07-11 16:50:05", "interval": 20, "get_conf_cdr_total": { "joined_users": { "data": [ { "name": "1001", "id": "3", "user_id": "3", "destination_number": "3000", "left_at": "2024-07-11 16:50:05", "joined_at": "2024-07-11 16:50:04", "uuid": "0190a0fc-3f54-7336-9344-b3b2c10e87cb", "num": "1001", "type": "NORMAL", "attend_type": "Group" } ], "total": 1 }, "unjoined_members": { "data": [], "total": 0 }, "return_all_members": { "data": [], "total": 0 }, "late_and_early_leave_members": { "data": [], "total": 0 }, "normal_joined_users": { "data": [], "total": 0 }, "late_members": { "data": [], "total": 0 }, "early_leave_members": { "data": [], "total": 0 } }, "started_at": "2024-07-11 16:50:04", "has_video": 0, "hostname": "77cf3d8ae018", "num": "3000-xswitch.cn", "id": 1, "uuid": "0190a0fc-3fcd-7c84-a778-cbe74f120145" } ], "pageCount": 1 }
查看某个指定会议话单
- 请求 URL:
/api/conference_cdrs/$id
- 请求方式:
GET
- Body 信息:参见信息说明。
- 返回值: code(200 即为正常),msg
- curl 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conference_cdrs/1
- 返回会议会议话单(示例):
{ "name": "测试会议1", "num": "713556038-demo.xswitch.cn", "started_at": "2022-05-17 01:24:52", "id": 1, "completed_at": "2022-05-17 01:25:04", "meeting_id": 2, "recurrent_meeting_id": 1, "interval": 20, "hostname": "bob", "has_video": 0, "rate": 8000, "uuid": "cafd90d0-4ffb-4c4e-b765-fd61ba392390" }
查看某个指定会议话单中的所有参会成员
- 请求 URL:
/api/conference_cdrs/uuid/$conference_uuid/members
- 请求方式:
GET
- Body 信息:参见信息说明。
- 返回值: code(200 即为正常),msg
参数 | 说明 |
---|---|
uuid | 该参会人员呼入会议的 UUID |
caller_id_name | 主叫名称 |
caller_id_number | 主叫号码 |
destination_number | 被叫号码 |
is_moderator | 是否是管理员 1 是 0 否 |
context | 呼叫源 |
network_addr | 网络地址 |
conference_uuid | 会议 UUID |
joined_at | 该成员加入会议时间 |
left_at | 该成员离开会议时间 |
has_video | 是否开启视频 |
num | 参会人数 |
- curl 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conference_cdrs/uuid/cafd90d0-4ffb-4c4e-b765-fd61ba392390/members
- 返回会议会议话单(示例):
{ "members": [ { "is_ghost": 0, "aniii": "", "conference_cdr_id": 0, "end_conference": 0, "caller_id_number": "1003", "is_moderator": 1, "id": 1, "chan_name": "sofia/default/1003@192.168.3.222", "destination_number": "3000", "ani": "1003", "uuid": "c3975ddf-2f3d-4e4a-b89c-2e3cfce028a3", "context": "context-1", "dialplan": "XML", "rdnis": "", "network_addr": "192.168.3.192", "source": "mod_sofia", "username": "1003", "conference_uuid": "cafd90d0-4ffb-4c4e-b765-fd61ba392390", "was_kicked": 0, "left_at": "2022-05-17 01:25:04", "joined_at": "2022-05-17 01:24:52", "callee_id_number": "", "caller_id_name": "1003", "callee_id_name": "", "has_video": 0 } ], "num": 1 }
FIFO 话单
参数 | 说明 |
---|---|
channel_uuid | 通道 UUID |
dest_number | 被叫号码 |
started_at | 开始时间 |
bridged_at | 接听时间 |
ended_at | 结束时间 |
ani | 服务坐席分机号码 |
media_file_id | 队列录音媒体文件 ID |
fifo_name | 队列名 |
bridged_number | 服务号码 |
获取所有 FIFO 话单
FIFO 话单支持按时间、主被叫号码等精确查询。
- 请求 URL:
/api/fifo_cdrs
- 请求方式:
GET
- Body 信息:参见信息说明。
- 返回值: code(200 即为正常) msg
- curl 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/fifo_cdrs
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/fifo_cdrs?page=1&perPage=500&startDate=2023-03-15&endDate=2023-03-23&ani=1001&destNumber=9196&bridgedNumber=1002
- 返回 FIFO 话单(示例):
{ "page": 1, "pageCount": 1, "data": [ { "channel_uuid": "4a08edda-a9cf-497c-9aa5-3af760e4fdd2", "id": 2, "dest_number": "9196", "bridged_at": "2023-03-25 17:28:15", "ani": "6000", "started_at": "2023-03-25 17:28:12", "ended_at": "2023-03-25 17:28:18", "media_file_id": 209, "fifo_name": "fifo", "bridged_number": "6000" }, { "channel_uuid": "efd88d74-5acd-47cb-99e0-c0ad52fe1edc", "id": 1, "dest_number": "9196", "bridged_at": "", "ani": "6000", "started_at": "2023-03-25 17:27:35", "ended_at": "2023-03-25 17:28:02", "media_file_id": 208, "fifo_name": "fifo", "bridged_number": "" } ], "rowCount": 2 }
CC 话单
CC 话单支持按时间、主被叫号码等精确查询。
信息说明:
参数 | 说明 |
---|---|
started_at | 开始时间 |
answer_at | 应答时间 |
channel_uuid | 通道 UUID |
dest_number | 被叫号码 |
ani | 服务号码 |
queuing_time | 进入队列时长 |
callcenter_name | 队列名 |
bridged_number | 服务号码 |
ring_time | 坐席响铃时长 |
bridged_at | 呼叫坐席时间 |
agent | 服务坐席 |
media_file_id | 录音文件 ID |
ended_at | 结束时间 |
- 请求 URL:
/api/callcenter_cdrs
- 请求方式:
GET
- Body 信息:参见信息说明。
- 请求值:参见说明。
请求值 | 说明 |
---|---|
startDate | 成功 |
endDate | 失败 |
ani | 主叫号码 |
destNumber | 被叫号码 |
bridgedNumber | 服务号码 |
agent | 坐席 |
queue | 队列 |
- curl 示例:
获取所有话单:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/callcenter_cdrs
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/ /api/callcenter_cdrs?page=1&perPage=500&startDate=2023-03-10&endDate=2023-03-25&ani=1001&destNumber=9196&bridgedNumber=1002
- 返回 CC 话单(示例):
{ "data": [ { "started_at": "2023-03-25 17:45:04", "answer_at": "2023-03-25 17:45:06", "channel_uuid": "75c86e7f-120a-4091-8d18-50022e92bdcc", "dest_number": "9196", "ani": "6000", "queuing_time": 2, "callcenter_name": "cc", "bridged_number": "6000", "ring_time": 2, "id": 2, "bridged_at": "2023-03-25 17:45:04", "agent": "default.5000", "media_file_id": 211, "ended_at": "2023-03-25 17:45:08" }, { "started_at": "2023-03-25 17:44:47", "answer_at": "", "channel_uuid": "82c42e7f-d43c-4f22-9a3f-6f1db842e72e", "dest_number": "9196", "ani": "6000", "queuing_time": 6, "callcenter_name": "cc", "bridged_number": "", "ring_time": 0, "id": 1, "bridged_at": "2023-03-25 17:44:47", "agent": "", "media_file_id": 210, "ended_at": "2023-03-25 17:44:52" } ], "pageCount": 1, "page": 1, "rowCount": 2 }
话单--通话记录
话单字段 | 中文说明 |
---|---|
caller_id_name | 主叫名称 |
caller_id_number | 主叫号码 |
destination_number | 被叫号码 |
start_stamp | 开始时间 |
ring_stamp | 振铃时间 |
answer_stamp | 应答时间 |
end_stamp | 结束时间 |
duration | 总时长 |
billsec | 计费时长 |
account_code | 计费号码 |
hangup_cause | 挂机原因 |
network_addr | 网络地址 |
network_port | 网络端口 |
sip_hangup_disposition | 挂机方向 |
context | 呼叫源 |
uuid | 通话 UUID |
bleg_uuid | B 腿 UUID |
direction | 方向,inboud 为向内,outbound 向外 |
realm | 域 |
caller_id_number | 主叫号码 |
external_tracking_id | 自定义 id |
caller_source | caller_source |
other_uuid | 该话单另外一个 uuid |
digits_dialed | 按键信息 |
sip_call_id | Call ID |
xui_route_ids | 经过的路由 ID |
abs_path | 录音文件绝对路径 |
rel_path | 录音文件相对路径 |
rtp_use_codec_name | 使用的编码 |
caller_source | caller_source |
xui_hangup_cause | XUI自定义挂机原因 |
media_file_id | 录音对应的媒体文件id |
挂机原因 | 中文说明 |
---|---|
ORIGINATOR_CANCEL | 主叫挂机 |
NORMAL_CLEARING | 正常释放 |
NORMAL_TEMPORARY_FAILURE | 临时故障 |
WRONG_CALL_STATE | 呼叫状态异常 |
USER_BUSY | 用户忙 |
LOSE_RACE | 别处应答 |
MEDIA_TIMEOUT | 媒体超时 |
CALL_REJECTED | 拒绝呼叫 |
UNALLOCATED_NUMBER | 空号 |
NO_ROUTE_DESTINATION | 无法路由 |
NO_USER_RESPONSE | 久叫不应 |
NO_ANSWER | 无应答 |
NORMAL_UNSPECIFIED | 未定义 |
NETWORK_OUT_OF_ORDER | 网络异常 |
RECOVERY_ON_TIMER_EXPIRE | 呼叫超时 |
USER_NOT_REGISTERED | 用户未注册 |
SUBSCRIBER_ABSENT | 用户缺席 |
GATEWAY_DOWN | 网关故障 |
MANDATORY_IE_MISSING | SIP 消息不全 |
SYSTEM_SHUTDOWN | 系统关机 |
INCOMPATIBLE_DESTINATION | 目的地不兼容 |
EXCHANGE_ROUTING_ERROR | 交换路由错误 |
MANAGER_REQUEST | 强制挂机 |
DESTINATION_OUT_OF_ORDER | 目的地异常 |
SERVICE_NOT_IMPLEMENTED | 服务未实现 |
查询话单
- 请求 URL:
/api/cdrs
- 请求方式:
GET
- 请求参数说明:
请求参数 | 说明 |
---|---|
dateType | 话单时间查询类型,默认话单开始时间,如果选话单结束时间:end_stamp |
startDate | 呼叫开始时间,格式:2018-06-06 |
endDate | 呼叫结束时间:格式:2018-06-06 |
cidNumber | 主叫号码 |
destNumber | 被叫号码 |
startBillsec | 最小billsec 值, 秒 |
endBillsec | 最大billsec 值, 秒 |
groupValue | 组ID |
page | 当前页码 |
perPage | 每页 cdr 条数 |
话单支持按时间、主被叫号码、通话时长等精确查询。
按时间查询时,默认查询的是话单的开始时间
,如果想要按话单的结束时间
去查询指定时间的全部话单需要指定日期类型,即,dateType=end_stamp
。
按时间查询时,如果指定了 startDate 和 startDate,而 endDate 如果只是输入了日期没有精确时分秒,则结束时间默认为该日期加 1,具体如下
示例 1
api/cdrs?startDate=2022-11-03&startDate=2022-11-03&perPage=1&page=2
查询结果为话单的开始时间在 11 月 03 号当天所有话单
示例 2
api/cdrs?startDate=2022-11-03&startDate=2022-11-03 18:30:59&perPage=1&page=2
查询结果为话单的开始时间2022-11-03
到2022-11-03 18:30:59
之内的话单
示例 3
api/cdrs?dateType=end_stamp&startDate=2022-11-03&startDate=2022-11-03 18:30:59&perPage=1&page=2
查询结果为话单的结束时间在2022-11-03
到2022-11-03 18:30:59
之内的所有话单
page=1&perPage=500&startDate=2023-03-15&endDate=2023-03-23&ani=&destNumber=&bridgedNumber=
- curl 示例:
获取所有话单:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/cdrs
- 返回值:
{ "pageCount": 1, "page": 1, "data": [ { "account_code": "1003", "external_tracking_id": "", "sip_call_id": "61b0aca4459f42e8a6f5d131ebc93d42", "sip_hangup_disposition": "recv_bye", "answer_stamp": "2022-05-17 01:30:33", "network_addr": "192.168.3.192", "abs_path": "", "digits_dialed": "none", "xui_route_ids": "1", "hangup_cause": "NORMAL_CLEARING", "caller_source": "", "other_uuid": "", "context": "context-1", "network_port": "", "bleg_uuid": "", "billsec": "1", "start_stamp": "2022-05-17 01:30:33", "caller_id_name": "1003", "duration": "1", "caller_id_number": "1003", "realm": "", "end_stamp": "2022-05-17 01:30:34", "direction": "inbound", "destination_number": "9196", "rel_path": "", "uuid": "0e3ca7b2-6626-419e-8766-64de327a4741" }, { "account_code": "1003", "external_tracking_id": "", "sip_call_id": "c79fd9801a904668b6d0b78e292bb359", "sip_hangup_disposition": "recv_bye", "answer_stamp": "2022-05-17 01:30:09", "network_addr": "192.168.3.192", "abs_path": "", "digits_dialed": "none", "xui_route_ids": "20", "hangup_cause": "NORMAL_CLEARING", "caller_source": "", "other_uuid": "", "context": "context-1", "network_port": "", "bleg_uuid": "", "billsec": "20", "start_stamp": "2022-05-17 01:30:09", "caller_id_name": "1003", "duration": "20", "caller_id_number": "1003", "realm": "", "end_stamp": "2022-05-17 01:30:29", "direction": "inbound", "destination_number": "3000", "rel_path": "", "uuid": "6242c44b-c2f2-4882-8941-784d44ba9885" } ], "rowCount": 2 }
查询指定通话时间内通话信息
- 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/cdrs?startDate=2022-05-17&endDate=2022-05-17&perPage=1&page=2
或查询最近 30 天话单
- 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/cdrs?last=30"
- 返回:
{ "data": [ { "caller_id_number": "1003", "context": "context-1", "caller_source": "", "destination_number": "9196", "end_stamp": "2022-05-17 01:30:34", "direction": "inbound", "answer_stamp": "2022-05-17 01:30:33", "hangup_cause": "NORMAL_CLEARING", "rel_path": "", "abs_path": "", "network_addr": "192.168.3.192", "start_stamp": "2022-05-17 01:30:33", "account_code": "1003", "digits_dialed": "none", "billsec": "1", "external_tracking_id": "", "xui_route_ids": "1", "realm": "", "bleg_uuid": "", "duration": "1", "sip_call_id": "61b0aca4459f42e8a6f5d131ebc93d42", "uuid": "0e3ca7b2-6626-419e-8766-64de327a4741", "other_uuid": "", "caller_id_name": "1003", "sip_hangup_disposition": "recv_bye", "network_port": "" } ... ], "page": 1, "rowCount": 12, "pageCount": 1 }
查询指定 uuid 话单
请求 URL:
/api/cdrs/$uuid
请求方式:
GET
参数说明:
示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/cdrs/6f781c5f-9ab7-43c2-8e4a-aa3143761093"
- 返回:
{ "hangup_cause": "NORMAL_CLEARING", "caller_id_number": "1022", "bleg_uuid": "", "xui_route_ids": "19", "uuid": "6f781c5f-9ab7-43c2-8e4a-aa3143761093", "network_addr": "192.168.3.192", "digits_dialed": "none", "answer_stamp": "2022-05-05 15:08:38", "sip_call_id": "a5211f22b8f44e4e8d5e1466bb25054f", "account_code": "1022", "billsec": "1133", "context": "context-1", "caller_id_name": "1022", "direction": "inbound", "network_port": "", "external_tracking_id": "", "other_uuid": "", "realm": "", "destination_number": "3000", "end_stamp": "2022-05-05 15:27:31", "duration": "1134", "start_stamp": "2022-05-05 15:08:37", "sip_hangup_disposition": "recv_bye", "caller_source": "" }
话单通知
通话记录通知使用mod_xml_cdr
模块推送到第三方服务器。
配置推送目的 URL: url
。
<configuration name="xml_cdr.conf" description="XML CDR CURL logger"> <settings> <param name="url" value="http://10.10.10.10:40016/new_call_center/call/center/cdr"/> <param name="log-dir" value=""/> <param name="log-b-leg" value="false"/> <param name="prefix-a-leg" value="true"/> ...
- mod_xml_cdr cdr 示例:
<?xml version="1.0"?> <cdr> <channel_data> <state>CS_REPORTING</state> <direction>inbound</direction> <state_number>11</state_number> <flags>0=1;36=1;38=1;51=1</flags> <caps>1=1;2=1;3=1</caps> </channel_data> <variables> <uuid>2e831835-d336-4735-b3e5-90e5d7dc8187</uuid> <sip_network_ip>192.168.0.2</sip_network_ip> <sip_network_port>56866</sip_network_port> <sip_received_ip>192.168.0.2</sip_received_ip> <sip_received_port>56866</sip_received_port> <sip_via_protocol>udp</sip_via_protocol> <sip_from_user>1000</sip_from_user> <sip_from_uri>1000%40192.168.0.2</sip_from_uri> <sip_from_host>192.168.0.2</sip_from_host> <sip_from_user_stripped>1000</sip_from_user_stripped> ... </variables> <app_log> <application app_name="set" app_data="continue_on_fail=true"></application> <application app_name="bridge" app_data="sofia/external/gateway/gw001/1000"></application> <application app_name="bridge" app_data="sofia/external/gateway/gw002/1000"></application> </app_log> <callflow dialplan="XML" profile_index="1"> <extension name="1000" number="1000"> <application app_name="set" app_data="continue_on_fail=true"></application> <application app_name="bridge" app_data="sofia/external/gateway/gw001/1000"></application> </extension> </callflow> <caller_profile> <username>1000</username> <dialplan>XML</dialplan> <caller_id_name>1000</caller_id_name> <ani>1000</ani> <aniii></aniii> <caller_id_number>1000</caller_id_number> <network_addr>192.168.0.2</network_addr> <rdnis>1000</rdnis> <destination_number>1000</destination_number> <uuid>2e831835-d336-4735-b3e5-90e5d7dc8187</uuid> <source>mod_sofia</source> <context>default</context> <chan_name>sofia/default/1000@192.168.0.2</chan_name> </caller_profile> <times> <created_time>1274439432438053</created_time> <profile_created_time>1274439432448060</profile_created_time> <progress_time>0</progress_time> <progress_media_time>0</progress_media_time> <answered_time>0</answered_time> <hangup_time>1274439438418776</hangup_time> <resurrect_time>0</resurrect_time> <transfer_time>0</transfer_time> </times> </cdr>
删除话单
提供接口支持删除指定 N 天、N 月、N 年前话单,即,仅保留最近几天、几月或几年的话单。
自动删除话单功能,前提是自动删除话单脚本已启动,系统初始化安装是该脚本未启动。
参数 | 说明 |
---|---|
day | 7Day 表示删除 7 天前,7Month 表示删除 7 个月前话单,7Year 表示删除 7 年前话单 |
auto_delete | 是否自动删除,如果设置了 true,则系统会每天凌晨自动执行指定时间话单删除 |
请求 URL:
/api/cdrs?day=7Day&auto_delete=false
请求方式:
DELETE
参数说明: 参考参数说明
示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/cdrs?day=7Day&auto_delete=false
- 返回值:
{ "data": 80500, "code": 200, "message": "success" }
话单配置
参数 | 说明 |
---|---|
name | 配置名称 |
description | 描述 |
log_leg | 记录哪条腿话单 a 腿:a-bleg ;b 腿话单:b-bleg; ab 腿话单:both |
disabled | 是否启用 0-启用 1-不启用 |
template | 模版 ID |
查询话单配置
- 请求 URL:
/api/odbc_cdrs
- 请求方式:
GET
- 返回值
[ { "description": "", "name": "cdrs", "deleted_at": "", "updated_at": "2022-05-16 09:51:32", "id": 1, "disabled": 0, "created_at": "2022-05-16 09:51:32", "log_leg": "a-leg" } ]
- 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/odbc_cdrs"
创建话单配置
- 请求 URL:
/api/odbc_cdrs
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息:
{ "name": "111", "log_leg": "a-leg", "disabled": 1, "template": "1" }
- 返回值:
{ "message": "success", "code": 200, "data": 2 }
- 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"name": "111","log_leg": "a-leg","disabled": 1, "template": "1"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/odbc_cdrs
修改话单配置
- 请求 URL:
/api/odbc_cdrs/$id
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息:
{ "log_leg": "b-leg" }
- 返回值:
{ "data": "1", "message": "success", "code": 200 }
- 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"log_leg": "b-leg"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/odbc_cdrs/1
删除话单配置
- 请求 URL:
/api/odbc_cdrs/$id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{ "message": "success", "code": 200, "data": 1 }
- 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/odbc_cdrs/2
查询 ODBC CDR 全局参数
参数 | 说明 |
---|---|
k | 参数名 |
v | 参数值 |
realm | 固定值 话单全局参数为-ODBC_CDR_SETTINGS |
disabled | 是否启用该参数,0-启用 1-不启用 |
- 请求 URL:
/api/params/realm/ODBC_CDR_SETTINGS
- 请求方式:
GET
- 返回值
{ "page": 1, "data": [ { "created_at": "2022-04-28 16:49:05", "id": "1057", "deleted_at": "", "ref_id": "0", "v": "$${DSN}", "realm": "ODBC_CDR_SETTINGS", "updated_at": "2022-04-28 16:49:05", "disabled": "0", "k": "odbc-dsn" }, { "created_at": "2022-04-28 16:49:05", "id": "1058", "deleted_at": "", "ref_id": "0", "v": "both", "realm": "ODBC_CDR_SETTINGS", "updated_at": "2022-04-28 16:49:05", "disabled": "0", "k": "log-leg" } ], "rowCount": 2, "pageCount": 1 }
- 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/params/realm/ODBC_CDR_SETTINGS"
创建 ODBC CDR 全局参数
- 请求 URL:
/api/params
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息:
{ "disabled": 1, "k": "test", "realm": "ODBC_CDR_SETTINGS", "v": "100" }
- 返回值:
{ "data": 1596, "code": 200, "message": "success" }
- 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"disabled": "1","k": "test","realm": "ODBC_CDR_SETTINGS","v": "100"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/params
修改 ODBC CDR 全局参数
- 请求 URL:
/api/params/$id
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息:
{ "disabled": 0, "k": "test", "realm": "ODBC_CDR_SETTINGS", "v": "200" }
- 返回值:
{ "data": "1597", "message": "success", "code": 200 }
- 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"disabled": "0","k": "test","realm": "ODBC_CDR_SETTINGS","v": "100"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/params/1597
删除 ODBC CDR 全局参数
- 请求 URL:
/api/params/$id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{ "code": 200, "data": "1596", "message": "success" }
- 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/params/1596
查询指定话单配置下参数
参数 | 说明 |
---|---|
k | 参数名 |
v | 参数值 |
realm | 固定值 话单参数为-ODBC_CDR |
disabled | 是否启用该参数,0-启用 1-不启用 |
- 请求 URL:
/api/odbc_cdrs/$id
- 请求方式:
GET
- 返回值
{ "updated_at": "2023-03-24 09:00:39", "disabled": 0, "created_at": "2023-03-23 06:25:21", "deleted_at": "", "params": [ { "v": "accountcode", "updated_at": "2023-03-23 06:25:23", "disabled": "0", "created_at": "2023-03-23 06:25:23", "deleted_at": "", "ref_id": "1", "id": "1314", "k": "account_code", "realm": "ODBC_CDR" }, ... { "v": "xui_route_ids", "updated_at": "2023-03-23 06:25:23", "disabled": "0", "created_at": "2023-03-23 06:25:23", "deleted_at": "", "ref_id": "1", "id": "1337", "k": "xui_route_ids", "realm": "ODBC_CDR" } ], "description": "", "id": 1, "name": "cdrs", "log_leg": "b-leg" }
- 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "http://192.168.1.100:8081/api/odbc_cdrs/1"
话单配置增加某参数
- 请求 URL:
/api/odbc_cdrs/$id/params/
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息:
{ "k": "test-param", "v": "test" }
- 返回值:
{ "code": 200, "message": "success", "data": 2101 }
- 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"k": "test-param","v": "test"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/odbc_cdrs/1/params/
修改指定话单配置下某参数
- 请求 URL:
/api/odbc_cdrs/$id/params/$param_id
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息:
{ "k": "test" }
- 返回值:
{ "data": "1597", "message": "success", "code": 200 }
- 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"k": "test"}' \ -H "Content-Type: application/json" http://192.168.1.100:8081/api/odbc_cdrs/1/params/1597
删除话单配置某参数
- 请求 URL:
/api/odbc_cdrs/$id/params/$params_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{ "code": 200, "data": "1597", "message": "success" }
- 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/odbc_cdrs/1/params/1597