查询所有共享中继
查询所有共享中继的详细信息。
请求 URL
GET {base_url}/dm/open_api/v1/shared_trunk
请求参数
请求头
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| Authorization | 是 | String | 在请求头中传递访问 Token。 格式:Bearer {access_token}。 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Object <Details> | 详情。 |
| requestId | String | 请求 ID,作为该请求的唯一标识,用于快速定位请求。 |
| status | String | 请求结果。
|
| time | Long | 请求响应的时间。 注: YCM API
响应返回的是时间戳,如有需要,你可以将时间戳转换成具体的日期和时间。详细操作方法,请参见 将时间戳转换为日期和时间。
|
Details
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Integer | 共享中继 ID。 |
| regionId | Integer | 共享中继所属区域的 ID。 |
| regionName | String | 共享中继所属区域的名称。 |
| creator | String | 共享中继的创建者。 |
| name | String | 共享中继的名称。 |
| enable | Integer | 共享中继是否启用。
|
| country | String | SIP 运营商所属国家。 |
| itsp | String | SIP 运营商名称。 |
| type | String | 中继类型
|
| hostname | String | SIP 运营商提供的中继域名或 IP 地址。 |
| port | Integer | SIP 运营商提供的 SIP 中继注册端口。 |
| domain | String | SIP 运营商提供的中继域名或 IP 地址。 |
| transport | String | 传输协议。 |
| backupHostname | String | 可选的备用主机名,用于接受来自 ITSP 备用地址 (非主地址) 的SIP信令。 |
| remark | String | 中继的备注信息。 |
| username | String | SIP 运营商提供的注册中继的账号名称。 注: 仅注册中继支持此参数。 |
| password | String | 与注册中继的账号关联的密码。 注: 仅注册中继支持此参数。
|
| authName | String | SIP 运营商提供的中继的认证名称。 注: 仅注册中继支持此参数。
|
| enbOutboundProxy | Integer | 是否启用呼出代理服务器。
|
| outboundProxyServer | String | 呼出代理服务器的域名或 IP 地址。 注: 仅注册中继支持此参数。
|
| outboundProxyPort | Integer | 呼出代理服务器的端口。 注: 仅注册中继支持此参数。
|
| proxyClusterPublicIp | String | SBC Proxy 服务器的公网 IP 地址,可提供给 SIP 运营商用于中继绑定。 注: 仅点对点中继支持此参数。 |
| proxyPort | String | SBC Proxy 服务器的端口。 注: 仅点对点中继支持此参数。
|
| proxyServerName | String | SBC Proxy 服务器的名称。 |
| codecSel | String | 编解码设置。 |
| dtmfMode | String | 发送的 DTMF 模式。
|
| dtmfFmtp | String | DTMF fmtp 的属性值。
|
| enbQualify | Integer | 是否启用 Qualify。
|
| enbSrtp | Integer | 是否启用 SRTP。
|
| enbT38Support | Integer | 是否启用 T.38 支持。
|
| enbInbandProgress | Integer | 是否启用 Inband Progress。
|
| ignore183WithoutSdp | Integer | 是否忽略无 SDP 的 183 消息。
|
| transparentTrans180Msg | Integer | 是否跟随对端消息格式处理 180 消息。
|
| enbDedicate | Integer | 是否启用专线中继。
|
| enbSipauthCache | Integer | 是否启用 SIP 鉴权缓存。 注: 仅注册中继支持此参数。
|
| callRestrictionType | String | 受中继最大并发通话数限制的通话类型。
|
| maxCallChans | Integer | 该中继所允许的最大通话并发数。 注: 若返回的值为
0,则表示无限制。 |
| authErrorSipCode | String | SIP 运营商返回的表示鉴权错误的 SIP 错误码。 注: 仅注册中继支持此参数。
|
| authRegisterAttempt | Integer | PBX 在收到 SIP 运营商返回的 鉴权错误 SIP 码 后重新发送注册请求的尝试次数。 注: 仅注册中继支持此参数。
|
| globalRegisterRetryInterval | Integer | PBX 在收到 SIP 运营商返回的任意SIP 错误码 (即非 200 的状态码) 后重新发送注册请求的间隔时间 (单位:秒)。 注: 仅注册中继支持此参数。
|
| callerIdFrom | String | 中继从哪里获取显示号码 (Caller ID)。
|
| didFrom | String | 中继从哪里获取 DID 号码。
|
| fromUserPart | String | 用于外呼时的主叫号码 (即 SIP From 头域中的用户部分)。
|
| fromUser | String | fromUserPart 参数设置为 custom
时的自定义值。 |
| fromDispNamePart | String | 用于外呼时的主叫名称 (即 SIP From 头域中的显示名称部分)。
|
| fromDispName | String | fromDispNamePart 参数设置为
custom 时的自定义值。 |
| diversionUserPart | String | 用于外呼时在 SIP INVITE 数据包中携带的 Diversion
头域的值。注: 如果此参数返回为空( ""),表示 SIP INVITE
数据包中将不包含此头域。
|
| diversionUser | String | diversionUserPart 参数设置为
custom 时的自定义值。 |
| rpidUserPart | String | 用于外呼时在 SIP INVITE 数据包中携带的 Remote-Party-ID 头域的值。注: 如果此参数返回为空(
""),表示 SIP INVITE
数据包中将不包含此头域。
|
| rpidUser | String | rpidUserPart 参数设置为 custom
时的自定义值。 |
| paiUserPart | String | 用于外呼时在 SIP INVITE 数据包中携带的
P-Asserted-Identity 头域的值。注: 如果此参数返回为空(
""),表示 SIP INVITE
数据包中将不包含此头域。
|
| paiUser | String | paiUserPart 参数设置为 custom
时的自定义值。 |
| paiUserPartUriFormat | String | P-Asserted-Identity 头域的格式。
|
| ppiUserPart | String | 用于外呼时在 SIP INVITE 数据包中携带的
P-Preferred-Identity 头域的值。注: 如果此参数返回为空(
""),表示 SIP INVITE
数据包中将不包含此头域。
|
| ppiUser | String | ppiUserPart 参数设置为 custom
时的自定义值。 |
| userAgent | String | 用于身份验证的用户代理信息。 |
| realm | String | 用于 SIP 认证的域 (Realm)。 |
| enb100Rel | Integer | 中继的 100rel 设置。
|
| maxPtime | String | PBX 发出 INVITE 包时使用的 maxptime 值。 注: 若此参数返回的值为 default,则表示 PBX
会根据呼出通话所使用的语音编码发送对应的 maxptime。 |
| enbPrivacyId | Integer | 是否在 SIP 头域中发送 Privacy ID。
|
| enbUserPhone | Integer | 是否在 INVITE 包的 SIP 头域中增加 user=phone 的参数。
|
| enbApiCallId | Integer | 是否在 SIP INVITE 请求中包含 X-OpenAPI-Call-ID
字段以携带通话的 Call ID。
|
| enbEarlyMedia | Integer | 是否在 SIP INVITE 请求中包含 P-Early-Media 字段。
|
| enbEarlyMediaFor183 | Integer | 是否在通过此中继呼入的通话的 183 消息中包含值为 sendrecv 的
P-Early-Media 字段。
|
| fromDomainPart | String | SIP INVITE 中 From 头域所使用的域名或 IP 地址。注: 仅点对点中继支持此参数。
|
| fromDomainValue | String | fromDomainPart 设置为 custom
时的自定义值。 |
| toDomainPart | String | SIP INVITE 中 To 头域所使用的域名或 IP 地址。注: 仅点对点中继支持此参数。
|
| toDomainValue | String | toDomainPart 设置为 custom
时的自定义值。 |
| failoverServersList | Array <Failover_Server> | 用于故障转移的 SIP 运营商备用服务器信息列表。 |
- Failover_Server
-
参数 类型 说明 host String 备用服务器的域名或 IP 地址。 port Integer 备用服务器的注册端口。 domain String 备用服务器的域名或 IP 地址。
示例
请求示例
GET /dm/open_api/v1/shared_trunk HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer ******响应示例HTTP/1.1 200 OK
{
"data": [
{
"id": 2,
"regionId": 20,
"regionName": "China (Shanghai)",
"creator": "Leo Ball",
"name": "trunk-shanghai-01",
"enable": 1,
"country": "China",
"itsp": "China Telecom",
"type": "register",
"hostname": "sip.chinatelecom.com",
"port": 5060,
"domain": "sip.chinatelecom.com",
"transport": "udp",
"username": "ct_username_001",
"password": "encrypted_CTpass123",
"authName": "",
"enbOutboundProxy": 0,
"outboundProxyServer": "",
"outboundProxyPort": 0,
"proxyServerName": "cn-shanghai-proxy-a",
"codecSel": "ulaw,alaw,g729",
"dtmfMode": "rfc4733",
"dtmfFmtp": "0-16",
"enbQualify": 0,
"enbSrtp": 0,
"enbT38Support": 0,
"enbInbandProgress": 0,
"ignore183WithoutSdp": 0,
"enbDedicate": 0,
"callRestrictionType": "outbound",
"maxCallChans": 0,
"transparentTrans180Msg": 0,
"authErrorSipCode": "401;407;403",
"authRegisterAttempt": 3,
"globalRegisterRetryInterval": 20,
"callerIdFrom": "follow_system",
"didFrom": "follow_system",
"fromUserPart": "default",
"fromUser": "",
"fromDispNamePart": "default",
"fromDispName": "",
"diversionUserPart": "",
"diversionUser": "",
"rpidUserPart": "",
"rpidUser": "",
"paiUserPart": "",
"paiUser": "",
"paiUserPartUriFormat": "sip",
"ppiUserPart": "",
"ppiUser": "",
"userAgent": "",
"enb100Rel": 0,
"maxPtime": "default",
"enbPrivacyId": 0,
"enbUserPhone": 0,
"enbApiCallId": 0,
"realm": "",
"enbEarlyMedia": 0,
"enbEarlyMediaFor183": 0,
"enbSipauthCache": 1
},
... ...
{
"id": 6688,
"regionId": 20,
"regionName": "China (Beijing)",
"creator": "Leo Ball",
"name": "bandwidth-trunk_F9I8P8",
"enable": 1,
"country": "United States",
"itsp": "Bandwidth",
"type": "did_based",
"hostname": "sip.bandwidth.com",
"port": 5060,
"domain": "sip.bandwidth.com",
"transport": "udp",
"proxyClusterPublicIp": "52.82.120.101",
"proxyPort": 5060,
"proxyServerName": "cn-beijing-proxy-b",
"codecSel": "ulaw,g729",
"dtmfMode": "rfc4733",
"dtmfFmtp": "0-16",
"enbQualify": 0,
"enbSrtp": 0,
"enbT38Support": 0,
"enbInbandProgress": 0,
"ignore183WithoutSdp": 0,
"enbDedicate": 0,
"callRestrictionType": "outbound",
"maxCallChans": 0,
"transparentTrans180Msg": 0,
"callerIdFrom": "follow_system",
"didFrom": "follow_system",
"fromUserPart": "default",
"fromUser": "",
"fromDispNamePart": "default",
"fromDispName": "",
"diversionUserPart": "",
"diversionUser": "",
"rpidUserPart": "",
"rpidUser": "",
"paiUserPart": "",
"paiUser": "",
"paiUserPartUriFormat": "sip",
"ppiUserPart": "",
"ppiUser": "",
"userAgent": "",
"enb100Rel": 0,
"maxPtime": "default",
"enbPrivacyId": 0,
"enbUserPhone": 0,
"enbApiCallId": 0,
"enbEarlyMedia": 0,
"enbEarlyMediaFor183": 0,
"fromDomainPart": "default",
"toDomainPart": "default",
"failoverServersList": [
{
"host": "67.23.8.195",
"port": 5060,
"domain": "67.23.8.195"
}
]
}
],
"requestId": "41bb65359db6aa3cd3384dd72ef9629e",
"status": "Success",
"time": 1747120211
}