所有api接口都需要鉴权规则,具体详情前往新平台鉴权规则查看

目录

SIP号管理

获取SIP号列表

无传参则默认查询账户下所有sip号

请求参数

字段名称 字段类型 是否必传 字段描述
number string sip号码
registerStatuses number[] 注册状态 [0, 1] 0(未注册) 1(已注册)

请求示例

curl --location --request POST 'http://v7openapi.7moor.com/openapi/v1/call/sip/list' \
--header 'm7-appkey: 2000113' \
--header 'm7-nonce: 025513' \
--header 'm7-sign: lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=' \
--header 'm7-timestamp: 1616408549' \
--header 'content-type: application/json' \
--data-raw '{
    "number":"2000",
    "registerStatuses":[0, 1]
}'

返回参数

字段名称 字段类型 是否必传 字段描述
clientUrl string sip用户端注册地址
serverUrl string sip服务器注册地址
registerDevice string 注册设备
registerTime string 注册时间
registerStatus string 注册状态 0(未注册) 1(已注册)
number string sip号码
sipId string sip号主键 id
accountId string 账户编号
agent obj 座席信息

agent

字段名称 字段类型 是否必传 字段描述
agentId string 座席id
agentName string 座席名称
agentNumber string 座席工号

返回示例

{
    "success": true,
    "code": "200",
    "message": "requestSuccess",
    "data": [
        {
            "clientUrl": "111.202.78.82:54869",
            "serverUrl": "opensips.pbxtest.7moor.com:32760",
            "registerDevice": "Telephone",
            "registerTime": "2020-12-04 14:33:27",
            "registerStatus": 1,
            "number": "2000",
            "sipId": "5fc9d54105fd0161a498c503",
            "accountId": "2000113",
            "agent": {
                "agentId": "5feb148e19a5207b5020e728",
                "agentName": "凯哥测试",
                "agentNumber": "8734"
            }
        }
    ],
    "requestInfo": {
        "requestId": "1c8eb9708c7511ebadd101dc5c1e7708",
        "url": "/openapi/v1/call/sip/list",
        "proxyUrl": "http://v7openapi.7moor.com/call/openapi/v1/call/sip/list",
        "body": {
            "number": "2000",
            "registerStatuses": [
                "1"
            ]
        },
        "headers": {
            "m7-appkey": "2000113",
            "m7-nonce": "025513",
            "m7-sign": "lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=",
            "m7-timestamp": "1616572011",
            "content-type": "application/json",
            "user-agent": "PostmanRuntime/7.26.10",
            "accept": "*/*",
            "cache-control": "no-cache",
            "postman-token": "e4867249-9050-4c6f-a471-11c27ab6336c",
            "host": "localhost:5100",
            "accept-encoding": "gzip, deflate, br",
            "connection": "keep-alive",
            "content-length": "56",
            "traceId": "1c8eb9708c7511ebadd101dc5c1e7708",
            "accountId": "2000113"
        },
        "span": {
            "requestStartTime": 1616572018311,
            "proxyStartTime": 1616572018334,
            "proxyEndTime": 1616572018545,
            "reqEndTime": 1616572018546,
            "bizSpan": "211ms",
            "latency": "24ms"
        }
    }
}

创建sip号

2 创建sip号

请求参数

字段名称 字段类型 是否必传 字段描述
number string sip号码
password string sip号密码
isNAT boolean 是否NAT false(否) true(是)
codingFormat string[] 语音编码格式 目前支持 "G711A","G711U","GSM","G729","VP8","ILBC"
agentId string sip号应用座席 座席应用在sip号的前提是 sip必须是已注册且未绑定的状态

请求示例

curl --location --request POST 'http://v7openapi.7moor.com/openapi/v1/call/sip/create' \
--header 'm7-appkey: 2000113' \
--header 'm7-nonce: 025513' \
--header 'm7-sign: lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=' \
--header 'm7-timestamp: 1616408549' \
--header 'content-type: application/json' \
--data-raw '{
    "number": "2004",
    "password":"123456",
    "isNAT": false,
    "codingFormat": ["G711A"],
    "agentId": ""
}'

返回参数

字段名称 字段类型 是否必传 字段描述
sipId string sip号主键 id

返回示例


{
    "success": true,
    "code": "200",
    "message": "requestSuccess",
    "data": {
        "sipId": "605aeef6e9930e49f48444be"
    },
    "requestInfo": {
        "requestId": "676ed0b08c7511ebadd101dc5c1e7708",
        "url": "/openapi/v1/call/sip/create",
        "proxyUrl": "http://v7openapi.7moor.com/call/openapi/v1/call/sip/create",
        "body": {
            "number": "2005",
            "password": "123456",
            "isNAT": false,
            "codingFormat": [
                "G711A"
            ],
            "agentId": ""
        },
        "headers": {
            "m7-appkey": "2000113",
            "m7-nonce": "025513",
            "m7-sign": "lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=",
            "m7-timestamp": "1616572137",
            "content-type": "application/json",
            "user-agent": "PostmanRuntime/7.26.10",
            "accept": "*/*",
            "cache-control": "no-cache",
            "postman-token": "02771dbd-de29-42b1-8a58-0efc79917629",
            "host": "localhost:5100",
            "accept-encoding": "gzip, deflate, br",
            "connection": "keep-alive",
            "content-length": "125",
            "traceId": "676ed0b08c7511ebadd101dc5c1e7708",
            "accountId": "2000113"
        },
        "span": {
            "requestStartTime": 1616572143931,
            "proxyStartTime": 1616572143954,
            "proxyEndTime": 1616572150674,
            "reqEndTime": 1616572150675,
            "bizSpan": "6720ms",
            "latency": "24ms"
        }
    }
}

