CN106131084B - RTP Media Stream traversing method, sip server and SIP communication system - Google Patents

RTP Media Stream traversing method, sip server and SIP communication system Download PDF

Info

Publication number
CN106131084B
CN106131084B CN201610770605.8A CN201610770605A CN106131084B CN 106131084 B CN106131084 B CN 106131084B CN 201610770605 A CN201610770605 A CN 201610770605A CN 106131084 B CN106131084 B CN 106131084B
Authority
CN
China
Prior art keywords
called subscriber
message
calling telephone
address
public network
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.)
Active
Application number
CN201610770605.8A
Other languages
Chinese (zh)
Other versions
CN106131084A (en
Inventor
卢立铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201610770605.8A priority Critical patent/CN106131084B/en
Publication of CN106131084A publication Critical patent/CN106131084A/en
Application granted granted Critical
Publication of CN106131084B publication Critical patent/CN106131084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • H04L61/2564NAT traversal for a higher-layer protocol, e.g. for session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/1046Call controllers; Call servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M7/00Arrangements for interconnection between switching centres
    • H04M7/006Networks other than PSTN/ISDN providing telephone service, e.g. Voice over Internet Protocol (VoIP), including next generation networks with a packet-switched transport layer
    • H04M7/0081Network operation, administration, maintenance, or provisioning

Abstract

The invention discloses a kind of RTP Media Stream traversing method, sip server and SIP communication systems, are related to the communications field, for solve the problem of when mutually transmission RTP Media Stream sip user agent between there are RTP Media Streams when NAT device can not cross-over NAT equipment.RTP Media Stream traversing method includes: the SIP registration message or registration keep alive Packet that the sip server receives calling telephone agent and called subscriber agency, obtains public network IP address and public network port number;The public network IP address and public network port number acted on behalf of according to calling telephone agent and called subscriber are acted on behalf of to the calling telephone agent and called subscriber sends message to wait for confirming;Determine user agent's type;If RTP media information is directly passed through another party both for Media proxy type;If there is a side is media relays type, then it is replaced and replaced SIP message is transmitted to another party.The embodiment of the present invention is communicated applied to SIP.

Description

RTP Media Stream traversing method, sip server and SIP communication system
Technical field
The present invention relates to the communications field more particularly to a kind of RTP Media Stream traversing methods, sip server and SIP communication system System.
Background technique
SIP (full name in English: Session Initiation Protocol, Chinese name: session initiation protocol) is just gradually Mainstream association as VOIP (full name in English: Voice Over Internet Protocol, Chinese name: ip voice) communication View.But SIP communication process needs to realize in conjunction with other agreements, a kind of agreement being often used in conjunction at present with SIP is RTP (full name in English: Real-time Transport Protocol, Chinese name: real-time transport protocol), specifically, can pass through Real-time Transport Protocol media stream.
In VOIP network environment, generally includes sip server and carries out the sip user agent of VOIP business mutually, And it is isolated between sip user agent and sip server by NAT device, so that sip server is located in public network, SIP User agent is located in private network.When transmitting RTP medium stream information between sip user agent, what is carried in SIP message is The private network IP address of sip user agent, or when there are STUN (full name in English: Simple Traversal of UDP in public network Over NATs, Chinese name: the User Datagram Protocol simple traversal of network address translation) server when, sip user agent The public network IP address of oneself can be obtained from STUN server and carries the public network IP address of oneself in SIP message, still Since SIP message is application layer data, NAT device can not be explained it to carry out public network IP address and private network IP address Conversion, therefore, according to existing Session Initiation Protocol, when between the sip user agent of transmission RTP Media Stream mutually there are when NAT device, RTP Media Stream can not cross-over NAT equipment.
Summary of the invention
The embodiment of the present invention provides a kind of RTP Media Stream traversing method, sip server and SIP communication system, uses In solution when, there are when NAT device, RTP Media Stream can not passing through NAT between the sip user agent of transmission RTP Media Stream mutually The problem of equipment.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that
In a first aspect, a kind of RTP Media Stream traversing method is provided, this method comprises:
The sip server receives the SIP registration message or registration keep alive Packet of the calling telephone agent, and according to institute The SIP registration message or registration keep alive Packet of stating calling telephone agent obtain the public network IP address and public affairs of the calling telephone agent Net port numbers receive the SIP registration message or registration keep alive Packet of the called subscriber agency, and according to called subscriber's generation The SIP registration message or registration keep alive Packet of reason obtain the public network IP address and public network port number of the called subscriber agency;
The sip server is used according to the public network IP address and public network port number of the calling telephone agent to the caller Family agency sends message to wait the calling telephone agent to be confirmed, and the public network IP acted on behalf of according to the called subscriber Address and public network port number are acted on behalf of to the called subscriber sends message to wait the called subscriber agency to confirm;
The sip server determines that the calling telephone agent is media relays type or Media proxy type, and sentences The fixed called subscriber agency is the media relays type or the Media proxy type;
If the calling telephone agent and called subscriber agency are the Media proxy type, described Sip server believes the RTP media in the calling telephone agent or called subscriber agency in the SIP message of a side Breath directly passes through another party, according to the public network IP of other side in order to the calling telephone agent and called subscriber agency Directly transmit RTP Media Stream in location, wherein the RTP media information includes IP address and port numbers;
If at least one party in the calling telephone agent or called subscriber agency is the media relays class Type, then will be in the RTP media information in the calling telephone agent or called subscriber agency in the SIP message of a side IP address replace with the IP address of the sip server, the port numbers in the RTP media information in the SIP message are replaced It is changed to the port of the sip server, replaced SIP message is then transmitted to the calling telephone agent or described called Another party in user agent, in order to which the calling telephone agent and called subscriber agency pass through the sip server Forward RTP Media Stream.
Second aspect provides a kind of sip server, which includes:
Receiving unit, for receiving the SIP registration message of the calling telephone agent or registering keep alive Packet, described in reception The SIP registration message or registration keep alive Packet of called subscriber agency;
Acquiring unit, the SIP registration message of the calling telephone agent for being received according to the receiving unit or Registration keep alive Packet obtains the public network IP address and public network port number of the calling telephone agent, is received according to the receiving unit To called subscriber agency SIP registration message or registration keep alive Packet obtain the public network IP of called subscriber agency Location and public network port number;
Transmission unit, the public network IP address and public network of the calling telephone agent for being obtained according to the acquiring unit Port numbers send message to the calling telephone agent to wait the calling telephone agent to be confirmed, and are obtained according to described The public network IP address and public network port number for the called subscriber agency for taking unit 1032 to obtain are acted on behalf of to the called subscriber and are sent out Text deliver newspaper to wait the called subscriber agency to confirm;
Judging unit, for determining that the calling telephone agent for media relays type or Media proxy type, and is sentenced The fixed called subscriber agency is the media relays type or the Media proxy type;
The transmission unit, if being also used to the judging unit determines the calling telephone agent and the called use Family agency is the Media proxy type, then by a side in the calling telephone agent or called subscriber agency RTP media information in SIP message directly passes through another party, in order to the calling telephone agent and called subscriber's generation Reason directly transmits RTP Media Stream according to the public network IP address of other side, wherein the RTP media information includes IP address and port Number;
Replacement unit, if determining the calling telephone agent or called subscriber agency for the judging unit In at least one party be the media relays type, then will from the calling telephone agent or the called subscriber agency in one The IP address in RTP media information in the SIP message of side replaces with the IP address of the sip server, by the SIP message In RTP media information in port numbers replace with the port of the sip server;
The transmission unit is also used to the replaced SIP message of the replacement unit being transmitted to calling subscriber's generation Reason or the called subscriber agency in another party, in order to the calling telephone agent and the called subscriber agency pass through institute State sip server forwarding RTP Media Stream.
The third aspect provides a kind of SIP communication system, including the sip server as described in second aspect.
RTP Media Stream traversing method, sip server and the SIP communication system that the embodiment of the present invention provides, pass through utilization Message test user agent public network IP address whether up to come judge according to public network IP address can cross-over NAT equipment, thus User agent is divided into media relays type or Media proxy type, the user agent for communicating pair is according to public network IP When the Media proxy type of cross-over NAT equipment is capable of in address, RTP media can directly be transmitted according to the public network IP address of other side Stream, for have in the user agent of communicating pair a side be according to public network IP address can not cross-over NAT equipment media relays class When type, by user agent by RTP media stream to sip server, it is transmitted to by sip server as forward relay another Side is solved when, there are when NAT device, RTP Media Stream can not pass through between the sip user agent of transmission RTP Media Stream mutually The problem of NAT device.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the structural schematic diagram for the SIP communication system that the embodiment of the present invention provides;
Fig. 2 is a kind of flow diagram for RTP Media Stream traversing method that the embodiment of the present invention provides;
Fig. 3 is the flow diagram for another RTP Media Stream traversing method that the embodiment of the present invention provides;
Fig. 4 is the IP address for the SIP communication system that the embodiment of the present invention provides and the schematic diagram of port numbers;
The schematic diagram of RTP Media Stream when the media relays type that Fig. 5 provides for the embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram for sip server that the embodiment of the present invention provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The present invention provides a kind of SIP communication systems, referring to fig. 1, comprising: calling telephone agent 101, first NAT device 102, sip server 103, the second NAT device 104, called subscriber act on behalf of 105 and STUN server 106.Caller is used Family agency 101 initiates VOIP calling to called subscriber agency 105 by sip server 103, it should be noted that called subscriber Agency 105 and the role of calling telephone agent 101 can be interchanged, i.e., called subscriber agency 105 can also be actively to calling subscriber Agency 101 initiates VOIP calling.Calling telephone agent 101 is isolated in private network by the first NAT device 102, called subscriber Agency 105 is isolated in private network by the second NAT device 104.Sip server 103, STUN server 106 are respectively positioned on public network In.Calling telephone agent 101 obtains IP address of the calling telephone agent 101 in public network by STUN server 106, is called and uses Family agency 105 obtains IP address of the called subscriber agency 105 in public network by STUN server 106, it should be noted that this Invention is not limited only to obtain a kind of this mode of public network IP address by STUN server, enables user agent using other modes The public network IP address for enough obtaining oneself is equally applicable to the present invention.
Embodiment 1,
The present invention provides a kind of RTP Media Stream traversing methods, are applied to SIP communication system shown in Fig. 1, referring to figure Shown in 2, this method comprises:
S101, sip server receive the SIP registration message or registration keep alive Packet of calling telephone agent, and according to caller The SIP registration message or registration keep alive Packet of user agent obtain the public network IP address and public network port number of calling telephone agent, Receive called subscriber agency SIP registration message or registration keep alive Packet, and according to called subscriber agency SIP registration message or Register public network IP address and public network port number that keep alive Packet obtains called subscriber agency.
It should be noted that calling telephone agent and called subscriber act on behalf of to sip server send SIP registration message or Need to carry oneself public network IP address and public network port number in registration keep alive Packet, rather than the private network IP address of oneself and private Net port numbers.Calling telephone agent and called subscriber act on behalf of obtain oneself public network IP address can choose as described above by The mode or other modes of STUN server, the present invention are not defined herein.
S102, sip server are according to the public network IP address of calling telephone agent and public network port number to calling telephone agent Message is sent to wait calling telephone agent to be confirmed, and according to the public network IP address of called subscriber agency and public network port Number to called subscriber act on behalf of send message with wait called subscriber agency confirm.
Specifically, sip server receives the first UDP (full name in English: user datagram of the calling telephone agent Protocol, Chinese name: User Datagram Protocol) request message.
Sip server sends the to calling telephone agent according to the public network IP address of calling telephone agent and public network port number One response message is to wait calling telephone agent to confirm the first response message, wherein the first response message is used for master The first UDP request message of user agent is made to respond.
Sip server receives the 2nd UDP request message of called subscriber agency.
The public network IP address and public network port number that sip server is acted on behalf of according to called subscriber are acted on behalf of to called subscriber sends the Two response messages are to wait called subscriber agency to confirm the second response message, wherein the second response message is used for quilt The 2nd UDP request message of user agent is made to respond.
S103, sip server determine that calling telephone agent is media relays type or Media proxy type, and determine quilt Being user agent is media relays type or Media proxy type.
If can receive in the given time calling telephone agent or called subscriber agency confirmation, illustrate according to The public network IP address and public network port number of family agency can direct cross-over NAT equipment, otherwise then illustrate according to the public affairs of user agent Net address and public network port number can not direct cross-over NAT equipments.
Specifically, after sip server sends the first response message to calling telephone agent, sip server starting the One timer.
If sip server does not receive calling telephone agent for the first response yet after first timer time-out First confirmation message transmitted by message, then again according to the public network IP address of calling telephone agent and public network port number to caller User agent sends the first response message and restarts first timer, if before first timer time-out, SIP service Device receives the first confirmation message, then calling telephone agent is labeled as Media proxy type.
If sip server does not receive the first confirmation message yet after first timer again time out, then by caller User agent is labeled as media relays type, if sip server receives first really before first timer again time out Recognize message, then calling telephone agent is labeled as Media proxy type.
After sip server acts on behalf of the second response message of transmission to called subscriber, the second timing of sip server starting Device.
If sip server does not receive called subscriber agency for the second response yet after second timer time-out Second confirmation message transmitted by message, then again according to the public network IP address of called subscriber agency and public network port number to called User agent sends the second response message and restarts second timer, if before second timer time-out, SIP service Device receives the second confirmation message, then called subscriber agency is labeled as Media proxy type.
If sip server does not receive the second confirmation message yet after second timer again time out, then will be called User agent is labeled as media relays type, if sip server receives second really before second timer again time out Recognize message, then called subscriber agency is labeled as Media proxy type.
Media proxy type described herein refers to can be set by the public network IP address of user agent and port by NAT It is standby to reach corresponding user agent, therefore report can be directly transmitted by the public network IP address and port of other side between user agent Text;And media relays type refers to not reaching by NAT device by the public network IP address of user agent and port and corresponds to User agent, therefore must be communicated using relay forwarding mode between user agent.
If S104, calling telephone agent and called subscriber agency are Media proxy type, sip server is in the future Another party is directly passed through from the RTP media information in calling telephone agent or called subscriber agency in the SIP message of a side, with RTP Media Stream is directly transmitted according to the public network IP address of other side convenient for calling telephone agent and called subscriber agency, wherein RTP Media information includes IP address and port numbers.
Specifically, sip server the INVITE call request message from calling telephone agent is directly passed through it is called User agent, so that called subscriber agency obtains the public network IP address of calling telephone agent from INVITE call request message.
The 200OK call answering acted on behalf of from called subscriber success message is directly passed through calling subscriber by sip server Agency, so that calling telephone agent obtains the public network IP address that called subscriber acts on behalf of from 200OK call answering success message.
It can be arrived by NAT device since Media proxy type refers to by the public network IP address of user agent and port Up to corresponding user agent, therefore calling telephone agent is according to act on behalf of with called subscriber can be direct according to the public network IP address of other side RTP Media Stream is transmitted, realizes passing through for NAT device.
If at least one party in S105, calling telephone agent or called subscriber agency is media relays type, will The IP address in RTP media information in SIP message from a side in calling telephone agent or called subscriber agency replaces with Port numbers in RTP media information in SIP message are replaced with the port of sip server, so by the IP address of sip server Replaced SIP message is transmitted to another party in calling telephone agent or called subscriber agency afterwards, in order to calling subscriber Agency forwards RTP Media Stream by sip server with called subscriber agency.
Specifically, sip server is that calling telephone agent distributes the first RTP media endpoints, it is called subscriber's agent allocation 2nd RTP media endpoints, wherein IP address in the RTP media information of the first RTP media endpoints is the IP of sip server Location, the port numbers in the RTP media information of the first RTP media endpoints are idle port No. the first, the 2nd RTP media endpoints IP address in RTP media information is the IP address of sip server, the port in the RTP media information of the 2nd RTP media endpoints Number be idle port No. the second.Idle port No. first and idle port No. the second described herein is idle on sip server Port port numbers.
IP address in RTP media information in INVITE call request message from calling telephone agent is replaced with Port numbers in RTP media information in INVITE call request message are replaced with the first RTP by the IP address of sip server Then INVITE call request message is sent to called subscriber agency by the port numbers of media endpoints.
IP address in RTP media information in the 200OK call answering success message that called subscriber acts on behalf of is replaced It is changed to the IP address of sip server, the port numbers in the RTP media information in 200OK call answering success message are replaced with Then 200OK call answering success message is sent to calling telephone agent by the port numbers of the 2nd RTP media endpoints.
In this way, being sent to SIP first when calling telephone agent is acted on behalf of to called subscriber and sends RTP media stream message later Then first RTP media endpoints of server are transmitted to called subscriber agency by the 2nd RTP media endpoints of sip server; It is sent to the 2nd RTP matchmaker of sip server first when called subscriber, which acts on behalf of, sends RTP media stream message to calling telephone agent Then body end point is transmitted to calling telephone agent by the first RTP media endpoints of sip server.In being used as by SIP service RTP Media Stream is forwarded after forwarding server to realize the transmission of RTP Media Stream between calling telephone agent and called subscriber agency And reception.
It should be noted that for the convenience of description, the present invention takes calling telephone agent and called subscriber agency with SIP Similar communication process is incorporated into step S101 into step S105 between business device, it will be understood to those skilled in the art that main Cry user agent and sip server communication process and both called subscriber agency and the communication process of sip server it Between and execute sequence there is no successive, the two is the process being individually performed.
RTP Media Stream traversing method provided by the invention, by using message test user agent public network IP address be It is no up to come judge according to public network IP address can cross-over NAT equipment, so that user agent is divided into media relays type or matchmaker Body Agent Type, the user agent for communicating pair are the Media proxy for capableing of cross-over NAT equipment according to public network IP address When type, RTP Media Stream can directly be transmitted according to the public network IP address of other side, for having one in the user agent of communicating pair Side for according to public network IP address can not cross-over NAT equipment media relays type when, by user agent by RTP media stream extremely Sip server is transmitted to another party as forward relay by sip server, solves the SIP that ought transmit RTP Media Stream mutually There are when NAT device between user agent, RTP Media Stream can not cross-over NAT equipment the problem of.
Embodiment 2,
The present invention provides another RTP Media Stream traversing methods, are applied to SIP communication system shown in Fig. 1, reference Shown in Fig. 3, the method comprising the steps of S201-S228, wherein step S201-S215 is the process for determining user agent's type, Processing forward stream when step S216-S220 is calling telephone agent 101 and called subscriber agency 105 is Media proxy type Journey, step S221-S228 are that at least one party in calling telephone agent 101 and called subscriber agency 105 is media relays type When forwarding process.
S201, sip server 103 create UDP server-side (English abbreviation: US) and UDP client (English abbreviation: UC).
Sip server 103 is located in public network, referring to fig. 4, it is assumed that the public network IP address of sip server 103 is 130.255.3.101.UDP server-side and UDP client can be created by public network IP address or public network port number.It is exemplary , sip server 103 monitors 5066 ports to create UDP server-side, binds 5068 ports to create UDP client.Alternatively, Two addresses public network IP address a and the address b are configured for sip server 103, monitor the address a to create UDP server-side, with binding b Location is to create UDP client.
S202, calling telephone agent 101 send registration to sip server 103 according to Session Initiation Protocol normal process after starting and report Literary (REGISTER message) or registration keep alive Packet are to be registered, wherein the logon message of calling telephone agent 101 or registration It include the public network IP address and public network port number of calling telephone agent 101 in keep alive Packet.
Calling telephone agent 101 can obtain the public network IP address of calling telephone agent 101 by the first STUN server. Referring to fig. 4, it is assumed that the private network IP address of calling telephone agent 101 is 192.168.1.1, and private network port numbers are 32768, For public network IP address after the first NAT device is converted into 130.255.3.168, public network port number (is equivalent to the first NAT device Public network port number) be 18900.
After S203, calling telephone agent 101 succeed in registration, the first UDP is sent to the UDP server-side of sip server 103 and is asked Message is sought, the format of the first UDP request message is as follows:
Method:REQUEST
Call-ID:cala985a21534f77
Wherein, Method field indicates that this type of message is request message (REQUEST).Call-ID field is SIP registration The Call-ID field carried in message, can on sip server 103 this user agent of globally unique identifier, different users Call-ID difference is acted on behalf of, the same user agent, which re-registers, can also generate new Call-ID.
S204, sip server 103 UDP server-side receive the first UDP request message after, with UDP client according to caller The public network IP address and public network port number of user agent 101 sends the first response message to calling telephone agent 101 to wait master It making user agent 101 confirm the first response message, starts first timer T1, wherein the time-out time of T1 is configurable, It is defaulted as 2 seconds, the first response message is for responding the first UDP request message of calling telephone agent 101, the first response The format of message is as follows:
Method:REQUEST
Call-ID:cala985a21534f77
Wherein, Method field indicates that this type of message is response message (RESPONSE).Call-ID field sync is rapid Call-ID described in S203, details are not described herein.
After S205, calling telephone agent 101 receive the first response message, send the first confirmation message (ACK message), first The format of confirmation message is as follows:
Method:ACK
Call-ID:ca1a985a21534f77
Wherein, Method field indicates that this type of message is response confirmation message (ACK).Call-ID field sync is rapid Call-ID described in S203, details are not described herein.
If S206, before first timer T1 time-out, sip server 103 receives the first confirmation message, then marks master Being user agent 101 is Media proxy type.If sip server 103 does not receive yet after first timer T1 time-out First confirmation message, then again according to the public network IP address of calling telephone agent 101 and public network port number to calling telephone agent 101 the first response messages of transmission simultaneously restart first timer T1.
If S207, before first timer T1 again time out, sip server 103 receives the first confirmation message, then Calling telephone agent 101 is labeled as Media proxy type.If after first timer T1 again time out, sip server 103 do not receive the first confirmation message yet, then calling telephone agent 101 are labeled as media relays type.
Registration report is sent to sip server 103 according to Session Initiation Protocol normal process after S208,105 starting of called subscriber agency Literary (REGISTER message) or registration keep alive Packet are to be registered, wherein the logon message of called subscriber agency 105 or registration Public network IP address and public network port number comprising called subscriber agency 105 in keep alive Packet.
Called subscriber agency 105 can obtain the public network IP address of called subscriber agency 105 by the 2nd STUN server. Referring to fig. 4, it is assumed that the private network IP address of called subscriber agency 105 is 10.0.0.1, and private network port numbers are 32768, warp The public network IP address after the second NAT device is converted is crossed as 130.255.3.169, public network port number (is equivalent to the second NAT device Public network port number) it is 18902.
After S209, called subscriber agency 105 succeed in registration, the 2nd UDP is sent to the UDP server-side of sip server 103 and is asked Message is sought, the format of the 2nd UDP request message is as follows:
Method:REQUEST
Call-ID:cala1112111
Wherein, Method field and Call-ID field described in Method field and the rapid S203 of Call-ID field sync Identical, details are not described herein.
S210, sip server 103 UDP server-side receive the 2nd UDP request message after, with UDP client according to called The public network IP address and public network port number of user agent 105 sends the second response message to called subscriber agency 105 to wait quilt It making user agent 105 confirm the second response message, starts second timer T2, wherein the time-out time of T2 is configurable, It is defaulted as 2 seconds, the second response message is used to respond the 2nd UDP request message of called subscriber agency 105, the second response The format of message is as follows:
Method:REQUEST
Call-ID:cala1112111
Wherein, Method field and Call-ID field described in Method field and the rapid S204 of Call-ID field sync Identical, details are not described herein.
After S211, called subscriber agency 105 receive the second response message, send the second confirmation message (ACK message), second The format of confirmation message is as follows:
Method:ACK
Call-ID:cala1112111
Wherein, Method field and Call-ID field described in Method field and the rapid S205 of Call-ID field sync Identical, details are not described herein.
If S212, before second timer T2 time-out, sip server 103 receives the second confirmation message, then marks quilt Being user agent 105 is Media proxy type.If sip server 103 does not receive yet after second timer T1 time-out Second confirmation message is then acted on behalf of according to the public network IP address of called subscriber agency 105 and public network port number to called subscriber again 105 the second response messages of transmission simultaneously restart second timer T2.
If S213, before second timer T2 again time out, sip server 103 receives the second confirmation message, then Called subscriber agency 105 is labeled as Media proxy type.If after second timer T2 again time out, sip server 103 do not receive the second confirmation message yet, then called subscriber agency 105 are labeled as media relays type.
S214, calling telephone agent 101 initiate calling to called subscriber agency 105, according to the public affairs of calling telephone agent 101 Net IP address and public network port number building INVITE call request message are simultaneously sent to sip server 103, carry in message RTP media information specifically includes that
C=IN IP4 130.255.3.168
18900 RTP/AVP 0 101 of m=audio
It can be seen that the RTP media address carried in INVITE call request message is calling subscriber from c field in message The public network IP address 130.255.3.168 of agency 101, m field can be seen that public network port number is 18900 from message.
After S215, sip server 103 receive INVITE call request message, carried out according to call control information therein The registration information of called subscriber agency 105 is found in routing, passes through the INVITE call request report of calling telephone agent 101 again at this time FROM (header field of SIP message identifies source user agent information) header field in text finds the registration letter of calling telephone agent 101 Breath.According to the registration acknowledgement message calling telephone agent 101 and called use of calling telephone agent 101 and called subscriber agency 105 The medium type (media relays type or Media proxy type) of family agency 105.
If S216, calling telephone agent 101 and called subscriber agency 105 are Media proxy type, sip server INVITE call request message from calling telephone agent 101 is directly passed through called subscriber agency 105 by 103, so that by The public network IP address for making user agent 105 obtain calling telephone agent 101 from INVITE call request message.
After S217, called subscriber agency 105 receive INVITE call request message, according to the public affairs of called subscriber agency 105 Net IP address and public network port number building 200OK call answering success message are simultaneously sent to sip server 103.
The RTP matchmaker in INVITE call request message that specific sip server 103 is sent to called subscriber agency 105 Content in the INVITE call request message of body information direct copying calling telephone agent 101, the RTP media carried in message Information specifically includes that
C=IN IP4 130.255.3.169
18902 RTP/AVP 0 101 of m=audio
It can be seen that the RTP media address called subscriber carried in 200OK call answering success message from c field in message The public IP network address 130.255.3.169 of agency 105, m field can be seen that public network port number is 18902 from message.
After S218, sip server 103 receive the response message of called subscriber agency 105, it will be acted on behalf of from called subscriber 105 200OK call answering success message directly pass through calling telephone agent 101 so that calling telephone agent 101 from 200OK call answering success message obtains the public network IP address of called subscriber agency 105.
Specifically, sip server 103, which also generates a 200OK call answering success message, is sent to calling telephone agent 101, the 200OK calling that the RTP media information copy in this message is received from sip server 103 from called subscriber agency 105 Response success message.
S219, calling telephone agent 101 receive 200OK call answering success post-message response ACK SIP message, and (response is true Recognize message), while the RTP media address (public network IP address) into 200OK call answering success message sends RTP Media Stream.
S220, called subscriber agency 105 start after receiving ACK SIP message into the INVITE message received before RTP media address (public network IP address) sends RTP Media Stream, at this time between calling telephone agent 101 and called subscriber agency 105 Point-to-point calling media channel is established.
If at least one party in S221, calling telephone agent 101 and called subscriber agency 105 is media relays type, Sip server 103 is that calling telephone agent 101 distributes the first RTP media endpoints, for 105 the 2nd RTP of distribution of called subscriber agency Media endpoints, wherein the IP address in the RTP media information of the first RTP media endpoints is the IP address of sip server 103, the Public network port number in the RTP media information of one RTP media endpoints is idle port No. the first, the RTP of the 2nd RTP media endpoints IP address in media information is the IP address of sip server 103, the port in the RTP media information of the 2nd RTP media endpoints Number be idle port No. the second.Idle port No. first and idle port No. the second described herein is 103 overhead of sip server The port numbers of not busy port.
Illustratively, referring to fig. 5, it is assumed that the first RTP media endpoints that sip server 103 distributes are as follows: 130.255.3.101:32768 the 2nd RTP media endpoints are 130.255.3.101:33770, wherein 130.255.3.101 is The public network IP address of sip server 103,32768 be idle port No. the first, and 33770 be idle port No. the second.
S222, sip server 103 are by the RTP media in the INVITE call request message from calling telephone agent 101 IP address in information replaces with the IP address of sip server 103, by the RTP media information in INVITE call request message In port numbers replace with the port numbers of the first RTP media endpoints, INVITE call request message is then sent to called use Family agency 105.
After S223, called subscriber agency 105 receive INVITE call request message, according to the public affairs of called subscriber agency 105 Net IP address and public network port number building 200OK call answering success message are simultaneously sent to sip server 103.
The step is identical as step S217, and details are not described herein.
S224, sip server 103 by from called subscriber agency 105 200OK call answering success message in RTP IP address in media information replaces with the IP address of sip server 103, by the RTP matchmaker in 200OK call answering success message Port numbers in body information replace with the port numbers of the 2nd RTP media endpoints, then send 200OK call answering success message To calling subscriber.
S225, it is sent out first when calling telephone agent 101 sends the first RTP media stream message to called subscriber agency 105 Give the first RTP media endpoints of sip server 103.
Illustratively, referring to fig. 5, the first RTP media stream message of calling telephone agent 101 passes through the first NAT The first RTP media endpoints of sip server 103 are reached after equipment 102.
S226, the oneth RTP media stream message is transmitted to called use by the 2nd RTP media endpoints of sip server 103 Family agency 105.
Illustratively, referring to fig. 5, the first RTP media stream message enters the first RTP media of sip server 103 It after endpoint, is flowed out from the 2nd RTP media endpoints of sip server 103, reaches called subscriber agency via the second NAT device 104 105。
S227, it is sent out first when called subscriber agency 105 sends the 2nd RTP media stream message to calling telephone agent 101 Give the 2nd RTP media endpoints of sip server 103.
Illustratively, referring to fig. 5, the 2nd RTP media stream message of called subscriber agency 105 passes through the 2nd NAT The 2nd RTP media endpoints of sip server 103 are reached after equipment 104.
S228, the 2nd RTP media stream message is transmitted to caller use by the first RTP media endpoints of sip server 103 Family agency 101.
Illustratively, referring to fig. 5, the 2nd RTP media stream message enters the 2nd RTP media of sip server 103 It after endpoint, is flowed out from the first RTP media endpoints stream of sip server 103, reaches calling subscriber's generation via the first NAT device 102 Reason 101.
Specifically, the data forwarding of the media endpoints of sip server 103, can pass through socket (Chinese name: socket Word) programming realization, iptable also can be used and create corresponding forward rule realization, the present invention does not specifically describe.
RTP Media Stream traversing method provided by the invention, by using message test user agent public network IP address be It is no up to come judge according to public network IP address can cross-over NAT equipment, so that user agent is divided into media relays type or matchmaker Body Agent Type, the user agent for communicating pair are the Media proxy for capableing of cross-over NAT equipment according to public network IP address When type, RTP Media Stream can directly be transmitted according to the public network IP address of other side, for having one in the user agent of communicating pair Side for according to public network IP address can not cross-over NAT equipment media relays type when, by user agent by RTP media stream extremely Sip server is transmitted to another party as forward relay by sip server, solves the SIP that ought transmit RTP Media Stream mutually There are when NAT device between user agent, RTP Media Stream can not cross-over NAT equipment the problem of.
Embodiment 3,
The present invention provides a kind of sip servers, referring to fig. 6, are applied to above-mentioned RTP Media Stream traversing method, As sip server 103 shown in Fig. 1, which includes:
Receiving unit 1031 receives called for receiving the SIP registration message or registration keep alive Packet of calling telephone agent The SIP registration message or registration keep alive Packet of user agent.
Acquiring unit 1032, the SIP registration message of the calling telephone agent for being received according to receiving unit 1031 or Public network IP address and public network port number that keep alive Packet obtains calling telephone agent are registered, is received according to receiving unit 1031 The SIP registration message or registration keep alive Packet of called subscriber agency obtain public network IP address and the public network port of called subscriber agency Number.
Transmission unit 1033, the public network IP address and public network of the calling telephone agent for being obtained according to acquiring unit 1032 Port numbers send message to calling telephone agent to wait calling telephone agent to be confirmed, and are obtained according to acquiring unit 1032 The public network IP address and public network port number of the called subscriber agency taken is acted on behalf of to called subscriber sends message to wait called subscriber Agency is confirmed.
Judging unit 1034, for determining that calling telephone agent for media relays type or Media proxy type, and is sentenced Determining called subscriber agency is media relays type or Media proxy type.
Transmission unit 1033, if it is determined that being also used to unit 1034 determines that calling telephone agent and called subscriber agency are equal For Media proxy type, then the RTP media in calling telephone agent or called subscriber agency in the SIP message of a side are believed Breath directly passes through another party, acts on behalf of for calling telephone agent with called subscriber and is directly transmitted according to the public network IP address of other side RTP Media Stream, wherein RTP media information includes IP address and port numbers.
Replacement unit 1035, if it is determined that determining in calling telephone agent or called subscriber agency for unit 1034 At least one party be media relays type, then will from calling telephone agent or called subscriber agency in a side SIP message in IP address in RTP media information replaces with the IP address of sip server, by the port in the RTP media information in SIP message Number replace with the port of sip server.
Transmission unit 1033, be also used to for the replaced SIP message of replacement unit 1035 being transmitted to calling telephone agent or Another party in called subscriber agency acts on behalf of for calling telephone agent and called subscriber and forwards RTP media by sip server Stream.
Since the sip server in the embodiment of the present invention can be used for above-mentioned RTP Media Stream traversing method, institute Obtainable technical effect is see also above method embodiment, and details are not described herein for the embodiment of the present invention.
Optionally, in a kind of possible mode:
Receiving unit 1031 is also used to receive the first UDP request message of calling telephone agent.
Transmission unit 1033, specifically for being used according to the public network IP address and public network port number of calling telephone agent to caller Family agency sends the first response message to wait calling telephone agent to confirm the first response message, and starts the first timing Device, wherein the first response message is for responding the first UDP request message of calling telephone agent.
Receiving unit 1031 is also used to receive the 2nd UDP request message of called subscriber agency.
Transmission unit 1033, specifically for the public network IP address acted on behalf of according to called subscriber and public network port number to called use Family agency sends the second response message to wait called subscriber agency to confirm the second response message, and starts the second timing Device, wherein the second response message is for responding the 2nd UDP request message that called subscriber acts on behalf of.
Optionally, in a kind of possible mode, referring to fig. 6, sip server 103 further includes timer unit 1036:
Timer unit 1036, for transmission unit 1033 to calling telephone agent send first response message it Afterwards, start first timer.
Transmission unit 1033, if connect specifically for after the first timer time-out that timer unit 1036 starts It receives unit 1031 and does not receive calling telephone agent yet for the first confirmation message transmitted by the first response message, then root again The first response message is sent to calling telephone agent according to the public network IP address and public network port number of calling telephone agent and is opened again Dynamic first timer.
Judging unit 1034, if connect specifically for before the first timer time-out that timer unit 1036 starts It receives unit 1031 and receives the first confirmation message, then calling telephone agent is labeled as Media proxy type.
Judging unit 1034, if be specifically used for after first timer again time out, receiving unit 1031 does not connect yet The first confirmation message is received, then calling telephone agent is labeled as media relays type, if in first timer again time out Before, receiving unit 1031 receives the first confirmation message, then calling telephone agent is labeled as Media proxy type.
Timer unit 1036 is also used to act on behalf of transmission second response message to called subscriber in transmission unit 1033 Later, start second timer.
Transmission unit 1033, if connect specifically for after the second timer time-out that timer unit 1036 starts It receives unit 1031 and does not receive called subscriber agency yet for the second confirmation message transmitted by the second response message, then root again It is acted on behalf of according to the public network IP address and public network port number of called subscriber agency to called subscriber and sends the second response message and open again Dynamic second timer.
Judging unit 1034, if connect specifically for before the second timer time-out that timer unit 1036 starts It receives unit 1031 and receives the second confirmation message, then called subscriber agency is labeled as Media proxy type.
Judging unit 1034, if be specifically used for after second timer again time out, receiving unit 1031 does not connect yet The second confirmation message is received, then called subscriber agency is labeled as media relays type, if in second timer again time out Before, receiving unit 1031 receives the second confirmation message, then called subscriber agency is labeled as Media proxy type.
Optionally, in a kind of possible mode, referring to fig. 6, sip server 103 further includes allocation unit 1037。
Allocation unit 1037 is called subscriber's agent allocation for distributing the first RTP media endpoints for calling telephone agent 2nd RTP media endpoints, wherein IP address in the RTP media information of the first RTP media endpoints is the IP of sip server Location, the port numbers in the RTP media information of the first RTP media endpoints are idle port No. the first, the 2nd RTP media endpoints IP address in RTP media information is the IP address of sip server, the port in the RTP media information of the 2nd RTP media endpoints Number be idle port No. the second.
Replacement unit 1035, specifically for will be from the RTP matchmaker in the INVITE call request message of calling telephone agent IP address in body information replaces with the IP address of sip server, will be in the RTP media information in INVITE call request message Port numbers replace with allocation unit 1037 distribution the first RTP media endpoints port numbers.
Transmission unit 1033, specifically for by the replaced INVITE call request message of replacement unit 1035 be sent to by It is user agent.
Replacement unit 1035, specifically for by from called subscriber agency 200OK call answering success message in RTP IP address in media information replaces with the IP address of sip server, by the RTP media in 200OK call answering success message Port numbers in information replace with the port numbers of the 2nd RTP media endpoints of the distribution of allocation unit 1037.
Transmission unit 1033 is specifically used for sending the replaced 200OK call answering of replacement unit 1035 success message To calling telephone agent.
It, can also be with it should be noted that acquiring unit, judging unit and replacement unit can be the processor individually set up It is integrated in some processor of controller and realizes, in addition it is also possible to be stored in depositing for controller in the form of program code In reservoir, is called by some processor of controller and execute the function of the above acquiring unit, judging unit and replacement unit. Processor described here can be a central processing unit (full name in English: central processing unit, English letter Claim: CPU) or specific integrated circuit (full name in English: application specific integrated circuit, English abbreviation: ASIC), or be arranged to implement one or more integrated circuits of the embodiment of the present invention.
Receiving unit and transmission unit can be the module that Ethernet interface or optical fiber network interface etc. have network communicating function.
It should be understood that in various embodiments of the present invention, magnitude of the sequence numbers of the above procedures are not meant to execute suitable Sequence it is successive, the execution of each process sequence should be determined by its function and internal logic, the implementation without coping with the embodiment of the present invention Process constitutes any restriction.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, it can be with It realizes by another way.For example, apparatus embodiments described above are merely indicative, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of equipment or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (full name in English: read-only memory, English letter Claim: ROM), random access memory (full name in English: random access memory, English abbreviation: RAM), magnetic disk or light The various media that can store program code such as disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (9)

1. a kind of realtime transmission protocol RTP Media Stream traversing method characterized by comprising
Sip server receives the SIP registration message or registration keep alive Packet of calling telephone agent, and according to calling subscriber's generation The SIP registration message or registration keep alive Packet of reason obtain the public network IP address and public network port number of the calling telephone agent, connect Receive the SIP registration message or registration keep alive Packet of called subscriber agency, and the SIP registration message acted on behalf of according to the called subscriber Or registration keep alive Packet obtains the public network IP address and public network port number of the called subscriber agency;
The sip server is according to the public network IP address of the calling telephone agent and public network port number to calling subscriber's generation Haircut delivers newspaper text to wait the calling telephone agent to be confirmed, and the public network IP address acted on behalf of according to the called subscriber It is acted on behalf of with public network port number to the called subscriber and sends message to wait the called subscriber agency to confirm;
The sip server determines that the calling telephone agent is media relays type or Media proxy type, and determines institute Stating called subscriber agency is the media relays type or the Media proxy type;
If the calling telephone agent and called subscriber agency are the Media proxy type, the SIP clothes Be engaged in device will from the calling telephone agent or the called subscriber agency in a side SIP message in RTP media information it is straight It connects and passes through another party, in order to which the calling telephone agent and called subscriber agency are straight according to the public network IP address of other side Connect transmission RTP Media Stream, wherein the RTP media information includes IP address and port numbers;
If at least one party in the calling telephone agent or called subscriber agency is the media relays type, By the IP in the RTP media information in the calling telephone agent or called subscriber agency in the SIP message of a side Address replaces with the IP address of the sip server, and the port numbers in the RTP media information in the SIP message are replaced with Then replaced SIP message is transmitted to the calling telephone agent or the called subscriber by the port of the sip server Another party in agency, in order to which the calling telephone agent and called subscriber agency are forwarded by the sip server RTP Media Stream.
2. the method according to claim 1, wherein the sip server is according to the calling telephone agent It is true that public network IP address and public network port number wait the calling telephone agent to carry out to calling telephone agent transmission message Recognize, and is acted on behalf of according to the public network IP address of called subscriber agency and public network port number to the called subscriber and send message To wait the called subscriber agency to confirm, comprising:
The sip server receives the first UDP request message of the calling telephone agent;
The sip server is according to the public network IP address of the calling telephone agent and public network port number to calling subscriber's generation Haircut send the first response message to wait the calling telephone agent to confirm first response message, wherein described First response message is for responding the first UDP request message of the calling telephone agent;
The sip server receives the 2nd UDP request message of the called subscriber agency;
Public network IP address that the sip server is acted on behalf of according to the called subscriber and public network port number are to called subscriber's generation Haircut send the second response message to wait the called subscriber agency to confirm second response message, wherein described The 2nd UDP request message that second response message is used to act on behalf of the called subscriber responds.
3. the method according to claim 1, wherein the sip server determines that the calling telephone agent is Media relays type or Media proxy type, and determine that the called subscriber agency is the media relays type or the matchmaker Body Agent Type, comprising:
After the sip server sends the first response message to the calling telephone agent, sip server starting the One timer;
If the sip server does not receive the calling telephone agent yet and is directed to after the first timer time-out First confirmation message transmitted by first response message, then again according to the public network IP address of the calling telephone agent and Public network port number sends first response message to the calling telephone agent and restarts the first timer, if Before the first timer time-out, the sip server receives first confirmation message, then by the calling subscriber Agency is labeled as Media proxy type;
If the sip server does not receive first confirmation message yet after the first timer again time out, The calling telephone agent is then labeled as media relays type;
After the sip server is acted on behalf of to the called subscriber and to send the second response message, sip server starting the Two timers;
If the sip server does not receive the called subscriber agency yet and is directed to after the second timer time-out Second confirmation message transmitted by second response message, then again according to the called subscriber agency public network IP address and Public network port number is acted on behalf of to the called subscriber to be sent second response message and restarts the second timer, if Before the second timer time-out, the sip server receives second confirmation message, then by the called subscriber Agency is labeled as Media proxy type;
If the sip server does not receive second confirmation message yet after the second timer again time out, Called subscriber agency is then labeled as media relays type.
4. the method according to claim 1, wherein described will come from the calling telephone agent or described called The IP address in RTP media information in user agent in the SIP message of a side replaces with the IP address of the sip server, Port numbers in RTP media information in the SIP message are replaced with to the port of the sip server, after then replacing SIP message be transmitted to the calling telephone agent or the called subscriber agency in another party, comprising:
The sip server is that the calling telephone agent distributes the first RTP media endpoints, is called subscriber's agent allocation 2nd RTP media endpoints, wherein the IP address in the RTP media information of the first RTP media endpoints is the SIP service The IP address of device, the port numbers in the RTP media information of the first RTP media endpoints are idle port No. the first, described the IP address in the RTP media information of two RTP media endpoints is the IP address of the sip server, the 2nd RTP media end Port numbers in the RTP media information of point are idle port No. the second;
IP address in RTP media information in INVITE call request message from the calling telephone agent is replaced with The IP address of the sip server replaces with the port numbers in the RTP media information in the INVITE call request message Then the INVITE call request message is sent to called subscriber's generation by the port numbers of the first RTP media endpoints Reason;
IP address in RTP media information in the 200OK call answering success message that the called subscriber acts on behalf of is replaced It is changed to the IP address of the sip server, by the port in the RTP media information in 200OK call answering success message The port numbers of the 2nd RTP media endpoints number are replaced with, are then sent to 200OK call answering success message described Calling telephone agent.
5. a kind of sip server characterized by comprising
Receiving unit receives called subscriber agency for receiving the SIP registration message or registration keep alive Packet of calling telephone agent SIP registration message or registration keep alive Packet;
Acquiring unit, the SIP registration message of the calling telephone agent for being received according to the receiving unit or registration Keep alive Packet obtains the public network IP address and public network port number of the calling telephone agent, is received according to the receiving unit The SIP registration message or registration keep alive Packet of called subscriber agency obtain the called subscriber agency public network IP address and Public network port number;
Transmission unit, the public network IP address of the calling telephone agent for being obtained according to the acquiring unit and public network port Number message is sent to wait the calling telephone agent to be confirmed to the calling telephone agent, and singly according to acquisitions Member obtain the called subscriber agency public network IP address and public network port number to the called subscriber act on behalf of send message with The called subscriber agency is waited to confirm;
Judging unit, for determining that the calling telephone agent for media relays type or Media proxy type, and determines institute Stating called subscriber agency is the media relays type or the Media proxy type;
The transmission unit, if being also used to the judging unit determines the calling telephone agent and called subscriber's generation Reason is the Media proxy type, then by the SIP of a side in the calling telephone agent or called subscriber agency RTP media information in message directly passes through another party, in order to which the calling telephone agent and the called subscriber are acted on behalf of RTP Media Stream is directly transmitted according to the public network IP address of other side, wherein the RTP media information includes IP address and port numbers;
Replacement unit, if determined in the calling telephone agent or called subscriber agency for the judging unit At least one party is the media relays type, then by a side in the calling telephone agent or called subscriber agency The IP address in RTP media information in SIP message replaces with the IP address of the sip server, will be in the SIP message Port numbers in RTP media information replace with the port of the sip server;
The transmission unit, be also used to for the replaced SIP message of the replacement unit being transmitted to the calling telephone agent or Another party in the called subscriber agency, in order to which the calling telephone agent and the called subscriber are acted on behalf of by described Sip server forwards RTP Media Stream.
6. sip server according to claim 5, which is characterized in that
The receiving unit is also used to receive the first UDP request message of the calling telephone agent;
The transmission unit, specifically for according to the public network IP address of the calling telephone agent and public network port number to the master Cry user agent's the first response message of transmission to wait the calling telephone agent to confirm first response message, In, first response message is for responding the first UDP request message of the calling telephone agent;
The receiving unit is also used to receive the 2nd UDP request message of the called subscriber agency;
The transmission unit, specifically for the public network IP address acted on behalf of according to the called subscriber and public network port number to the quilt User agent's the second response message of transmission is made to confirm to wait the called subscriber to act on behalf of to second response message, In, the 2nd UDP request message that second response message is used to act on behalf of the called subscriber responds.
7. sip server according to claim 5, which is characterized in that the sip server further includes timer unit,
The timer unit is used for after the transmission unit sends the first response message to the calling telephone agent, Start first timer;
The transmission unit, if specifically for after the first timer time-out that the timer unit starts, institute It states receiving unit and does not receive the calling telephone agent yet for the first confirmation message transmitted by first response message, Then again according to the public network IP address of the calling telephone agent and public network port number to described in calling telephone agent transmission First response message simultaneously restarts the first timer;
The judging unit, if specifically for before the first timer time-out that the timer unit starts, institute It states receiving unit and receives first confirmation message, then the calling telephone agent is labeled as Media proxy type;
The judging unit, if be specifically used for after the first timer again time out, the receiving unit does not connect yet First confirmation message is received, then the calling telephone agent is labeled as media relays type;
The timer unit, be also used to the transmission unit to the called subscriber act on behalf of send the second response message it Afterwards, start second timer;
The transmission unit, if specifically for after the second timer time-out that the timer unit starts, institute It states receiving unit and does not receive called subscriber agency yet for the second confirmation message transmitted by second response message, Then acted on behalf of described in transmission according to the public network IP address of called subscriber agency and public network port number to the called subscriber again Second response message simultaneously restarts the second timer;
The judging unit, if specifically for before the second timer time-out that the timer unit starts, institute It states receiving unit and receives second confirmation message, then called subscriber agency is labeled as Media proxy type;
The judging unit, if be specifically used for after the second timer again time out, the receiving unit does not connect yet Second confirmation message is received, then called subscriber agency is labeled as media relays type.
8. sip server according to claim 5, which is characterized in that the sip server further includes allocation unit,
The allocation unit is acted on behalf of for distributing the first RTP media endpoints for the calling telephone agent for the called subscriber Distribute the 2nd RTP media endpoints, wherein the IP address in the RTP media information of the first RTP media endpoints is the SIP The IP address of server, the port numbers in the RTP media information of the first RTP media endpoints are idle port No. the first, institute State the IP address that the IP address in the RTP media information of the 2nd RTP media endpoints is the sip server, the 2nd RTP matchmaker Port numbers in the RTP media information of body end point are idle port No. the second;
The replacement unit, specifically for will be from the RTP matchmaker in the INVITE call request message of the calling telephone agent IP address in body information replaces with the IP address of the sip server, by the RTP matchmaker in the INVITE call request message Port numbers in body information replace with the port numbers of the first RTP media endpoints of the allocation unit distribution;
The transmission unit, specifically for the replaced INVITE call request message of the replacement unit is sent to institute State called subscriber agency;
The replacement unit, specifically for by from the called subscriber agency 200OK call answering success message in RTP IP address in media information replaces with the IP address of the sip server, will be in 200OK call answering success message Port numbers in RTP media information replace with the port numbers of the 2nd RTP media endpoints of the allocation unit distribution;
The transmission unit is specifically used for sending the replaced 200OK call answering success message of the replacement unit To the calling telephone agent.
9. a kind of SIP communication system, which is characterized in that including the sip server as described in any one of claim 5-8.
CN201610770605.8A 2016-08-30 2016-08-30 RTP Media Stream traversing method, sip server and SIP communication system Active CN106131084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610770605.8A CN106131084B (en) 2016-08-30 2016-08-30 RTP Media Stream traversing method, sip server and SIP communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610770605.8A CN106131084B (en) 2016-08-30 2016-08-30 RTP Media Stream traversing method, sip server and SIP communication system

Publications (2)

Publication Number Publication Date
CN106131084A CN106131084A (en) 2016-11-16
CN106131084B true CN106131084B (en) 2019-07-02

Family

ID=57275650

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610770605.8A Active CN106131084B (en) 2016-08-30 2016-08-30 RTP Media Stream traversing method, sip server and SIP communication system

Country Status (1)

Country Link
CN (1) CN106131084B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI639326B (en) * 2016-12-05 2018-10-21 財團法人資訊工業策進會 Network address translation server and network address translation method thereof
CN107634954B (en) * 2017-09-25 2020-04-10 中国联合网络通信集团有限公司 Soft switch calling method and system
CN110677291A (en) * 2019-09-26 2020-01-10 广州兰德视讯有限公司 Method and device for reducing server load and network bandwidth in multipoint communication
CN113099056B (en) * 2021-03-24 2022-07-22 网经科技(苏州)有限公司 NAT (network Address translation) traversing method for realizing VoIP (Voice over Internet protocol) based on kamailio

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316042A (en) * 2011-09-30 2012-01-11 杭州华三通信技术有限公司 Message transmission method, equipment and system
CN102664901A (en) * 2012-05-15 2012-09-12 苏州工业园区云视信息技术有限公司 Method for adaptive traversal through network address translator (NAT) in session initiation protocol (SIP) call
CN102932235A (en) * 2012-10-09 2013-02-13 曙光信息产业(北京)有限公司 Method and server system for instant messaging in cloud computing environment
CN103108054A (en) * 2011-11-11 2013-05-15 中国移动通信集团公司 Method for penetrating through transit server and corresponding server and terminal and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7801953B1 (en) * 2001-02-12 2010-09-21 Nortel Networks Limited Push-to-talk wireless telecommunications system utilizing an voice-over-IP network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102316042A (en) * 2011-09-30 2012-01-11 杭州华三通信技术有限公司 Message transmission method, equipment and system
CN103108054A (en) * 2011-11-11 2013-05-15 中国移动通信集团公司 Method for penetrating through transit server and corresponding server and terminal and system
CN102664901A (en) * 2012-05-15 2012-09-12 苏州工业园区云视信息技术有限公司 Method for adaptive traversal through network address translator (NAT) in session initiation protocol (SIP) call
CN102932235A (en) * 2012-10-09 2013-02-13 曙光信息产业(北京)有限公司 Method and server system for instant messaging in cloud computing environment

Also Published As

Publication number Publication date
CN106131084A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
EP3552364B1 (en) Conferencing server
JP5209061B2 (en) Control of sending interface of SIP response message
JP5842290B2 (en) Session start protocol adapter
JP5636516B2 (en) Backup SIP server for enterprise network survivability using SIP
CN106131084B (en) RTP Media Stream traversing method, sip server and SIP communication system
EP1751919B1 (en) Method and apparatus for dynamically determining when to use quality of service reservation in internet media applications
AU2005201075B2 (en) Apparatus and method for voice processing of voice over internet protocol (VOIP)
JP5312672B2 (en) Access node comprising a VoIP card having a common IP address and a MAC address
US20070147263A1 (en) Method for transmitting real-time streaming data and apparatus using the same
TW201002018A (en) Method for predicting port number of NAT apparatus based on two STUN server inquiry results
US20100040057A1 (en) Communication method
EP2850813A1 (en) Nat traversal for voip
CN105721570B (en) Data peer-to-peer transmission method and device
KR20090057097A (en) Traversal of nat address translation equipment for signalling messages complying with the sip protocol
JP2006067579A (en) System and method of collecting and distributing participant identifying data
US20190081886A1 (en) Method and system for surviving outages in hosted sip service networks
US8194686B2 (en) Communications relay device, program and method, and network system
US20090201933A1 (en) Method, device and system for signaling transfer
US20090285198A1 (en) Apparatus and methods for providing media packet flow between two users operating behind a gateway device
JP5752014B2 (en) Gateway device and data transmission method
Houngue et al. Overcoming NAT traversal issue for SIP-based communication in P2P networks
JP2009130712A (en) Gateway device and communication control method
JP2004165823A (en) Ip address converting apparatus
Sadjadi et al. A self-configuring communication virtual machine
KR100410809B1 (en) Communication method for SIP under Network Address Translation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant