CN101902506A - Method and system for SIP call traversal network address translation - Google Patents
Method and system for SIP call traversal network address translation Download PDFInfo
- Publication number
- CN101902506A CN101902506A CN2010102176823A CN201010217682A CN101902506A CN 101902506 A CN101902506 A CN 101902506A CN 2010102176823 A CN2010102176823 A CN 2010102176823A CN 201010217682 A CN201010217682 A CN 201010217682A CN 101902506 A CN101902506 A CN 101902506A
- Authority
- CN
- China
- Prior art keywords
- media
- message
- address
- sip
- channel information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Telephonic Communication Services (AREA)
Abstract
本发明公开了一种SIP呼叫穿越网络地址转换的方法和系统,包括私网用户进行SIP呼叫,该私网用户归属的信令代理设备对该SIP消息进行应用层SIP协议解析;该信令代理设备根据解析得到的结果,判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息,是,则将媒体通道信息修改为网络分配的媒体代理设备上与对端网元进行通信的媒体地址和端口,并发送修改后的消息;该私网用户通过所述媒体地址和端口与对端用户建立媒体连接。本发明实现了SIP呼叫的NAT穿越,无需升级终端和NAT设备,也不会增加NAT设备的负担。
The invention discloses a method and system for SIP call traversing network address translation, including a private network user making a SIP call, and a signaling proxy device to which the private network user belongs performs application layer SIP protocol analysis on the SIP message; the signaling proxy The device judges whether it is necessary to modify the media channel information of the application layer SIP protocol of the SIP message according to the analysis result. If yes, the device modifies the media channel information to the media address and port, and send the modified message; the private network user establishes a media connection with the peer user through the media address and port. The invention realizes the NAT traversal of the SIP call without upgrading the terminal and the NAT equipment, and does not increase the burden of the NAT equipment.
Description
技术领域technical field
本发明涉及通信领域,尤其涉及一种SIP呼叫穿越网络地址转换设备的方法和系统。The invention relates to the communication field, in particular to a method and a system for SIP call traversal network address translation equipment.
背景技术Background technique
由于IP地址资源紧缺以及安全等原因,大量的企业网和驻地网采用将私有IP地址通过出口的网络地址转换(NAT)设备接入公网。NAT设备实际上只对UDP或TCP报文头域地址信息进行修改,将内部网络的源地址变为NAT设备自己的外部网络地址,对应用层的内容不作修改。该应用层的内容包括会话初始协议(SIP)消息,NAT设备用来完成会话时SIP信令的NAT穿越。由于SIP协议属于应用层协议,SIP消息携带有控制通道和媒体通道信息(IP地址和端口),支持SIP协议的网元使用此信息进行信令和媒体层面的交互,但是SIP协议携带的地址是私网地址,在至少呼叫一方为私网用户时,如不修改SIP协议本身携带的地址信息,则无法利用控制通道和媒体通道信息与呼叫对端交互,呼叫不能建立。目前对SIP呼叫进行网络地址转换的方法,业界的解决方案有以下几种:Due to the shortage of IP address resources and security reasons, a large number of enterprise networks and resident networks use network address translation (NAT) devices that connect private IP addresses to the public network through egress. In fact, the NAT device only modifies the address information of the UDP or TCP packet header field, changing the source address of the internal network into the external network address of the NAT device itself, and does not modify the content of the application layer. The content of the application layer includes a Session Initiation Protocol (SIP) message, which is used by the NAT device to complete the NAT traversal of the SIP signaling during the session. Since the SIP protocol belongs to the application layer protocol, the SIP message carries the control channel and media channel information (IP address and port), and the network element supporting the SIP protocol uses this information for signaling and media interaction, but the address carried by the SIP protocol is Private network address, when at least one of the calling parties is a private network user, if the address information carried by the SIP protocol itself is not modified, the control channel and media channel information cannot be used to interact with the calling end, and the call cannot be established. At present, there are several solutions in the industry for network address translation for SIP calls:
1、应用层网关(ALG,Application Layer Gateway)方式1. Application Layer Gateway (ALG, Application Layer Gateway) method
NAT设备除了修改UDP或TCP报文头域地址,还解析应用层的SIP协议消息,修改SIP消息本身携带的地址信息。使用此方式来支持SIP协议的NAT设备需要升级,而且由于对所有包进行监控和解析,NAT设备的负荷很大。In addition to modifying the address of the UDP or TCP packet header, the NAT device also parses the SIP protocol message at the application layer and modifies the address information carried in the SIP message itself. The NAT device that supports the SIP protocol in this way needs to be upgraded, and because all packets are monitored and analyzed, the load of the NAT device is very large.
2、中间盒通信(MIDCOM,Middlebox Communication)方式2. Middlebox Communication (MIDCOM, Middlebox Communication) mode
MIDCOM方式的基本框架是采用可信的第三方中间代理(MIDCOM Agent)对中间盒(Middlebox)进行控制,中间盒接收SIP消息,修改UDP或TCP报文头域地址,并在网络与MIDCOM Agent之间对应用层数据进行透明转发。应用层协议的识别不由中间盒完成,而是由外部的MIDCOM Agent完成,由MIDCOM Agent解析应用层的SIP协议消息,修改SIP消息本身携带的地址信息。因此SIP协议对中间盒是透明的,只需支持MIDCOM协议即可。使用此方式的NAT设备需要升级,以支持MIDCOM协议。The basic framework of the MIDCOM method is to use a trusted third-party intermediate agent (MIDCOM Agent) to control the middlebox (Middlebox). Transparent forwarding of application layer data. The identification of the application layer protocol is not completed by the middle box, but by the external MIDCOM Agent, which analyzes the SIP protocol message of the application layer and modifies the address information carried by the SIP message itself. Therefore, the SIP protocol is transparent to the middle box, and it only needs to support the MIDCOM protocol. The NAT device using this method needs to be upgraded to support the MIDCOM protocol.
3、NAT的UDP简单穿越方式(STUN,Simple Traversal of UDP over NATS)3. UDP simple traversal mode of NAT (STUN, Simple Traversal of UDP over NATS)
私网接入终端通过某种机制预先得到其地址对应在出口NAT上的对外地址,直接将应用层的SIP消息的地址填写为出口NAT上的该对外地址,而不是私网终端的私有IP地址。这样报文应用层的内容在经过NAT时无需修改,只需按普通NAT流程转换报文头的IP地址即可,此时应用层负载中的地址和UDP或TCP报文头域地址是一致的。STUN协议基于此思路来解决应用层地址转换的问题。此方式需要升级终端以支持STUN客户端功能,同时该方式不支持对称NAT类型的穿越。The private network access terminal obtains the external address corresponding to its address on the egress NAT through a certain mechanism in advance, and directly fills in the address of the SIP message at the application layer as the external address on the egress NAT instead of the private IP address of the private network terminal . In this way, the content of the application layer of the message does not need to be modified when it passes through NAT. It only needs to convert the IP address of the message header according to the normal NAT process. At this time, the address in the application layer load is consistent with the address of the UDP or TCP message header field. . Based on this idea, the STUN protocol solves the problem of address translation at the application layer. This method needs to upgrade the terminal to support the STUN client function, and this method does not support symmetric NAT type traversal.
4、通过中继方式穿越NAT(TURN,Traversal Using Relay NAT)4. Traversing NAT through relay (TURN, Traversal Using Relay NAT)
TURN方式解决SIP呼叫的网络地址转换穿越问题的思路与STUN方式类似,私网接入终端通过某种机制预先得到其私有地址对应的公网地址(STUN方式得到的地址为出口NAT设备上的地址,TURN方式得到的地址是TURNServer上的地址),然后将报文的应用层负载中的地址填写为该公网地址。此方式也需要升级终端,以支持TURN客户端功能,同时需提供TURN服务器设备,所有报文必须经过TURN服务器转发,增大了包的延迟和丢包的可能性。The TURN method is similar to the STUN method in solving the network address translation traversal problem of SIP calls. The private network access terminal obtains the public network address corresponding to its private address in advance through a certain mechanism (the address obtained by the STUN method is the address on the egress NAT device. , the address obtained by the TURN method is the address on the TURNServer), and then fill in the address in the application layer payload of the message as the public network address. This method also needs to upgrade the terminal to support the TURN client function. At the same time, it needs to provide a TURN server device. All packets must be forwarded by the TURN server, which increases the possibility of packet delay and packet loss.
以上几种解决方案由于需要解析SIP协议、升级NAT设备或终端等原因,在性能、可扩展性以及对现网改造方面都存在一定缺陷,因此需要一种性能较优且无需升级终端和NAT设备的方法,来解决SIP协议的NAT穿越问题。Due to the need to analyze the SIP protocol, upgrade the NAT device or terminal, and other reasons, the above solutions have certain defects in performance, scalability and reconstruction of the existing network. Therefore, a solution with better performance and without upgrading the terminal and NAT device is required A method to solve the NAT traversal problem of the SIP protocol.
发明内容Contents of the invention
本发明要解决的技术问题是提供另一种SIP呼叫穿越网络地址转换的方法,无需升级终端和NAT设备。The technical problem to be solved by the present invention is to provide another method for SIP call traversal network address translation without upgrading terminal and NAT equipment.
为了解决上述问题,本发明提供了一种会话初始协议(SIP)呼叫穿越网络地址转换的方法,包括:In order to solve the above problems, the present invention provides a method for Session Initiation Protocol (SIP) call traversal network address translation, comprising:
私网用户进行SIP呼叫,该私网用户归属的信令代理设备对该SIP消息进行应用层SIP协议解析;When a private network user makes a SIP call, the signaling proxy device to which the private network user belongs performs application layer SIP protocol analysis on the SIP message;
该信令代理设备根据解析得到的结果,判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息,是,则将媒体通道信息修改为网络分配的媒体代理设备上与对端网元进行通信的媒体地址和端口,并发送修改后的消息;The signaling proxy device judges whether it is necessary to modify the media channel information of the SIP message application layer SIP protocol according to the analysis result, and if so, modify the media channel information to communicate with the peer network element on the media proxy device allocated by the network media address and port, and send the modified message;
该私网用户通过所述媒体地址和端口与对端用户建立媒体连接。The private network user establishes a media connection with the peer user through the media address and port.
进一步地,该信令代理设备根据解析得到的结果,如判断不需修改该SIP消息应用层SIP协议的媒体通道信息,则直接转发该SIP消息;Further, the signaling proxy device forwards the SIP message directly if it judges that the media channel information of the SIP message application layer SIP protocol does not need to be modified according to the result obtained through analysis;
该私网用户终端还通过网络地址转换(NAT)设备和该私网用户归属的信令代理设备通信,该NAT设备对该呼叫的SIP消息进行网络层地址和传输层端口转换,该私网用户还利用该NAT设备通过所述媒体地址和端口与对端用户建立媒体连接。The private network user terminal also communicates with the signaling proxy device to which the private network user belongs through a network address translation (NAT) device. The NAT device is also used to establish a media connection with the peer user through the media address and port.
进一步地,该信令代理设备修改该SIP消息应用层SIP协议的媒体通道信息,包括:Further, the signaling proxy device modifies the media channel information of the SIP message application layer SIP protocol, including:
如该SIP消息为请求消息,则将该SIP消息应用层SIP协议的媒体通道信息修改为媒体代理设备与对端网元进行通信的网络地址和端口,同时在该消息的原始控制通道信息Via头域的第一行信息之前增加本信令代理设备的地址和端口,还在该增加的行中加入媒体附加参数,该媒体附加参数为网络分配的该媒体代理设备与对端网元进行通信的网络地址和端口;If the SIP message is a request message, the media channel information of the SIP message application layer SIP protocol is modified to the network address and port used by the media proxy device to communicate with the peer network element, and at the same time, the original control channel information Via header of the message Add the address and port of the signaling proxy device before the first line of information in the domain, and add media additional parameters in the added line, the media additional parameters are the communication between the media proxy device and the peer network element allocated by the network network address and port;
如该SIP消息为响应消息,则用该消息应用层控制通道信息中Via头域的第一行信息的媒体附加参数中的媒体地址和端口替换该响应消息携带的媒体通道信息的媒体地址和端口,并删除该Via头域的第一行。If the SIP message is a response message, replace the media address and port of the media channel information carried in the response message with the media address and port in the media additional parameters of the first line of information in the Via header field in the application layer control channel information of the message , and delete the first line of the Via header field.
进一步地,该信令代理设备根据解析得到的结果,通过以下方式判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息:Further, the signaling proxy device judges whether the media channel information of the SIP message application layer SIP protocol needs to be modified in the following manner according to the result obtained from the analysis:
该信令代理设备如判断该消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,或被叫用户是归属于本信令代理设备的私网用户并且该SIP消息携带的媒体通道信息没有改变,则需要修改该SIP消息应用层SIP协议的媒体通道信息。If the signaling proxy device judges that the message network layer source address and transport layer source port are inconsistent with the address and port information in the first line of the Via header field of the control channel information of the application layer SIP protocol, or the called party belongs to this signaling If the proxy device is a private network user and the media channel information carried in the SIP message has not changed, it is necessary to modify the media channel information of the SIP message application layer SIP protocol.
进一步地,该信令代理设备通过如下方式判断被叫用户是否是归属于本信令代理设备的私网用户:Further, the signaling proxy device judges whether the called user is a private network user belonging to the signaling proxy device in the following manner:
终端向该信令代理设备注册时,该信令代理设备对该终端的注册SIP消息进行解析,如该消息的网络层源地址与应用层SIP协议的控制通道信息的地址不一致,则保存该终端的用户号码、网络层源IP地址和端口;When the terminal registers with the signaling proxy device, the signaling proxy device parses the registration SIP message of the terminal. If the source address of the network layer of the message is inconsistent with the address of the control channel information of the application layer SIP protocol, the terminal will be saved User number, network layer source IP address and port;
该信令代理设备对用户进行呼叫的消息进行解析,得到该呼叫消息中的被叫号码,检查本地是否保存有该号码,如有,则该被叫用户是归属于本信令代理设备的私网用户。The signaling proxy device parses the message of the user's call, obtains the called number in the call message, and checks whether the number is saved locally. If so, the called user is a private user belonging to the signaling proxy device. net users.
进一步地,该信令代理设备对该SIP消息进行应用层SIP协议解析,通过以下方式判断该SIP消息携带的媒体通道信息是否改变:Further, the signaling agent device performs application layer SIP protocol analysis on the SIP message, and judges whether the media channel information carried by the SIP message has changed in the following manner:
该信令代理设备先检查该SIP消息的类型,如该SIP消息为请求消息,再判断该请求消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则该请求消息携带的媒体通道信息已经改变,如否,则该请求消息携带的媒体通道信息没有改变;The signaling proxy device first checks the type of the SIP message, if the SIP message is a request message, then judges whether the first line of information in the Via header field in the application layer control channel information of the request message contains media additional parameters, and if so, then The media channel information carried in the request message has changed, if not, the media channel information carried in the request message has not changed;
如该SIP消息为响应消息,则检查该响应消息应用层控制通道信息中Via头域第一行的信息中是否包含媒体附加参数,如是,则该响应消息携带的媒体通道信息没有改变,如否,则该响应消息携带的媒体通道信息已经改变。If the SIP message is a response message, check whether the information in the first line of the Via header field in the application layer control channel information of the response message contains media additional parameters, if yes, the media channel information carried in the response message has not changed, if not , the media channel information carried in the response message has changed.
进一步地,该信令代理设备如判断该SIP消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,还在该控制通道信息的Contact头域原有信息后增加该网络层地址和传输层端口作为Contact头域的附加参数,用于表示通过该地址和端口访问该私网用户的直接方式,如该SIP消息为请求消息,还在原始控制通道信息Via头域的第一行信息后增加该传输层端口作为端口附加参数,用于回送应答消息。Further, if the signaling agent device judges that the source address of the network layer of the SIP message and the source port of the transport layer are inconsistent with the address and port of the first line of information in the Via header field of the control channel information of the application layer SIP protocol, the control channel information After the original information of the Contact header field, the network layer address and transport layer port are added as additional parameters of the Contact header field, which are used to indicate the direct way to access the private network user through the address and port. If the SIP message is a request message, The transport layer port is also added after the first line of information in the Via header field of the original control channel information as an additional port parameter for sending back a response message.
为了解决该问题,本发明还提供了一种SIP呼叫穿越网络地址转换的系统,其特征在于包括:私网用户的终端、信令代理设备和媒体代理设备,其中:In order to solve this problem, the present invention also provides a system for SIP call traversal network address translation, which is characterized in that it includes: a terminal of a private network user, a signaling proxy device and a media proxy device, wherein:
该私网用户的终端,用于通过其归属的信令代理设备进行SIP呼叫,通过该信令代理设备提供的媒体地址和端口与对端用户建立媒体连接;The private network user's terminal is used to make a SIP call through its belonging signaling proxy device, and establish a media connection with the opposite end user through the media address and port provided by the signaling proxy device;
该媒体代理设备,用于提供网络侧媒体通道,包括媒体地址和端口;The media proxy device is used to provide network-side media channels, including media addresses and ports;
该信令代理设备,用于收到该终端进行呼叫的SIP消息,对该消息进行应用层SIP协议解析,根据解析得到的结果,判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息,是,则将该消息应用层SIP协议的媒体通道信息修改为该媒体代理设备上与对端网元进行通信的媒体地址和端口,并发送修改后的消息。The signaling agent device is used to receive the SIP message that the terminal calls, and analyze the message through the application layer SIP protocol, and judge whether it is necessary to modify the media channel information of the SIP message application layer SIP protocol according to the result obtained by the analysis, If yes, modify the media channel information of the message application layer SIP protocol to the media address and port on the media proxy device for communicating with the peer network element, and send the modified message.
进一步地,该系统还包括网络地址转换(NAT)设备,位于该私网用户终端和该信令代理设备之间,用于转发该终端和对端之间通过该信令代理设备交互的SIP消息,并对该SIP消息进行网络层地址和传输层端口转换;Further, the system also includes a network address translation (NAT) device, located between the private network user terminal and the signaling proxy device, for forwarding SIP messages exchanged between the terminal and the opposite end through the signaling proxy device , and perform network layer address and transport layer port conversion on the SIP message;
该私网用户的终端,还用于通过该NAT设备进行SIP呼叫,利用该NAT设备通过该信令代理设备提供的媒体地址和端口与对端用户建立媒体连接;The terminal of the private network user is also used to make a SIP call through the NAT device, and utilize the NAT device to establish a media connection with the peer user through the media address and port provided by the signaling agent device;
该信令代理设备还用于根据解析得到的结果,如判断不需修改该SIP消息应用层SIP协议的媒体通道信息,则直接转发该SIP消息。The signaling proxy device is also used to forward the SIP message directly if it is judged that the media channel information of the SIP protocol in the application layer of the SIP message does not need to be modified according to the result obtained from the analysis.
进一步地,该信令代理设备,还用于收到SIP消息,对该SIP消息进行解析,如解析得到该SIP消息为请求消息,将该SIP消息应用层SIP协议的媒体通道信息修改为媒体代理设备与对端网元进行通信的网络地址和端口,在该消息的原始控制通道信息Via头域的第一行信息之前增加本信令代理设备的地址和端口后,还在该增加的行中加入媒体附加参数,该媒体附加参数为网络分配的该媒体代理设备与对端网元进行通信的网络地址和端口;如解析得到该SIP消息为响应消息,则用该响应消息应用层控制通道信息中Via头域第一行信息的媒体附加参数的媒体地址和端口替换该响应消息携带的媒体通道信息的媒体地址和端口,并删除该Via头域的第一行。Further, the signaling agent device is also used to receive a SIP message, and analyze the SIP message, if the SIP message is obtained through analysis as a request message, modify the media channel information of the SIP message application layer SIP protocol to be a media agent The network address and port for communication between the device and the peer network element. After adding the address and port of the signaling proxy device before the first line of information in the Via header field of the original control channel information of the message, it is still in the added line Add media additional parameters, the media additional parameters are the network address and port allocated by the network for the media proxy device to communicate with the peer network element; if the SIP message is analyzed to be a response message, use the response message to control the channel information of the application layer Replace the media address and port of the media channel information carried in the response message with the media address and port of the media additional parameters in the first line of information in the Via header field, and delete the first line of the Via header field.
进一步地,该信令代理设备根据解析的到的结果,判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息,包括:Further, the signaling proxy device judges whether the media channel information of the SIP message application layer SIP protocol needs to be modified according to the analyzed result, including:
该信令代理设备,判断该消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,或被叫用户是归属于本信令代理设备的私网用户并且该SIP消息携带的媒体通道信息没有改变,则需要修改该SIP消息应用层SIP协议的媒体通道信息。The signaling proxy device judges that the message network layer source address and transport layer source port are inconsistent with the address and port information in the first line of the Via header field of the control channel information of the application layer SIP protocol, or the called user belongs to this signaling If the proxy device is a private network user and the media channel information carried in the SIP message has not changed, it is necessary to modify the media channel information of the SIP message application layer SIP protocol.
进一步地,该信令代理设备,还用于接收终端的注册请求,对该终端的注册SIP消息进行解析,检查并判断该消息的网络层源地址与应用层SIP协议的控制通道信息的地址是否一致,如不一致,则保存该终端的用户号码、网络层源IP地址和端口;对用户进行呼叫的消息进行解析,得到该呼叫消息中的被叫号码,检查本地是否保存有该号码,如有,则认为该被叫用户是归属于本信令代理设备的私网用户。Further, the signaling proxy device is also used to receive a registration request from a terminal, analyze the registration SIP message of the terminal, check and judge whether the source address of the network layer of the message and the address of the control channel information of the application layer SIP protocol are Consistent, if inconsistent, save the user number, network layer source IP address and port of the terminal; analyze the message of the user's call, get the called number in the call message, check whether the number is saved locally, if any , it is considered that the called user is a private network user belonging to the signaling proxy device.
进一步地,该信令代理设备,还用于收到该用户呼叫的SIP消息,检查该SIP消息的类型,如该SIP消息为请求消息,再判断该请求消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则认为该请求消息携带的媒体通道信息已经改变,如否,则该请求消息携带的媒体通道信息没有改变;如该SIP消息为响应消息,则检查该响应消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则认为该响应消息携带的媒体通道信息没有改变,如否,则该响应消息携带的媒体通道信息已经改变。Further, the signaling agent device is also used to receive the SIP message called by the user, check the type of the SIP message, if the SIP message is a request message, and then judge the Via header field in the application layer control channel information of the request message Whether the first line of information in the first line of information contains media additional parameters, if so, then consider that the media channel information carried by the request message has changed, if not, then the media channel information carried by the request message has not changed; if the SIP message is a response message, Then check whether the first line of information in the Via header field in the response message application layer control channel information contains media additional parameters, if so, then consider that the media channel information carried by the response message has not changed, if not, then the response message carried Media channel information has changed.
进一步地,该信令代理设备,还用于判断该SIP消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,在该控制通道信息的Contact头域原有信息后增加该网络层地址和传输层端口作为Contact头域的附加参数,用于表示通过该地址和端口访问该私网用户的直接方式,如该SIP消息为请求消息,还在原始控制通道信息Via头域的第一行信息后增加该传输层端口作为端口附加参数,用于回送应答消息。Further, the signaling agent device is also used to judge that the source address of the SIP message network layer and the source port of the transport layer are inconsistent with the address and port of the first line of information in the Via header field of the control channel information of the application layer SIP protocol. Add the network layer address and transport layer port as additional parameters of the Contact header field after the original information of the Contact header field of the channel information, which is used to indicate the direct way to access the private network user through the address and port. For example, the SIP message is a request message, the transport layer port is added after the first line of information in the Via header field of the original control channel information as an additional parameter of the port, and is used to send back a response message.
进一步地,该信令代理设备的功能可由IP多媒体系统(IMS)的代理呼叫会话控制功能设备实现,该媒体代理设备的功能可由IP多媒体系统的媒体资源设备实现。Further, the function of the signaling proxy device can be realized by a proxy call session control function device of IP Multimedia System (IMS), and the function of the media proxy device can be realized by a media resource device of IP Multimedia System.
本发明通过信令代理设备对SIP消息进行应用层SIP协议解析,修改媒体通道信息为媒体代理设备的媒体地址和端口,将该媒体通道信息发送到相应的终端,使得终端通过NAT设备利用该媒体通道信息进行通信,实现了SIP呼叫的NAT穿越,无需升级终端和NAT设备,也不会增加NAT设备的负担。The present invention uses the signaling proxy device to analyze the SIP message at the application layer SIP protocol, modifies the media channel information to be the media address and port of the media proxy device, and sends the media channel information to the corresponding terminal, so that the terminal can use the media through the NAT device Channel information is used to communicate, realizing NAT traversal of SIP calls, without upgrading terminals and NAT devices, and without increasing the burden on NAT devices.
本发明该信令代理设备的功能可由IMS网络的代理呼叫会话控制功能设备P-CSCF实现,该媒体代理设备的功能可由IMS网络的媒体资源设备MRFP实现,不需要增加额外的设备。The function of the signaling proxy device in the present invention can be realized by the proxy call session control function device P-CSCF of the IMS network, and the function of the media proxy device can be realized by the media resource device MRFP of the IMS network without adding additional devices.
附图说明Description of drawings
图1为实施例一私网用户注册sip信令流程图;Fig. 1 is embodiment one private network user registration sip signaling flowchart;
图2为实施例二私网用户呼叫公网用户的网络结构示意图;FIG. 2 is a schematic diagram of a network structure in which a private network user calls a public network user in
图3为实施例二私网用户呼叫公网用户的SIP信令流程图;Fig. 3 is the SIP signaling flowchart of embodiment two private network users calling public network users;
图4为实施例二私网用户呼叫公网用户的媒体通道信息示意图;Fig. 4 is a schematic diagram of the media channel information of a private network user calling a public network user in
图5为实施例三公网用户呼叫私网用户的网络结构示意图;5 is a schematic diagram of a network structure in which a public network user calls a private network user in Embodiment 3;
图6为实施例三公网用户呼叫私网用户的SIP信令流程图;Fig. 6 is the SIP signaling flowchart of embodiment three public network users calling private network users;
图7为实施例三公网用户呼叫私网用户的媒体通道信息示意图;FIG. 7 is a schematic diagram of the media channel information of a public network user calling a private network user in Embodiment 3;
图8为实施例四私网用户呼叫私网用户的网络结构示意图;FIG. 8 is a schematic diagram of a network structure in which a private network user calls a private network user in Embodiment 4;
图9为实施例四私网用户呼叫私网用户的SIP信令流程图;FIG. 9 is a SIP signaling flow chart of a private network user calling a private network user in Embodiment 4;
图10为实施例四私网用户呼叫私网用户的媒体通道信息示意图。FIG. 10 is a schematic diagram of media channel information of a private network user calling a private network user in Embodiment 4. FIG.
具体实施方式Detailed ways
下面通过具体的实施例并结合附图对本发明作进一步详细的描述。The present invention will be described in further detail below through specific embodiments and in conjunction with the accompanying drawings.
本发明实施例中增加支持信令代理(PROXY)功能的设备,对应用层SIP信令修改和转发;由媒体代理设备转发媒体数据。信令代理设备(简称网络代理)用于维护SIP消息中的媒体信息(用于承载的媒体通道信息),还支持扩展SIP协议参数,该扩展SIP协议参数包括SIP协议的路由信息。主叫与被叫终端之间的信令通过NAT、主叫信令代理和被叫信令代理交互;主叫和被叫终端之间的语音和业务数据通过NAT和媒体资源处理(MRFP)设备传输。In the embodiment of the present invention, a device supporting the signaling proxy (PROXY) function is added to modify and forward the SIP signaling at the application layer; media data is forwarded by the media proxy device. The signaling proxy device (referred to as the network proxy) is used to maintain the media information in the SIP message (media channel information used for bearing), and also supports extended SIP protocol parameters, the extended SIP protocol parameters include routing information of the SIP protocol. The signaling between the calling and called terminals passes through NAT, the calling signaling agent and the called signaling agent interact; the voice and service data between the calling and called terminals pass through NAT and media resource processing (MRFP) equipment transmission.
该信令代理设备可以是单独的设备,也可以在现有设备上增加该信令代理功能。对于IP多媒体子系统(IMS)网络,该功能可由代理呼叫会话控制设备(P-CSCF)实现,媒体代理功能可由媒体资源处理设备(MRFP)实现。The signaling proxy device may be an independent device, or the signaling proxy function may be added to an existing device. For an IP Multimedia Subsystem (IMS) network, this function can be implemented by a proxy call session control device (P-CSCF), and the media proxy function can be implemented by a media resource processing device (MRFP).
信令代理设备保存私网终端注册时的网络层源地址和传输层源端口,并与该终端号码绑定。私网用户通过NAT设备和该私网用户归属的信令代理设备进行呼叫时,该NAT设备对呼叫消息进行网络层地址和传输层端口转换,该信令代理设备对应用层协议进行解析,根据解析得到的结果,判断是否需要修改该SIP消息应用层SIP协议的媒体通道信息,是,则将媒体通道信息修改为网络分配的媒体代理设备上与对端网元进行通信的媒体地址和端口,如该呼叫消息为NAT设备转发的请求消息,则在该消息的原始控制通道信息Via头域第一行信息之前增加本信令代理设备的地址和端口以及该媒体地址和端口作为媒体附加参数,在原Via头域第一行信息后增加该消息的传输层端口作为端口附加参数;对于NAT设备转发的INVITE请求消息和200响应消息,还在Contact头域信息后增加该消息网络层IP地址和端口作为Contact域的附加参数;然后将修改后的消息发送到对应网元。下面对本方法对私网用户注册、私网用户呼叫公网用户、公网用户呼叫私网用户和私网用户呼叫私网用户的处理分别进行详细的说明。The signaling proxy device saves the network layer source address and transport layer source port when the private network terminal registers, and binds it to the terminal number. When a private network user makes a call through the NAT device and the signaling proxy device to which the private network user belongs, the NAT device performs network layer address and transport layer port conversion on the call message, and the signaling proxy device analyzes the application layer protocol, according to Analyzing the obtained result, judging whether the media channel information of the SIP message application layer SIP protocol needs to be modified, if yes, modifying the media channel information to the media address and port for communicating with the peer network element on the media agent device allocated by the network, If the call message is a request message forwarded by the NAT device, add the address and port of the signaling proxy device and the media address and port as media additional parameters before the first line of information in the Via header field of the original control channel information of the message, After the first line of information in the original Via header field, add the transport layer port of the message as an additional port parameter; for the INVITE request message and 200 response message forwarded by the NAT device, add the network layer IP address and port of the message after the Contact header field information As an additional parameter of the Contact field; and then send the modified message to the corresponding network element. The processing of private network user registration, private network user calling public network user, public network user calling private network user and private network user calling private network user will be described in detail below.
实施例一私网用户注册
本实施例中终端向信令代理进行SIP注册时,信令代理收到该终端的注册SIP消息,如判断该注册SIP消息中网络层源IP地址与应用层SIP消息中控制通道(Via头域)地址不一致,则保存网络层源IP地址和传输层源端口,并与该终端号码绑定。如图1所示,该终端的地址为10.1.1.2,NAT的公网地址为20.0.0.1,该信令代理的地址为20.0.0.3,本实施例中该终端发起SIP注册的处理包括以下步骤:In this embodiment, when the terminal performs SIP registration with the signaling agent, the signaling agent receives the registration SIP message of the terminal, such as judging the network layer source IP address in the registration SIP message and the control channel (Via header field) in the application layer SIP message ) addresses are inconsistent, save the source IP address of the network layer and the source port of the transport layer, and bind it to the terminal number. As shown in Figure 1, the address of this terminal is 10.1.1.2, and the public network address of NAT is 20.0.0.1, and the address of this signaling agent is 20.0.0.3, and the processing that this terminal initiates SIP registration comprises the following steps in the present embodiment :
步骤S101:终端发起SIP注册,发送注册(Register)SIP消息到NAT,携带本终端的控制通道信息;Step S101: The terminal initiates SIP registration, sends a Register (Register) SIP message to the NAT, and carries the control channel information of the terminal;
该注册消息的网络层源IP地址是终端私网地址、传输层源端口为终端信令端口;网络层目的IP地址是信令代理的地址、传输层目的端口为信令代理的端口。The network layer source IP address of the registration message is the private network address of the terminal, the transport layer source port is the terminal signaling port; the network layer destination IP address is the address of the signaling agent, and the transport layer destination port is the port of the signaling agent.
该注册消息应用层携带的控制通道信息为:The control channel information carried by the registration message application layer is:
Via:SIP/2.0/UDP 10.1.1.2 //终端地址,为私网地址,用于接收注册响应消息。Via: SIP/2.0/UDP 10.1.1.2 //Terminal address, which is a private network address, used to receive registration response messages.
Contact:<sip:10.1.1.2> //终端地址,为私网地址,用于接收SIP请求或更新消息。Contact: <sip:10.1.1.2> //Terminal address, which is a private network address, used to receive SIP requests or update messages.
步骤S102:NAT接收终端发送的注册消息,修改该消息中网络层地址和传输端口,发送到信令代理;Step S102: NAT receives the registration message sent by the terminal, modifies the network layer address and transmission port in the message, and sends it to the signaling agent;
NAT将该消息中网络层源IP地址10.1.1.2修改为NAT自身的公网地址20.0.0.1,传输层源端口修改为NAT自身的端口,其它保持不变,将修改后的注册SIP消息发送到信令代理。NAT modifies the network layer source IP address 10.1.1.2 in the message to the NAT's own public network address 20.0.0.1, and the transport layer source port is modified to the NAT's own port, and the others remain unchanged. The modified registration SIP message is sent to Signaling agent.
步骤S103:信令代理接收NAT发送的注册消息,完成注册处理后,返回200响应消息;Step S103: the signaling agent receives the registration message sent by the NAT, and returns a 200 response message after completing the registration process;
该信令代理收到NAT发送的注册消息,判断该消息中网络层源IP地址与应用层SIP控制通道(Via头域)的网络地址是否一致,如否,则保存该消息中的网络层源IP地址20.0.0.1和传输层源端口,并与该终端号码绑定。The signaling agent receives the registration message sent by NAT, and judges whether the network layer source IP address in the message is consistent with the network address of the application layer SIP control channel (Via header field), and if not, saves the network layer source IP address in the message The IP address 20.0.0.1 and the source port of the transport layer are bound to the terminal number.
信令代理向该NAT返回200响应消息,该200响应消息的网络层目的IP地址是NAT的地址20.0.0.1、传输层目的端口为NAT的端口;网络层源IP地址是该信令代理的地址20.0.0.3、传输层源端口为信令代理的端口。The signaling agent returns a 200 response message to the NAT. The network layer destination IP address of the 200 response message is the NAT address 20.0.0.1, and the transport layer destination port is the NAT port; the network layer source IP address is the address of the signaling agent 20.0.0.3. The source port of the transport layer is the port of the signaling agent.
步骤S104:NAT接收信令代理发送的200响应消息,修改该消息中网络层地址和传输端口,发送到终端。Step S104: NAT receives the 200 response message sent by the signaling agent, modifies the network layer address and transmission port in the message, and sends it to the terminal.
NAT将该200消息中网络层目的IP地址修改为终端私网地址10.1.1.2、传输层目的端口为终端端口,其它保持不变,发送200响应消息到终端。The NAT modifies the network layer destination IP address in the 200 message to the terminal private network address 10.1.1.2, the transport layer destination port is the terminal port, and the others remain unchanged, and sends a 200 response message to the terminal.
实施例二私网用户呼叫公网用户Embodiment 2 A private network user calls a public network user
如图2所示的网络,私网用户呼叫公网用户,私网用户通过NAT进行地址转换,利用主叫的信令代理修改该呼叫的消息中应用层携带的控制通道和媒体通道信息,通过被叫信令代理直接转发与该公网用户之间的消息。该NAT进行地址转换时,将网络层地址和端口分别修改为NAT的公网地址和端口。主叫的信令代理收到NAT发送的消息,保留原始控制通道(Contact和Via头域)信息,并在此基础上添加该NAT网元信息,同时修改媒体通道信息为媒体代理网元(媒体资源设备MRFP)的地址和端口。图2中各网元的IP地址和端口如表1所示:In the network shown in Figure 2, when a private network user calls a public network user, the private network user performs address translation through NAT, uses the calling signaling agent to modify the control channel and media channel information carried by the application layer in the call message, and passes The called signaling agent directly forwards messages with the public network user. When the NAT performs address translation, the network layer address and port are respectively modified to the public network address and port of the NAT. The signaling agent of the calling party receives the message sent by NAT, retains the original control channel (Contact and Via header field) information, and adds the NAT network element information on this basis, and modifies the media channel information as the media proxy network element (media The address and port of the resource device MRFP). The IP addresses and ports of each network element in Figure 2 are shown in Table 1:
表1Table 1
该呼叫的SIP协议NAT穿越的处理方法如图3所示,包括以下步骤:The processing method of the SIP protocol NAT traversal of this call is as shown in Figure 3, comprises the following steps:
步骤S301:主叫终端发起呼叫,发送初始INVITE消息到NAT;Step S301: the calling terminal initiates a call and sends an initial INVITE message to the NAT;
该INVITE消息的网络层源IP地址和端口是主叫终端私网地址和信令端口10.1.1.1:49170;网络层目的IP地址是主叫信令代理地址20.0.0.2、传输层目的端口为主叫信令代理端口。The network layer source IP address and port of the INVITE message are the calling terminal private network address and signaling port 10.1.1.1:49170; the network layer destination IP address is the calling party signaling agent address 20.0.0.2, and the transport layer destination port is the main Called the signaling proxy port.
该INVITE消息中应用层携带的控制通道信息为:The control channel information carried by the application layer in the INVITE message is:
Via:SIP/2.0/UDP 10.1.1.1 //主叫终端地址,为私网地址,用于接收SIP响应消息。Via: SIP/2.0/UDP 10.1.1.1 //The address of the calling terminal, which is a private network address, is used to receive SIP response messages.
Contact:<sip:10.1.1.1> //主叫终端地址,为私网地址,用于接收SIP请求或更新消息。Contact: <sip:10.1.1.1> //The address of the calling terminal, which is a private network address, is used to receive SIP requests or update messages.
该INVITE消息中应用层携带的媒体通道信息为:The media channel information carried by the application layer in the INVITE message is:
C=IN IP4 10.1.1.1 //主叫终端媒体通道IP地址C=IN IP4 10.1.1.1 //The media channel IP address of the calling terminal
m=audio 49170 RTP/AVP 0 //主叫终端的媒体通道端口m=audio 49170 RTP/
步骤S302:NAT接收主叫终端发送的初始INVITE消息,修改该消息中网络层地址和端口,将修改后的消息发送到主叫的信令代理;Step S302: NAT receives the initial INVITE message sent by the calling terminal, modifies the network layer address and port in the message, and sends the modified message to the calling signaling agent;
NAT将该消息中网络层源IP地址和端口修改为自身的公网地址和端口20.0.0.1:9988,其它信息保持不变,如控制通道和媒体通道信息,然后将修改后的消息发送到主叫信令代理。NAT modifies the network layer source IP address and port in the message to its own public network address and port 20.0.0.1:9988, and keeps other information unchanged, such as control channel and media channel information, and then sends the modified message to the master Called the signaling agent.
步骤S303:主叫信令代理收到NAT发送的INVITE消息,解析该消息应用层SIP消息的内容,并进行修改;Step S303: the calling signaling agent receives the INVITE message sent by the NAT, analyzes the content of the message application layer SIP message, and modifies it;
主叫信令代理判断该SIP消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,且该SIP消息为请求消息,除按照现有技术修改该消息应用层SIP协议的控制通道信息在该消息的原始控制通道信息Via头域的第一行信息之前增加本信令代理设备的地址和端口外,还在该增加的行中加入媒体附加参数,该媒体附加参数为网络分配的该媒体代理设备与对端网元进行通信的网络地址和端口;在该控制通道信息的Contact头域原有信息后增加该SIP消息的网络层地址和传输层端口(即NAT设备的地址和端口)作为Contact头域的附加参数,用于表示通过该地址和端口访问该私网用户的直接方式;在原有控制通道信息Via头域的第一行信息后增加该传输层端口作为端口附加参数,用于回送应答消息。同时修改该媒体通道信息,将该消息应用层SIP协议的媒体通道信息修改为该媒体代理设备上与对端网元进行通信的媒体地址和端口,然后将修改后的消息通过相应的网元发送到被叫终端。The calling signaling agent judges that the source address of the network layer and the source port of the transport layer of the SIP message are inconsistent with the address and port of the first line of information in the Via header field of the control channel information of the SIP protocol at the application layer, and the SIP message is a request message, except according to The existing technology modifies the control channel information of the message application layer SIP protocol. Add the address and port of the signaling proxy device before the first line of information in the Via header field of the original control channel information of the message, and also in the added line Add media additional parameters, which are the network address and port allocated by the network for the media proxy device to communicate with the peer network element; add the network layer of the SIP message after the original information of the Contact header field of the control channel information The address and transport layer port (that is, the address and port of the NAT device) are used as additional parameters of the Contact header field to indicate the direct way to access the private network user through the address and port; in the first part of the Via header field of the original control channel information Add the transport layer port after the line information as an additional parameter of the port, which is used to send back the reply message. At the same time, modify the media channel information, modify the media channel information of the message application layer SIP protocol to the media address and port for communicating with the peer network element on the media proxy device, and then send the modified message through the corresponding network element to the called terminal.
具体地,该主叫信令代理对该INVITE消息的修改包括:Specifically, the modification of the INVITE message by the calling signaling agent includes:
a.保留主叫终端发送的INVITE消息的原始控制通道信息(Contact和Via头域);a. retain the original control channel information (Contact and Via header fields) of the INVITE message sent by the calling terminal;
b.在原控制通道信息(Via行和Contact行)中添加NAT网元信息作为附加参数;b. Add NAT network element information as an additional parameter in the original control channel information (Via line and Contact line);
c.获取IMS网络分配的媒体代理(媒体中继设备)的转发地址和端口,修改该SIP消息中媒体通道信息为该媒体代理的地址和端口;c. Obtain the forwarding address and the port of the media agent (media relay equipment) allocated by the IMS network, modify the media channel information in the SIP message to be the address and the port of the media agent;
d.在原有控制通道信息之前,添加新的控制通道信息(Via头域),内容为该主叫信令代理自身的地址,用于作为该SIP消息对应的响应消息的返回地址,并在该添加的控制通道信息中携带附加参数,该附加参数包括该媒体代理地址和端口,用于向NAT返回响应消息时,按照该附加参数的内容填写该响应消息应用层的媒体通道信息;d. Before the original control channel information, add new control channel information (Via header field), the content is the address of the calling signaling agent itself, which is used as the return address of the response message corresponding to the SIP message, and in the The added control channel information carries additional parameters, which include the media agent address and port, and are used to fill in the media channel information of the response message application layer according to the content of the additional parameters when returning a response message to NAT;
e.添加控制通道信息(Record-Route头域),内容为主叫信令代理自身的地址,主叫信令代理接收到该呼叫的后续SIP消息;e. Add control channel information (Record-Route header field), the content is the address of the calling signaling agent itself, and the calling signaling agent receives the follow-up SIP message of the call;
f.保留其它控制通道内容。f. Keep other control channel content.
主叫信令代理修改该INVITE消息中应用层携带的控制通道信息和媒体通道信息为:The calling signaling agent modifies the control channel information and media channel information carried by the application layer in the INVITE message to:
//主叫信令代理添加自身地址,作为接收该INVITE消息对应的响应消息的地址,同时增加附加参数,包括IMS网络分配的媒体代理设备的媒体通道信息(IP地址和端口号)//The calling signaling agent adds its own address as the address for receiving the response message corresponding to the INVITE message, and adds additional parameters at the same time, including the media channel information (IP address and port number) of the media agent device allocated by the IMS network
Via:SIP/2.0/UDP 20.0.0.2;relaymedia=20.0.0.9:4000Via: SIP/2.0/UDP 20.0.0.2; relaymedia=20.0.0.9:4000
//主叫信令代理保留主叫终端发送的INVITE消息的原始控制通道信息,增加NAT的IP地址和端口,用于主叫信令代理沿此路径通过NAT向主叫终端返回SIP响应消息//The calling signaling agent retains the original control channel information of the INVITE message sent by the calling terminal, and adds the IP address and port of NAT for the calling signaling agent to return a SIP response message to the calling terminal through NAT along this path
Via:SIP/2.0/UDP 10.1.1.1;received=20.0.0.1;rport=9988Via: SIP/2.0/UDP 10.1.1.1; received=20.0.0.1; rport=9988
//保留主叫终端发送的INVITE消息的原始控制通道信息,增加NAT的地址和端口,用于主叫信令代理沿此路径通过NAT向主叫终端发送后续SIP请求消息//Retain the original control channel information of the INVITE message sent by the calling terminal, and add the address and port of NAT for the calling signaling agent to send subsequent SIP request messages to the calling terminal through NAT along this path
Contact:<sip:10.1.1.1;nataddr=20.0.0.1:9988>Contact: <sip:10.1.1.1; nataddr=20.0.0.1:9988>
//主叫信令代理添加自身地址,作为接收本呼叫后续SIP消息的地址//The calling signaling agent adds its own address as the address for receiving subsequent SIP messages of this call
Record-Route:<sip:20.0.0.2>Record-Route: <sip:20.0.0.2>
//修改媒体通道信息为IMS网络分配的媒体代理(如媒体资源设备MRFP)的媒体通道信息(IP地址和端口)//Modify media channel information The media channel information (IP address and port) of the media proxy (such as media resource device MRFP) allocated by the IMS network
C=IN IP4 20.0.0.9C=IN IP4 20.0.0.9
m=audio 4000 RTP/AVP 0m=audio 4000 RTP/
步骤304:被叫信令代理收到该主叫信令代理发送的INVITE消息,根据该消息中的被叫号码查询终端注册时保存的绑定信息,判断该被叫是否是私网用户,如否,则按照现有技术向被叫终端转发该INVITE消息,收到该被叫终端返回的200响应消息后,向主叫信令代理返回200响应消息;Step 304: The called signaling agent receives the INVITE message sent by the calling signaling agent, queries the binding information saved when the terminal is registered according to the called number in the message, and judges whether the called party is a private network user, such as No, forward the INVITE message to the called terminal according to the prior art, and return a 200 response message to the calling signaling agent after receiving the 200 response message returned by the called terminal;
被叫信令代理返回的200响应消息携带的应用层信息中,按照现有技术填写相应的控制通道信息,同时保留该INVITE消息携带的应用层控制通道信息,并添加控制通道信息(Record-Route头域),内容为该被叫信令代理自身的地址,表示访问该主叫用户的直接方式。将该媒体通道信息修改为被叫终端的媒体信息。In the application layer information carried in the 200 response message returned by the called signaling agent, fill in the corresponding control channel information according to the existing technology, while retaining the application layer control channel information carried in the INVITE message, and adding the control channel information (Record-Route Header field), the content is the address of the called signaling agent itself, indicating the direct way to access the calling user. Modify the media channel information to the media information of the called terminal.
该响应消息中应用层携带的关键控制通道信息为:The key control channel information carried by the application layer in the response message is:
Via:SIP/2.0/UDP 20.0.0.2;relaymedia=20.0.0.9:4000 //主叫信令代理的地址以及媒体代理地址Via: SIP/2.0/UDP 20.0.0.2; relaymedia=20.0.0.9: 4000 //The address of the calling signaling agent and the address of the media agent
Via:SIP/2.0/UDP 10.1.1.1;received=20.0.0.1;rport=9988 //主叫终端的地址及NAT地址Via: SIP/2.0/UDP 10.1.1.1; received=20.0.0.1; rport=9988 //The address of the calling terminal and the NAT address
Contact:<sip:20.0.0.100> //被叫终端地址,用于接收后续SIP请求消息,为公网地址Contact: <sip:20.0.0.100> //The address of the called terminal, used to receive subsequent SIP request messages, is the public network address
Record-Route:<sip:20.0.0.2> //主叫信令代理地址。Record-Route: <sip:20.0.0.2> //Caller signaling proxy address.
Record-Route:<sip:20.0.0.3> //被叫信令代理地址。Record-Route: <sip:20.0.0.3> //Called signaling proxy address.
该响应消息中应用层携带的媒体通道信息为:The media channel information carried by the application layer in the response message is:
C=IN IP4 20.0.0.100 //被叫终端媒体通道IP地址C=IN IP4 20.0.0.100 //The media channel IP address of the called terminal
m=audio 50100 RTP/AVP 0 //被叫终端的媒体通道端口m=audio 50100 RTP/
步骤305:主叫信令代理接收被叫信令代理的200响应消息,解析该消息应用层SIP消息的内容,并修改200响应消息的控制通道信息和媒体通道信息,然后发送到NAT;Step 305: the calling signaling agent receives the 200 response message of the called signaling agent, parses the content of the message application layer SIP message, and modifies the control channel information and media channel information of the 200 response message, and then sends it to the NAT;
主叫信令代理判断该200响应消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口一致,但被叫用户是归属于本信令代理设备的私网用户,然后检查该响应消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则该响应消息携带的媒体通道信息没有改变,则修改该200响应消息的控制通道信息和媒体通道信息,用删除后该Via头域第一行信息的媒体附加参数中的媒体地址和端口替换该响应消息携带的媒体通道信息的媒体地址和端口,然后删除该Via头域的第一行。The calling signaling agent judges that the source address of the network layer and the source port of the transport layer of the 200 response message are consistent with the address and port of the first line of information in the Via header field of the control channel information of the application layer SIP protocol, but the called party belongs to this letter. Let the private network user of the proxy device check whether the first line of information in the Via header field in the application layer control channel information of the response message contains media additional parameters, and if so, the media channel information carried in the response message has not changed, and then modify For the control channel information and media channel information of the 200 response message, replace the media address and port of the media channel information carried in the response message with the media address and port in the media additional parameters of the first line of information in the Via header field after deletion, and then Delete the first line of the Via header field.
主叫信令代理对该200响应消息的修改包括:Modifications to the 200 response message by the calling signaling agent include:
对网络层地址和传输层端口的修改:Modifications to network layer addresses and transport layer ports:
主叫信令代理将该200响应消息的网络层目的IP地址修改为NAT地址、传输层目的端口修改为NAT端口;网络层源IP地址修改为主叫信令代理地址、传输层源端口修改为主叫信令代理端口。The calling signaling agent changes the network layer destination IP address of the 200 response message to a NAT address, the transport layer destination port to a NAT port; the network layer source IP address to the calling signaling proxy address, and the transport layer source port to Caller signaling proxy port.
对应用层控制通道和媒体通道信息的修改:Modifications to the application layer control channel and media channel information:
a.根据控制通道(第一个Via头域)携带的扩展参数内容(媒体代理地址、端口)替换媒体通道信息,并删除该控制通道。a. Replace the media channel information according to the extended parameter content (media proxy address, port) carried by the control channel (the first Via header field), and delete the control channel.
b.根据控制通道(第二个Via头域)携带的参数内容(NAT地址、端口)作为响应消息的目的地,然后删除参数内容。b. Use the parameter content (NAT address, port) carried by the control channel (the second Via header field) as the destination of the response message, and then delete the parameter content.
c.保留其它控制通道内容,如Contact头域。c. Retain other control channel content, such as the Contact header field.
主叫信令代理修改该200响应消息中应用层携带的控制通道信息和媒体通道信息为:The calling signaling agent modifies the control channel information and media channel information carried by the application layer in the 200 response message as:
Via:SIP/2.0/UDP 10.1.1.1 //去掉第一个Via头域,保留第二个Via头域,并去掉NAT信息Via: SIP/2.0/UDP 10.1.1.1 //Remove the first Via header field, keep the second Via header field, and remove the NAT information
Contact:<sip:20.0.0.100> //保留Contact头域Contact: <sip:20.0.0.100> //Reserve the Contact header field
C=IN IP4 20.0.09 //媒体通道替换为媒体代理地址C=IN IP4 20.0.09 //The media channel is replaced by the media proxy address
m=audio 4000 RTP/AVP 0 //媒体通道替换为媒体代理端口m=audio 4000 RTP/
步骤306:NAT接收主叫信令代理发送的200响应消息,修改消息中网络层目的IP地址为主叫终端地址、传输层目的端口为主叫终端控制通道端口,其它保持不变,发送消息到主叫终端。Step 306: NAT receives the 200 response message sent by the calling signaling agent, modifies the destination IP address of the network layer in the message to be the address of the calling terminal, and the destination port of the transport layer is the control channel port of the calling terminal. Others remain unchanged, and sends the message to calling terminal.
主叫终端接收到的200响应消息中应用层携带的控制通道信息和媒体通道信息为:The control channel information and media channel information carried by the application layer in the 200 response message received by the calling terminal are:
Via:SIP/2.0/UDP 10.1.1.1 //主叫终端自身地址Via: SIP/2.0/UDP 10.1.1.1 //The calling terminal's own address
Contact:<sip:20.0.0.100> //被叫终端地址Contact: <sip:20.0.0.100> //Called terminal address
Record-Route:<sip:20.0.0.2> //主叫信令代理地址Record-Route: <sip:20.0.0.2> //Caller signaling proxy address
Record-Route:<sip:20.0.0.3> //被叫信令代理地址Record-Route: <sip:20.0.0.3> //Called signaling agent address
C=IN IP4 20.0.0.9 //媒体代理地址C=IN IP4 20.0.0.9 //Media proxy address
m=audio 4000 RTP/AVP 0 //媒体代理端口m=audio 4000 RTP/
步骤307:主叫终端返回200响应消息的确认ACK消息;Step 307: the calling terminal returns a confirmation ACK message of the 200 response message;
该ACK消息的网络层源IP地址是主叫终端私网地址、传输层源端口为主叫终端信令端口;网络层目的IP地址是主叫信令代理地址、传输层目的端口为主叫信令代理端口。The source IP address of the network layer of the ACK message is the private network address of the calling terminal, the source port of the transport layer is the signaling port of the calling terminal; the destination IP address of the network layer is the proxy address of the calling party, and the destination port of the transport layer is the signaling port of the calling Make the proxy port.
该ACK消息应用层不携带媒体通道信息,携带的控制通道信息为:The ACK message application layer does not carry media channel information, and the control channel information carried is:
Ack sip:20.0.0.100 //被叫终端地址Ack sip: 20.0.0.100 //Called terminal address
Route:<sip:20.0.0.2> //主叫信令代理地址Route: <sip:20.0.0.2> //Caller signaling proxy address
Route:<sip:20.0.0.3> //被叫信令代理地址Route: <sip:20.0.0.3> //Called signaling proxy address
步骤308:NAT接收主叫终端发送的ACK消息;Step 308: NAT receives the ACK message sent by the calling terminal;
NAT修改消息中网络层源IP地址为NAT自身的公网地址、修改传输层源端口为NAT自身的端口,其它保持不变,将修改后的消息发送到主叫信令代理。In the NAT modification message, the source IP address of the network layer is the public network address of the NAT itself, the source port of the modification transport layer is the port of the NAT itself, and the others remain unchanged, and the modified message is sent to the calling signaling agent.
步骤309:主叫信令代理收到NAT发送的ACK消息,解析该消息应用层SIP消息的内容,删除代表自身内容的第一个Route头域,根据第二个Route头域地址作为消息目的地,发送ACK消息到被叫信令代理。Step 309: The calling signaling agent receives the ACK message sent by the NAT, parses the content of the message application layer SIP message, deletes the first Route header field representing its own content, and uses the second Route header field address as the message destination , send an ACK message to the called signaling agent.
该关键控制通道信息为:The key control channel information is:
Ack sip:20.0.0.100 //被叫终端地址Ack sip: 20.0.0.100 //Called terminal address
Route:<sip:20.0.0.3> //被叫信令代理地址Route: <sip:20.0.0.3> //Called signaling proxy address
主叫终端和被叫终端利用该媒体通道信息通过主叫NAT设备和媒体代理设备进行语音或数据通信。图4所示的是媒体通道传输的媒体数据流程,主叫终端的数据通过主叫NAT设备和媒体代理设备发送到被叫终端,被叫终端的数据沿此通路反向传递给主叫终端。The calling terminal and the called terminal use the media channel information to perform voice or data communication through the calling NAT device and the media proxy device. Figure 4 shows the flow of media data transmitted by the media channel. The data of the calling terminal is sent to the called terminal through the calling NAT device and the media proxy device, and the data of the called terminal is reversely transmitted to the calling terminal along this path.
实施例三公网用户呼叫私网用户Embodiment 3 A public network user calls a private network user
如图5所示的网络,公网用户呼叫私网用户,主被叫终端间通过主叫信令代理、被叫信令代理和NAT设备进行信令通信,通过媒体代理和NAT设备进行媒体通信。NAT设备用于网络地址转换,将被叫发送的消息的网络层地址和端口分别修改为NAT的公网地址和端口。被叫信令代理收到主叫信令代理发送的消息,根据被叫用户号码查找注册时保存的绑定关系,获取对应的NAT信息,判断被叫终端是否是私网用户,如是,则保留原始控制通道(Contact和Via头域)信息,并在此基础上添加该NAT网元信息(该消息的网络层地址和传输层端口),同时修改媒体通道信息为媒体代理网元(媒体资源设备MRFP)的地址和端口。图5中各网元的IP地址和端口如表2所示:In the network shown in Figure 5, when a public network user calls a private network user, the calling and called terminals perform signaling communication through the calling signaling agent, called signaling agent, and NAT device, and media communication through the media agent and NAT device . The NAT device is used for network address translation, and changes the network layer address and port of the message sent by the called party to the NAT public network address and port respectively. The called signaling agent receives the message sent by the calling signaling agent, searches the binding relationship saved during registration according to the called user number, obtains the corresponding NAT information, and judges whether the called terminal is a private network user, and if so, keeps it The original control channel (Contact and Via header fields) information, and on this basis, add the NAT network element information (the network layer address and the transport layer port of the message), and modify the media channel information to be the media proxy network element (media resource device MRFP) address and port. The IP addresses and ports of each network element in Figure 5 are shown in Table 2:
表2Table 2
该呼叫的SIP协议NAT穿越的处理方法如图6所示,包括以下步骤:The processing method of the SIP protocol NAT traversal of this call is as shown in Figure 6, comprises the following steps:
步骤S601:主叫信令代理收到主叫终端的呼叫请求,发送初始INVITE消息到被叫信令代理;Step S601: the calling signaling agent receives the call request from the calling terminal, and sends an initial INVITE message to the called signaling agent;
主叫信令代理按照现有技术的方法封装该初始INVITE消息,该INVITE消息中应用层携带的控制通道信息为:The calling signaling agent encapsulates the initial INVITE message according to the method of the prior art, and the control channel information carried by the application layer in the INVITE message is:
Via:SIP/2.0/UDP 20.0.0.2 //主叫信令代理地址。Via: SIP/2.0/UDP 20.0.0.2 //Caller signaling proxy address.
Via:SIP/2.0/UDP 20.0.0.100 //主叫终端地址,为公网地址。Via: SIP/2.0/UDP 20.0.0.100 //Calling terminal address, which is the public network address.
Contact:<sip:20.0.0.100> //主叫终端地址,为公网地址。Contact: <sip:20.0.0.100> //Calling terminal address, which is the public network address.
该INVITE消息中应用层携带的媒体通道信息为:The media channel information carried by the application layer in the INVITE message is:
C=IN IP4 20.0.0.100 //主叫终端媒体通道IP地址C=IN IP4 20.0.0.100 //The media channel IP address of the calling terminal
m=audio 50100 RTP/AVP 1 //主叫终端的媒体通道端口m=audio 50100 RTP/
步骤S602:被叫信令代理收到主叫信令代理发送的初始INVITE消息,解析该消息应用层SIP协议的内容,修改该SIP消息的控制通道信息和媒体通道信息;Step S602: The called signaling agent receives the initial INVITE message sent by the calling signaling agent, analyzes the content of the message application layer SIP protocol, and modifies the control channel information and media channel information of the SIP message;
该INVITE消息的网络层目的IP地址是NAT地址、传输层目的端口为NAT端口;网络层源IP地址是被叫信令代理地址、传输层源端口为被叫信令代理端口。The network layer destination IP address of the INVITE message is the NAT address, the transport layer destination port is the NAT port; the network layer source IP address is the called signaling proxy address, and the transport layer source port is the called signaling proxy port.
该被叫信令代理设备判断该消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口一致,然后根据主叫信令代理发送的初始INVITE消息中的被叫用户号码查找终端注册时保存的绑定信息,判断该被叫为归属于本信令代理设备的私网用户,然后获取对应的NAT信息,还判断该请求消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则认为该请求消息携带的媒体通道信息已经改变;否,则修改该INVITE消息,发送修改后的INVITE消息到该NAT设备。被叫信令代理对该INVITE消息应用层的修改包括:The called signaling proxy device judges that the source address of the message network layer and the source port of the transport layer are consistent with the address and port of the first line of information in the Via header field of the control channel information of the application layer SIP protocol, and then according to the information sent by the calling signaling proxy, The called user number in the initial INVITE message looks up the binding information saved when the terminal is registered, and judges that the called party is a private network user belonging to the signaling proxy device, then obtains the corresponding NAT information, and judges the application layer of the request message Whether the first line of information in the Via header field in the control channel information contains media additional parameters, if yes, consider that the media channel information carried in the request message has changed; if not, modify the INVITE message, and send the modified INVITE message to the NAT device. The modification of the application layer of the INVITE message by the called signaling agent includes:
a.保留主叫信令代理发送的INVITE消息中原始控制通道信息(Contact和Via头域);a. retain the original control channel information (Contact and Via header fields) in the INVITE message sent by the calling signaling agent;
b.获取IMS网络分配的媒体代理(媒体中继设备)的转发地址和端口,修改SIP消息中媒体通道信息,更换为该媒体代理地址和端口;B. Obtain the forwarding address and the port of the media agent (media relay equipment) assigned by the IMS network, modify the media channel information in the SIP message, and replace it with the media agent address and port;
c.在原始控制通道信息前添加控制通道信息(Via头域),内容为被叫信令代理自身的地址,用于该INVITE消息的接收端NAT设备根据该地址返回SIP响应消息,该被叫信令代理还在该添加的控制通道信息中携带媒体附加参数,该媒体附加参数包括该媒体代理地址和端口,用于向主叫信令代理返回SIP响应消息时,根据该媒体附加参数修改媒体通道信息;c. Add control channel information (Via header field) before the original control channel information, and the content is the address of the called signaling agent itself, and the receiving end NAT device used for the INVITE message returns a SIP response message according to the address, and the called party The signaling agent also carries media additional parameters in the added control channel information, and the media additional parameters include the media agent address and port, and are used to modify the media according to the media additional parameters when returning a SIP response message to the calling signaling agent. channel information;
d.添加控制通道信息(Record-Route头域),内容为被叫信令代理自身的地址,用于接收后续的SIP消息;d. Add control channel information (Record-Route header field), the content is the address of the called signaling agent itself, for receiving subsequent SIP messages;
e.保留其它控制通道内容。e. Keep other control channel content.
被叫信令代理修改该INVITE消息中应用层携带的控制通道信息和媒体通道信息为:The called signaling agent modifies the control channel information and media channel information carried by the application layer in the INVITE message to:
//被叫信令代理添加自身地址,作为该INVITE消息对应的SIP响应消息的返回地址;携带附加参数,包括IMS网络分配的媒体代理设备的媒体通道信息(IP地址和端口号)//The called signaling agent adds its own address as the return address of the SIP response message corresponding to the INVITE message; carries additional parameters, including the media channel information (IP address and port number) of the media agent device allocated by the IMS network
Via:SIP/2.0/UDP 20.0.0.3;relaymedia=20.0.0.9:4000Via: SIP/2.0/UDP 20.0.0.3; relaymedia=20.0.0.9:4000
//保留原始控制通道信息//Retain the original control channel information
Via:SIP/2.0/UDP 20.0.0.2 //主叫信令代理地址。Via: SIP/2.0/UDP 20.0.0.2 //Caller signaling proxy address.
Via:SIP/2.0/UDP 20.0.0.100 //主叫终端地址,为公网地址。Via: SIP/2.0/UDP 20.0.0.100 //Calling terminal address, which is the public network address.
Contact:<sip:20.0.0.100> //主叫终端地址,为公网地址。Contact: <sip:20.0.0.100> //Calling terminal address, which is the public network address.
//在Record-Route头域添加被叫信令代理的地址,作为接收SIP消息的地址//Add the address of the called signaling agent in the Record-Route header field as the address for receiving SIP messages
Record-Route:<sip:20.0.0.3>Record-Route: <sip:20.0.0.3>
//修改媒体通道信息为IMS网络分配的媒体代理的媒体通道信息(如媒体资源设备MRFP的IP地址和端口)//Modify the media channel information is the media channel information of the media agent assigned by the IMS network (such as the IP address and port of the media resource device MRFP)
C=IN IP4 20.0.0.9C=IN IP4 20.0.0.9
m=audio 4000 RTP/AVP 0m=audio 4000 RTP/
步骤603:NAT接收被叫信令代理发送的INVITE消息,修改消息中网络层目的IP地址为被叫终端私网地址、传输层目的端口为被叫终端端口,其它保持不变,发送消息到被叫终端;Step 603: NAT receives the INVITE message sent by the called signaling agent, modifies the destination IP address of the network layer in the message to the private network address of the called terminal, the destination port of the transport layer is the port of the called terminal, and keeps the others unchanged, and sends the message to the called terminal. call the terminal;
步骤604:被叫终端接收呼叫INVITE消息,发送200响应消息到NAT;Step 604: The called terminal receives the calling INVITE message, and sends a 200 response message to the NAT;
该响应消息中网络层目的IP地址是被叫信令代理地址、传输层目的端口为被叫信令代理端口;网络层源IP地址是被叫终端私网地址、传输层源端口为被叫终端信令代理端口。In the response message, the network layer destination IP address is the called signaling proxy address, the transport layer destination port is the called signaling proxy port; the network layer source IP address is the private network address of the called terminal, and the transport layer source port is the called terminal Signaling proxy port.
该被叫终端按照现有技术封装该响应消息的控制通道和媒体通道信息,并保留接收到的INVITE消息中的原始控制通道信息。该响应消息中应用层携带的关键控制通道信息为:The called terminal encapsulates the control channel and media channel information of the response message according to the prior art, and retains the original control channel information in the received INVITE message. The key control channel information carried by the application layer in the response message is:
Via:SIP/2.0/UDP 20.0.0.3;relaymedia=20.0.0.9:4000 //被叫信令代理的地址以及媒体代理地址Via: SIP/2.0/UDP 20.0.0.3; relaymedia=20.0.0.9: 4000 //The address of the called signaling agent and the address of the media agent
Via:SIP/2.0/UDP 20.0.0.2 //主叫信令代理的地址Via: SIP/2.0/UDP 20.0.0.2 //The address of the calling signaling agent
Via:SIP/2.0/UDP 20.0.0.100 //主叫终端地址Via: SIP/2.0/UDP 20.0.0.100 //Calling terminal address
Contact:<sip:10.1.1.2> //Contact头域修改为被叫终端地址,为私网地址,用于接收后续SIP消息Contact: <sip:10.1.1.2> //Contact header field is modified to the address of the called terminal, which is a private network address and used to receive subsequent SIP messages
Record-Route:<sip:20.0.0.3> //被叫信令代理地址。Record-Route: <sip:20.0.0.3> //Called signaling proxy address.
该响应消息中应用层携带的媒体通道信息为:The media channel information carried by the application layer in the response message is:
C=IN IP4 10.1.1.2 //被叫终端媒体通道IP地址C=IN IP4 10.1.1.2 //The media channel IP address of the called terminal
m=audio 47100 RTP/AVP 1 //叫终端的媒体通道端口m=audio 47100 RTP/
步骤605:NAT接收被叫终端发送的200消息,修改该消息的网络层源IP地址为NAT自身的公网地址,修改传输层源端口为NAT自身的端口,其它保持不变,将修改后的消息发送到被叫信令代理;Step 605: NAT receives the 200 message sent by the called terminal, modifies the network layer source IP address of the message to be the public network address of NAT itself, modifies the transport layer source port to be the port of NAT itself, and keeps the others unchanged. The message is sent to the called signaling agent;
步骤606:被叫信令代理接收NAT发送的200响应消息,解析该消息应用层内容,并修改控制通道信息和媒体通道信息,然后发送到主叫信令代理;Step 606: The called signaling agent receives the 200 response message sent by the NAT, parses the application layer content of the message, and modifies the control channel information and media channel information, and then sends it to the calling signaling agent;
被叫信令代理判断该SIP消息网络层源地址和传输层源端口与应用层SIP协议的控制通道信息Via头域第一行信息的地址和端口不一致,检查该响应消息应用层控制通道信息中Via头域的第一行信息中是否包含媒体附加参数,如是,则认为该响应消息携带的媒体通道信息没有改变,用该消息应用层控制通道信息中Via头域的第一行信息的媒体附加参数中的媒体地址和端口替换该响应消息携带的媒体通道信息的媒体地址和端口,然后删除该Via头域的第一行。还在该控制通道信息的Contact头域原有信息后增加该网络层地址和传输层端口作为Contact头域的附加参数,用于表示通过该地址和端口访问该私网用户的直接方式。The called signaling agent judges that the source address of the network layer and the source port of the transport layer of the SIP message are inconsistent with the address and port of the first line of information in the Via header field of the control channel information of the application layer SIP protocol, and checks the response message in the application layer control channel information. Whether the first line of information in the Via header field contains media additional parameters, if so, consider that the media channel information carried in the response message has not changed, and use this message to control the media attachment of the first line of information in the Via header field in the channel information The media address and port in the parameter replace the media address and port of the media channel information carried in the response message, and then delete the first line of the Via header field. After the original information of the Contact header field of the control channel information, the network layer address and the transport layer port are added as additional parameters of the Contact header field, which are used to indicate the direct way to access the private network user through the address and port.
被叫信令代理对该200响应消息的修改包括:The modification of the 200 response message by the called signaling agent includes:
对网络层地址和传输层端口的修改:Modifications to network layer addresses and transport layer ports:
修改该ACK消息的网络层源IP地址为被叫信令代理地址、传输层源端口为被叫信令代理端口;修改网络层目的IP地址为NAT地址、传输层目的端口为NAT端口。Modify the network layer source IP address of the ACK message to be the called signaling proxy address, and the transport layer source port to be the called signaling proxy port; modify the network layer destination IP address to be the NAT address, and the transport layer destination port to be the NAT port.
对应用层SIP协议内容的修改:Modifications to the content of the application layer SIP protocol:
a.根据控制通道(第一个Via头域)携带的附加参数的内容(媒体代理地址、端口)替换媒体通道信息,并删除该Via头域;a. replace the media channel information according to the content (media proxy address, port) of the additional parameters carried by the control channel (the first Via header field), and delete the Via header field;
b.保留原始控制通道(Contact头域)内容,并在此基础上添加NAT的地址,用于表示主叫信令代理通过NAT设备访问被叫信令代理的直接方式;B. retain the original control channel (Contact header field) content, and add the address of NAT on this basis, be used to represent the direct way that the calling signaling agent visits the called signaling agent through the NAT device;
c.保留其它控制通道内容。c. Keep other control channel content.
主叫信令代理修改该200响应消息中应用层携带的控制通道信息和媒体通道信息为:The calling signaling agent modifies the control channel information and media channel information carried by the application layer in the 200 response message as:
//去掉第一个Via头域,保留后续Via头域//Remove the first Via header field and keep the subsequent Via header field
Via:SIP/2.0/UDP 20.0.0.2Via: SIP/2.0/UDP 20.0.0.2
Via:SIP/2.0/UDP 20.0.0.100Via: SIP/2.0/UDP 20.0.0.100
//Contact头域添加NAT信息//Add NAT information to the Contact header field
Contact:<sip:10.1.1.1;nataddr=20.0.0.1:9988>Contact: <sip:10.1.1.1; nataddr=20.0.0.1:9988>
Route:<sip:20.0.0.3> //被叫信令代理地址Route: <sip:20.0.0.3> //Called signaling proxy address
//媒体通道替换为媒体代理地址//The media channel is replaced by the media proxy address
C=IN IP4 20.0.0.9C=IN IP4 20.0.0.9
//媒体通道替换为媒体代理端口//The media channel is replaced by the media proxy port
m=audio 4000 RTP/AVP 0m=audio 4000 RTP/
步骤607:主叫信令代理向被叫信令代理返回200响应消息的确认ACK消息,该ACK消息应用层不携带媒体通道信息,仅携带控制通道信息,该控制通道信息为:Step 607: The calling signaling agent returns an acknowledgment ACK message of the 200 response message to the called signaling agent. The application layer of the ACK message does not carry media channel information, but only carries control channel information. The control channel information is:
Ack sip:10.1.1.2;nataddr=20.0.0.1:9988 //被叫终端地址以及NAT地址Ack sip: 10.1.1.2; nataddr=20.0.0.1: 9988 //Called terminal address and NAT address
Route:<sip:20.0.0.3> //被叫信令代理地址Route: <sip:20.0.0.3> //Called signaling proxy address
步骤608:被叫信令代理接收到主叫信令代理发送的ACK消息,对网络层地址和端口以及应用层的控制通道信息进行修改;Step 608: The called signaling agent receives the ACK message sent by the calling signaling agent, and modifies the network layer address and port and the control channel information of the application layer;
被叫信令代理对该ACK消息网络层地址和端口的修改与步骤602的处理相同。被叫信令代理解析该消息应用层SIP消息的内容,修改控制通道信息删除代表自身的Route头域,根据起始行Ack sip:10.1.1.2;nataddr=20.0.0.1:9988中nataddr参数内容(NAT信息)作为消息目的地,删除nataddr参数,发送消息到NAT。修改后的控制通道信息为:The modification of the network layer address and port of the ACK message by the called signaling agent is the same as the processing of
Ack sip:10.1.1.2 //被叫终端地址Ack sip: 10.1.1.2 // called terminal address
步骤609:NAT接收被叫信令代理发送的ACK消息,修改消息中网络层目的IP地址为被叫终端地址、传输层目的端口为被叫终端控制通道端口,其它保持不变,发送消息到被叫终端。Step 609: NAT receives the ACK message sent by the called signaling agent, modifies the network layer destination IP address in the message to the called terminal address, the transport layer destination port to the called terminal control channel port, and keeps the other things unchanged, and sends the message to the called terminal called terminal.
主叫终端和被叫终端利用该媒体通道信息通过媒体代理设备和被叫NAT设备进行语音或数据通信。图7所示的是媒体通道传输的媒体数据流程,主叫终端的数据通过媒体代理设备和被叫NAT设备发送到被叫终端,被叫终端的数据沿此通路反向传递给主叫终端。The calling terminal and the called terminal use the media channel information to perform voice or data communication through the media proxy device and the called NAT device. Figure 7 shows the flow of media data transmitted by the media channel. The data of the calling terminal is sent to the called terminal through the media proxy device and the called NAT device, and the data of the called terminal is reversely transmitted to the calling terminal along this path.
实施例四主被叫均为私网用户的场景Embodiment 4 Scenario where both the calling party and the called party are private network users
如图8所示的网络,私网用户呼叫私网用户,主被叫终端间通过主叫NAT设备、主叫信令代理、被叫信令代理和被叫NAT设备进行信令通信,通过主叫NAT设备、媒体代理设备和被叫NAT设备进行媒体通信。与实施例一和实施例二相同,NAT设备用于网络地址转换,将终端发送的消息的网络层地址和端口分别修改为NAT的公网地址和端口,将信令代理设备发送的消息的网络层地址和端口分别修改为私网地址和端口。如图9所示,主叫信令代理行为与实施例二场景(私网用户呼叫公网用户)完全一样,都需修改应用层控制通道和媒体通道信息。被叫信令代理行为与实施例三的场景(公网用户呼叫私网用户)相比,不需要修改应用层媒体通道信息,只需修改应用层控制通道信息。具体的,由于主叫信令代理已经修改主叫终端经NAT设备转发的INVITE消息中的媒体信息和控制通道信息,并将修改后的消息发送到被叫信令代理,该被叫信令代理收到该INVITE消息,对该SIP消息进行解析,检查该消息应用层控制通道信息中Via头域的第一行信息中包含了附加参数,则认为该消息携带的媒体通道信息已经改变,该被叫信令代理设备按照现有技术,在原始控制通道信息Via头域中第一行信息前增加本信令代理的地址,同时在Record-Route域最后一条记录后添加本信令代理的地址,然后通过被叫NAT设备将修改后的INVITE消息发送到被叫终端。该被叫信令代理收到终端返回的200响应消息,删除该消息应用层控制通道信息Via头域的第一行(本信令代理的地址),检查删除后该Via头域的第一行信息中是否包含所述附加参数,由于该200响应消息保留了该被叫信令代理发送的INVITE消息中的控制通道和媒体通道信息,因此,当前该Via头域的第一行信息中包含了该附加参数,该被叫信令代理直接转发该响应消息到主叫信令代理,该主叫信令代理按照与实施例一同样的方式进行处理,主叫终端和被叫终端利用该媒体通道信息通过主被叫NAT设备和媒体代理设备进行语音或数据通信。图10所示的是媒体通道传输的媒体数据流程,主叫终端的数据通过主叫NAT设备、媒体代理设备和被叫NAT设备发送到被叫终端,被叫终端的数据沿此通路反向传递给主叫终端。In the network shown in Figure 8, when a private network user calls a private network user, the calling and called terminals perform signaling communication through the calling NAT device, the calling signaling agent, the called signaling agent, and the called NAT device. The calling NAT device, the media agent device and the called NAT device perform media communication. Same as
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010102176823A CN101902506A (en) | 2010-06-21 | 2010-06-21 | Method and system for SIP call traversal network address translation |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2010102176823A CN101902506A (en) | 2010-06-21 | 2010-06-21 | Method and system for SIP call traversal network address translation |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN101902506A true CN101902506A (en) | 2010-12-01 |
Family
ID=43227704
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2010102176823A Pending CN101902506A (en) | 2010-06-21 | 2010-06-21 | Method and system for SIP call traversal network address translation |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101902506A (en) |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102420835A (en) * | 2012-01-10 | 2012-04-18 | 广东佳和通信技术有限公司 | Proxy method for RTP media stream in converged communication system |
| CN102546644A (en) * | 2012-01-17 | 2012-07-04 | 华为技术有限公司 | Method, equipment and system for implementing SIP (Session Initiation Protocol) calling |
| CN102651778A (en) * | 2011-02-24 | 2012-08-29 | 中兴通讯股份有限公司 | Method and system for implementing NAT (Network Address Translator) traversal by FCC (Fast Channel Change) system |
| CN104753928A (en) * | 2015-03-16 | 2015-07-01 | 苏州科达科技股份有限公司 | Code stream forwarding method and system |
| CN104980528A (en) * | 2015-06-26 | 2015-10-14 | 广州华多网络科技有限公司 | Method, system and apparatus for realizing communication between nodes |
| CN105049545A (en) * | 2015-06-17 | 2015-11-11 | 广州云积软件技术有限公司 | Streaming media NAT traverse method based on national education examination online patrol system video standard |
| CN111131747A (en) * | 2019-12-06 | 2020-05-08 | 视联动力信息技术股份有限公司 | Method, apparatus, electronic device and storage medium for determining data channel status |
| CN111131315A (en) * | 2019-12-31 | 2020-05-08 | 西安抱朴通信科技有限公司 | Session connection method, device, equipment and medium |
| CN111835885A (en) * | 2020-07-15 | 2020-10-27 | 杭州迪普科技股份有限公司 | Network address translation method, device and equipment |
| CN114500166A (en) * | 2021-12-24 | 2022-05-13 | 广州爱浦路网络技术有限公司 | IMS communication method based on public network and private network superposition |
| CN115277874A (en) * | 2022-07-29 | 2022-11-01 | 明阳产业技术研究院(沈阳)有限公司 | IPv4/IPv6 protocol intercommunication method based on SIP protocol and related equipment |
| CN115484311A (en) * | 2022-08-19 | 2022-12-16 | 重庆长安汽车股份有限公司 | Signaling interaction method, device and server of national standard signaling edge proxy system |
| CN116566955A (en) * | 2023-07-07 | 2023-08-08 | 杭州英旭智能科技有限公司 | Digital voice call method, device and application based on mqtt |
-
2010
- 2010-06-21 CN CN2010102176823A patent/CN101902506A/en active Pending
Non-Patent Citations (3)
| Title |
|---|
| 丁明等: "一种基于SIP NAT穿越的解决方案", 《中国科技论文在线》 * |
| 蔡闻怡等: "基于代理的SIP穿越NAT和防火墙方案", 《计算机工程》 * |
| 高扬等: "SIP协议的NAT穿越研究", 《重庆邮电学院学报(自然科学版)》 * |
Cited By (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102651778A (en) * | 2011-02-24 | 2012-08-29 | 中兴通讯股份有限公司 | Method and system for implementing NAT (Network Address Translator) traversal by FCC (Fast Channel Change) system |
| CN102420835A (en) * | 2012-01-10 | 2012-04-18 | 广东佳和通信技术有限公司 | Proxy method for RTP media stream in converged communication system |
| CN102420835B (en) * | 2012-01-10 | 2014-07-16 | 广东佳和通信技术有限公司 | Method for realizing real-time transport protocol (RTP) media stream agent in unified communication system |
| CN102546644A (en) * | 2012-01-17 | 2012-07-04 | 华为技术有限公司 | Method, equipment and system for implementing SIP (Session Initiation Protocol) calling |
| CN102546644B (en) * | 2012-01-17 | 2015-03-25 | 华为技术有限公司 | Method, equipment and system for implementing SIP (Session Initiation Protocol) calling |
| CN104753928A (en) * | 2015-03-16 | 2015-07-01 | 苏州科达科技股份有限公司 | Code stream forwarding method and system |
| CN104753928B (en) * | 2015-03-16 | 2018-08-17 | 苏州科达科技股份有限公司 | A kind of code stream retransmission method and system |
| CN105049545A (en) * | 2015-06-17 | 2015-11-11 | 广州云积软件技术有限公司 | Streaming media NAT traverse method based on national education examination online patrol system video standard |
| CN105049545B (en) * | 2015-06-17 | 2018-02-02 | 广州云积软件技术有限公司 | Based on the Streaming Media NAT through method under the online inspection system video standard of the national education examinations |
| CN104980528A (en) * | 2015-06-26 | 2015-10-14 | 广州华多网络科技有限公司 | Method, system and apparatus for realizing communication between nodes |
| CN111131747A (en) * | 2019-12-06 | 2020-05-08 | 视联动力信息技术股份有限公司 | Method, apparatus, electronic device and storage medium for determining data channel status |
| CN111131315A (en) * | 2019-12-31 | 2020-05-08 | 西安抱朴通信科技有限公司 | Session connection method, device, equipment and medium |
| CN111835885A (en) * | 2020-07-15 | 2020-10-27 | 杭州迪普科技股份有限公司 | Network address translation method, device and equipment |
| CN111835885B (en) * | 2020-07-15 | 2023-04-07 | 杭州迪普科技股份有限公司 | Network address translation method, device and equipment |
| CN114500166A (en) * | 2021-12-24 | 2022-05-13 | 广州爱浦路网络技术有限公司 | IMS communication method based on public network and private network superposition |
| CN114500166B (en) * | 2021-12-24 | 2023-06-16 | 广州爱浦路网络技术有限公司 | IMS communication method based on public network and private network superposition |
| CN115277874A (en) * | 2022-07-29 | 2022-11-01 | 明阳产业技术研究院(沈阳)有限公司 | IPv4/IPv6 protocol intercommunication method based on SIP protocol and related equipment |
| CN115277874B (en) * | 2022-07-29 | 2025-01-14 | 明阳产业技术研究院(沈阳)有限公司 | IPv4/IPv6 protocol intercommunication method based on SIP protocol and related equipment |
| CN115484311A (en) * | 2022-08-19 | 2022-12-16 | 重庆长安汽车股份有限公司 | Signaling interaction method, device and server of national standard signaling edge proxy system |
| CN115484311B (en) * | 2022-08-19 | 2024-05-07 | 重庆长安汽车股份有限公司 | Signaling interaction method, device and server of national standard signaling edge proxy system |
| CN116566955A (en) * | 2023-07-07 | 2023-08-08 | 杭州英旭智能科技有限公司 | Digital voice call method, device and application based on mqtt |
| CN116566955B (en) * | 2023-07-07 | 2023-09-19 | 杭州英旭智能科技有限公司 | Digital voice call method, device and application based on mqtt |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101902506A (en) | Method and system for SIP call traversal network address translation | |
| CN100399768C (en) | Method and system for realizing network address translation traversal | |
| CN104040998B (en) | NAT traversal based on ICE | |
| US10693919B2 (en) | Distributed connectivity policy enforcement with ICE | |
| US8095668B2 (en) | Middlebox control | |
| CN100440850C (en) | Method and system for multimedia service network address translation traversal | |
| CN102685268B (en) | Fast private network traversal method based on ICE (Information and Content Exchange) protocol in VoIP (Voice over Internet Protocol) | |
| US20130308628A1 (en) | Nat traversal for voip | |
| CN100539504C (en) | A network address translation and/or firewall traversal platform, system and method thereof | |
| US9497108B2 (en) | Media sessions | |
| CN102035813B (en) | The implementation method of end-to-end calling, end-to-end calling terminal and system | |
| US7764668B2 (en) | Signaling gateway for multihop-relaying a signaling message | |
| CN100550882C (en) | A method for traversing subnets and a system for traversing subnets | |
| CN102780675A (en) | Transmission method, device and system for streaming media service | |
| CN100403729C (en) | The method of call control and media flow traversing private network in SIP softswitch system | |
| CN100493033C (en) | Method for passing through network address conversion | |
| US8374178B2 (en) | Apparatus and method for supporting NAT traversal in voice over internet protocol system | |
| CN101742008B (en) | Media stream proxy method, voice exchanger and communication system | |
| CN101867575B (en) | A kind of media hairpin connection method of inter-network element and system | |
| CN101047548A (en) | Communication in multiple NAT private network | |
| CN102255980B (en) | Method and apparatus for managing calling information of session initiation protocol | |
| JP2008258917A (en) | Same NAT subordinate communication control system, NAT device, same NAT subordinate communication control method, and program | |
| US20150078263A1 (en) | Mobile-device based proxy for browser-originated procedures | |
| CN100433738C (en) | A method for realizing capability interaction between terminals | |
| CN119967000A (en) | Media data communication method, device, electronic device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20101201 |
