修改start和end默认为空时t=传值错误

This commit is contained in:
zhouyun
2021-05-25 16:25:42 +08:00
parent 0481b71d52
commit 6188118ef6

View File

@@ -253,6 +253,8 @@ f字段中视、音频参数段之间不需空格分割。
可使用f字段中的分辨率参数标识同一设备不同分辨率的码流。
*/
func (d *Device) Invite(channelIndex int, start, end string) int {
sint, _ := strconv.Atoi(start)
eint, _ := strconv.Atoi(end)
channel := d.Channels[channelIndex]
var publisher Publisher
publisher.Type = "GB28181"
@@ -286,7 +288,7 @@ func (d *Device) Invite(channelIndex int, start, end string) int {
"s=" + s,
"u=" + channel.DeviceID + ":0",
"c=IN IP4 " + d.SipIP,
fmt.Sprintf("t=%s %s", start, end),
fmt.Sprintf("t=%d %d", sint, eint),
fmt.Sprintf("m=video %d RTP/AVP 96 97 98", config.MediaPort),
"a=recvonly",
"a=rtpmap:96 PS/90000",