Categorygithub.com/lzh2nix/gb28181Simulator
modulepackage
0.0.0-20241129125909-e2a6097e5af9
Repository: https://github.com/lzh2nix/gb28181simulator.git
Documentation: pkg.go.dev

# README

gb28181Simulator

使用 golang 实现的一个GB28181模拟器,主要用于测试目的

功能:

  • Register
  • Register retry
  • Register with 401 challange
  • keepalive
  • catalog
  • invite
  • as a GB28181 benchmark tool

Quick Start

go run main.go -c sim.conf

Configure File

{
  "localSipPort": 5061,
  "serverID": "32011500002000000001",
  "realm": "3201150000",
  "serverAddr": "127.0.0.1:5061",
  "userName": "test",
  "password": "test",
  "regExpire": 3600,
  "keepaliveInterval": 100,
  "maxKeepaliveRetry": 3,
  "transport": "udp",
  "gbId": "31011500991320000532",
  "devices": [
    {
      "deviceID": "32011500991320000040",
      "name": "test001",
      "manufacturer": "simulatorFactory",
      "model": "Mars",
      "CivilCode": "civilCode",
      "address": "192.18.1.1",
      "parental": "0",
      "safeWay": "1",
      "registerWay": "1",
      "secrecy": "1",
      "status": "ON"
    },
    {
      "deviceID": "32011500991320000041",
      "name": "test002",
      "manufacturer": "simulatorFactory",
      "model": "Mars",
      "CivilCode": "civilCode",
      "address": "192.18.1.2",
      "parental": "0",
      "safeWay": "1",
      "registerWay": "1",
      "secrecy": "1",
      "status": "ON"
    }
  ]
}

配置说明:

PropertyDescription
localSipPortgb28181 本地端口
serverIDserver 国标ID
realmserver 国标域
serverAddrserver 服务器地址(接入服务地址)
userName国标用户名(从服务端获取)
password国标密码(从服务端获取)
regExpire设备注册超时时间
keepaliveIntervalkeepalive 发送间隔
maxKeepaliveRetrykeeplive超时次数(超时之后发送重新发送reg)
transport传输层协议(目前只支持udp)
gbId设备国标ID
devices.deviceID子设备国标ID
devices.name子设备名称
devices.manufacturer子设备厂商
devices.model子设备model
devices.address子设备ip地址
devices.status子设备状态