sip 容易混乱的一些header

voip sip的最简单最标准的过程应该是这样

seq 1
src invite
dst ring
dst ok
src ack

....通话...

seq 2
src(dst) bye
dst(src) ok
....结束...


seq 1
双方的包 from , to 不变。
via ,dst增加自己的信息,如rport,用分号;分隔。

contact 始终是自己的sip完整地址。

call-id 始终是整个通话过程中的唯一值。它代表一个request从开始到结束。不管seq增加多少 。

seq 2
from , to 由seq变方重新生成,sip地址和tag都不变,只是To和From可能顺序换一下。 在seq下一次改变前,双方一致。

via 重新生成。里面的branch也重新生成。


sdp相关记录

v=0
o=IpPhone 2890844526 8000 IN IP4 192.168.84.121
s=IpPhone CALL
c=IN IP4 192.168.84.121
t=0 0
m=audio 10000 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv

Origin
o=<username> <session id> <version> <network type> <address type> <address>

Connection Data
c=<network type> <address type> <connection address>

Media Announcements
m=<media> <port> <transport> <fmt list>

a=rtpmap:<payload type> <encoding name>/<clock rate>[/<encoding
parameters>]
rtpmap是fmt list 的详细解释


a=recvonly
This specifies that the tools should be started in receive-only
mode where applicable. It can be either a session or media
attribute, and is not dependent on charset.

a=sendrecv
This specifies that the tools should be started in send and
receive mode. This is necessary for interactive conferences with
tools such as wb which defaults to receive only mode. It can be
either a session or media attribute, and is not dependent on
charset.

a=sendonly
This specifies that the tools should be started in send-only
mode. An example may be where a different unicast address is to
be used for a traffic destination than for a traffic source. In
such a case, two media descriptions may be use, one sendonly and
one recvonly. It can be either a session or media attribute, but
would normally only be used as a media attribute, and is not
dependent on charset.

rtp 大小计算

根据ptime值,
比如ptime=20, media = pcma 表示 20ms发一个包,内容容量为160byte
计划方法

pcm a律为 8000hz 每次8bit,则秒秒发送包大小 8000(hz) * 8bit = 64kbps
64kbps/8 = 8k byte /s
因为ptime=20,即每次 1/20 * 8kbyte = 160byte(20ms)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值