国标gb28181模拟环境搭建

准备工作

按照wireshark使用教程:https://blog.csdn.net/fedorayang/article/details/135474018安装,这种安装方式解决了两个问题:

  1. windows平台能捕获自身的网络数据包,因为安装了loopback回环模拟网卡
  2. GB28181-2016自动化测试工具能正常运行,因为自动化测试工具依赖WinPcap.

服务器搭建

服务器使用GB28181-2016自动化测试工具代替

测试设备:GB28181设备的IP地址
本地IP:GB28181服务器的IP地址
sipID:需要和GB28181设备的设置一致
sip域:需要和GB28181设备的设置一致

在这里插入图片描述

模拟设备搭建

模拟设备目录下config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <version>2016</version>                         <!-- gb28181 version : 2016 or 2022 -->
    <!-- 服务器所在的电脑IP地址 -->
    <server_ip>192.168.2.21</server_ip>             <!-- sip server ip address -->
    <server_port>5060</server_port>                 <!-- sip server port -->
    <!-- 需要和服务器保持一致 -->
    <server_id>44010200492000000001</server_id>     <!-- server id -->
    <!-- 需要和服务器保持一致 -->
    <server_domain>4401020049</server_domain>       <!-- server domain -->
    <local_port>0</local_port>                      <!-- local sip port, 0 - assigned by the system -->
    <device_id>34020000001110000001</device_id>     <!-- device id -->
    <device_name>Happytimesoft</device_name>        <!-- device name -->
    <password>12345678</password>                   <!-- login password -->
    <protocol>udp</protocol>                        <!-- sip signaling protocol, udp or tcp -->
    <media_protocol>tcp</media_protocol>            <!-- media transfer protocol, udp or tcp, valid for active outbound call sessions -->
    <reg_expires>3600</reg_expires>                 <!-- register expires, unit is second -->
    <heartbeat_interval>30</heartbeat_interval>     <!-- heartbeat interval, unit is second -->
    <heartbeat_count>0</heartbeat_count>            <!-- heartbeat timeout count, if the specified number of heartbeat responses is not received, it will be re-register, 0 means no check -->
    <media_base_port>19000</media_base_port>        <!-- Media transmission base port -->
    <log_enable>1</log_enable>                      <!-- 0-disable log, 1-enable log -->                          
    <log_level>1</log_level>                        <!-- 0:TRACE,1:DEBUG,2:INFO,3:WARNING,4:ERROR,5:FATAL -->
    <channel>                                       <!-- channel configuration, you can configure multiple  -->
        <cid>34020000001310000001</cid>             <!-- channel id -->
        <cname>channel1</cname>                     <!-- channel name -->
        <media_url>MP4_AVC.mp4</media_url>             <!-- media url, file path,rtsp/rtmp/srt stream address, or videodevice or screenlive or videodevice+audiodevice -->
        <ondemand>0</ondemand>                      <!-- If media_url is a stream address, specify whether to connect on demand, 1-Connect when needed, 0-Always keep connected -->
        <output>
            <video>                                 <!-- Specify the video output parameters -->
                <codec>H264</codec>                 <!-- Specify the video stream codec, H264,H265,MP4 -->
                <width></width>                     <!-- Specify the output video width, If 0 use the original video width (camera stream use the default width) -->
                <height></height>                   <!-- Specify the output video height, If 0 use the original video height (camera stream use the default height) -->
                <framerate></framerate>             <!-- Specify the output video framerate, If 0 use the original video framerate (camera stream use the default value 25) -->
                <bitrate></bitrate>                 <!-- Specify the output video bit rate, if 0, automatically calculate the output bit rate, the unit is kb/s -->
            </video>
            <audio>                                 <!-- Specify the audio output parameters -->
                <codec>G711A</codec>                <!-- Specify the audio stream codec, G711A,G711U,AAC -->
                <samplerate>8000</samplerate>       <!-- Specify the audio sample rate -->
                <channels>1</channels>              <!-- Specify the audio channel number, 1 is mono, 2 is stereo, If 0 use the original audio channel number (audio device stream use the default value 2) -->
                <bitrate></bitrate>                 <!-- Specify the output audio bit rate, if 0, automatically calculate the output bit rate, the unit is kb/s -->
            </audio>
        </output>
    </channel>
</config>

<device_id>和<channel_id>根据情况修改,其他选项保持不变.

注意事项:

1.GB28181-2016模拟设备网络情况

保证只要一个网络接口打开,由于SIP协议是UDP协议,打开多个网络接口时,可能不会发送数据包到服务器上.

2.保证防火墙关闭

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

3.按照我提供的方式安装wireshark

否则可能GB28181-2016自动化测试工具不能运行,不能捕获自己发送的网络数据包等情况.

操作步骤

1.打开GB28181-2016自动化测试工具

一定先打开GB28181-2016自动化测试工具.

如上配置自动化测试工具,点击确认.

2.运行界面配置

切换到运行界面,选择11实时视频,其他依赖选项会自动选择.
在这里插入图片描述

3.GB28181-2016自动化测试工具运行

运行界面,点击运行按钮.
在这里插入图片描述

4.打开模拟设备

在模拟设备文件夹中点击GB28181Device.exe.

5.查看测试结果

在自动化测试工具中可以看到测试过程,播放视频时,语音也正常播放.
在这里插入图片描述

6.生成测试报告

生成的pdf格式的测试报告,内容有发送和接收的消息等内容,可以用于定位问题.
在这里插入图片描述

抓包

这里设备和服务器在同一台电脑上,选择回环网络.

在这里插入图片描述
在这里插入图片描述
抓包的过滤条件如下:

tcp.port==5060 || udp.port==5060

资料下载和国标总的资料参考我的这篇文章:国标gb28181保姆级入门教程

相关推荐

  1. GO语言 环境

    2024-01-10 12:26:04       35 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-10 12:26:04       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-10 12:26:04       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-10 12:26:04       87 阅读
  4. Python语言-面向对象

    2024-01-10 12:26:04       96 阅读

热门阅读

  1. Qt之字节数组类QByteArray

    2024-01-10 12:26:04       65 阅读
  2. 神经网络(Neural Networks)

    2024-01-10 12:26:04       66 阅读
  3. 控制台程序退出时触发事件

    2024-01-10 12:26:04       56 阅读
  4. Python使用函数统计指定数字的个数

    2024-01-10 12:26:04       51 阅读
  5. vue首次加载白屏问题

    2024-01-10 12:26:04       62 阅读
  6. Acwing 844 走迷宫

    2024-01-10 12:26:04       61 阅读
  7. Golang 快乐数 leetcode202 map哈希表 快慢指针法

    2024-01-10 12:26:04       55 阅读
  8. MongoDB之安全管理

    2024-01-10 12:26:04       57 阅读
  9. docker-宿主机与容器的命令执行方法

    2024-01-10 12:26:04       52 阅读
  10. Actor-Model和Reward-Model

    2024-01-10 12:26:04       45 阅读
  11. 数据结构-怀化学院期末题

    2024-01-10 12:26:04       45 阅读