Note: Issues that do not provide the following information will be directly deleted (Please follow the issue template, or we will delete it)'
Make sure to maintain the markdown structure.
Note: For inquiries and discussions, please submit them to the SRS forum (Please ask questions at) http://bbs.ossrs.net
Make sure to maintain the markdown structure.
Description
Make sure to maintain the markdown structure.
Hikvision cameras use gb28181 for streaming, webrtc for pulling streams, and it takes 30 seconds to receive a response from the camera after sending the Invite command through srs's http api.
http_server {
enabled on;
listen 8098;
dir ./objs/nginx/html;
}
stats {
network 0;
}
rtc_server {
enabled on;
Listen at udp://8000
listen 8000;
#
# The $CANDIDATE means fetch from env, if not configed, use * as default.
#
# The * means retrieving server IP automatically, from all network interfaces,
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
# Pull stream address: Use local address or configure as follows
candidate 192.168.216.39; # Set to public address
vhost defaultVhost {
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
rtc {
enabled on;
bframe discard;
}
}
**Replay**
**How to replay bug?**
> Steps to reproduce the bug
**How to replay bug?**
1. Start SRS.
2. Enable Hikvision camera GB28181 function.
3. After seeing the channel information in the web console, send the INVITE command through the SRS HTTP API.
http://192.168.216.39:1985/api/v1/gb28181?action=sip_invite&id=34020000001320000005&chid=34020000001320000005
**How to replay bug?**
1. Start SRS.
2. Enable Hikvision camera GB28181 function.
3. After seeing the channel information in the web console, send the INVITE command through the SRS HTTP API.
4. The server's tcpdump log shows that the camera's reply is received 30 seconds after the INVITE command is sent. (Server IP is 192.168.216.39, camera IP is 192.168.99.70)
**tcpdump log:**
The tcpdump log is as follows:
09:08:52.965368 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 424)
192.168.99.70.sip > 39.sip: SIP, length: 396
REGISTER sip:34020000002000000001@3402000000 SIP/2.0
Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK1101250767
From: sip:34020000001320000005@3402000000;tag=1972280948
To: sip:34020000001320000005@3402000000
Call-ID: 697742333
CSeq: 1 REGISTER
Contact: sip:34020000001320000005@192.168.99.70:5060
Max-Forwards: 70
User-Agent: IP Camera
Expires: 3600
Content-Length: 0
**Using another gb28181 testing tool to receive camera streaming works fine. The server-side Wireshark capture log (server IP is 192.168.216.149) is as follows:**
**Expected behavior (Expect)**
**> After sending the INVITE command through the HTTP API, it is expected to immediately receive a response from the camera.**
**Camera configuration:**
![ipc_config](https://user-images.githubusercontent.com/8139457/136639790-8295a6f9-f271-4786-8cd2-f6df0ad95770.png)
`TRANS_BY_GPT3`
Make sure to maintain the markdown structure.
Make sure to maintain the markdown structure.
Description
Make sure to maintain the markdown structure.
listen 1935; max_connections 1000; daemon off; srs_log_tank console;
srs_log_tank file;
srs_log_level trace;
srs_log_file ./objs/srs.log;
http_api { enabled on; listen 1985; }
http_server { enabled on; listen 8098; dir ./objs/nginx/html; }
stats { network 0; }
rtc_server { enabled on;
Listen at udp://8000
}
stream_caster { enabled on; caster gb28181; output rtmp://127.0.0.1:1935/live/[stream]; listen 9000;
tcp_enable on;
jitterbuffer_enable false;
}
vhost defaultVhost { http_remux { enabled on; mount [vhost]/[app]/[stream].flv; }
}
09:08:52.965368 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 424) 192.168.99.70.sip > 39.sip: SIP, length: 396 REGISTER sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK1101250767 From: sip:34020000001320000005@3402000000;tag=1972280948 To: sip:34020000001320000005@3402000000 Call-ID: 697742333 CSeq: 1 REGISTER Contact: sip:34020000001320000005@192.168.99.70:5060 Max-Forwards: 70 User-Agent: IP Camera Expires: 3600 Content-Length: 0
09:08:52.965976 IP (tos 0x0, ttl 64, id 1662, offset 0, flags [DF], proto UDP (17), length 402) 39.sip > 192.168.99.70.sip: SIP, length: 374 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;received=192.168.99.70;branch=z9hG4bK1101250767 From: sip:34020000001320000005@3402000000;tag=1972280948 To: sip:34020000001320000005@3402000000 CSeq: 1 REGISTER Call-ID: 697742333 Contact: sip:34020000001320000005@192.168.99.70:5060 User-Agent: SRS/5.0.12(Leo) Expires: 3600 Content-Length: 0
09:08:53.974584 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 558) 192.168.99.70.sip > 39.sip: SIP, length: 530 MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK1210990363 From: sip:34020000001320000005@3402000000;tag=1567478558 To: sip:34020000002000000001@3402000000 Call-ID: 2137199910 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 162
09:08:53.974984 IP (tos 0x0, ttl 64, id 2665, offset 0, flags [DF], proto UDP (17), length 332) 39.sip > 192.168.99.70.sip: SIP, length: 304 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;received=192.168.99.70;branch=z9hG4bK1210990363 From: sip:34020000001320000005@3402000000;tag=1567478558 To: sip:34020000002000000001@3402000000 CSeq: 20 MESSAGE Call-ID: 2137199910 User-Agent: SRS/5.0.12(Leo) Content-Length: 0
09:08:54.966571 IP (tos 0x0, ttl 64, id 2748, offset 0, flags [DF], proto UDP (17), length 563) 39.sip > 192.168.99.70.sip: SIP, length: 535 MESSAGE sip:34020000001320000005@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.39:5060;rport;branch=SrsGbB88318221 From: sip:34020000002000000001@192.168.216.39:5060;tag=SrsGbF67124795 To: sip:34020000001320000005@3402000000 Call-ID: 202062700960 CSeq: 100 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: SRS/5.0.12(Leo) Content-Length: 149
09:09:25.033654 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 332) 192.168.99.70.sip > 39.sip: SIP, length: 304 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.39:5060;rport=5060;branch=SrsGbB88318221 From: sip:34020000002000000001@192.168.216.39:5060;tag=SrsGbF67124795 To: sip:34020000001320000005@3402000000;tag=1500524665 Call-ID: 202062700960 CSeq: 100 MESSAGE User-Agent: IP Camera Content-Length: 0
09:09:25.033885 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 32) 192.168.99.70.sip > 39.sip: SIP 0x0000: 4568 0020 0000 4000 3e11 7fa6 c0a8 6346 Eh....@.>.....cF 0x0010: c0a8 d827 13c4 13c4 000c 662d 6a61 4b00 ...'......f-jaK. 0x0020: 0000 0000 0000 0000 0000 0000 0000 .............. 09:09:25.052360 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 954) 192.168.99.70.sip > 39.sip: SIP, length: 926 MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK657659771 From: sip:34020000001320000005@3402000000;tag=1317313620 To: sip:34020000002000000001@3402000000 Call-ID: 1398600959 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 559
09:09:25.052872 IP (tos 0x0, ttl 64, id 13178, offset 0, flags [DF], proto UDP (17), length 331) 39.sip > 192.168.99.70.sip: SIP, length: 303 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;received=192.168.99.70;branch=z9hG4bK657659771 From: sip:34020000001320000005@3402000000;tag=1317313620 To: sip:34020000002000000001@3402000000 CSeq: 20 MESSAGE Call-ID: 1398600959 User-Agent: SRS/5.0.12(Leo) Content-Length: 0
09:09:47.128337 IP (tos 0x0, ttl 64, id 16849, offset 0, flags [DF], proto UDP (17), length 676) 39.sip > 192.168.99.70.sip: SIP, length: 648 INVITE sip:34020000001320000005@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.39:5060;rport;branch=SrsGbB43388735 From: sip:34020000002000000001@3402000000;tag=SrsGbF12017618 To: sip:34020000001320000005@3402000000 Call-ID: 202027248962 CSeq: 101 INVITE Content-Type: Application/SDP Contact: sip:34020000001320000005@3402000000 Max-Forwards: 70 User-Agent: SRS/5.0.12(Leo) Subject: 34020000001320000005:0041238534,34020000002000000001:0 Content-Length: 168
09:10:17.190078 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 311) 192.168.99.70.sip > 39.sip: SIP, length: 283 SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.216.39:5060;rport=5060;branch=SrsGbB43388735 From: sip:34020000002000000001@3402000000;tag=SrsGbF12017618 To: sip:34020000001320000005@3402000000 Call-ID: 202027248962 CSeq: 101 INVITE User-Agent: IP Camera Content-Length: 0
09:10:17.201525 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 557) 192.168.99.70.sip > 39.sip: SIP, length: 529 MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK805708165 From: sip:34020000001320000005@3402000000;tag=1545404225 To: sip:34020000002000000001@3402000000 Call-ID: 1336456979 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 162
09:10:17.201777 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 640) 192.168.99.70.sip > 39.sip: SIP, length: 612 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.39:5060;rport=5060;branch=SrsGbB43388735 From: sip:34020000002000000001@3402000000;tag=SrsGbF12017618 To: sip:34020000001320000005@3402000000;tag=1286517288 Call-ID: 202027248962 CSeq: 101 INVITE Contact: sip:34020000001320000005@192.168.99.70:5060 Content-Type: application/sdp User-Agent: IP Camera Content-Length: 227
09:10:17.201870 IP (tos 0x0, ttl 64, id 35419, offset 0, flags [DF], proto UDP (17), length 331) 39.sip > 192.168.99.70.sip: SIP, length: 303 SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;received=192.168.99.70;branch=z9hG4bK805708165 From: sip:34020000001320000005@3402000000;tag=1545404225 To: sip:34020000002000000001@3402000000 CSeq: 20 MESSAGE Call-ID: 1336456979 User-Agent: SRS/5.0.12(Leo) Content-Length: 0
09:10:17.201944 IP (tos 0x68, ttl 62, id 0, offset 0, flags [DF], proto UDP (17), length 32) 192.168.99.70.sip > 39.sip: SIP 0x0000: 4568 0020 0000 4000 3e11 7fa6 c0a8 6346 Eh....@.>.....cF 0x0010: c0a8 d827 13c4 13c4 000c 662d 6a61 4b00 ...'......f-jaK. 0x0020: 0000 0000 0000 0000 0000 0000 0000 .............. 09:10:17.202244 IP (tos 0x0, ttl 64, id 35420, offset 0, flags [DF], proto UDP (17), length 371) 39.sip > 192.168.99.70.sip: SIP, length: 343 ACK sip:34020000001320000005@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.39:5060;rport;branch=SrsGbB43388735 From: sip:34020000002000000001@3402000000;tag=SrsGbF12017618 To: sip:34020000001320000005@3402000000;tag=1286517288 Call-ID: 202027248962 CSeq: 101 ACK Max-Forwards: 70 User-Agent: SRS/5.0.12(Leo) Content-Length: 0
REGISTER sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK100361778 From: sip:34020000001320000005@3402000000;tag=947331244 To: sip:34020000001320000005@3402000000 Call-ID: 2085583278 CSeq: 1 REGISTER Contact: sip:34020000001320000005@192.168.99.70:5060 Max-Forwards: 70 User-Agent: IP Camera Expires: 3600 Content-Length: 0
SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;branch=z9hG4bK100361778 From: sip:34020000001320000005@3402000000;tag=947331244 To: sip:34020000001320000005@3402000000;tag=3386257134 Call-ID: 2085583278 CSeq: 1 REGISTER User-Agent: eXosip/4.1.0 WWW-Authenticate: Digest realm="34020000",algorithm=MD5,nonce="1633742709" Date: 2021-10-09T09:25:09.614 Content-Length: 0
REGISTER sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK794466993 From: sip:34020000001320000005@3402000000;tag=947331244 To: sip:34020000001320000005@3402000000 Call-ID: 2085583278 CSeq: 2 REGISTER Contact: sip:34020000001320000005@192.168.99.70:5060 Authorization: Digest username="34020000001320000005", realm="34020000", nonce="1633742709", uri="sip:34020000002000000001@3402000000", response="2cf6312cf90c5dd5e84aec54d81e92e0", algorithm=MD5 Max-Forwards: 70 User-Agent: IP Camera Expires: 3600 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;branch=z9hG4bK794466993 From: sip:34020000001320000005@3402000000;tag=947331244 To: sip:34020000001320000005@3402000000;tag=3777622645 Call-ID: 2085583278 CSeq: 2 REGISTER User-Agent: eXosip/4.1.0 Date: 2021-10-09T09:25:09.654 Content-Length: 0
MESSAGE sip:34020000001320000005@192.168.99.70:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.149:5060;rport;branch=z9hG4bK2450550764 From: sip:34020000002000000001@192.168.216.149:5060;tag=3032406888 To: sip:34020000001320000005@192.168.99.70:5060 Call-ID: 1516658054 CSeq: 20 MESSAGE Content-Type: application/MANSCDP+xml Max-Forwards: 70 User-Agent: eXosip/4.1.0 Date: 2021-10-09T09:25:09.660 Content-Length: 125
<?xml version="1.0"?>
MESSAGE sip:34020000001320000005@192.168.99.70:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.149:5060;rport;branch=z9hG4bK3717284264 From: sip:34020000002000000001@192.168.216.149:5060;tag=1745384054 To: sip:34020000001320000005@192.168.99.70:5060 Call-ID: 3414201841 CSeq: 20 MESSAGE Content-Type: application/MANSCDP+xml Max-Forwards: 70 User-Agent: eXosip/4.1.0 Date: 2021-10-09T09:25:09.662 Content-Length: 130
<?xml version="1.0"?>
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.149:5060;rport=5060;branch=z9hG4bK2450550764 From: sip:34020000002000000001@192.168.216.149:5060;tag=3032406888 To: sip:34020000001320000005@192.168.99.70:5060;tag=49272682 Call-ID: 1516658054 CSeq: 20 MESSAGE User-Agent: IP Camera Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.149:5060;rport=5060;branch=z9hG4bK3717284264 From: sip:34020000002000000001@192.168.216.149:5060;tag=1745384054 To: sip:34020000001320000005@192.168.99.70:5060;tag=849489297 Call-ID: 3414201841 CSeq: 20 MESSAGE User-Agent: IP Camera Content-Length: 0
MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK966280842 From: sip:34020000001320000005@3402000000;tag=2044473818 To: sip:34020000002000000001@3402000000 Call-ID: 1344021516 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 552
<?xml version="1.0" encoding="UTF-8"?>
MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK2124261070 From: sip:34020000001320000005@3402000000;tag=2024371382 To: sip:34020000002000000001@3402000000 Call-ID: 478773802 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 334
<?xml version="1.0" encoding="UTF-8"?>
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;branch=z9hG4bK966280842 From: sip:34020000001320000005@3402000000;tag=2044473818 To: sip:34020000002000000001@3402000000;tag=1400281431 Call-ID: 1344021516 CSeq: 20 MESSAGE User-Agent: eXosip/4.1.0 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;branch=z9hG4bK2124261070 From: sip:34020000001320000005@3402000000;tag=2024371382 To: sip:34020000002000000001@3402000000;tag=1130320606 Call-ID: 478773802 CSeq: 20 MESSAGE User-Agent: eXosip/4.1.0 Content-Length: 0
MESSAGE sip:34020000002000000001@3402000000 SIP/2.0 Via: SIP/2.0/UDP 192.168.99.70:5060;rport;branch=z9hG4bK433901396 From: sip:34020000001320000005@3402000000;tag=1712874258 To: sip:34020000002000000001@3402000000 Call-ID: 1042261920 CSeq: 20 MESSAGE Content-Type: Application/MANSCDP+xml Max-Forwards: 70 User-Agent: IP Camera Content-Length: 162
<?xml version="1.0" encoding="UTF-8"?>
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.99.70:5060;rport=5060;branch=z9hG4bK433901396 From: sip:34020000001320000005@3402000000;tag=1712874258 To: sip:34020000002000000001@3402000000;tag=671005484 Call-ID: 1042261920 CSeq: 20 MESSAGE User-Agent: eXosip/4.1.0 Content-Length: 0
INVITE sip:34020000001320000005@192.168.99.70:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.149:5060;rport;branch=z9hG4bK4130119083 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060 Call-ID: 4216367525 CSeq: 20 INVITE Contact: sip:34020000002000000001@192.168.216.149:5060 Content-Type: application/sdp Max-Forwards: 70 User-Agent: eXosip/4.1.0 Date: 2021-10-09T09:25:20.728 Subject: 34020000001320000005:04020000001320000005,34020000002000000001:1000 Content-Length: 230
v=0 o=34020000002000000001 0 0 IN IP4 192.168.216.149 s=Play c=IN IP4 192.168.216.149 t=0 0 m=video 45056 RTP/AVP 96 98 97 a=recvonly a=rtpmap:96 PS/90000 a=rtpmap:98 H264/90000 a=rtpmap:97 MPEG4/90000 y=0000001000 f= SIP/2.0 100 Trying Via: SIP/2.0/UDP 192.168.216.149:5060;rport=5060;branch=z9hG4bK4130119083 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060 Call-ID: 4216367525 CSeq: 20 INVITE User-Agent: IP Camera Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.149:5060;rport=5060;branch=z9hG4bK4130119083 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060;tag=1292151514 Call-ID: 4216367525 CSeq: 20 INVITE Contact: sip:34020000001320000005@192.168.99.70:5060 Content-Type: application/sdp User-Agent: IP Camera Content-Length: 227
v=0 o=34020000001320000005 2942 2942 IN IP4 192.168.99.70 s=play c=IN IP4 192.168.99.70 t=0 0 m=video 15060 RTP/AVP 96 a=sendonly a=rtpmap:96 PS/90000 a=username:34020000001320000005 a=password:12345678 y=0000001000 ACK sip:34020000001320000005@192.168.99.70:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.149:5060;rport;branch=z9hG4bK3752273265 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060;tag=1292151514 Call-ID: 4216367525 CSeq: 20 ACK Contact: sip:34020000002000000001@192.168.216.149:5060 Max-Forwards: 70 User-Agent: eXosip/4.1.0 Content-Length: 0
BYE sip:34020000001320000005@192.168.99.70:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.216.149:5060;rport;branch=z9hG4bK3751275626 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060;tag=1292151514 Call-ID: 4216367525 CSeq: 21 BYE Contact: sip:34020000002000000001@192.168.216.149:5060 Max-Forwards: 70 User-Agent: eXosip/4.1.0 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.216.149:5060;rport=5060;branch=z9hG4bK3751275626 From: sip:34020000002000000001@192.168.216.149:5060;tag=2931710285 To: sip:34020000001320000005@192.168.99.70:5060;tag=1292151514 Call-ID: 4216367525 CSeq: 21 BYE User-Agent: IP Camera Content-Length: 0
jaK.