gb28181语音对讲的一个例子

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后通过上面的端口,协议信息发送语音数据

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值