How does SmargGBD (GB28181 device access module) connect to wvp-gb28181-pro

Technical background

When we connect to SmartGBD (GB28181 device access module), in addition to the conventional national standard platforms such as Hikvision Dahua Univision, some companies will choose wvp-gb28181-pro.

As we all know, WEB VIDEO PLATFORM is an out-of-the-box network video platform based on the GB28181-2016 standard. It is responsible for implementing the core signaling and device management backend parts. It supports NAT penetration and supports brands such as Hikvision, Dahua, and Uniview. IPC and NVR access. Supports national standard cascading and supports forwarding cameras/live streams/live push streams without national standard functions to other national standard platforms. Suitable for supporting browser playback of camera videos without plug-ins. Supports the access of national standard equipment (camera, platform, NVR, etc.) and supports the access of non-national standard equipment (onvif, rtsp, rtmp, live broadcast equipment, etc.) to make full use of old equipment. Support national standard cascade. Multi-platform cascading. Cross-network video preview. Support cross-network gatekeeper platform interconnection.

Based on this, we also compiled wvp-gb28181-pro and deployed their services locally. I won’t go into details about compilation and installation. wvp-gb28181-pro provides relevant technical instructions. It should be easy for technicians with certain development capabilities to build it.

Technical docking

Everything is ready. We set the platform docking parameters of wvp-gb28181-pro on the SmartGBD Android demo of Daniu Live SDK:

 /*** GB28181 related parameters, you can modify the relevant parameters before testing ***/
    GBSIPAgent gb28181_agent_ = null;
    private int gb28181_sip_local_port_base_ = 5060;

    private String gb28181_sip_server_id_ = "41010500002000000001";
    private String gb28181_sip_domain_ = "4101050000";
    private String gb28181_sip_server_addr_ = "192.168.0.106";
    private int gb28181_sip_server_port_ = 8118;

    private String gb28181_sip_user_agent_filed_ = null; // "NT GB UserAgent V1.7";
    private String gb28181_sip_username_ = "41010500001310000039";
    private String gb28181_sip_password_ = "12345678";

    private int gb28181_reg_expired_ = 3600; // The minimum registration validity period is 3600 seconds
    private int gb28181_heartbeat_interval_ = 20; // The default heartbeat interval of GB28181 is 60, currently adjusted to 20 seconds
    private int gb28181_heartbeat_count_ = 3; // The heartbeat interval fails 3 times, indicating that it is disconnected from the server
    private int gb28181_sip_trans_protocol_ = 0; // 0 means signaling is transmitted using UDP, 1 means signaling is transmitted using TCP

    private long gb28181_rtp_sender_handle_ = 0;
    private int gb28181_rtp_payload_type_ = 96;
    private String gb28181_rtp_encoding_name_ = "PS";

Start GB28181:

 class ButtonGB28181AgentListener implements View.OnClickListener {
        public void onClick(View v) {
            record_executor_.cancel_tasks();

            stopRecordDownloads(true);
            stopPlaybacks(true);

            stopAudioPlayer();
            destroyRTPReceiver();

            gb_broadcast_source_id_ = null;
            gb_broadcast_target_id_ = null;
            btnGB28181AudioBroadcast.setText("GB28181 Voice Broadcast");
            btnGB28181AudioBroadcast.setEnabled(false);

            stopGB28181Stream();
            destroyRTPSender();

            if (null == gb28181_agent_ ) {
                if( !initGB28181Agent() )
                    return;
            }

            if (gb28181_agent_.isRunning()) {
                gb28181_agent_.terminateAllAudioBroadcasts(true);
                gb28181_agent_.terminateAllPlays(true); // After testing so far, some servers will immediately send INVITE after sending BYE. Whether to send BYE depends on the actual situation.
                gb28181_agent_.stop();
                btnGB28181Agent.setText("Start GB28181");
            }
            else {
                record_executor_.cancel_tasks();
                initPlaybacks(null);
                initRecordDownloads(null);
                if ( gb28181_agent_.start() ) {
                    btnGB28181Agent.setText("Stop GB28181");
                }
            }
        }
    }

If the registration is successful, the wvp-gb28181-pro platform will display online:

Click “Channel” to enter the corresponding channel page:

Here you can choose to play directly, and the wvp national standard platform will send an INVITE request:

 INVITE sip:[email protected]:5060 SIP/2.0
    Call-ID: [email protected]
    CSeq: 613 INVITE
    From: <sip:41010500002000000001@4101050000>;tag=fbc9cccc34234fc3b4d78cb7035ca7a5
    To: <sip:[email protected]:5060>
    Via: SIP/2.0/UDP 192.168.0.106:8118;branch=z9hG4bK2349190019;rport=8118;received=192.168.0.106
    Max-Forwards: 70
    User-Agent: WVP-Pro v2.6.9.20231103
    Contact: <sip:[email protected]:8118>
    Subject: 34020000001380000001:0105008771,41010500002000000001:0
    Content-Type: APPLICATION/SDP
    Content-Length: 288
    
    v=0
    o=34020000001380000001 0 0 IN IP4 192.168.0.106
    s=Play
    c=IN IP4 192.168.0.106
    t=0 0
    m=video 50136 TCP/RTP/AVP 96 97 98 99
    a=recvonly
    a=rtpmap:96 PS/90000
    a=rtpmap:98 H264/90000
    a=rtpmap:97 MPEG4/90000
    a=rtpmap:99 H265/90000
    a=setup:passive
    a=connection:new
    y=0105008771

The Android platform GB28181 device accesses the response processing and then sends the packaged ps data.

wvp-gb28181-pro also supports Li Shi video and audio playback. Click on the device recording on the page to enter the playback page, select the corresponding date, and the national standard platform will send a file retrieval request (RecordInfo):

 MESSAGE sip:[email protected]:5060 SIP/2.0
    Call-ID: [email protected]
    CSeq: 622 MESSAGE
    From: <sip:41010500002000000001@4101050000>;tag=5adbe8c090fd40698b58c9d77795e5c2
    To: <sip:[email protected]:5060>
    Via: SIP/2.0/UDP 192.168.0.106:8118;branch=z9hG4bK2970158694;rport=8118;received=192.168.0.106
    Max-Forwards: 70
    User-Agent: WVP-Pro v2.6.9.20231103
    Content-Type: Application/MANSCDP + xml
    Content-Length: 277
    
    <?xml version="1.0" encoding="GB2312"?>
    <Query>
    <CmdType>RecordInfo</CmdType>
    <SN>813631</SN>
    <DeviceID>34020000001380000001</DeviceID>
    <StartTime>2023-11-05T00:00:00</StartTime>
    <EndTime>2023-11-05T23:59:59</EndTime>
    <Secrecy> 0 </Secrecy>
    <Type>all</Type>
    </Query>

The list of retrieved files is as follows, just click to play.

If you need to download video files, you also need to install the wvp-pro-assist plug-in, so I won’t try it here.

In addition to regular functions, such as video preview, PTZ control, preset positions, support for subscriptions and notifications, and heartbeat keep-alive, wvp-gb28181-pro also supports real-time location subscription. Unfortunately, the demo did not see voice broadcast and voice Talkback, because the platform is open, interested developers can also extend support.