Specific embodiment
The embodiment of the invention provides a kind of data transmission method, relevant apparatus and its systems, for solving public network terminal
Unidirectional code stream or intermittent code stream cross-over NAT equipment the problem of being transmitted to private net terminal.
Referring to Fig. 1, one embodiment of data transmission method includes: in the embodiment of the present invention
101, SIP communication is established;
It, can be first between private net terminal and public network terminal when public network terminal and private net terminal need to carry out SIP business
Establish SIP communication.
Private net terminal and public network terminal establish the common knowledge that the process that SIP is communicated is those skilled in the art, it is specific this
Place is not construed as limiting.
102, it obtains public network and sends address;
After the SIP communication for establishing private net terminal and public network terminal, it is whole that private net terminal can obtain public network by SIP signaling
The public network that end is sent sends address, which sends address and send code stream to private net terminal for public network terminal.
Private net terminal can obtain public network in several ways and send address in the present embodiment, specifically will be in subsequent implementation
It is described in detail in example.
103, survival packet is sent;
Private net terminal, every during cycle, can be sent out by NAT device to the public network after getting public network and sending address
Address transmission survival packet is sent, which is less than the private net address for the private net terminal established in NAT device and is somebody's turn to do
Public network sends the out-of-service time of the mapping relations between address.
In the present embodiment, the mapping relations saved on NAT device would generally be provided with an out-of-service time, if in the failure
Private net terminal does not send code stream to public network terminal in time, then the public network of the private net address of the private net terminal and the public network terminal
Mapping relations between address will fail.So after the mapping relations established between private net address and public network transmission address,
Private net terminal, which needs to send address to the public network by NAT device every during cycle, sends survival packet, to keep the mapping to close
System, and the time of the during cycle is less than the out-of-service time of the mapping relations in NAT device.
When survival packet is by NAT device, NAT device is converted to the source address of survival packet can be in public network transmissions
Address, which is the dynamic mapping using static mappings, what the mode of dynamic port mapping generated, while NAT device also can
Establish or keep private net address and public network to send the mapping relations between address: (private net address, private net address are converted by NAT
Address afterwards, public network send address).
Source address, that is, private net terminal private net address of survival packet establishes private net address in NAT device and public network sends ground
After mapping relations between location, when public network terminal sends code stream to private net terminal, NAT device can utilize the mapping relations
Back mapping is carried out to code stream, to be forwarded to private net terminal.
During unidirectional bit stream, due to only having public network terminal to send code stream to private net terminal, private net terminal will not
Code stream is sent to public network terminal, so the public network terminal only exists public network and sends address, private net terminal needs to send to the public network
Address, which sends survival packet, could make public network terminal receive the survival packet, and NAT device is made to can establish or keep private
Net address and public network send the mapping relations between address.
In the present embodiment, private net terminal and public network terminal are established after SIP communicates, and private net terminal obtains public network and sends address,
And address is sent to the public network by NAT device and sends survival packet, which can make NAT device establish or keep private network
The private net address of terminal and the public network send the mapping relations between address, so that public network terminal is carrying out unidirectional code stream or interval
When property bit stream, corresponding mapping relations can be found in NAT device, to realize the code stream passing through NAT of public network terminal
Transmission of the equipment to private net terminal.
Referring to Fig. 2, another embodiment of data transmission method includes: in the embodiment of the present invention
201, SIP communication is established;
The content of step 201 in the present embodiment is identical as the content of step 101 in aforementioned embodiment shown in FIG. 1, this
Place repeats no more.
202, communication request is received;
Private net terminal receives the transfer of unidirectional code stream request that public network terminal is sent, which requests for indicating
Public network terminal will send unidirectional code stream to private net terminal, and transfer of unidirectional code stream request can specifically be carried out by SIP signaling
It sends.
Specific unidirectional code stream can be secondary flow, and an only side is sending, and reception is only responsible in opposite end, without to sender
Send code stream.
203, it obtains public network and sends address;
In the present embodiment, private net terminal, which obtains public network transmission address, specifically can be used following methods:
(1), private net terminal obtains public network from the request of transfer of unidirectional code stream and sends address:
Public network terminal can request to be extended to transfer of unidirectional code stream, and it is whole to carry public network using the extension bits in the request
The public network at end sends address.
When private net terminal is after the transfer of unidirectional code stream request for receiving public network terminal transmission, due to the transfer of unidirectional code stream
Public network is carried in request and sends address, and therefore, private net terminal can be from the transfer of unidirectional code stream request that public network terminal is sent
It extracts the public network and sends address.
(2), private net terminal obtains public network from the SIP signaling of public network terminal active transmission and sends address:
If public network terminal does not carry public network in the request of transfer of unidirectional code stream and sends address, then public network terminal can also make
Public network is carried with notice INFO message and sends address, and INFO message is actively sent to private net terminal, and private net terminal can be from
The public network is extracted in the INFO message sends address.
It should be noted that the INFO message is one kind of SIP signaling, it is to be understood that other than INFO message,
Public network terminal can also use others SIP signaling to send public network to private net terminal and send address, and this is not limited here.
(3), private net terminal actively sends address to public network terminal request public network:
When private net terminal is after the transfer of unidirectional code stream request for receiving public network terminal transmission, if the transfer of unidirectional code stream is asked
Public network is not carried in asking and sends address, then the unidirectional code stream that private net terminal can wait public network terminal to send, if when preset
The unidirectional code stream of public network terminal transmission is not received after length yet, then private net terminal can send Address requests, the ground to public network terminal
Location request can be sent by SIP signaling to public network terminal from private net terminal, and public network terminal, can after receiving the Address requests
To send address to private net terminal feedback public network for example, by the SIP such as INFO message signaling, then private net terminal can be from for example
The public network is extracted in the SIP signaling such as INFO message sends address.
Example from above illustrates that private net terminal obtains the mode that public network sends address in the present embodiment, it is to be understood that
In practical applications, private net terminal can also obtain public network by other means and send address, specifically herein without limitation.
204, survival packet is sent;
The content of step 204 in the present embodiment is identical as the content of step 103 in aforementioned embodiment shown in FIG. 1, this
Place repeats no more.
In the present embodiment, private net terminal and public network terminal are established after SIP communicates, and private net terminal obtains public network and sends address,
And address is sent to the public network by NAT device and sends survival packet, which can make NAT device establish or keep private network
The private net address of terminal and the public network send the mapping relations between address, so that public network terminal is carrying out unidirectional code stream or interval
When property bit stream, corresponding mapping relations can be found in NAT device, to realize the code stream passing through NAT of public network terminal
Transmission of the equipment to private net terminal;
Secondly, private net terminal can get public network in several ways and send address, so can mention in the present embodiment
The using flexible of high scheme.
Above-mentioned embodiment shown in Fig. 2 is illustrated by taking the transmission of unidirectional code stream as an example, in practical applications, in addition to list
To except code stream, can also there be intermittent code stream, specific treatment process is referring to Fig. 3, data pass in the embodiment of the present invention
Another embodiment of transmission method includes:
301, code stream exchanges;
Private net terminal and public network terminal are established after SIP communicates, and both sides send code stream to opposite end by NAT device, such as
Both sides are carrying out Remote Video Conference, then can send video code flow mutually, and private net address is saved on NAT device and public network is sent
The mapping relations of address.
302, pause code stream is sent;
In SIP business procedure, private net terminal can suspend the transmission of code stream, such as when video conference has carried out one section
Between, private net terminal needs the content with regard to aforementioned video meeting to carry out primary internal discussion, is not intended at this time by internal discussion process
Video and audio-frequency information send the public network terminal of opposite end to, so the sendaisle of video code flow can be closed, or pause code
Stream is sent.
303, survival packet is sent;
If private net terminal closes the sendaisle of video code flow, or the duration that pause code stream is sent sets more than NAT
The out-of-service time of standby corresponding mapping relations, then it will lead to the failure of the mapping relations, and make the subsequent transmission of public network terminal
Code stream can not cross-over NAT equipment reach private net terminal to thorough break of video meeting.
In order to avoid there is above situation, in the present embodiment, when private net terminal closes code stream sendaisle or pause code stream
When transmission, then private net terminal sends address to the public network of public network terminal by NAT device every during cycle and sends survival packet, with
The mapping relations in NAT device are kept, which is less than the out-of-service time of the mapping relations.
304, restart code stream transmission;
After private net terminal closes the sendaisle of video code flow, or pause code stream is sent, code stream transmission can be reopened
Channel continues to send code stream to public network terminal, such as internal discuss terminates, and continues video conference.
305, stop sending survival packet;
When private net terminal restarts code stream sendaisle or continues code stream and send, then the mapping relations on NAT device can be with
It is kept by the data code flow, in order to avoid the transmission of unnecessary data, private net terminal can stop sending survival packet.
When carrying out intermittent bit stream in the present embodiment, if private net terminal closes the sendaisle of video code flow, or temporarily
Stop code stream transmission, then private net terminal meeting active transmission survival packet, to keep the mapping relations in NAT device, ensure that public network end
Hold transmitted stream that can transmit with cross-over NAT equipment to private net terminal;
Secondly, when private net terminal reopens code stream sendaisle, when continuing to send code stream to public network terminal, private net terminal
It can stop sending survival packet, so that unnecessary data be avoided to transmit, save Internet resources.
Other than unidirectional code stream mentioned above and intermittent code stream may result in mapping failure, in reality
In, the code stream of burst and interrupted code stream may also lead to the mapping failure in NAT device, specific processed
Journey is as follows:
One, for the code stream of burst:
In media call, it is burst that certain code streams, which are not persistently existing,.If private net terminal and public network terminal are
It has been set up the duplex channel of SIP, before private net terminal does not send code stream, mapping relations are not present on NAT device, so
The code stream of public network terminal will be unable to cross-over NAT equipment.
Therefore, in the present embodiment, after establishing the SIP duplex channel between private net terminal and public network terminal, private network
Terminal can actively pass through NAT device and send survival packet to public network terminal, establish corresponding mapping relations.
Two, interrupted code stream:
In above-mentioned SIP business, even if private net terminal has sent code stream to public network terminal, established in NAT device
Corresponding mapping relations, but since code stream is interrupted, it is possible to when being more than the failure of mapping relations because of the time of disconnection
Between, and the code stream of public network terminal is caused to will be unable to cross-over NAT equipment.
Therefore, in the present embodiment, after establishing the SIP duplex channel between private net terminal and public network terminal, private network
Terminal can continue through NAT device every during cycle and send survival packet, to keep corresponding mapping relations.
For ease of understanding, burst code stream and interrupted code stream are illustrated so that Remote Camera controls as an example below:
Remote Camera control is that control data are sent by private net terminal (such as control terminal) (such as: amplifying, reduce, is left
Move right) to public network terminal (such as video camera), which is exactly a kind of burst and interrupted code stream.
After SIP duplex channel between control terminal and video camera is established, video camera can continue to send video to control terminal
Data, and after only control terminal has carried out control operation, control terminal can just send control stream to video camera, and in control terminal
Before being controlled, the video data that video camera is sent just becomes unidirectional code stream.
Even if control terminal had carried out operation, corresponding mapping relations are formd on NAT device, but if it exceeds
It the out-of-service time of mapping relations and is not operated again, then the mapping relations will fail, the video that video camera is sent
Data then can not cross-over NAT equipment, so after establishing the SIP duplex channel between control terminal and video camera, control terminal
NAT device being continued through every during cycle and sending survival packet to video camera, which closes less than the correspondence mappings
The out-of-service time of system, to establish and keep corresponding mapping relations in NAT device.
Only the application scenarios in the embodiment of the present invention are illustrated with some examples above, it is to be understood that
In practical application, there can also be more application scenarios, this is not limited here.
Above-described embodiment is that data transmission method of the present invention is described from the angle of private net terminal, below from public network
Data transmission method of the present invention is described in the angle of terminal, referring to Fig. 4, the data transmission method in the embodiment of the present invention
Another embodiment includes:
401, SIP communication is established;
The content of step 401 in the present embodiment is identical as the content of step 101 in aforementioned embodiment shown in FIG. 1, this
Place repeats no more.
402, it sends public network and sends address;
In the present embodiment, public network terminal can send public network to private net terminal by the following mode and send address:
(1), public network terminal sends public network by the request of transfer of unidirectional code stream and sends address:
When public network terminal is needed to private net terminal transfer of unidirectional code stream, it is single that public network terminal can send transmission to private net terminal
It is requested to code stream, transfer of unidirectional code stream request can be realized by SIP signaling, specifically, transmission can be used in public network terminal
Extension bits in unidirectional code stream request carry public network and send address, and public network terminal can be requested by transfer of unidirectional code stream to send out
Public network is sent to send address.
(2), public network terminal active transmission includes the SIP signaling that public network sends address:
If public network terminal does not carry public network in the request of transfer of unidirectional code stream and sends address, then public network terminal can also make
Public network is carried with notice INFO message and sends address, and INFO message is actively sent to private net terminal.
It should be noted that the INFO message is one kind of SIP signaling, it is to be understood that other than INFO message,
Public network terminal can also use others SIP signaling to send public network to private net terminal and send address, and this is not limited here.
(3), public network terminal sends public network according to the request of private net terminal and sends address:
After public network terminal sends the request of transfer of unidirectional code stream to private net terminal, if not carried in transfer of unidirectional code stream request
Public network sends address, then the unidirectional code stream that private net terminal can wait public network terminal to send, if not receiving yet after preset duration
The unidirectional code stream sent to public network terminal, then private net terminal can send Address requests to public network terminal, which can be with
It is sent from private net terminal by SIP signaling to public network terminal, public network terminal, can be for example, by after receiving the Address requests
The SIP such as INFO message signaling sends address to private net terminal feedback public network.
Example from above illustrates that public network terminal in the present embodiment sends the mode that public network sends address to private net terminal, can be with
Understand, in practical applications, public network terminal can send public network to private net terminal by other means and send address, specifically
Herein without limitation.
403, survival packet is received;
After public network terminal has sent public network transmission address to private net terminal, the public network can be passed through and send address reception private
Survival packet transmitted by network termination.
404, survival packet is abandoned;
Since the purpose that private net terminal sends survival packet is for the foundation in NAT device or to keep private net terminal and public network
The mapping relations of terminal, so can directly abandon this after public network terminal receives the survival packet by public network transmission address
Survival packet.
In order to make it easy to understand, below with a concrete application scene to data transmission method described in the above embodiments into
Row detailed description, referring to FIG. 5, specifically:
501, the foundation of SIP communication;
When needing to carry out SIP business between private net terminal and public network terminal, private net terminal can be established with public network terminal
SIP communication.
502, secondary flow request is sent;
If public network terminal needs to send secondary flow to private net terminal, public network terminal can be by SIP signaling to private net terminal
Secondary flow request is sent, the public network that public network terminal is carried in secondary flow request sends address ip3.
503, it receives and response secondary flow is requested;
Private net terminal receives the secondary flow request that public network terminal is sent.
Secondary flow in the present embodiment can be video flowing, for showing video to private net terminal, belong to point-to-point unidirectional
Code stream, only a side are sending secondary flow, and opposite end only receives secondary flow.
After private net terminal confirmation can receive the secondary flow, private net terminal is requested to the public network terminal response secondary flow.
504, it obtains public network and sends address;
Private net terminal is after receiving the secondary flow request of public network terminal transmission, secondary flow that private net terminal is sent in public network terminal
Ip3 is extracted in request.
It should be noted that being for carrying the public network of public network terminal during secondary flow is requested and send address in the present embodiment
It is illustrated, it is to be understood that in practical applications, private net terminal can also obtain public network by other means and send ground
Location, concrete mode is similar with mode described in aforementioned embodiment shown in Fig. 2, and details are not described herein again.
505, survival packet is sent;
Private net terminal is sent by NAT device to the ip3 of public network terminal after getting ip3 every during cycle
KeepAlive packet (src_ip1, dst_ip3);The time of the during cycle is less than the mistake of correspondence mappings relationship in NAT device
Imitate the time.Src_ip1 is the private net address of private net terminal and the reception address of code stream.
506, mapping relations are established;
NAT device is after receiving KeepAlive packet (src_ip1, dst_ip3), by KeepAlive packet (src_
Ip1, dst_ip3) it is converted to KeepAlive packet (src_ip2, dst_ip3), ip2 is ip1 in the address of public network transmissions,
It is NAT device according to ip1 using static mappings, dynamic mapping, what the mode of dynamic port mapping generated.
After ip1 is converted to ip2 by NAT device, the mapping relations (ip1, ip2, ip3) of ip1 and ip3 are established.
507, the survival packet after conversion is sent;
KeepAlive (src_ip2, dst_ip3) is sent to public network terminal according to ip3 by NAT device.
508, secondary flow is sent;
Public network terminal confirms in NAT device after receiving KeepAlive packet (src_ip2, dst_ip3) and has existed public affairs
Net sends the mapping relations between address and private net address, therefore can start to send secondary flow.
Since the purpose that private net terminal sends survival packet is for the foundation in NAT device or to keep private net address and public network
The mapping relations between address are sent, so public network terminal can be abandoned directly after receiving survival packet.
509, secondary flow is forwarded;
After NAT device receives the secondary flow (src_ip3, dst_ip2) of public network terminal transmission, mapping relations are inquired
The back mapping of secondary flow is (src_ip2, dst_ip1), is sent to private net terminal by (ip1, ip2, ip3).
In the present embodiment, mapping relations are preserved on NAT device, which can be (ip1, ip2, ip3), wherein
Ip1 is actually (private net address+port numbers), and ip3 is actually (public network terminal+port numbers), in practical applications, general next
Say that the code stream of each medium type can correspond to a port number, the port numbers that the code stream of different medium types uses are different,
Due to generally requiring to transmit a variety of different medium types between private net terminal and public network terminal, to Mr. Yu's private net terminal with
It may be preserved and for certain public network terminal, on NAT device and much organize different mapping relations, difference is only that port numbers not phase
Together, so that NAT device needs to carry out these mapping relations of storage and maintenance using a large amount of resource.
For the burden for mitigating NAT device, a kind of data transmission method is proposed in the present embodiment, referring specifically to Fig. 6, this hair
Another embodiment of data transmission method includes: in bright embodiment
601, SIP communication is established;
When needing transmission code stream data between public network terminal and private net terminal, public network terminal and private net terminal establish SIP
Communication, and pass through the control instruction of SIP signalling both sides.
602, negotiation communication port;
It is held consultation between private net terminal and public network terminal by SIP signaling, determines the first communication port and the second communication
Port.First communication port is the preset communication port of private net terminal after negotiating, which is public network after negotiating
The communication port of terminal preset.
Private net terminal and public network terminal have determined that both sides carry out the fixed communication port of bit stream afterwards through consultation, at it
In the bit stream carried out afterwards, the bit stream data of either any medium type all passes through first communication port and second
Communication port is received and dispatched.
603, private net terminal sends code stream;
When private net terminal needs to send code stream, pass through NAT device second to public network terminal using the first communication port
Communication port sends code stream.
The code stream includes at least one data packet, includes: attribute-bit, private net address, public network transmission in each data packet
Address, real-time transport protocol file header (RTP Head, Real-time Transport Protocol) and at least one matchmaker
Volume data.
The attribute-bit is for distinguishing different media datas, convenient for public network terminal respectively to different types of media data
It is handled.
604, private net terminal sends code stream again;
When private net terminal needs to send code stream to the public network terminal again, the code stream number of either any medium type
According to all continuing to use the first communication port and sent by NAT device to the second communication port of public network terminal.
In the present embodiment, when the same private net terminal sends code stream to the same public network terminal by NAT device, no matter
It is the bit stream data of any medium type, it is all unified to be received and dispatched using a preset communication port, since mapping relations are
Send what address was established according to communication port, private net address and public network, so the private net terminal and public network terminal in NAT device
A kind of mapping relations only need to be established, save the link circuit resource on NAT device.
It is above-mentioned to be illustrated from the angle of private net terminal, it is illustrated below from the angle of public network terminal, please refers to figure
7, another embodiment of data transmission method includes: in the embodiment of the present invention
701~703, the content of the step 701 to 703 in the present embodiment and step 601 in aforementioned embodiment shown in fig. 6
Content to 603 is identical, and details are not described herein again.
704, public network terminal receives code stream;
Public network terminal receives private net terminal transmitted stream by NAT device, from the second communication port;And according to the code stream
Data packet in include attribute-bit distinguish different media datas, media data different in code stream is located accordingly
Reason;
705, public network terminal sends code stream;
When public network terminal needs to send code stream to the private net terminal, no matter what the medium type of this code stream is, nothing
By, either with or without being transmitted across, public network terminal can use the second communication port whole to private network by NAT device before this code stream
First communication port at end is sent.
In the present embodiment, when public network terminal needs to send code stream to private net terminal, as long as in NAT device before
The mapping relations of private net terminal and public network terminal are preserved, no matter what the medium type of code stream is, either unidirectional code stream is also
It is two-way code stream, the mapping relations before may be by carry out the transmission of code stream.
In order to make it easy to understand, below with a concrete application scene to data transmission method described in the above embodiments into
Row detailed description, specifically:
One, negotiation communication port;
Private net terminal and public network terminal determine the first communication port and the after establishing SIP communication, through SIP signaling negotiation
Two communication port, first communication port are the preset communication port of private net terminal after negotiating, which is to negotiate
The preset communication port of public network terminal afterwards.
Two, private net terminal sends code stream by the first communication port;
Private net terminal passes through NAT device first and sends address and preset communication port to the corresponding public network of public network terminal
Ip3+port3 sends code stream.Assuming that the private net address of private net terminal and its preset communication port are ip1+port1, passing through
When NAT device, ip1+port1 is converted into the network address ip2+port2 of public network transmissions, and establishes fixed mapping and close
It is (ip1+port1, ip2+port2, ip3+port3), ip1+port1 and ip2+port2 is one-to-one.NAT device is again
Code stream is sent to public network terminal according to mapping relations, and public network terminal is then received by preset communication port.
Three, both sides are multiplexed preset communication port and transmit;
When private net terminal need again to the public network terminal send code stream when, no matter again transmitted stream type whether with
Transmitted stream type is identical for the first time, all unified to be sent using ip1+port1 to ip3+port3, can when by NAT device
With multiplexing mapping relationship (ip1+port1, ip2+port2, ip3+port3).
When public network terminal needs to send code stream to the private net terminal, it is assumed that the medium type of the code stream is secondary flow, and private
Network termination is never transmitted across secondary flow to public network terminal, but as long as above-mentioned mapping relations (ip1+port1, ip2+port2, ip3+
Port3 it) does not fail, public network terminal can use ip3+port3 to send to ip2+port2, due to ip1+port1 and ip2+
Port2 is that correspondingly, public network terminal utilizes (ip1+port1, ip2+port2, ip3+port3) energy in NAT device
For back mapping to ip1+port1, secondary flow data can Successful transmissions.
Four, attribute-bit is added;
The same communication port is all multiplexed when the transmitting-receiving of all media data types, when no matter which side sends code stream, all
It needs to add attribute-bit for the data packet in code stream.The attribute-bit can be negotiated to obtain (e.g., sound in SIP communication process
Frequency can be " 001 ", and video can be " 002 "), it can also be the data code of other forms, this is not limited here.
After recipient receives code stream, the attribute-bit can be first parsed, distinguishes video, audio, secondary flow, distal end camera shooting
Machine controls the different types of media datas such as data, then carries out corresponding media handling.
The embodiment of the private net terminal of the present invention for executing above-mentioned data transmission method is illustrated below, logic
Structure is referring to FIG. 8, one embodiment of private net terminal includes: in the embodiment of the present invention
Acquiring unit 801 is sent for after SIP connection setup between this terminal and public network terminal, obtaining public network
Address, it is the address that public network terminal sends code stream to this terminal which, which sends address,;
First transmission unit 802, for, by NAT device, sending address every during cycle to public network and sending survival packet,
So that NAT device establishes or keeps the private net address of this terminal and public network to send the mapping relations between address, the during cycle
Less than the out-of-service time of correspondence mappings relationship in NAT device.
Private net terminal in the embodiment of the present invention can further include:
First receiving unit 803 for receiving the transfer of unidirectional code stream request of public network terminal transmission, and triggers acquiring unit
801 send address from transfer of unidirectional code stream request public network.
Transfer of unidirectional code stream request can be what public network terminal was sent by SIP signaling, transfer of unidirectional code stream request
Extension bits can carry public network send address.
Or, the private net terminal in the embodiment of the present invention can further include:
Second receiving unit 804, for receiving the SIP signaling for sending address containing public network of public network terminal active transmission,
And it triggers acquiring unit 801 and obtains public network transmission address from the SIP signaling.
Or, the private net terminal in the embodiment of the present invention can further include:
Third receiving unit 805, for receiving the transfer of unidirectional code stream request of public network terminal transmission, the transfer of unidirectional code stream
Request can be what public network terminal was sent by SIP signaling;
Second transmission unit 806, for when receive public network terminal transmission transfer of unidirectional code stream request, by it is preset when
After length, if do not receive the unidirectional code stream of public network terminal transmission, Address requests, the ground are sent to public network terminal by SIP signaling
Location request sends address for requesting public network terminal to return to public network;
4th receiving unit 807 sends address containing public network according to what the Address requests were sent for receiving public network terminal
SIP signaling, and trigger acquiring unit 801 obtained from the SIP signaling public network send address.
For ease of understanding, specific with each unit of a concrete application scene to private net terminal in the embodiment of the present invention below
Interactive process be described:
The first receiving unit 803 after SIP connection setup between private net terminal and public network terminal, in private net terminal
The transfer of unidirectional code stream request that public network terminal is sent is received, and triggers acquiring unit 801 and is obtained from transfer of unidirectional code stream request
Public network is taken to send address.
If the request of transfer of unidirectional code stream does not carry public network and sends address, the second receiving unit 804 in private net terminal can
To receive the SIP signaling containing public network transmission address of public network terminal transmission, and acquiring unit 801 is triggered from the SIP signaling
It obtains public network and sends address.
Private net terminal obtain public network send address can also be by third receiving unit 805, the second transmission unit 806 and the
Four receiving units 807 are realized: third receiving unit 805 receives the transfer of unidirectional code stream request that public network terminal is sent, the transmission list
Address is sent without carrying public network into code stream request;After preset time period, if not receiving the unidirectional code of public network terminal transmission
Stream, then the second transmission unit 806 of private net terminal can send Address requests to public network terminal, and the Address requests are for requesting public affairs
Network termination returns to public network and sends address;When public network terminal, which returns to public network using INFO message, sends address, the of private net terminal
Four receiving units 807 receive the public network that contains that public network is sent and send address SIP signaling, and trigger acquiring unit 801 and believe from the SIP
Public network is obtained in order sends address.
After obtaining public network and sending address, the first transmission unit 802 passes through NAT device to public network terminal every during cycle
Public network send address and send survival packet so that NAT device is established or private net address and public network is kept to send reflecting between address
Relationship is penetrated, which is less than the out-of-service time of correspondence mappings relationship in NAT device.
The embodiment of the public network terminal of the present invention for executing above-mentioned data transmission method is illustrated below, logic
Structure is referring to FIG. 9, one embodiment of public network terminal includes: in the embodiment of the present invention
Address transmission unit 901, for after SIP connection setup between private net terminal and this terminal, to private network end
End sends public network and sends address;
Processing unit 902 is received, receives the survival packet that private net terminal is sent for sending address by public network, and abandon and connect
The survival packet received.
Address transmission unit 901 in the embodiment of the present invention may further include:
First request sending module 9011, for sending the request of transfer of unidirectional code stream to private net terminal by SIP signaling,
Public network, which is carried, in transfer of unidirectional code stream request sends address.
Or, the address transmission unit 901 in the embodiment of the present invention may further include:
First address sending module 9012 sends the SIP signaling that address is sent containing public network for active to private net terminal.
Or, the address transmission unit 901 in the embodiment of the present invention may further include:
Second request sending module 9013, for sending the request of transfer of unidirectional code stream to private net terminal by SIP signaling;
Request receiving module 9014, for receiving the Address requests of private net terminal transmission;
Second address sending module 9015 sends address containing public network for sending according to the Address requests to private net terminal
SIP signaling.
The specific interactive process of each unit of public network terminal is as follows in the embodiment of the present invention:
After SIP connection setup between private net terminal and public network terminal, the first request sending module of public network terminal
9011, which can send the transfer of unidirectional code stream for sending address comprising public network to private net terminal by SIP signaling, requests;
Or, 9012 active of the first address sending module of public network terminal is sent to private net terminal sends address containing public network
SIP signaling;
Or, the second request sending module 9013 sends the transfer of unidirectional code stream for not carrying public network and sending address to private net terminal
After request, the request receiving module 9014 of public network terminal receives the Address requests that private net terminal is sent, the second ground of public network terminal
Location sending module 9015 sends the SIP signaling that address is sent containing public network according to the Address requests to private net terminal.
It receives processing unit 902 and gets public network transmission address in private net terminal, and address is sent to public network by public network
After terminal sends survival packet, the survival packet that private net terminal is sent is received by NAT device.Since private net terminal sends survival packet
Purpose is the mapping relations in order to which private net terminal and public network terminal are established or kept in NAT device, so receiving processing unit
902 receive after survival is wrapped and can directly abandon.
The embodiment of the data transmission system of the present invention for executing above-mentioned data transmission method is illustrated below,
Logical construction is referring to FIG. 10, one embodiment of data transmission system includes: in the embodiment of the present invention
Private net terminal 1001 sends ground for after SIP connection setup between public network terminal 1003, obtaining public network
Location, it is the address that public network terminal 1003 sends code stream to this terminal that public network, which sends address, every during cycle, sends ground to public network
Location sends survival packet, so that NAT device 1002 establishes or keep the private net address of this terminal and public network to send ground according to survival packet
Mapping relations between location, during cycle are less than the out-of-service time of mapping relations;
NAT device 1002 connects for converting to the network address between private net terminal 1001 and public network terminal 1003
The survival packet that private net terminal 1001 is sent is received, establishes or keep the private net address of private net terminal 1001 and public network to send out according to survival packet
Send the mapping relations between address;
Public network terminal 1003, for after SIP connection setup between this terminal and private net terminal 1001, to private network end
End 1001 sends public network and sends address, sends address by public network and receives the survival packet that private net terminal 1001 is sent, and abandons and connect
The survival packet received.
Above system is applied to application scenarios described in embodiment as shown in Figure 5.
Another embodiment of the data transmission system of the present invention for executing above-mentioned data transmission method is carried out below
Illustrate, logical construction is same referring to FIG. 10, another embodiment of data transmission system includes: in the embodiment of the present invention
Private net terminal 1001, for after SIP connection setup between this terminal and public network terminal 1003, with public network end
End 1003 determines that the first communication port and the second communication port, the first communication port are the preset communication ends of this terminal after negotiating
Mouthful, the second communication port is the communication port that public network terminal 1003 is preset after negotiating, when needs are sent respectively to public network terminal 1003
When the code stream of kind medium type, the first communication port of multiplexing sends code stream to the second communication port of public network terminal 1003;
NAT device 1002, for being converted to the network address between private net terminal 1001 and public network terminal 1003;
Public network terminal 1003, for after SIP connection setup between this terminal and private net terminal 1001, with private network end
End 1001 determines the first communication port and the second communication port, when the code for needing to send various medium types to private net terminal 1001
When stream, the second communication port of multiplexing sends code stream to the first communication port of private net terminal 1001.
Above system is applied to the application scenarios as described in Fig. 6 or 7 embodiments.
Those of ordinary skill in the art will appreciate that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, which can store in a kind of computer readable storage medium, above-mentioned to mention
To storage medium can be read-only memory, disk or CD etc..
A kind of data transmission method provided by the present invention, relevant apparatus and its system are described in detail above,
For those of ordinary skill in the art, thought according to an embodiment of the present invention, in specific embodiments and applications
It will change, therefore, the contents of this specification are not to be construed as limiting the invention.