The SIP demo application for SRS GB28181.
63
stars
41
commits
Go
primary language
Oct 15, 2025
updated
Pre-requisites:
Then run
git clone https://github.com/ossrs/srs-sip
cd srs-sip
./build.sh
If on Windows
./build.bat
Run the program:
./objs/srs-sip -c conf/config.yaml
Run all tests:
go test -v ./pkg/...
Run tests with coverage:
go test ./pkg/... -coverprofile=coverage.out
go tool cover -func=coverage.out
For more details, see Testing Guide.
This project uses CodeQL for automated security scanning. For more information about security practices and how to report vulnerabilities, see Security Guide.
Use docker
docker run -id -p 1985:1985 -p 5060:5060 -p 8025:8025 -p 9000:9000 -p 5060:5060/udp -p 8000:8000/udp --name srs-sip --env CANDIDATE=your_ip ossrs/srs-sip:alpha
sequenceDiagram
Device ->> SRS-SIP : 1. Register
SRS-SIP ->> Device : 2. 401
Device ->> SRS-SIP : 3. Register
SRS-SIP ->> Device : 4. 200 OK
sequenceDiagram
Player ->> SRS-SIP : 1. Play Request(with id)
SRS-SIP ->> SRS : 2. Publish Request(with ssrc and id)
SRS ->> SRS-SIP : 3. Response(with port)
SRS-SIP ->> Device : 4. Invite(with port)
Device ->> SRS-SIP : 5. 200 OK
SRS-SIP ->> Player : 6. 200 OK(with url)
Device -->> SRS : Media Stream
Player ->> SRS : 7. Play
SRS -->> Player : Media Stream
Player ->> SRS-SIP : 8. Stop Request
SRS-SIP ->> SRS : 9. Unpublish Request
SRS-SIP ->> Device : 10. Bye
/srs-sip/v1/invite,Player主动发起播放请求,携带设备的通道IDstream_caster.listen中配置Invite请求,携带SRS的收流端口及SSRCSRS-SIP 提供了完整的 HTTP API 接口,用于设备管理、视频流控制、PTZ控制等功能。
详细的API接口文档请参考:API接口文档
# 获取设备列表
curl -X GET "http://localhost:8025/srs-sip/v1/devices"
# 发起视频邀请
curl -X POST "http://localhost:8025/srs-sip/v1/invite" \
-H "Content-Type: application/json" \
-d '{
"device_id": "34020000001320000001",
"channel_id": "34020000001320000002",
"media_server_id": 1,
"play_type": 0
}'
40 commits
1 commits
Go
44.9%
Vue
40.5%
TypeScript
10.7%
Shell
1.1%
The SIP demo application for SRS GB28181.
63
stars
41
commits
Go
primary language
Oct 15, 2025
updated
Pre-requisites:
Then run
git clone https://github.com/ossrs/srs-sip
cd srs-sip
./build.sh
If on Windows
./build.bat
Run the program:
./objs/srs-sip -c conf/config.yaml
Run all tests:
go test -v ./pkg/...
Run tests with coverage:
go test ./pkg/... -coverprofile=coverage.out
go tool cover -func=coverage.out
For more details, see Testing Guide.
This project uses CodeQL for automated security scanning. For more information about security practices and how to report vulnerabilities, see Security Guide.
Use docker
docker run -id -p 1985:1985 -p 5060:5060 -p 8025:8025 -p 9000:9000 -p 5060:5060/udp -p 8000:8000/udp --name srs-sip --env CANDIDATE=your_ip ossrs/srs-sip:alpha
sequenceDiagram
Device ->> SRS-SIP : 1. Register
SRS-SIP ->> Device : 2. 401
Device ->> SRS-SIP : 3. Register
SRS-SIP ->> Device : 4. 200 OK
sequenceDiagram
Player ->> SRS-SIP : 1. Play Request(with id)
SRS-SIP ->> SRS : 2. Publish Request(with ssrc and id)
SRS ->> SRS-SIP : 3. Response(with port)
SRS-SIP ->> Device : 4. Invite(with port)
Device ->> SRS-SIP : 5. 200 OK
SRS-SIP ->> Player : 6. 200 OK(with url)
Device -->> SRS : Media Stream
Player ->> SRS : 7. Play
SRS -->> Player : Media Stream
Player ->> SRS-SIP : 8. Stop Request
SRS-SIP ->> SRS : 9. Unpublish Request
SRS-SIP ->> Device : 10. Bye
/srs-sip/v1/invite,Player主动发起播放请求,携带设备的通道IDstream_caster.listen中配置Invite请求,携带SRS的收流端口及SSRCSRS-SIP 提供了完整的 HTTP API 接口,用于设备管理、视频流控制、PTZ控制等功能。
详细的API接口文档请参考:API接口文档
# 获取设备列表
curl -X GET "http://localhost:8025/srs-sip/v1/devices"
# 发起视频邀请
curl -X POST "http://localhost:8025/srs-sip/v1/invite" \
-H "Content-Type: application/json" \
-d '{
"device_id": "34020000001320000001",
"channel_id": "34020000001320000002",
"media_server_id": 1,
"play_type": 0
}'
40 commits
1 commits
Go
44.9%
Vue
40.5%
TypeScript
10.7%
Shell
1.1%