gb28181语音对讲的一个例子

编程入门 行业动态 更新时间:2024-10-27 12:30:10

1、发起端发送sip请求

MESSAGE sip:34020000001320000074@192.168.3.123:5100 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.10:5090;rport;branch=z9hG4bK755065984
From: <sip:34020000002000000065@192.168.3.10:5090>;tag=141992068
To: <sip:34020000001320000074@192.168.3.123:5100>
Call-ID: 970796440
CSeq: 20 MESSAGE
Content-Type: Application/MANSCDP+xml
Max-Forwards: 70
User-Agent: JUNTAI SIP UAS/1.0
Content-Length:   159

<?xml version="1.0"?><Notify><CmdType>Broadcast</CmdType><SN>12</SN><SourceID>34020000001360000065</SourceID><TargetID>34020000001370000074</TargetID></Notify> 

接受端响应:

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.10:5090;rport=5090;branch=z9hG4bK755065984
From: <sip:34020000002000000065@192.168.3.10:5090>;tag=141992068
To: <sip:34020000001320000074@192.168.3.123:5100>;tag=1205858790
Call-ID: 970796440
CSeq: 20 MESSAGE
User-agent: IP Camera
Content-Length: 0

2、接受端发送Response

MESSAGE sip:34020000002000000065@3402000000 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.123:5100;rport=5100;branch=z9hG4bK1693666253
From: <sip:34020000001320000074@3402000000>;tag=630894241
To: <sip:34020000002000000065@3402000000>
Call-ID: 950626075
CSeq: 20 MESSAGE
Content-Type: Application/MANSCDP+xml
Max-forwards: 70
User-agent: IP Camera
Content-Length:   166

<?xml version="1.0" encoding="GB2312"?>
<Response>
<CmdType>Broadcast</CmdType>
<SN>12</SN>
<DeviceID>34020000001370000074</DeviceID>
<Result>OK</Result>
</Response>

3、接受端发送带sdp的invite

INVITE sip:34020000001360000065@192.168.3.10:5090 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.123:5100;rport=5100;branch=z9hG4bK2145781957
From: <sip:34020000001320000074@192.168.3.123:5100>;tag=1263238741
To: <sip:34020000001360000065@192.168.3.10:5090>
Call-ID: 393121623
CSeq: 20 INVITE
Contact: <sip:34020000001320000074@192.168.3.123:5100>
Content-Type: application/sdp
Max-forwards: 70
User-agent: IP Camera
Subject: 34020000001360000065:1,34020000001320000074:2
Content-Length:   213

v=0
o=34020000001320000074 1575297968291966 1575297968291966 IN IP4 192.168.3.123
s=Play
c=IN IP4 192.168.3.123
t=0 0
m=audio 25069 RTP/AVP 8
a=recvonly
a=rtpmap:8 PCMA/8000
y=0200000002
f=v/a/1/8/1

4、发起端响应改invite,发送ANSWERED

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.123:5100;rport=5100;branch=z9hG4bK2145781957
From: <sip:34020000001320000074@192.168.3.123:5100>;tag=1263238741
To: <sip:34020000001360000065@192.168.3.10:5090>;tag=2048197322
Call-ID: 393121623
CSeq: 20 INVITE
Contact: <sip:34020000001360000065@192.168.3.10:5090>
Content-Type: application/sdp
User-Agent: JUNTAI SIP UAS/1.0
Content-Length:   181

v=0
o=34020000002000000065 0 0 IN IP4 192.168.3.10
s=Play
c=IN IP4 192.168.3.10
t=0 0
m=audio 6002 RTP/AVP 8
a=sendonly
a=rtpmap:8 PCMA/8000
y=0200000002
f=v/ a/1/8/1

5、接收端发送ACK确认invite

ACK sip:34020000001360000065@192.168.3.10:5090 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.123:5100;rport=5100;branch=z9hG4bK539005821
From: <sip:34020000001320000074@192.168.3.123:5100>;tag=1263238741
To: <sip:34020000001360000065@192.168.3.10:5090>;tag=2048197322
Call-ID: 393121623
CSeq: 20 ACK
Contact: <sip:34020000001320000074@192.168.3.123:5100>
Max-forwards: 70
User-agent: IP Camera
Content-Length: 0

6、发起端收到ack后通过上面的端口,协议信息发送语音数据

更多推荐

gb28181语音对讲的一个例子

本文发布于:2023-06-14 07:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1451601.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语音   例子

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!