3 更新sip号

请求参数

字段名称 字段类型 是否必传 字段描述
sipId string sip号主键 id
number string sip号码
password string sip号密码
isNAT boolean 是否NAT false(否) true(是)
codingFormat string[] 语音编码格式 目前支持 "G711A","G711U","GSM","G729","VP8","ILBC"
agentId string sip号应用座席 座席应用在sip号的前提是 sip必须是已注册且未绑定的状态

请求示例


curl --location --request POST 'http://v7openapi.7moor.com/openapi/v1/call/sip/update' \
--header 'm7-appkey: 2000113' \
--header 'm7-nonce: 025513' \
--header 'm7-sign: lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=' \
--header 'm7-timestamp: 1616408549' \
--header 'content-type: application/json' \
--data-raw '{
    "sipId":"5fc9d54105fd0161a498c505",
    "number": "2002",
    "password":"123456",
    "isNAT": true,
    "codingFormat": ["G711A"],
    "agentId": "5fe47b9df94f8c728ac1bbde"
}'

返回参数

字段名称 字段类型 是否必传 字段描述
sipId string sip号主键 id

返回示例

{
    "success": true,
    "code": "200",
    "message": "requestSuccess",
    "data": {
        "sipId": "5fc9d54105fd0161a498c503"
    },
    "requestInfo": {
        "requestId": "1a5de4d08c7711ebadd101dc5c1e7708",
        "url": "/openapi/v1/call/sip/update",
        "proxyUrl": "http://v7openapi.7moor.com/call/openapi/v1/call/sip/update",
        "body": {
            "sipId": "5fc9d54105fd0161a498c503",
            "number": "2000",
            "password": "123456",
            "isNAT": true,
            "codingFormat": [
                "G711A"
            ],
            "agentId": "5fe47b9df94f8c728ac1bbde"
        },
        "headers": {
            "m7-appkey": "2000113",
            "m7-nonce": "025513",
            "m7-sign": "lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=",
            "m7-timestamp": "1616572749",
            "content-type": "application/json",
            "user-agent": "PostmanRuntime/7.26.10",
            "accept": "*/*",
            "cache-control": "no-cache",
            "postman-token": "be4c779e-e2b5-4b8b-b693-50f0c7c2abbd",
            "host": "localhost:5100",
            "accept-encoding": "gzip, deflate, br",
            "connection": "keep-alive",
            "content-length": "189",
            "traceId": "1a5de4d08c7711ebadd101dc5c1e7708",
            "accountId": "2000113"
        },
        "span": {
            "requestStartTime": 1616572873629,
            "proxyStartTime": 1616572873834,
            "proxyEndTime": 1616572880983,
            "reqEndTime": 1616572880984,
            "bizSpan": "7149ms",
            "latency": "206ms"
        }
    }
}

4 删除sip号

请求参数

字段名称 字段类型 是否必传 字段描述
sipId string sip号主键 id

请求示例


curl --location --request POST 'http://v7openapi.7moor.com/openapi/v1/call/sip/delete' \
--header 'm7-appkey: 2000113' \
--header 'm7-nonce: 025513' \
--header 'm7-sign: wUEGeVnHPLCYjznDd2op1+Ek+UCeUWLO365XNIhV/LQ=' \
--header 'm7-timestamp: 1616406746' \
--header 'content-type: application/json' \
--data-raw '{
    "sipId": "60585ef758b4e753b049830c"
}'

返回示例

{
    "success": true,
    "code": "200",
    "message": "requestSuccess",
    "data": {
        "sipId": "60587623c81cd14a21966fae"
    },
    "requestInfo": {
        "requestId": "81af2c708c7711ebadd101dc5c1e7708",
        "url": "/openapi/v1/call/sip/delete",
        "proxyUrl": "http://v7openapi.7moor.com/call/openapi/v1/call/sip/delete",
        "body": {
            "sipId": "60587623c81cd14a21966fae"
        },
        "headers": {
            "m7-appkey": "2000113",
            "m7-nonce": "025513",
            "m7-sign": "lmwwrahWCRO0x+3DhlMMVgB2V5ytUXp5GxbLTW9wOig=",
            "m7-timestamp": "1616572922",
            "content-type": "application/json",
            "user-agent": "PostmanRuntime/7.26.10",
            "accept": "*/*",
            "cache-control": "no-cache",
            "postman-token": "a1d88c1c-0f77-4da5-bbe4-eb3c1e8a71d5",
            "host": "localhost:5100",
            "accept-encoding": "gzip, deflate, br",
            "connection": "keep-alive",
            "content-length": "45",
            "traceId": "81af2c708c7711ebadd101dc5c1e7708",
            "accountId": "2000113"
        },
        "span": {
            "requestStartTime": 1616573046967,
            "proxyStartTime": 1616573047349,
            "proxyEndTime": 1616573072244,
            "reqEndTime": 1616573072244,
            "bizSpan": "24895ms",
            "latency": "382ms"
        }
    }
}