@ -21,7 +21,7 @@ If on Windows
|
||||
Run the program:
|
||||
|
||||
```
|
||||
./objs/srs-sip
|
||||
./objs/srs-sip -c conf/config.yaml
|
||||
```
|
||||
|
||||
Use docker
|
||||
@ -29,6 +29,12 @@ 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
|
||||
```
|
||||
|
||||
- 1985/TCP: SRS监听,SRS-SIP通过此端口调用SRS的API
|
||||
- 9000/TCP: SRS监听,用于接收国标推送的媒体流
|
||||
- 8000/UDP:SRS监听,用于RTC播放
|
||||
- 5060/TCP:SRS-SIP监听,用于国标注册
|
||||
- 8025/TCP:SRS-SIP监听,用于前端页面
|
||||
|
||||
## Sequence
|
||||
|
||||
1. 注册流程
|
||||
|
||||
12
main/main.go
12
main/main.go
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
@ -28,9 +29,18 @@ func WaitTerminationSignal(cancel context.CancelFunc) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
// 定义配置文件路径参数
|
||||
configPath := flag.String("c", "", "配置文件路径")
|
||||
flag.Parse()
|
||||
|
||||
if *configPath == "" {
|
||||
logger.E(nil, "错误: 通过 -c 参数指定配置文件路径,比如:./srs-sip -c conf/config.yaml")
|
||||
return
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
conf, err := config.LoadConfig("conf/config.yaml")
|
||||
conf, err := config.LoadConfig(*configPath)
|
||||
if err != nil {
|
||||
logger.E(nil, "load config failed: %v", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user