sip协议详解

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

SIP消息之逐项讲解AgendaSIPINVITESIPINVITEMessageBodySIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;ms-received-cid=B100Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.ultrapower.com.cn;epid=203e516cd9Call-ID:d455d3faf197403482154b9a319f54e0CSeq:1INVITERequire:com.microsoft.rtc-multipartyContent-Type:application/sdpContent-Length:134SIP消息的第一部分:起始行(StartLine)本消息属于RequestLine,它所包含的信息:RequestType:方法名就是INVITE,表示邀请其他用户加入会话Request-URI:sip:long@add.ultrapower.com.cn;transport=tcp,这属于SIPURI中的“Address-of-Record(AOR)”种类。SIPVersion:2.0版本号SIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;ms-received-cid=B100Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.ultrapower.com.cn;epid=203e516cd9Call-ID:d455d3faf197403482154b9a319f54e0CSeq:1INVITERequire:com.microsoft.rtc-multipartyContent-Type:application/sdpContent-Length:134SIP消息的第二部分:消息头(MessageHeader)Via:记录了请求在SIP网络中的路由路径。最下面的Via是初始化这个请求的UA(UserAgent)插入的;上面的Via都是在这个路由路径上的Proxy们插入的。Via头域就是用来指示如何将响应沿原路返回到UA的。SIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;ms-received-cid=B100Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.ultrapower.com.cn;epid=203e516cd9Call-ID:d455d3faf197403482154b9a319f54e0CSeq:1INVITERequire:com.microsoft.rtc-multipartyContent-Type:application/sdpContent-Length:134SIP消息的第二部分:消息头(MessageHeader)Max-Forwards:最大转发数,用来限制一个SIP请求消息所能经过的实体的最大数目。如果消息拷贝中包含一个Max-Forwards字段,代理服务器必须将其减一。如果消息拷贝中不含Max-Forwards字段,代理服务器必须加入该字段,其值应该为70。如果请求消息中包含Max-Forwards字段,且其值为零,则SIP实体不得转发,并且返回483(TooManyHops)响应。SIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;ms-received-cid=B100Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.ultrapower.com.cn;epid=203e516cd9Call-ID:d455d3faf197403482154b9a319f54e0CSeq:1INVITERequire:com.microsoft.rtc-multipartyContent-Type:application/sdpContent-Length:134SIP消息的第二部分:消息头(MessageHeader)FromTag,ToTag,和Call-ID构成了dialog信息,可以唯一标识一个dialog。在本次呼叫(Call)中的所有请求和响应将使用同样dialog信息。Call-ID的构成:伪随机数字+”@”+主机名或者IP地址SIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;ms-received-cid=B100Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.ultrapower.com.cn;epid=203e516cd9Call-ID:d455d3faf197403482154b9a319f54e0CSeq:1INVITERequire:com.microsoft.rtc-multipartyContent-Type:application/sdpContent-Length:134SIP消息的第二部分:消息头(MessageHeader)CSeq:CommandSequenceNumber用于标识事务并对事务排序。由一个序列号和请求方法组成。呼叫开始时初始化CSeq。非REGISTER请求的CSeq,序列号值可以是一个任意的32位无符号整数。CSeq按照各自方向严格单向按1递增。CSeq能够区分某个请求是新请求还是重发的请求。SIP–INVITEINVITEsip:victor@add.ultrapower.com.cn;transport=tcpSIP/2.0Via:SIP/2.0/TCP192.168.5.162;branch=z9hG4bK381ACAFC.537D4376;branched=FALSE;Max-Forwards:69Contact:sip:long@add.ultrapower.com.cn:2992;maddr=192.168.5.162;transport=tcp;Via:SIP/2.0/TCP192.168.5.162:11499;ms-received-port=2992;ms-received-cid=b100Record-Route:sip:helen.add.ultrapower.com.cn;transport=tcp;tag=9B8AE5F9C759FB02F679AFD6CB71394CFrom:sip:long@add.ultrapower.com.cn;tag=704b1683edd4438f85a34adb6201e078;epid=d9176cec0cTo:sip:victor@add.u

1 / 13
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功