1. CallBack
  2. cdr

HTTP methods

POST

Request parameters

回调post一个json对象:

ParametersDescription
total_duration呼叫持续时间,单位毫秒
cause呼叫消息的最终响应代码
cause_text呼叫消息最终响应
connect_delay呼叫开始到接通的时间,单位毫秒
connect_duration呼叫通话持续的时间,单位毫秒
ringing呼叫收到 180 或者 183 信令的时间戳,13 位长,单位为毫秒,如果整个呼叫过程没有收到180 或者 183,值为空字符串 “”
connected呼叫接通的时间戳,13 位长,单位为毫秒,如果整个呼叫过程未接通,值为空字符串 “”
disconnected呼叫结束的时间戳,13 位长,单位为毫秒
fromsip消息的from字段,包括tag
tosip消息的to字段,如果接通会有相应的tag
audio

呼叫中的rtp 流信息,如下:

"audio": [
  {
    "clock" : 8000,
    "codec" : "PCMU",         # 语音编码
    "pt"    : 0,              # 编码中的rtp payload字段
    "rx"    : {
      "avg_bps" : 59879,      # 平均码率
      "discard" : 1,          # 丢弃包数量
      "dup"     : 0,          # 重复包数量
      "loss"    : 21,         # 丢失包数量
      "reorder" : 0,          # 次序错误的包数量
      "total"   : 428         # 总的包数量
    },
    "srtp"  : "Not active",
    "tx"    : {               # 表示发送端的数据,含义同上rx
      "avg_bps" : 63937,
      "discard" : 0,
      "dup"     : 0,
      "loss"    : 0,
      "reorder" : 0,
      "total"   : 457
    }
  }
]

失败呼叫示例

{
  "audio"            : [
    {
      "clock" : 8000,
      "codec" : "PCMU",
      "pt"    : 0,
      "rx"    : {
        "avg_bps" : 0,
        "discard" : 0,
        "dup"     : 0,
        "loss"    : 0,
        "reorder" : 0,
        "total"   : 0
      },
      "srtp"  : "Not active",
      "tx"    : {
        "avg_bps" : 62822,
        "discard" : 0,
        "dup"     : 0,
        "loss"    : 0,
        "reorder" : 0,
        "total"   : 8
      }
    }
  ],
  "call_id"          : "5e8e5682b1db4f57916c756e8f45eb52",
  "cause"            : 480,
  "cause_text"       : "Temporarily Unavailable",
  "connect_delay"    : 0,
  "connect_duration" : 0,
  "ringing"          : "",
  "connected"        : "",
  "disconnected"     : "1694764203334",
  "from"             : "sip:1006@client.pbx.aiwcc.com",
  "to"               : "sip:1007@client.pbx.aiwcc.com",
  "total_duration"   : 509
}

成功呼叫示例

{
  "audio"            : [
    {
      "clock" : 8000,
      "codec" : "PCMU",
      "pt"    : 0,
      "rx"    : {
        "avg_bps" : 59879,
        "discard" : 1,
        "dup"     : 0,
        "loss"    : 21,
        "reorder" : 0,
        "total"   : 428
      },
      "srtp"  : "Not active",
      "tx"    : {
        "avg_bps" : 63937,
        "discard" : 0,
        "dup"     : 0,
        "loss"    : 0,
        "reorder" : 0,
        "total"   : 457
      }
    }
  ],
  "call_id"          : "e2aa1447f8dc496f97060d238d61fc1e",
  "cause"            : 200,
  "cause_text"       : "OK",
  "connect_delay"    : 367,
  "connect_duration" : 9135,
  "ringing"          : "",
  "connected"        : "1694764194562",
  "disconnected"     : "1694764203334"
  "from"             : "sip:1006@client.pbx.aiwcc.com",
  "to"               : "sip:*86@client.pbx.aiwcc.com",
  "total_duration"   : 9502
}