Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GB28181 push stream failed, SRS 5008 error #3369

Open
Doscene opened this issue Jan 9, 2023 · 6 comments · May be fixed by #3384
Open

GB28181 push stream failed, SRS 5008 error #3369

Doscene opened this issue Jan 9, 2023 · 6 comments · May be fixed by #3384
Assignees
Labels
GB28181 For GB28181. TransByAI Translated by AI/GPT.

Comments

@Doscene
Copy link

Doscene commented Jan 9, 2023

National standard flow push failed, log prompt:
err: code=5008(RtcStun)(RTC do STUN or ICE failed)

The INVITE request message is as follows:

Call-ID: e7634e25054f61ebbe6adf528baf7c16@192.168.0.104
CSeq: 1527 INVITE
From: <sip:51190200042000000001@5119020004:5060>;tag=1673234007732
To: <sip:51190200041320000008@192.168.0.101:5860>
Via: SIP/2.0/UDP 192.168.0.104:5060;branch=z9hG4bK1673234007732
Max-Forwards: 70
User-Agent: ldscloud V1.0.1
Content-Encoding: GB2312
Subject: 51190200041320000008:0902000001,192.168.0.104:0
Content-Type: Application/SDP
Content-Length: 206

v=0
o=51190200041320000008 0 0 IN 192.168.0.104
s=Play
c=IN IP4 192.168.0.106
t=0 0
m=video 8000 RTP/AVP 96 98 97
a=recvonly
a=rtpmap:96 PS/90000
a=rtpmap:98 H264/90000
a=rtpmap:97 MPEG4/90000
y=0902000001```
  1. SRS Version: 5.0.128
  1. SRS Log:
[2023-01-09 03:09:01.284][INFO][1][963c6429] Process: cpu=1.00%,49MB, threads=2
[2023-01-09 03:09:02.205][WARN][1][m173ps86][11] handle udp pkt, count=1/1, err: code=5008(RtcStun)(RTC do STUN or ICE failed) : size=1172, data=[80 60 00 01 00 20 ba bd] : no session, peer_id=192.168.0.101:12002, fast=-2148779970514605888
thread [1][m173ps86]: cycle() [./src/app/srs_app_listener.cpp:743][errno=11]
thread [1][m173ps86]: on_udp_packet() [./src/app/srs_app_rtc_server.cpp:430][errno=11]
[2023-01-09 03:09:02.205][INFO][1][m173ps86] <- RTC RECV #15, udp 1, pps 0/0, schedule 1
[2023-01-09 03:09:03.553][INFO][1][84yn0d8f] Hybrid cpu=2.99%,50MB, cid=72,1, timer=58,0,0, clock=0,14,31,0,0,0,0,0,0
[2023-01-09 03:09:06.296][INFO][1][963c6429] Process: cpu=3.00%,51MB, threads=2
[2023-01-09 03:09:08.554][INFO][1][84yn0d8f] Hybrid cpu=4.00%,52MB, cid=72,1, timer=58,0,0, clock=0,14,31,0,0,0,0,0,0
[2023-01-09 03:09:11.305][INFO][1][963c6429] Process: cpu=3.99%,53MB, threads=2
[2023-01-09 03:09:12.210][WARN][1][m173ps86][11] handle udp pkt, count=5152/5152, err: code=5008(RtcStun)(RTC do STUN or ICE failed) : size=1172, data=[80 60 14 20 00 2e 80 fa] : no session, peer_id=192.168.0.101:12002, fast=-2148779970514605888
thread [1][m173ps86]: cycle() [./src/app/srs_app_listener.cpp:743][errno=11]
thread [1][m173ps86]: on_udp_packet() [./src/app/srs_app_rtc_server.cpp:430][errno=11]
[2023-01-09 03:09:12.210][INFO][1][m173ps86] <- RTC RECV #15, udp 5151, pps 4/514, schedule 5151
[2023-01-09 03:09:13.554][INFO][1][84yn0d8f] Hybrid cpu=3.00%,54MB, cid=517,1, timer=61,0,0, clock=0,28,19,0,0,0,0,0,0
[2023-01-09 03:09:16.313][INFO][1][963c6429] Process: cpu=4.00%,55MB, threads=2
[2023-01-09 03:09:18.554][INFO][1][84yn0d8f] Hybrid cpu=4.00%,56MB, cid=517,1, timer=61,0,0, clock=0,28,19,0,0,0,0,0,0
[2023-01-09 03:09:21.322][INFO][1][963c6429] Process: cpu=4.00%,57MB, threads=2
[2023-01-09 03:09:22.259][WARN][1][m173ps86][11] handle udp pkt, count=10601/10601, err: code=5008(RtcStun)(RTC do STUN or ICE failed) : size=1172, data=[80 60 29 69 00 3c 4b e2] : no session, peer_id=192.168.0.101:12002, fast=-2148779970514605888
thread [1][m173ps86]: cycle() [./src/app/srs_app_listener.cpp:743][errno=11]
thread [1][m173ps86]: on_udp_packet() [./src/app/srs_app_rtc_server.cpp:430][errno=11]
  1. SRS Config:
# docker config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
# For docker, please use docker logs to manage the logs of SRS.
# See https://docs.docker.com/config/containers/logging/
srs_log_tank        console;
daemon              off;

http_api {
    enabled         on;
    listen          1985;
    https {
        enabled on;
        listen 1990;
        key ./conf/ssl/ldscloud.cn.key;
        cert ./conf/ssl/ldscloud.cn_bundle.crt;
   }
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
    https {
        enabled on;
        listen  8088;
        key ./conf/ssl/ldscloud.cn.key;
        cert ./conf/ssl/ldscloud.cn_bundle.crt;

    }
}
rtc_server {
    enabled on;
    listen 8000;
    # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate
    candidate 192.168.1.11;
    tcp {
        # Whether enable WebRTC over TCP.
        # Overwrite by env SRS_RTC_SERVER_TCP_ENABLED
        # Default: off
        enabled on;
        # The TCP listen port for WebRTC. Highly recommend is some normally used ports, such as TCP/80, TCP/443,
        # TCP/8000, TCP/8080 etc. However SRS default to TCP/8000 corresponding to UDP/8000.
        # Overwrite by env SRS_RTC_SERVER_TCP_LISTEN
        # Default: 8000
        listen 8000;
    }
    # The protocol for candidate to use, it can be:
    #       udp         Generate UDP candidates. Note that UDP server is always enabled for WebRTC.
    #       tcp         Generate TCP candidates. Fail if rtc_server.tcp(WebRTC over TCP) is disabled.
    #       all         Generate UDP+TCP candidates. Ignore if rtc_server.tcp(WebRTC over TCP) is disabled.
    # Note that if both are connected, we will use the first connected(DTLS done) one.
    # Overwrite by env SRS_RTC_SERVER_PROTOCOL
    # Default: udp
    protocol all;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    rtc {
        enabled     on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp
        rtc_to_rtmp on;
    }

   http_hooks {
        enabled         off;
        on_publish      https://10.0.0.1:9080/api/v1/streams;
        on_unpublish    https://10.0.0.1:9080/api/v1/streams;
        on_play         https://10.0.0.1:9080/api/v1/sessions;
        on_stop         https://10.0.0.1:9080/api/v1/sessions;
        on_dvr          https://10.0.0.1:9080/api/v1/dvrs;
        on_hls          https://10.0.0.1:9080/api/v1/hls;
        on_hls_notify   https://10.0.0.1:9080/api/v1/hls/[app]/[stream]/[ts_url][param];
    }
}

TRANS_BY_GPT3

@Doscene
Copy link
Author

Doscene commented Jan 9, 2023

Unable to call gb28181 related interfaces

http://host:port/api/v1/gb28181?action=sip_query_session

TRANS_BY_GPT3

@duiniuluantanqin
Copy link
Member

duiniuluantanqin commented Jan 14, 2023

Are you using it correctly? Is stream_caster not configured?

stream_caster {
    enabled on;
    caster gb28181;
    output rtmp://127.0.0.1/live/[stream];
    listen 9000;
    sip {
        enabled on;
        listen 5060;
        # @see https://ossrs.net/lts/zh-cn/docs/v5/doc/gb28181#config-candidate
        candidate $CANDIDATE;
    }
}

TRANS_BY_GPT3

@Doscene
Copy link
Author

Doscene commented Jan 14, 2023

Thank you, master, for your guidance.

Can I only configure the GB28181 streaming service? I want to use an external SIP signaling service.

TRANS_BY_GPT3

@duiniuluantanqin
Copy link
Member

duiniuluantanqin commented Jan 17, 2023

Thank you, master, for your guidance.

Can I only configure the GB28181 streaming service? I want to use an external SIP signaling service.

You can consider it.

TRANS_BY_GPT3

@Doscene
Copy link
Author

Doscene commented Jan 17, 2023

If I want to use multi-port mode, how should I configure it?

TRANS_BY_GPT3

@Doscene
Copy link
Author

Doscene commented Jan 17, 2023

After I use the device to push the stream, SRS cannot receive the stream properly and prompts as follows:

[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session
[2023-01-17 07:18:42.524][WARN][1][y5zg5m56][11] PS: Ignore packet length=1172 for no session

TRANS_BY_GPT3

@Doscene Doscene closed this as completed Jan 17, 2023
@winlinvip winlinvip reopened this Jun 10, 2023
@winlinvip winlinvip added the GB28181 For GB28181. label Jun 10, 2023
@winlinvip winlinvip changed the title GB28181推流失败,SRS 5008 错误 GB28181 push stream failed, SRS 5008 error Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GB28181 For GB28181. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants