WO2014190487A1 - Session connection establishment method, apparatus and system - Google Patents

Session connection establishment method, apparatus and system Download PDF

Info

Publication number
WO2014190487A1
WO2014190487A1 PCT/CN2013/076331 CN2013076331W WO2014190487A1 WO 2014190487 A1 WO2014190487 A1 WO 2014190487A1 CN 2013076331 W CN2013076331 W CN 2013076331W WO 2014190487 A1 WO2014190487 A1 WO 2014190487A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
session
network management
ice
response
Prior art date
Application number
PCT/CN2013/076331
Other languages
French (fr)
Chinese (zh)
Inventor
李世涛
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201380000701.9A priority Critical patent/CN104521211B/en
Priority to PCT/CN2013/076331 priority patent/WO2014190487A1/en
Publication of WO2014190487A1 publication Critical patent/WO2014190487A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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/2575NAT traversal using address mapping retrieval, e.g. simple traversal of user datagram protocol through session traversal utilities for NAT [STUN]
    • 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/2589NAT traversal over a relay server, e.g. traversal using relay for network address translation [TURN]
    • 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/2514Translation of Internet protocol [IP] addresses between local and global IP addresses

Definitions

  • the present invention relates to the field of computers and communications, and in particular, to a method, an apparatus and a system for establishing a session connection.
  • Interactive connectivity establishment is a combination of Network Address Translator (NAT) Session Transfer Application (SUN) and Relay-based NAT (Traversal Using Relay) NAT, TURN)
  • NAT Network Address Translator
  • SUN Session Transfer Application
  • Relay-based NAT Traversal Using Relay
  • NAT Network Address Translator
  • TURN Traversal Using Relay
  • the ICE can make up for the inherent defects of the two technologies in their respective implementations during the NAT traversal process.
  • the ICE can be utilized by any request/question mode protocol, for example:
  • the Session Description Protocol (SDP) is used to define and implement related functions.
  • SDP Session Description Protocol
  • a session connection negotiated through the ICE framework completes a network switch during a session, for example, the session initiation terminal in establishing a session connection switches from the wifi network to the 3G network; at this time, the network environment of the session initiation terminal changes. For example, the NAT device in the session connection network through which the session initiation terminal signal passes changes.
  • the existing method for restoring the session connection is that the two parties' session terminals re-negotiate the ICE.
  • the negotiation of the ICE includes the steps of candidate address collection, candidate address interaction, and connection test, and the candidate address interaction includes the acquisition of the candidate address of the other party's session terminal. And the process in which the two session terminals match the candidate addresses to generate candidate address pairs.
  • the prior art proposes an improved method of using network management, which speeds up the ICE renegotiation process by omitting the address interaction and shortening the preparation process before the connection test (the ICE renegotiation process is the session link re-re- Establishment process).
  • the above network management methods include two types: One network management mode is an ICE common network management mode, which mainly requires that both terminals of the session establishment support the ICE common network management mode (or both terminals described as establishing a session have ICE common network management capability), and is applied when a certain terminal of the session is to be switched over the network; another network management mode is an ICE relay network management mode, which is mainly a session terminal that requires network switching ( The session initiating terminal or the session responding terminal) and the STUN/TUR server in the network where the session terminal is located have the ICE relay network management capability, and are applied when the session terminal is to perform network switching.
  • ICE common network management mode which mainly requires that both terminals of the session establishment support the ICE common network management mode (or both terminals described as establishing a session have ICE common network management capability), and is applied when a certain terminal of the session is to be switched over the network
  • another network management mode is an ICE relay network management mode, which is mainly a session terminal that requires network switching ( The session initiating
  • ICE common network management mode Both session terminals that require communication support ICE common network management.
  • the ICE common network management mode is used for fast handover.
  • the main principle of ICE common network management is as follows: In FIG. 1 , user terminal A (session initiation terminal) sends a connection test request to user terminal B (session response terminal) in S110, and adds MOBILITY-SUPPORT parameter in the connection test request. The parameter is used to negotiate the support of the ICE common network management. If the user terminal B supports ICE common network management, the MOBILITY-SUPPORT parameter is also added to the connection test response, so that both parties can know each other's ICE common network. Management support.
  • the communication is started after the final connection address is selected.
  • a party switches over the network during communication, for example: User terminal A has network switching.
  • user terminal A needs to collect the allocated new candidate address after network switching, and uses the collected new candidate address to the user terminal.
  • the candidate address of B sends a new connection test request, and user terminal A adds a field named MOBILITY-EVENT in the new connection test request, and user terminal B receives the new connection test request carrying the MOBILITY-EVENT field.
  • MOBILITY-EVENT field it is determined that the user terminal A has a network handover, and the ICE common network management mode is being used to attempt to re-negotiate the ICE.
  • the user terminal B clears the matching information left by the matching candidate address pair.
  • the connection test is performed according to the candidate address of the user terminal A carried in the new connection test, and the session is established after the connection test is successful, thereby avoiding the re-collection of the candidate address by the user terminal B.
  • the ICE relay network management method does not require communication between the session initiation terminal and the session response terminal to support the ICE relay network management. In this mode, only the session terminal (session initiation terminal or session response terminal) having the network handover requirement and the session terminal are required.
  • the STUN/TUR server in the network can support ICE relay network management.
  • the main principle of the ICE relay network management is as follows: In the candidate address collecting process S101-S104, the user terminal A (session initiating terminal) adds a value to the initial request for sending the collecting candidate address to the STUN/TUR server in the candidate address collecting process S101-S104.
  • the STUN/TUR server In the empty MOBILITY-TICKET field, the STUN/TUR server also returns a MOBILITY-TICKET field to the user terminal A while assigning a relay address to the user terminal A, and assigns a value to the MOBILITY-TICKET field. It is assumed that the session established by the user terminal A and the user terminal B uses the relay address. When the user terminal A has a network switch during the session, the user terminal A can initiate a new candidate address collection to the STUN/TUR server. The request, the new candidate address collection request carries the MOBILITY-TICKET field with the assigned value, and the STUN/TUR server determines, according to the value in the MOBILITY-TICKET field, that the user terminal is still after the network switching occurs on the user terminal A.
  • the relay address of the user terminal A does not change before and after the network switching occurs in the user terminal A, and the data medium from the user terminal B can still establish a session connection with the user terminal A after the network switching occurs through the relay address. Thereby causing the user terminal A that has undergone network switching to resume the session with the user terminal B
  • the core processes of implementing the ICE framework include: four processes of self-candidate address collection, peer candidate address acquisition, candidate address pairing, and connection testing.
  • a flow of session establishment based on an ICE framework in the prior art is shown in FIG. 1 It includes the application of ICE common network management and ICE relay network management; it may be assumed that user terminal A (session initiation terminal) supports both ICE common network management mode and ICE relay network management mode, but user terminal B (session response terminal) ICE common network management is not supported.
  • User terminal A requires the selection of an address that can satisfy the network management in ICE negotiation.
  • the communication process is as follows:
  • User terminal A sends an initial request for collecting its own candidate address to the STUN/TUR server in its network.
  • This initial request is also referred to as a Binding request in the STU protocol.
  • the user terminal A adds a field named MOBILITY-TICKET to the initial request, and the field indicates that the user terminal A supports the ICE relay network management. At this time, the value of the MOBILITY-TICKET field added by the user terminal A is null.
  • the sending address of the initial request is the address of the host where the user terminal A is located and the assigned port number, and the destination address is the address of the STUN/TURN server.
  • the initial request is forwarded to the STUN/TUR server through the NAT device.
  • the sending address of the initial request is replaced with the server mapping address of the current NAT device when being forwarded by the NAT device, and the server mapping address is assigned by the NAT device to the user terminal A (the server mapping address is also referred to as a NAT address) And forwarded to the STUN/TUR server.
  • the STUN/TURN server replies to the user terminal A with an initial response, where the NAT address and the relay address assigned by the STUN/TUR server to the user terminal A are carried. Due to the initial request received
  • the MOBILITY-TICKET field if the STUN/TUR server also supports ICE trunk network management, also carries a MOBILITY-TICKET field in the initial response and assigns a value to the MOBILITY-TICKET field.
  • the initial response is forwarded by the NAT device and then reaches the user terminal A.
  • the user terminal A collects the candidate address and saves it.
  • the candidate address includes the host address (also referred to as a private address) of the user terminal A itself and the NAT address and the relay address in the initial response, and the user terminal A also needs to save the server for its allocation.
  • the user terminal A sends a call request to the user terminal B, where the call request carries all of its own candidate addresses collected by the user terminal A.
  • the call request is forwarded to the user terminal B by using the NAT device.
  • the user terminal B After receiving the call request, the user terminal B performs collection of its own candidate address, and the process of collecting the candidate address is similar to that of the user terminal A.
  • User terminal B sends a call response to user terminal A.
  • the user terminal B carries all the collected candidate addresses in the call response and sends them to the user terminal A.
  • the call response is forwarded to the user terminal A through the NAT device; S110.
  • the user terminal A performs a connection test after receiving the call response of the user terminal B. Before performing the connection test, the user terminal A performs matching of the candidate addresses according to the priorities of the candidate addresses themselves, and generates candidate address pairs including different priorities.
  • the user terminal A needs to send a connection test request to the user terminal B one by one according to the priority, and carries the MOBILITY-SUPPORT field in the connection test request, which is used to negotiate the ICE of the user terminal A and the user terminal B. Network management.
  • connection test request is forwarded by the NAT device (the connection test request for the relay address also needs to be forwarded by the STUN/TUR server).
  • the connection test request of some candidate address pairs may be forwarded to the user terminal B, and the connection test request of some candidate address pairs may not be forwarded to the user terminal B;
  • the user terminal B replies with a connectivity test response to the candidate address of the user terminal A. If the user terminal B also supports the ICE common network management mode, the user terminal B The MOBILITY-SUPPORT field after the assignment is carried in the connectivity test response; in this example, since the user terminal B does not support the ICE general network management, the MOBILITY-SUPPORT field in the connection test response is not assigned;
  • the link test response is forwarded to the user terminal A through the NAT device (for the relay address also needs to be forwarded by the STUN/TURN server);
  • Step S110-S113 generating a candidate address pair with priority according to the priority of the private address, the NAT address, and the relay address from the highest to the bottom, and sequentially performing the connection test of the candidate address pair;
  • address ll (host) is the private address of user terminal A
  • address 12 (reflx) is the NAT address of user terminal A
  • address 13 (relay) is the relay address of the user terminal.
  • the prior art includes a scheme of using ICE relay network management and ICE common network management, but in the prior art, the connection test is cumbersome and the resource loss is large.
  • the present invention provides a method, an apparatus, and a system for establishing a session connection.
  • the efficiency of the connection test is improved by improving the matching process of the candidate address pair in the prior art.
  • a first aspect of the present invention provides a method for establishing a session connection, including:
  • the session initiation terminal sends a collection request to the STUN/TUR server in the network, where the collection request includes: indicating support address collection of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management. Information collected;
  • the collecting response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TUR server to the ICE relay network management;
  • the session initiating terminal sends a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
  • the session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server to the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal;
  • the session initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test. .
  • the method before the session initiating terminal sends the call request to the session response terminal, the method further includes:
  • the session initiating terminal determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal;
  • the call request is carried in the call request after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management.
  • the at least one candidate address of the candidate address of the session initiation terminal is specifically: the session initiation terminal only carries the relay candidate address of the session initiation terminal in the call request;
  • the call request carries at least one candidate address in the candidate address of the collected session initiating terminal, specifically: the session initiating terminal is in the call.
  • the request carries all candidate addresses of the session initiation terminal and support information of the session initiation terminal to the ICE common network management.
  • One or more candidate addresses of the terminal further including:
  • the call response further includes support information of the session response terminal to the ICE common network management; and the session initiation terminal matches the collected information of the STUN/TURN server to the ICE relay network management. And the candidate address and the candidate address of the session response terminal, and generating one or more sets of candidate address pairs, specifically: The session initiation terminal according to the collected support information of the STUN/TUR server to the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the session response terminal to the ICE common network management Supporting information, matching the candidate address collected by itself and the candidate address of the session response terminal, and generating one or more sets of candidate address pairs with priority.
  • the session initiation terminal according to the collected support information of the STUN/TURN server to the ICE relay network management,
  • the support information of the session initiation terminal to the ICE common network management and the support information of the session response terminal to the ICE common network management match the candidate address collected by the session and the candidate address of the session response terminal to generate a priority group.
  • multiple sets of candidate address pairs specifically:
  • the session initiating terminal determines whether both the self and the session response terminal support the ICE common network management; when the judgment result is that both parties support the ICE common network management, the priority attribute of the candidate addresses of the two parties is matched to the priority one. Group or groups of candidate address pairs; when the judgment result is that both parties do not satisfy the ICE common network management condition, and confirm that the session initiation terminal and the STUN/TURN server support ICE relay network management, the session is The relay address of the originating terminal and the candidate address of the session responding terminal are matched into one or more sets of candidate address pairs having priority according to the priority attribute of the candidate address.
  • the session initiation terminal sends a collection request and/or a session to a STUN/TUR server in a network.
  • the sending terminal sends a call request to the session responding terminal and/or matches its own candidate address and the candidate address of the session responding terminal, which is performed after the session initiating terminal confirms that it has a network switching requirement.
  • a second aspect of the present invention provides a method for establishing a session connection, including:
  • the session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal;
  • the session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management according to the call request;
  • the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
  • the session response terminal matches a candidate address carried in the call response and a candidate address of the session initiation terminal, and generates one or more sets of candidate address pairs;
  • the session response terminal sends a connection test to the session initiation terminal according to the one or more sets of candidate address pairs. Requesting, and after successfully completing the connection test, establishing a session connection between the session initiation terminal and the session response terminal.
  • the call request receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, and the session response terminal matches the The candidate address carried in the call response and the candidate address of the session initiation terminal generate one or more sets of candidate address pairs, including:
  • the session response terminal determines, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, and the support information of the ICE common network management of the session response terminal itself, determining both the session initiation terminal and the session response terminal. Whether it supports ICE common network management;
  • the session response terminal matches the candidate address carried in the call response and the session initiation.
  • the relay candidate address in the candidate address of the terminal generates one or more sets of candidate address pairs with priority.
  • the session response terminal collects its own candidate address according to the call request, and collects the session response terminal In the network
  • the STUN/TUR server supports the information of the ICE relay network management, and the session response terminal sends the call response to the session initiation terminal, where the call response carries the candidate address and the session response collected by the session response terminal.
  • Terminal support information for ICE common network management including:
  • the session response terminal determines whether the session initiation terminal and the session response terminal both support ICE common network management
  • the session response terminal When the result of the determination is that the two are not satisfied, the ICE common network management is supported, and when the session response terminal side is confirmed to support the ICE relay network management, the session response terminal sends a call response to the session initiation terminal, where The call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
  • the session response terminal collects its own candidate address and/or the session according to the call request. Responding to the terminal sending a call response to the session initiating terminal and/or the session responding terminal matching the candidate address carried in the call response and the candidate address of the session initiating terminal, the session initiating terminal confirming that there is a network switching requirement Only afterwards.
  • a third aspect of the present invention provides a session initiation terminal for establishing a session connection, including:
  • a candidate address collection sending module configured to send a STUN/TUR server in a network where the terminal is located to the session Sending a collection request, the collection request includes: information indicating collection of candidate addresses of the session initiation terminal and collection of support information of the STUN/TUR server to the ICE relay network management;
  • a candidate address collection and receiving module configured to receive a collection response sent by the STUN/TUR server for the collection request, where the collection response carries one or more candidate addresses of the session initiation terminal and the STUN/TUR server pair Support information for ICE relay network management;
  • a call request sending module configured to send a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
  • a call response receiving module configured to receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
  • a candidate address matching module configured to: according to the collected support information of the STUN/TURN server to the ICE relay network management, match the candidate address of the UE and the candidate address of the session response terminal, and generate one or more candidate addresses. Correct;
  • connection test module configured to send a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establish a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties .
  • the session initiation terminal further includes:
  • a network management judging module configured to determine, according to the support information of the ICE common network management, whether the session initiating terminal supports the ICE common network management, where the support information of the ICE common network management is stored in the session initiating terminal;
  • the call request sending module sends a call request carrying only the relay candidate address to the session response terminal.
  • the session initiating terminal side supporting the ICE relay network management includes: the STUN/TURN server in the network where the session initiating terminal and the session initiating terminal are located support the ICE relay network management;
  • the call request sending module sends a call request to the session response terminal, where the call request carries all candidate addresses of the session initiation terminal and the The session initiation terminal supports the ICE common network management.
  • the call response receiving module receives the call response
  • the session response terminal further includes an ICE common
  • the candidate address matching module is specifically configured to: According to the collected support information of the STUN/TURN server for the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, match the self.
  • the collected candidate address and the candidate address of the session response terminal generate one or more sets of candidate address pairs with priority.
  • the candidate address matching module further includes:
  • a first determining sub-module configured to determine whether the session initiation terminal and the session response terminal are satisfied to support ICE common network management
  • a first matching submodule configured to: when the judgment result of the first determining submodule is that both parties support the ICE common network management, generate one or more groups with priority according to the priority attribute matching of the candidate addresses of the two parties Candidate address pair
  • a second matching submodule configured to confirm that the session initiation terminal and the STUN/TURN server support the ICE relay network when the judgment result of the first determining submodule is that both parties do not satisfy the ICE common network management
  • the management matches the relay address of the session initiation terminal and the candidate address of the session response terminal according to the priority attribute of the candidate address to generate one or more sets of candidate address pairs with priority.
  • the session initiation terminal further includes a handover requirement determination module
  • the candidate address collection and transmission module sends a collection request to the STUN/TUR server in the network; and/or,
  • the call request sending module sends a call request to the session responding terminal; and/or,
  • the candidate address matching module matches its own candidate address and the candidate address of the session response terminal; all of which are performed after the handover requirement determination module confirms that it has a network switching requirement.
  • a fourth aspect of the present invention provides a session response terminal established by a session connection, including:
  • a call request receiving module configured to receive a call request of the session initiating terminal, where the call request carries one or more candidate addresses of the session initiating terminal;
  • a candidate address collection module configured to collect a candidate address of the session response terminal according to the call request
  • a call response sending module configured to send a call response to the session initiation terminal, where the call response carries the candidate address collection module Collecting candidate addresses of the session response terminal and support information of the session response terminal to the ICE common network management
  • a candidate address matching module configured to match a candidate address carried in the call response and a candidate address of the session initiating terminal, to generate one or more sets of candidate address pairs;
  • connection test module configured to send a connection test request to the session initiation terminal according to the one or more sets of candidate address pairs, and establish the session initiation terminal and the session response terminal after successfully completing the two-party connection test Session connection.
  • the call request of the receiving session initiating terminal further includes the information that the session initiating terminal supports the ICE common network management
  • the candidate address matching module further includes: a first determining sub-module, configured to determine, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, whether the session initiation terminal and the session response terminal support the ICE common network Management
  • a first matching submodule configured to: when the first determining submodule determines that both do not support ICE common network management, when the session initiating terminal side supports the ICE relay network management, the session responding terminal Matching the candidate address carried in the call response and the relay candidate address of the session initiating terminal to generate one or more sets of candidate address pairs having priority.
  • the candidate address collecting module collects the candidate address according to the call request, and collects the session response.
  • the call response sending module of the STUN/TUR server in the network where the terminal is located, and the call response sending module further includes:
  • a second determining sub-module configured to determine whether the session initiation terminal and the session response terminal support ICE common network management
  • the call response sending module is further configured to: when the judgment result of the second determining submodule is that both do not support the ICE common network management, and confirm that the session response terminal side supports the ICE relay network management, The call response sending module sends a call response to the session initiating terminal, where the call response carries the relay address collected by the candidate address collecting module and the support information of the session response terminal to the ICE common network management.
  • the session response terminal further includes a handover requirement determination module
  • the candidate address collection module collects the candidate address of the session response terminal according to the call request; and/or, the call response sending module sends a call response to the session initiation terminal; and/or
  • the candidate address matching module matches the candidate address carried in the call response and the candidate of the session initiation terminal The address; is entered after the handover requirement judgment module confirms that it has network switching requirements.
  • the present invention combines the support information of the network management corresponding to the candidate address of the session initiation terminal to generate a candidate address pair, so that the connection test can be performed more efficiently, and the session connection between the session initiation terminal and the session response terminal is completed.
  • FIG. 1 is a flow chart of a process based on an ICE framework session established in the prior art provided by the present invention
  • FIG. 2A is a schematic diagram of a connection test of a candidate address on a session initiation terminal side in the prior art provided by the present invention
  • FIG. 2B is a schematic diagram of a connection test of a candidate address on a session initiation terminal side in an embodiment provided by the present invention
  • a schematic diagram of a system structure of an ICE framework provided by the present invention
  • FIG. 4 is a schematic flowchart of a method for establishing a session connection on a session initiating terminal side provided by the present invention
  • FIG. 5 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention
  • FIG. 6 is a schematic flowchart diagram of a method for establishing a session connection on a session response terminal side provided by the present invention
  • FIG. 7 is a schematic flowchart of a method for collecting a candidate address of an improved session response terminal provided by the present invention
  • FIG. 8 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention
  • FIG. 9 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention.
  • FIG. 10 is a schematic diagram of functions of fields of a session attribute row for carrying a candidate address in the SDP protocol provided by the present invention
  • FIG. 11 is an improved session attribute line capable of carrying support information of a candidate address for network management provided by the present invention. Functional diagram of each field;
  • FIG. 12 is a signaling diagram of the present invention for applying the session connection establishment method of the present invention to a browser.
  • FIG. 13 is a schematic structural diagram of a session initiating terminal applicable to the embodiments of the present invention
  • FIG. 14 is a schematic structural diagram of a session initiating terminal applicable to the embodiments of the present invention
  • FIG. 15 is a schematic structural diagram of a session response terminal applicable to the embodiments of the present invention
  • FIG. 16 is a schematic structural diagram of a session response terminal applicable to the embodiments of the present invention
  • FIG. 17 is a schematic structural diagram of a smart phone terminal for establishing a session connection according to the present invention.
  • the term "and/or,” is merely an association relationship describing an associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and A and B exist at the same time.
  • the character "/" in the present text generally indicates that the contextual object is an "or" relationship.
  • the network management in the present invention includes network switching.
  • the present invention collectively refers to a private address and a NAT address. It is a non-relay address and is used to distinguish it from the relay address.
  • connection test request required to support the ICE common network management in the present invention also carries the MOBILITY-SUPPORT field in the connection test request as described in S110-S113 mentioned in the background, due to the ICE common network management method and the ICE.
  • the network management method is prior art. Therefore, the following embodiments do not specifically describe the content related to the specific ICE common network management and ICE relay network management, but through a general description such as "using the ICE common network. Management" mode representation.
  • ICE common network management ICE common network management
  • the method in this embodiment may be implemented by installing the native App on the terminal, or may be implemented as part of the system module in the terminal, or may be implemented in the terminal in the form of a control or a script; therefore, the method of the present invention is When implemented in the terminal, the terminal itself may not have the ICE common network management and/or ICE relay network management.
  • the ICE framework-based system embodiment provided by the present invention, the subsequent method embodiments of the present invention can all run on the system, and the structure of the system is shown in FIG. 3 .
  • the user equipment A (session initiation terminal), the NAT device (NAT A) on the network side (also referred to as the user terminal A side) where the user terminal A is located, the NAT device (NAT B) on the user terminal B side, and the user terminal B (session response terminal) and STUN/TUR server.
  • NAT_A and NAT_B are optional in various embodiments of the present invention, and NAT on the user terminal A side and/or the user terminal B side
  • the number of devices is also not limited, and is not limited to one NAT_A and/or one NAT_B as shown in FIG.
  • the NAT device may be: a GGSN, a wireless router, or a general gateway, etc., depending on the specific application environment.
  • the STUN/TUR server may be used in combination with the user terminal A and the user terminal B as shown in FIG. 3; optionally, the user terminal B and the user terminal A own the STUN/TUR server on the respective terminal side; in the present invention Take only one STUN/TUR server shared by user terminal A and user terminal B as an example.
  • Those skilled in the art can easily derive the STUN/TUR server case on the respective terminal side of the above-mentioned user terminal A and user terminal B according to the enumerated embodiment.
  • the STUN/TUR server is not limited to a single device entity, and itself may be implemented in an existing server, or even integrated on the terminals of the user terminal A and/or the user terminal B.
  • the terminal entity of the user terminal A and the user terminal B in the present invention may be a mobile phone, a personal computer, a tablet computer, an e-book or other smart device.
  • the protocol used in the system is not limited to the STU protocol, the SDP protocol, and the SIP protocol mentioned in the present invention, and may be other protocols or specifications having a request/question mode similar to the processes and processing modes of the embodiments of the present invention. .
  • the STUN/TUR server obtains the NAT in the process of the user terminal A communicating with the STUN/TUR server on the network side where the user terminal A is located.
  • the server maps the address (also known as the NAT address) assigned to user terminal A. If a plurality of NAT devices are deployed on the user terminal A side, the NAT address assigned to the user terminal A is a NAT device directly connected to the STUN/TURN server on the user terminal A side (ie, the user terminal A side is last with the STUN/ The NAT device that the TURN server communicates) is the address assigned to the user terminal A.
  • the STUN/TUR server can assign a relay address and/or a NAT address obtained from the NAT device when the user terminal A and/or the user terminal B perform candidate address collection.
  • the local address (also referred to as a private address) and a server mapped address (also referred to as a NAT address) of the user terminal are collectively referred to as a non-relay address;
  • the relay address refers to the STU /TU RN server assigning to the user terminal. the address of.
  • the non-relay address carried in the SDP information is usually a private address and a NAT address. If not, the specific description is carried as private. Address or NAT address.
  • the method for establishing a session connection on the session initiation terminal side may be implemented on the system described in Embodiment 1, but is not limited to the system described in Embodiment 1.
  • the session initiation terminal and the session response terminal may be a personal computer, a notebook, an ultrabook, a tablet or a smart phone; As a system, it can even be a browser provided by the cloud (here, the browser can be considered to have many functions required by ordinary terminals); it can also be an intelligent terminal in the M2M field (the function configuration may be different from the existing terminal) , with higher customization).
  • the method includes:
  • the session initiation terminal sends a collection request to the STUN/TUR server in the network, where the collection request includes: collecting the candidate address collection of the session initiation terminal and the collection information of the STUN/TURN server to the ICE relay network management. information.
  • the session initiating terminal performs the collection process of the candidate address by itself, mainly by sending a collection request for the collection of the candidate address to the STUN/TUR server by using the STUN/TURN server address set by default in the session initiation terminal; the candidate address is used by the session.
  • possible network architectures include:
  • the session initiating terminal is finally connected to the NAT device through one or more NAT devices.
  • the STUN/TUR server at this time, the candidate addresses of the session initiation terminal include the following: 1) The address assigned by the NAT device closest to the STUN/TURN server to the session initiation terminal is also referred to as a NAT address in the present invention; The host address of the session initiating terminal, also referred to as the private address of the session initiating terminal in the present invention; 3) the address assigned by the STUN/TURN server to the session initiating terminal, also referred to as a relay address in the present invention.
  • the session initiating terminal directly connects to the server without using the NAT device.
  • the host address of the session initiating terminal is no longer the private address, but is specifically represented by the wide area network address allocated by the Internet for the session initiating terminal, and At this time, the session initiating terminal no longer has a NAT address; but even in the second network architecture, the session initiating terminal can still have the relay address assigned by the STUN/TURN server.
  • the present invention focuses on the first network architecture as the primary implementation network environment, and those skilled in the art can easily implement it to the second network architecture according to the implementation.
  • the session initiation terminal sends a collection request to the STUN/TUR server in the network
  • the method further includes: the session initiation terminal confirms that it does not support the ICE common network.
  • Management while supporting ICE relay network management, carries a type identifier in the collection request sent to the STUN/TUR server in the network, and the type identifier indicates that the STUN/TURN server only returns the relay address.
  • the first optional solution is proposed because: the session initiation terminal preferably selects during the session establishment process.
  • the session initiation terminal determines that it does not support the ICE common network management according to the support information of its own ICE common network management, the preferred STUN is selected.
  • ICE relay network management supported by the /TURN server in the first optional solution, the STUN/TURN server in the network where the default session initiation terminal is located supports the relay network management;
  • the ICE common network management that will not be used before the request is confirmed, naturally it is not necessary to obtain the corresponding non-relay address, and the STUN/TUR server can be directly requested to return the relay address. Therefore, the occupation of the NAT address on the network bandwidth is reduced, and the computing resources occupied by the subsequent session initiation terminal and the session response terminal matching the candidate address pair are also reduced.
  • the first optional solution is performed after the session initiating terminal first determines that it has a network switching requirement before performing the first optional solution.
  • the determining that the network switching requirement is provided by the user specifically includes: when the user enters a specific network domain or meets a specific condition, the network switching requirement is included, where the specific network domain includes: a wifi domain; Specific conditions include: The user sets the network switching requirement for a specific call; or when the frequency of the session response terminal itself moves to a specified value.
  • the user sets the network switching requirements for a specific call as follows: The user communicates on a network with free wifi, but it is possible to move out of the wifi area at any time, so the call at this time can be set to have network switching. demand.
  • the manner of collecting the support information of the STUN/TUR server for the ICE relay network management may directly use the field method of carrying the MOBILITY-TICKET in the collection request in the background technology, and collecting the MOBILITY-TICKET field in the response. Assign content to obtain support information for the ICE trunk network management by the STUN/TURN server.
  • the collecting request in the first optional solution in combination with the second embodiment may be implemented based on a Binding request (also referred to as an initial request in the background art) message in the STUN protocol, specifically in the Binding request.
  • a field is added to the message attribute (Message Attributes) of the message. For example: If the field name can be defined as SUPPORTING-MANNAGE and the content of the SUPPORTING-MANNAGE field is normal, the STUN/TUR server returns the available to the session originating terminal.
  • ICE common network management candidate address SUPPORTING-MANNAGE content is relay, then the server only returns the candidate address of the session initiation terminal supporting ICE relay network management; the default is when the SUPPORTING-MANNAGE content is empty, the server returns the session Initiate all candidate addresses of the terminal.
  • the way to define the SUPPORTING-MANNAGE field is empty is to be compatible with the existing scheme.
  • the session initiation terminal receives the collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management.
  • step S202 is specifically performed as follows: STUN/TURN server is Receiving the collection request sent from the session initiating terminal, and confirming that the session initiating terminal only requests to return the relay address according to the type identifier in the collecting request, then the relay address assigned to the session initiating terminal and the management of the ICE relay network The support information is carried in the collection response and sent to the session initiation terminal.
  • the default STUN/TURN server supports the ICE relay network management mode, and therefore, only the foregoing relay may be carried. Address, and the support information of the above STUN/TUR server for ICE relay network management can be omitted.
  • the step S202 is specifically executed as follows:
  • the STUN/TUR server receives the transmission. After the search request of the session initiation terminal, according to the type identifier in the search request, when the session initiation terminal only requests to return the relay address, first confirm whether the STUN/TUR server itself supports the ICE relay network management, and if the confirmation result is supported by the ICE, After the network management, the relay address allocated by the session initiating terminal and the support information of the ICE relay network management are carried in the collection response and sent to the session initiating terminal; if the confirmation result is that the ICE relay network management is not supported, The candidate address of the session initiation terminal (the candidate address here includes the relay address and the NAT address) and its own support information for the ICE relay network management (ie, the STUN/TUR server does not support the ICE relay network management) is carried in the collection response. Initiate a terminal for the session.
  • the session initiating terminal sends a call request to the session response terminal, where the call request carries at least one candidate address in the candidate address of the collected session initiating terminal.
  • the call request is a support address that does not need to carry the candidate address of the session initiation terminal for network management; and directly uses the session attribute line in the SDP protocol to carry the candidate address of the session initiation terminal. And sent to the session response terminal through a call request. Therefore, after the session response terminal collects its own candidate address, the candidate address pair is generated in combination with the candidate address of the session initiation terminal in the call request, and is used for the connection test process of both parties.
  • the session initiating terminal sends a call request to the session response terminal, and further includes:
  • the session initiating terminal determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal;
  • the call request is carried in the call request after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management.
  • the at least one candidate address of the candidate address of the session initiation terminal is specifically: the session initiation terminal carries only the relay candidate address of the session initiation terminal in the call request;
  • the call request is carried in the call request.
  • the at least one candidate address of the candidate address of the session initiating terminal is specifically: the session initiating terminal carries the candidate address of the session initiating terminal and the session initiating terminal support for the ICE common network management in the call request. information.
  • the session initiating terminal sends a call request to the session response terminal, where the call request carries at least one of the collected candidate addresses of the session initiating terminal.
  • the candidate address further includes: the call request further carries the support information of the session initiation terminal to the ICE common network management and/or the support information of the session initiation terminal side to the ICE relay network management, where the session initiation terminal side
  • the support information of the ICE relay network management includes support information of the session initiation terminal and the STUN/TUR server for the ICE relay network management.
  • the session response terminal After receiving the call request in the third optional solution, the session response terminal determines, in the first possible case: the session response terminal determines that both the session initiation terminal and the session response terminal support the ICE common network management. All the candidate addresses of the session response terminal and their own support information for the ICE common network management are carried in the call response and returned to the session initiation terminal;
  • the session response terminal After receiving the call request in the third optional solution, the session response terminal is in the second possible case: the session response terminal determines that both the session initiation terminal and the session response terminal are not satisfied before sending the collection request
  • the server When all the conditions of the ICE common network management are supported, the server only sends the relay address that collects itself and the support information of the STUN/TUR server to the relay network management; the collected relay address is carried in the call response and returned to the server. Session originating terminal.
  • the method further includes: the second response case is performed after the session response terminal determines that the network switching requirement exists.
  • the second possible case is to consider that the ICE common network management cannot perform network switching when the session initiation terminal and/or the session response terminal fail when the ICE common network management does not support the ICE common network management condition.
  • only the ICE relay network management supported by the relay address of the session response terminal can be used, and it can function when the network responds to the session response terminal. Therefore, in the above two possible cases, the The relay address carrying only the session response terminal in the call response is optimal in the ICE framework, and the further beneficial effect is to reduce the matching candidate address pairs of the two parties, calculate the priority of the candidate address pair, and the non-relay address in the network. The bandwidth used by the transfer.
  • the two alternatives can be used in combination because they The improvement is in the signaling process In different steps, the efficiency can be improved together with the embodiment; the first alternative of the second embodiment is combined with the third alternative of the second embodiment, and two alternatives are provided. It can also be used in combination; there is also a first optional solution, a second optional solution, and a third optional solution combined with the second embodiment of the second embodiment. The solution can also be combined.
  • the session initiation terminal may be selected.
  • the relay address of the terminal is carried in the call request directly to the session response terminal, thereby avoiding the judging process in the second alternative solution.
  • the second optional solution and/or the third optional solution may be further combined, but The judgment process in the second alternative scheme is omitted, but the result of the judgment in the first alternative scheme is directly utilized.
  • the call request sent in step S203 carries the MOBILITY-SUPPORT identification mode described in S112 in the background, so as to obtain the support information of the session response terminal for the ICE common network management in the call response.
  • the call request sent in step S203 carries the MOBILITY-SUPPORT identification mode described in S112 in the background, so as to obtain the support information of the session response terminal for the ICE common network management in the call response.
  • MOBILITY-SUPPORT identification mode described in S112 in the background, so as to obtain the support information of the session response terminal for the ICE common network management in the call response.
  • it can also be implemented by a customized extension field, and details are not described herein again.
  • S204 Receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal.
  • the call response further includes support information of the session response terminal to the ICE common network management
  • the call response carries one or more candidate addresses collected by the session response terminal and support information and/or ICE of the session response terminal to the ICE common network management.
  • the way to support information for relay network management can be varied. Here are a few ways to enumerate:
  • a field for specifying whether to support network management is added in the session attribute line ("a" line) of the SDP protocol, as shown in FIG. 11, where the session attribute line for carrying the candidate address in the SDP protocol is used.
  • the function diagram of each field is as shown in FIG. 10; the implementation is specifically to add a field named ICE-mobile-ability at the end of the "a" line, and the value of the field may be determined as normal, relay or both.
  • ICE-mobile-ability when the value of ICE-mobile-ability is normal, it indicates that the candidate address can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the candidate address can be used for ICE relay network management; When the value of ICE-mobile-ability is both, it indicates that the candidate address can be used for both ICE relay network management and ICE common network management. When the value of ICE-mobile-ability is non, the candidate address is not available for network management. (ie ICE common network management and ICE relay network management are not supported).
  • ICE common network management and ICE relay network management are not supported.
  • the value of the "ICE-mobile-ability" field of the session attribute line can be determined as normal, relay or both.
  • ICE-mobile-ability When the value of ICE-mobile-ability is normal, it indicates that the candidate address of the session response terminal can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the relay address of the session response terminal can be used in the ICE.
  • the value of ICE-mobile-ability is both, it indicates that the relay address of the session response terminal can be used for ICE relay network management, and all candidate addresses of the session response terminal can be used for ICE common network management.
  • a label representing the support information of the network management is added to the XMPP protocol, and the label may be:
  • the value of the session attribute line "ICE-mobile-ability" field can be determined as normal, relay or both.
  • ICE-mobile-ability When the value of ICE-mobile-ability is normal, it indicates that the candidate address of the session response terminal can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the relay address of the session response terminal can be used in the ICE.
  • the value of ICE-mobile-ability is both, it indicates that the relay address of the session response terminal can be used for ICE relay network management, and the candidate address of the session response terminal can be used for ICE common network management.
  • the session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server for the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal.
  • the session initiating terminal matches one of the candidate address and the candidate address of the session response terminal according to the collected support information of the STUN/TUR server to the ICE relay network management, and generates one or more groups of candidates.
  • Address pairs including:
  • the relay address of the session initiating terminal and the candidate address of the session responding terminal are matched according to the priority attribute of the candidate address to generate one or more priorities.
  • Group candidate address pair Preferably, there is no need to match the non-relay address of the session initiating terminal and the candidate address of the session response, thereby reducing the number of subsequent candidate address pair connection tests.
  • the session initiating terminal when the judgment result is that the session initiating terminal does not support the ICE common network management, after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management;
  • S205 matches the candidate address pair, the session initiating terminal directly matches the candidate address in the call response with its own relay address to generate one or more candidate address pairs.
  • the session initiating terminal in S205 matches the candidate address of the STUN/TURN server to the ICE relay network management, and matches the candidate address of the candidate address and the candidate address of the session response terminal.
  • One or more sets of candidate address pairs including:
  • the session initiating terminal matches the support information of the STUN/TURN server to the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, and matches the collection information.
  • the candidate address to and the candidate address received from the session response terminal generate one or more sets of candidate address pairs with priority.
  • the preferred session initiation terminal determines whether both the self and the session response terminal support the ICE common network management
  • the priority attribute of the candidate addresses of the two parties is matched into one or more sets of candidate address pairs having priority; if the judgment result is that both parties are not satisfied, the ICE common network management is supported.
  • both the session initiating terminal and the STUN/TUR server support the ICE relay network management, and the relay address of the session initiating terminal and the candidate address of the session responding terminal are matched to the priority one according to the priority attribute of the candidate address. Group or groups of candidate address pairs.
  • ICE common network management has higher priority than ICE relay network management.
  • ICE relay network management Combined with the principle of ICE common network management and ICE relay network management itself introduced in the background art, a relationship table 1 for generating a candidate address pair for the session initiation terminal is obtained, and a session initiation terminal and a session response terminal are given in Table 1.
  • the candidate address addresses several possible scenarios for network management support.
  • Session response terminal side Session response terminal side:
  • ICE general network management Session initiating terminal use can be used for session initiation terminal can only choose to use support: ICE relay network management ICE common network management and can be used for candidate for ICE relay network management
  • ICE common network management session initiation terminal can only select relay session initiation terminal can only choose to be available
  • ICE relay network management address generation candidate address candidate for priority candidate ICE relay network management
  • the address pair is a candidate address pair with priority.
  • ICE common network management Session initiating terminal can only choose to be available Session initiating terminal can not use the above two Unsupported: ICE relay network management ICE common network management candidate network management mode, and adopting existing technology
  • the special requirements of the session initiating terminal itself such as the privacy requirements of the session initiating terminal or the NAT device on the session initiating terminal side, only allow relay address communication and the like.
  • the privacy requirement is as follows: The user terminal does not want the external network to know its private address; the NAT device on the session initiation terminal side only allows relay address communication such as: Some NAT devices have restrictions on their own addresses, and non-permitted The relay address passes, and only the relay address is allowed to pass.
  • the voice initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs.
  • the connection test response is not received or the connection test response times out or the connection test response is an error, the connection test is unsuccessful; and when there are other candidate address pairs that have not completed the connection test, the connection test is performed one by one until there is a set of candidates. The address successfully completes the connection test.
  • the S206 is specifically implemented to indicate that the connection test is unsuccessful when the connection test response is not received or the connection test response is timed out or the connection test response is an error;
  • the connection test is performed one by one according to the priority of the candidate address pair until a set of candidate addresses successfully completes the connection test.
  • connection test After successfully completing the two-party connection test, establish a session connection between the session initiation terminal and the session response terminal.
  • the connection test is successfully completed, specifically, the session initiating terminal sends a connection test request to the session response terminal and receives the connection test response for a certain set of candidate address pairs, and further includes the session response terminal sending the same set of candidate address pairs to the session initiation terminal.
  • the connection test request and successfully receives the connection test response of the session initiation terminal, at this time, the connection test process between the session initiation terminal and the session response terminal is successfully completed, and the candidate address pair based on the successful completion of the connection test is established. Session connection.
  • the core inventing point of the present invention is explained from the perspective of the session initiating terminal side, and the session initiating terminal itself candidate is further combined by the candidate address carried in the call response and the network management support information corresponding to the candidate address.
  • the support information of the network management corresponding to the address generates a candidate address pair, so that the connection test can be performed more efficiently.
  • the process is relatively cumbersome in the connection test, and the greater possibility is a non-essential candidate.
  • the address pair (or the candidate address pair that cannot be used by subsequent session establishment) participates in the connection test process, and the resource loss is large.
  • This embodiment is the operation of the present invention on the session initiating terminal side. It is described in the second embodiment in combination with the specific application environment.
  • the signaling flowchart of the session establishment is shown in FIG. 5.
  • This embodiment is implemented based on the SDP protocol, but those skilled in the art can apply the method to other different multimedia signaling protocols based on the same ICE framework, such as the XMPP protocol, according to the technical content disclosed in the present invention.
  • the user terminal A in this embodiment that is, the session initiation terminal in the second embodiment, has the ICE common network management and the ICE relay network management capability;
  • the user terminal B that is, the session response terminal in the second embodiment, the user terminal B It does not have the ICE common network management capability, but has the ICE relay network management capability.
  • the STUN/TURN server has the capability of ICE relay network management; the support for network management in this embodiment corresponds to Case II in Table 1.
  • the user terminal A and the user terminal B have NAT devices A and NAT_B on their respective network sides, and both parties share a STUN/TURN server.
  • the method of this embodiment can also be applied to a more diverse ICE environment, such as: 1) The network side of user terminal A and/or user terminal B does not have a NAT device or has multiple NAT devices; 2) user terminal A and user terminal B respective network side has an independent STUN/TUR server; or the above 1), 2) environments exist, etc., can be adjusted based on the content disclosed in this embodiment by adjusting the candidate address and / or between the STUN / TUR server Communication is done.
  • the session establishment process of this embodiment specifically includes:
  • the process of the embodiment is performed after the user terminal A determines that it has the network switching requirement, and the determination may be completed before the user terminal A collects its own candidate address.
  • the confirmation that the network switching requirement itself includes:
  • the session initiating terminal is configured to have a network switching requirement when entering a specific network domain or when a specific condition is met, where the specific network domain includes: a wifi domain; the satisfying specific conditions include: for a specific call to the network Switch the requirements to set, or according to the frequency of the session response terminal's own movement to the specified value.
  • the user terminal A collects its own candidate address and the support information of the STUN/TURN server for the ICE relay network management.
  • the candidate address for collecting itself includes sending a collection request to the STUN/TUR server and receiving the collection response returned by the STUN/TUR server in the second embodiment.
  • the collecting request includes: information indicating that the candidate address collection of the session initiating terminal and the support information of the STUN/TUR server to the ICE relay network management are collected; STUN/TUR server to the ICE relay network management Support information, mainly through the initial request.
  • the MOBILITY-TICKET field identified by the STUN/TURN server is added, so that the STUN/TUR server recognizes the MOBILITY-TICKET field in the initial clearing and carries its own support information for the ICE relay network management in the MOBILITY-TICKET field. Specifically as follows: S101 and S104 are described.
  • the user terminal A also determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal; the support information of the ICE common network management may be recorded in
  • the data in the text may also be obtained by the user terminal A by acquiring the configuration parameters or by calling the response port.
  • the user terminal A sends a call request to the user terminal B, where the call request carries the SDP information, and the SDP information in the call request carries all the candidate addresses of the user terminal A collected by the user terminal A.
  • the call request further carries one or more candidate addresses of the session initiating terminal
  • the support information for the network management is specifically implemented in the embodiment as: After the session attribute line carrying the non-relay address is added to the SDP information, an identifier supporting the ICE common network management is added, and the SDP information for the call request is added to the session attribute line carrying the relay address. It also supports the identification of ICE trunk network management and ICE common network management.
  • Connection-address SP from RFC 4566
  • RFC 5246 defines all parameters that can be carried by a candidate address in the prior art, including the address supported class "candidate”, the transmitted protocol "transport”, the address priority “priority”, and the default connection address "connection-address”. " , address port "port” and so on.
  • a specific candidate address is the session attribute line in the SDP information. (“a” line) is carried, and its presentation is as follows:
  • This embodiment adds a field for determining whether the candidate address is available for network management (ICE common network management and/or ICE relay network management) in the session attribute line ("a" line) of the SDP protocol, specifically
  • the "a" line finally adds a field named ICE-mobile-ability, and the value of this field can be determined as normal, relay or both.
  • ICE-mobile-ability when the value of ICE-mobile-ability is normal, it indicates that user terminal A supports ICE common network management (ie, the candidate address is available for ICE common network management;); when the value of ICE-mobile-ability is relay, It indicates that the STUN/TURN server in the network where the user terminal A and the user terminal A are located support the ICE relay network management.
  • FIG. 11 is a schematic diagram showing the meaning of each identifier field of the session attribute line ("a" line) after the ICE-mobile-ability flag is added.
  • the candidate address parameter the call request from the user terminal A extended by the present invention.
  • a separate session attribute line may be used.
  • the call request is forwarded to the user terminal B by the NAT_A device and the NAT_B device. 5304. After receiving the call request, the user terminal B starts to collect support information of its own candidate address and the candidate address for network management, and the collecting process is similar to the user terminal A.
  • the user terminal B generates a call response message.
  • the session attribute line for carrying the non-relay address in the SDP information constituting the call response message is finally set to a non-identity, indicating that the non-relay address of the user terminal B is unavailable.
  • ICE common network management ie, user terminal B does not support ICE common network management
  • the session attribute line for carrying the relay address finally sets the relay identifier, indicating that the relay address of user terminal B can be used for ICE relay network management
  • the STUN/TUR server of the network where user terminal B and user terminal B are located supports ICE relay network management
  • the information used by the user terminal B for carrying the network management information that the candidate address is available in the call response message is the same as the information for the network management that the user terminal A uses to carry the self-candidate address in the call request message.
  • the call response is forwarded to the user terminal A by the NAT_B device and the NAT_A device.
  • step S205 in the second embodiment it is specifically executed as step S307 in this embodiment.
  • the user terminal A receives the call response from the user terminal B, and performs pairing according to the support information of the network management by itself and the user terminal B, and generates a candidate address pair with priority for connection test.
  • step S307 is specifically as follows:
  • ICE common network management is not supported, but the user terminal B side supports ICE relay network management.
  • the user terminal A Since the user terminal A has a network switching requirement, the user terminal A preferentially selects a candidate address pair capable of supporting the network management capability to perform a connection test, which can be analyzed in combination with Table 1: The user terminal A selects only its own relay address and user terminal B. The candidate address generates one or more sets of candidate address pairs with priority.
  • the candidate address pairs with priority generated according to the above are: 1) the relay address of the user terminal A ⁇ --> the private address of the user terminal B, 2) the relay address of the user terminal A ⁇ -- > the user terminal B.
  • the candidate address of the user terminal B is also a non-relay address generation candidate address pair of the user terminal A, and the candidate address pair is only the candidate address pair generated by the relay address of the user terminal A and the user terminal B.
  • the connection test is performed after the connection test result is a failure.
  • the optional case described here is to improve the solution.
  • the possibility that the relay address of the user terminal A and the candidate address generated by the user terminal B are successfully tested is higher than the non-relay address of the user terminal A.
  • the possibility that the connection test of the candidate address pair generated by the user terminal B is successful.
  • the priority of the candidate address pairs generated in the present invention includes two reference factors:
  • the user terminal A sends a connection test request to the user terminal B according to the priority of the one or more sets of candidate address pairs.
  • connection test request of the user terminal A is forwarded to the user terminal B through the NAT_A device, the STUN/TUR server, and the NAT_B device. (Note that if the candidate address pair of the connection test request that the user terminal A needs to perform is non-relayed At the time of address, the forwarding process of S309 does not require STUN/TUR server forwarding.
  • the user terminal B receives the connection test request, and extracts the candidate address pair carried by the user from the link test request. Then, the user terminal B sends a connection test response to the user terminal A according to the candidate address pair extracted from the connection test.
  • connection test request may also be sent from the user terminal B, and the specific execution process thereof is only The original cost execution subject user terminal A and the user terminal B in steps S308-S310 need to be exchanged.
  • This optional solution is mostly used in the case where the user terminal B has the candidate address of the user terminal A and the candidate address of the user terminal B, and the ability of both parties to actively perform the selection and matching of the network management support information.
  • the user terminal B determines that it has the network switching requirement, it is targeted to select the candidate address that can be used for the ICE relay network management to match the candidate address carried in the call request, or to select the ICE common network.
  • the managed candidate address is matched with the candidate address carried in the call request.
  • the generation of the candidate address pair is completed in the manner of the embodiment, and the subsequent connection test process (including the transmission of the connection test request and the connection test response reception, etc.) is still in accordance with the existing ICE framework. carry out. Because the order of the connection test of the existing ICE framework is in accordance with the priority order of the candidate address pairs, after the candidate address pairs with different priorities are generated in this example, the existing ICE framework can be applied to complete the connection. Testing process.
  • connection test response sent by the user terminal B is forwarded to the user terminal A through the NAT_B device, the STUN/TUR server, and the NAT A device. (Note that if the candidate address pair carried in the connection test response returned by the user terminal B is not in the middle When the address is followed, the forwarding process of S311 does not need to go through the STUN/TUR server).
  • the candidate address pair of the NAT address of the user terminal A of the user terminal A can be received when the user terminal A and the user terminal B initiate a connection test request according to the candidate address pair respectively.
  • the other party's connection test response indicates that the connection test was successfully completed.
  • User terminal A selects the candidate address pair to establish a session connection with user terminal B.
  • This embodiment summarizes that in the prior art, in order to implement the network switching requirements of the user terminal A and the user terminal B, a large number of connection tests are performed during network switching; to reduce the network delay occupied by the connection test during network switching.
  • the prior art also proposes ICE common network management and ICE relay network management.
  • the user terminal and each network node have different support capabilities for the two types of network management, and may or may not support one or both of the network management.
  • the confirmation of the support of the ICE common network management is in the connection test step (the connection test step, such as the steps shown in FIG. 1 such as S110-S113), the existing method cannot know whether the session response terminal is before the network connection test. It supports ICE common network management.
  • the session response terminal does not support ICE common network management, additional connection test requests are wasted.
  • a network management identifier is added, so that the user terminal A can accurately before sending the connection test. It is said that before generating the candidate address pair for the connection test, it is known whether the user terminal B supports the ICE common network management, thereby effectively reducing the invalid connection test and saving the network band. width.
  • the invalid connection test mentioned here includes, but is not limited to, the case where the test result is not used after being tested.
  • Embodiment 6 is combined when it is combined as a complete system solution.
  • the candidate address collected by the session initiation terminal or the session response terminal may only include one of the candidate addresses; possibly because of some requirements of the session initiation terminal or the session response terminal,
  • the session request carries only one of the private address or the NAT address.
  • the session attribute line ("a" line) corresponding to the missing candidate address is correspondingly deleted in the SDP information, and details are not described herein again.
  • the user terminal A has the capability of ICE relay network management and the ICE common network management capability
  • the user terminal B only supports the scheme of the ICE relay network management capability.
  • the combination of the user terminal A and the user terminal B actually supporting the above two kinds of network management includes five other cases as shown in Table 1 in addition to the enumeration in the embodiment.
  • the main steps of the embodiment will be analyzed on a case-by-case basis, wherein whether the user terminal B supports the ICE relay network management is only related to the network on the user terminal B side, and whether the user terminal B supports the ICE relay network.
  • the management is not considered in this embodiment and its related extended embodiment; the default user terminal B returns all the candidate addresses it collects in the call response, and the default is matching the candidate address of the user terminal A and the candidate address of the user terminal B. At the same time, all candidate addresses of the user terminal B are also used.
  • connection test of candidate address pairs available for ICE common network management is preferentially performed, and only the connection test failure of the candidate address pair available for ICE common network management is performed.
  • the connection test for candidate address pairs that can be used for ICE relay network management is performed.
  • the user terminal A After receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the support information of the candidate address of the user and the user terminal B for the network management. And sending a connection test request to the user terminal B in turn according to the priority of the candidate address pair.
  • the process is specifically as follows:
  • connection test request needs to adopt the technology described in S110-S112 to generate a network for the subsequent user terminal A by carrying the MOBILITY-SUPPORT field in the connection test request and carrying the value of the MOBILITY-SUPPORT field in the connection test response.
  • the ICE common network management mode is used to complete the ICE renegotiation preparation (that is, the ICE common network management negotiation of the user terminal A and the user terminal B is completed).
  • the process of the ICE common network management capability negotiation described in the above S110-S112 is not required.
  • the user terminal B receives the connection test request, and extracts the candidate address pair carried by the user from the link test request; then, the user terminal B sends a connection to the user terminal A according to the candidate address pair extracted from the connection test. Measurement Try to respond.
  • the connection test response carries the MOBILITY-SUPPORT field and the corresponding value.
  • the NAT address of the user terminal A is a candidate address pair of the NAT address of the user terminal B.
  • the user terminal A and the user terminal B respectively initiate a connection test request, they can receive the connection test of the other party. A response indicating that the connection test was successfully completed.
  • User terminal A selects the candidate address pair to establish a session connection with user terminal B.
  • the first option in the third embodiment may be adopted.
  • the process is similar to the third embodiment and will not be described here.
  • the user terminal A only supports the ICE relay network management, and does not support the ICE common network management
  • the user terminal B includes or does not support the ICE common network management.
  • the main difference in the steps of the expanded embodiment (2) of the third embodiment with respect to the third embodiment will be described by way of the combination of the extension embodiment designation "(2), and the step identification in the original embodiment 3.
  • the content of the other steps only needs to be modified, and will not be described here.
  • the candidate addresses of the user terminals B carried in the corresponding "a" line are different. According to the conclusions of III and IV in Table 1, the specific performance is as follows:
  • the user terminal A after receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the network management information available for the candidate addresses of both the user and the user terminal B, And then, according to the priority, the connection test request is sent to the user terminal B according to the candidate address pair.
  • the process is specifically as follows:
  • S312(2) The original S312 will be executed as S312(2) as follows:
  • the user terminal A in S312(2) After receiving the connection test response from the user terminal B, the user terminal A in S312(2) knows from the connection test response that the connection test of the relay address passes, and finally negotiates the use in S312(2).
  • the communication address is the relay address of the connection test.
  • the first option in the third embodiment may be adopted.
  • the process is similar to the third embodiment and will not be described here.
  • step S307(2) is:
  • the candidate address at user terminal A can be used for ICE general network management, and not for ICE relay network management. And when user terminal B supports ICE common network management, according to the conclusion of V in Table 1:
  • step S307 in the third embodiment will be executed as S307(3), as follows:
  • the user terminal A after receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the support information of the network management itself and the user terminal B, and according to the The priority sequentially sends a connection test request to the user terminal B according to the candidate address pair.
  • the process is specifically as follows:
  • the candidate address of the user terminal B is available for ICE common network management. Since user terminal A has network switching requirements, user terminal A needs to select a candidate address that can be used for network management (including ICE relay network management and ICE common network management) to establish communication. Since both user terminal A and user terminal B support ICE general network management, so user terminal A selects a candidate address that can be used for ICE general network management and a candidate address of user terminal B to generate a candidate address pair with priority.
  • S312(3) The original S312 will be executed as S312(3) as follows:
  • the user terminal A receives the connection test response from the user terminal B, and learns from the connection test response that the connection test of the NAT address of the user terminal A is less than the NAT address of the user terminal B, Then, the communication address finally used in the negotiation in S312(3) is the candidate address pair of the connection test.
  • the first option in the third embodiment can be used in addition to the manner adopted in the third embodiment.
  • the process is similar to the third embodiment and will not be described here.
  • the user terminal A only supports the ICE common network management, and according to the call response, it is confirmed that the user terminal B does not support the ICE common network management, as the VI conclusion in Table 1 can not adopt any of the network management methods, according to the existing method
  • the connection test is specifically performed in steps S307 and subsequent steps in this embodiment in accordance with steps S110-S113. And since it has been confirmed that the user terminal B does not support the ICE general network management, the MOBILITY-SUPPORT flag in the S 110 is no longer required to be carried in the extended embodiment (4).
  • the present invention can be more fully applied to various practical situations in combination with the present embodiment, so as to cover various situations in which the user terminal A and the user terminal B have network management capabilities, and
  • the specific case is optimized by the scheme, such as skipping the analysis of whether the candidate address of the user terminal B supports the network management in the extended embodiment (2), further simplifying the signaling interaction and the operation complexity.
  • Embodiment 4 is a method for establishing a session connection according to the present invention.
  • the fourth optional solution of the embodiment and the second embodiment is to write the two sides of the session response terminal and the session initiation end side respectively.
  • the embodiment can be implemented as a single improvement solution, or can be implemented as a solution in combination with the second embodiment.
  • the combination may be that the session initiation terminal in the second embodiment exists as the session response terminal in the embodiment, and the session response terminal in the embodiment is the existence of the session response terminal in the second embodiment.
  • the process specifically includes:
  • the session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal.
  • the call request includes one or more candidate addresses that are collected by the session initiating terminal and belong to the session initiating terminal, so that the session responding terminal can sort according to the priority of the candidate addresses after collecting the candidate addresses of the terminals, and combine different priorities.
  • the candidate address pair of the level is used to perform the process of the subsequent connection test on the terminal side of the session response.
  • the session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal for the ICE common network management according to the call request.
  • the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management.
  • the session responding terminal matches the candidate address carried in the call response and the candidate address of the session initiating terminal to generate a group or groups of candidate address pairs having a priority
  • the method includes: the session response terminal according to the call request The support information carried by the session initiation terminal to the ICE common network management and the support information of the ICE common network management of the session response terminal itself determine whether both the session initiation terminal and the session response terminal support the ICE common network management;
  • the session response terminal matches the candidate address carried in the call response and the candidate address of the session initiation terminal in determining the session initiation terminal side to support the ICE relay network management.
  • Relay candidate address generates one or more sets of candidates with priority Access right.
  • the first alternative solution of the fourth embodiment is proposed because the session response terminal actually knows that the session initiating terminal only supports the ICE relay network management when receiving the call request.
  • the following information is provided: 1.
  • the fourth optional solution according to the second embodiment of the present invention improves the session initiation terminal and uses only the relay address of the session initiation terminal and the call response after receiving the call response of the session response terminal.
  • the candidate address match generates the candidate address pair; therefore, the matching action can be further perceived in advance on the session response terminal side, so that the invalid candidate address pair generated by the session response terminal (ie, the candidate address pair that the session initiation terminal does not adopt) can be reduced. ); further improve the efficiency of subsequent connection tests.
  • step S401 the receiving the session is initiated.
  • the candidate address of the collection itself includes:
  • the session response terminal determines that the session initiation terminal and the session response terminal do not satisfy the ICE common network management according to the support information of the session initiation terminal and the ICE common network management carried in the call request, and the session response terminal itself supports the ICE relay network management.
  • the session response terminal carries the support information of the session response terminal to the ICE common network management support information and the session response terminal to the ICE relay network management in the collection request sent to the STUN/TUR server in the network, so as to facilitate the STUN/
  • the TUR server determines that it supports the ICE relay network management, it only returns its own relay address to the session originating terminal.
  • the process of collecting the candidate address to the STUN/TUR server can be simulated in the collection process in the second embodiment. Therefore, the foregoing collection request can be described in the second embodiment. It only carries the support information of the session response terminal to the ICE relay network management and/or carries the type identifier that requires the STUN/TUR server to return only the relay address in the collection request; corresponding to the STUN/TUR server for the above collection in the second embodiment
  • the process of determining the information in the request may also be applied to the collecting process of the fourth embodiment.
  • the session response terminal collects its own candidate address according to the call request, and collects the STUN/TURN server to the ICE relay network in the network where the session response terminal is located.
  • the management response information the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management, which specifically includes:
  • the session response terminal determines whether the session initiation terminal and the session response terminal both support ICE common network management; when the judgment result is that both of them do not satisfy the ICE common network management, and when the confirmation response response terminal side supports the ICE relay network management,
  • the session response terminal sends a call response to the session initiation terminal, where the call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
  • the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the session response terminal manages the ICE common network. support information.
  • the support information of the collected one or more candidate addresses for network management and the support information of the session initiation terminal to the ICE common network management carried in the call request are matched.
  • the method further includes: determining that the session response terminal has a network switching requirement, and then performing the first option in combination with the fourth embodiment.
  • the method further includes: determining that the session response terminal has the network switching requirement Then, the second alternative combined with the fourth embodiment is performed.
  • the session response terminal itself has network switching requirements specifically including:
  • the user set in the session response terminal has a network switching requirement when entering a specific network domain or meets a specific condition, and the specific network domain includes: a wifi domain; the satisfying specific conditions include: or the user is specific to a certain time
  • the call is set to the network switching requirement; or when the frequency of the session response terminal itself moves to a specified value.
  • the session response terminal sends a call response to the session initiation terminal, where the call response carries the collected candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management.
  • the call response carries the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management, so that the session initiation terminal supports the network management according to its own support information (the network management includes the ICE relay network management and the ICE).
  • the common network management) and the session response terminal carried in the call response support information of the ICE common network management, and the candidate addresses of both the session initiation terminal and the session response terminal are used to generate one or more sets of candidate address pairs with priority.
  • the session response terminal matches one of the candidate addresses carried in the call response and the candidate address of the session initiation terminal to generate one or more sets of candidate address pairs with priority.
  • the session response terminal sends a connection test request to the session initiation terminal according to the priority of the one or more groups of candidate address pairs.
  • the invention of the present invention is described from the side of the session response terminal, by carrying the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management in the call response.
  • the candidate address of the priority is generated by using the candidate addresses of the session initiation terminal and the session response terminal. This enables more efficient subsequent connectivity testing and reduces the number of redundant connection testing processes.
  • the improvement based on the session response terminal is not limited to the content described in the fourth embodiment.
  • the fourth embodiment is implemented on the premise that the session initiation terminal is improved by the present invention.
  • the session initiation terminal may be a session initiation terminal in the prior art, or may be a session initiation terminal that does not have the function of the third alternative scheme of the second embodiment of the present invention.
  • the session response terminal has the function of analyzing the network management for both the session initiation terminal and the session response terminal in the second embodiment of the present invention, and the network management analysis is beneficial to reduce the connection test in the case of referring to Table 2.
  • the method of signaling interaction Then, the fifth embodiment provides an embodiment in which the improvement of the present invention is applied to one side of the above-mentioned only session response terminal, and the flow includes:
  • the session response terminal receives the call request of the session initiation terminal, where the call request includes one or more candidate addresses of the session initiation end.
  • the call request in the fifth embodiment does not include the support information of the session initiation terminal for network management.
  • the corresponding candidate address is expressed in the SDP information as follows:
  • the session response terminal may carry only the candidate address, and does not include the network management support information of the corresponding candidate address according to the call request (that is, the session attribute line corresponding to the candidate address does not carry the extended ICE-mobile-ability field correspondingly.
  • the identification of the session initiation terminal does not have the function of the improvement proposed by the second embodiment of the present invention.
  • the session response terminal collects its own candidate address and the support information of the candidate address to the ICE common network management and the ICE relay network management.
  • step S402' The refinement of the step S402' is as described in FIG. 7, and specifically includes:
  • the session response terminal collects the candidate address of the terminal and the support information of the candidate address to the network management.
  • the session response terminal collects the relay address allocated by the STUN/TUR server for the session response terminal.
  • STUN/TUR server support information for ICE relay network management; non-relay address and session response terminal support information for ICE common network management.
  • the session response terminal determines whether it has a network handover requirement. If the result of the determination is that there is no network switching requirement, then S503 is performed; when the result of the determination is that the session response terminal has a network switching requirement, then S504 is performed.
  • the corresponding setting session response terminal itself has the network switching requirement, which specifically includes:
  • the user set in the session response terminal has a network switching requirement when entering a specific network domain or meets a specific condition, and the specific network domain includes: a wifi domain;
  • the satisfying specific conditions include: or the user is specific to a certain time
  • the call is set to the network switching requirement; or when the frequency of the session response terminal itself moves to a specified value.
  • the session response terminal carries the non-relay address and the relay address in the generated call response.
  • the call response may optionally carry the information of the ICE common network management support and/or the ICE relay network management. Supported information).
  • the session response terminal determines whether the self and the STUN/TUR server satisfy the condition that the ICE relay network management is supported. When the determination result is yes, S505 is performed; when the determination result is negative, S506 is performed.
  • the session response terminal only carries the collected relay address in the generated call response (in the embodiment, the optional call response further carries information about the support of the session response terminal to the ICE relay network management).
  • the session response terminal carries the non-relay address and the relay address in the generated call response.
  • the optional call response may further carry the session response terminal ICE common network management support information and the ICE relay network. Managed support information);
  • the session response terminal sends a call response to the session initiation terminal.
  • the session response terminal generates one or more sets of candidate address pairs with priority according to the candidate address carried in the call response and the candidate address of the session initiation terminal carried in the session request.
  • the session response terminal sequentially sends a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs.
  • determining whether the session response terminal in the step S502 has a network handover requirement may be performed before the candidate address of the collection session response terminal in step S501, similar to the third method as in the fourth embodiment. An alternative description. At this time, if it is determined that the session responding terminal does not have a network switching requirement, the subsequent execution process is no different from the prior art and will not be described here. If the session response terminal has a network switching requirement, the STUN/TUR server is sent to the STUN/TUR server.
  • the sent search candidate address request requires the server to return only the relay address and the support information of the STUN/TUR server to the ICE relay management; the generated call response carries the relay address, and completes the subsequent address with the relay address.
  • the generation and connection test process of candidate address pairs are described below.
  • This embodiment is an extension of the situation that may be encountered in the practical application of the fifth embodiment, and specifically includes the application of the present invention to the session initiation terminal, which is still the user terminal A in the background technology (FIG. 1) (does not have the design of the present invention)
  • the function mentioned in the scheme) and the session response terminal is provided in the environment of the functions involved in the fourth embodiment of the present invention; thus,
  • the network address switching requirement is ensured, the candidate address carried in the call response is reduced as much as possible, and the computer required for subsequent connection test and candidate address pair generation is effectively reduced. Resources.
  • This embodiment is an operation of the present invention on the side of the session response terminal, and is a description of the fourth embodiment in combination with a specific application environment.
  • This embodiment is implemented based on the SDP protocol, but those skilled in the art can apply the method to other different multimedia signaling protocols based on the same ICE framework, such as the XMPP protocol, according to the technical content disclosed in the present invention.
  • This embodiment may be implemented as a single improvement solution, or may be implemented in combination with the third embodiment.
  • the call request in the third embodiment not only carries the candidate address of the session initiation terminal, but also carries the session initiation terminal. Support information for network management.
  • the user terminal A also called the session initiation terminal, supports ICE common network management and ICE relay network management at the same time;
  • the user terminal B also called the session response terminal, does not support ICE common network management, but supports ICE.
  • Relay network management, and called user terminal B has network switching requirements.
  • the user terminal B receives the call request from the user terminal A, and determines that the user terminal A has the ICE according to the identifier of the network management carried in the session attribute line ("a" line) where the candidate address is located in the call request.
  • a session attribute line
  • ICE-mobile-ability At the end of the "a" line, a field named ICE-mobile-ability is added, and the value of the field is defined as normaK relay > both or ⁇ » and the value of ICE-mobile-ability is set to normal.
  • ICE-mobile-ability value When the ICE-mobile-ability value is relay, it indicates that the candidate address is available for the ICE relay network management mode; when the ICE-mobile-ability value is both , indicating that the candidate address can be used in both the ICE common network management mode and the ICE relay network management mode; when the value of ICE-mobile-ability is non, it indicates that the address is not available for the above two types of network management.
  • the specific implementation of carrying the network management information in the SDP information is:
  • a separate "a" line may be used to determine whether the user terminal is determined.
  • Support ICE common network The management capability or the ICE relay network management capability has higher integration than the method that has been adopted in this embodiment, and the implementation thereof is specifically as follows:
  • the value of ICE-mobile-ability is normal, it indicates that the user terminal supports the ICE common network management mode; when the value of ICE-mobile-ability is relay, it indicates that the user terminal A supports the ICE relay network management mode;
  • the value of the mobility-ability is both, it indicates that the user terminal A supports the ICE common network management mode and the user terminal A supports the ICE relay network management mode.
  • the value of the ICE-mobile-ability is non, it indicates that the user terminal A does not support the above. Two network management.
  • the user terminal B collects its own candidate address by using the method of step S301 in the third embodiment (FIG. 5).
  • the user terminal B determines that the user terminal A supports both the ICE common network management and the ICE relay network management according to the content of the ICE-mobile-ability field in the session attribute line ("a" line) of each candidate address in the received call request. .
  • the user terminal B that has determined that the session responding terminal has the network switching requirement, the user terminal B does not support the ICE common network management, but only supports the ICE relay network management (the third in the fourth embodiment)
  • the user terminal B preferably uses ICE relay network management. Then, it is only necessary to return a connection test result of the relay address carrying the user terminal B and the support information of the session response terminal to the ICE common network management to the user terminal A;
  • the new request when the user terminal B sends an initial request for collecting the candidate address to the STUN/TUR server, the new request may be extended to use a new field in the initial request.
  • the name can be SUPPORTING-MANNAGE. When it appears in the request, it indicates the type of address that the user wants to collect.
  • the STUN/TUR server only returns the corresponding address type in the SUPPORTING-MANNAGE field in the response message.
  • the SUPPORTING-MANNAGE field The value can be defined as: normal, relay or all.
  • the SUPPORTING-MANNAGE field may be empty, and the STUN/TUR server may be collected. All address types arrived are carried in the response message.
  • the initial request may be implemented on a Binding request based on the STU protocol, specifically in the Binding request.
  • the message attribute (Message Attributes) is added with a SUPPORTING-MA AGE field, and when the content is normal, the STUN/TURN server is required to return only the candidate address of the session response terminal supporting the ICE common network management; the content is relay The STUN/TUR server is required to return only the candidate addresses of the session response terminal that can be used for ICE relay network management; when the content is all, the STUN/TURN server is required to return all candidate addresses of the session response terminal.
  • the user terminal B sends a call response to the user terminal A, and adds only the relay address acquired by the user terminal B and the support information of the user terminal B to the ICE common network management in the SDP information of the call response;
  • the specific performance is:
  • the call response is forwarded by the NAT_B device and the NAT_A device, and is forwarded to the user terminal A;
  • the user terminal B sends a connection test request to the user terminal A. Before transmitting the connection test, since the user terminal B has determined in S604 that only the relay address is transmitted as the candidate address to the user terminal A, the user terminal B generates the priority according to the own relay address and the candidate address of the user terminal A. Candidate address pair. And sending a connection test request to the user terminal A in turn according to the priority of the candidate address pair.
  • connection test request of the user terminal B is forwarded by the NAT_B device, the STU /TR server, and the NAT_A device, and finally forwarded to the user terminal A;
  • the user terminal A generates a connection test response to notify the user terminal B that the connection test passes.
  • connection test response of the user terminal A is forwarded to the user terminal B after being forwarded by the NAT_B device, the STUN/TURN server, and the NAT_A device;
  • the user terminal B selects a relay address for communication, thereby satisfying the requirement of the network management of the user terminal B.
  • the session responding terminal side determines the candidate address carried in the call response after considering whether it has a network switching requirement.
  • the user terminal A can reduce the number of users that are acquired by the user terminal A.
  • the candidate address of the terminal B is different from that of the third embodiment.
  • the third embodiment reduces the connection test resources occupied by the invalid candidate address pair, and the embodiment reduces the user terminal B that needs to be tested by the user terminal A.
  • the candidate address of course, the third embodiment and the optional solution, and the solution of the embodiment and related optional solutions are combined, and the beneficial effects thereof can also be superimposed, and the network switching time is optimized based on the network switching requirement. Because of the waste of resources brought about by connectivity testing.
  • This embodiment only enumerates that user terminal A has both ICE common network management and ICE relay network management capability. Force, and the user terminal B only has the ICE relay network management capability to complete the connection establishment method.
  • the generation method creates a reference table 2 in which the user terminal B generates a candidate address pair in each case.
  • step S603 the user terminal B first analyzes the received call request, and obtains a case where the candidate address of the user terminal A is supported by the network management.
  • the case where the candidate address of the user terminal A supports the network management is included in the table. 2 is labeled as "user terminal A" in the first column, and in this embodiment, the candidate address of the user terminal A is the first column and the last row; then, the user terminal B obtains the candidate address according to itself. Its own support for network management, which is included in the first line of the "User Terminal B" in Table 2 (where the candidate address of the user terminal B is not listed does not support any kind of network management). Further, in the case of the combination of other line items and column items as in Table 2, the connectivity test is completed according to the corresponding operation method in Table 2, and will not be described here.
  • ICE general network management user terminal B can be used for user terminal B to select only relayed user terminal B only to support: ICE relay network management ICE common network management and available addresses and user terminal A candidates Generating a candidate address with a non-relay address and a candidate address generated by the ICE relay network to generate a candidate address candidate address address pair with a priority for the candidate selected address of the user terminal A, and the former generates a pair
  • User terminal A IV V VI does not support: User terminal B only selects the relay destination User terminal B only selects the relay destination User terminal B cannot make
  • the ICE common network management address and the candidate address of the user terminal A and the candidate location of the user terminal A are supported by the above two types of network pipes: Address generation candidate address address generation candidate address management mode
  • ICE relay network management address generation candidate address pair User terminal A XI XII XIII does not support: User terminal B only selects the user terminal B in use, only selects the user terminal B in use.
  • ICE common network management The address of the address and user terminal A and the candidate of user terminal A.
  • the above two types of network management do not support: Select address generation candidate address pair selection address generation candidate address pairing
  • This embodiment combines the case of the third embodiment and the sixth embodiment as the environment of the embodiment, and further increases the priority of the local area network on the basis of the foregoing, which does not indicate the third embodiment and the sixth embodiment.
  • the LAN case is not considered, but the description of each embodiment is highlighted to describe it as a different embodiment.
  • the LAN priority judgment involved in the seventh embodiment also belongs to the refinement of the second embodiment, and the technical means adopted by the session initiation terminal and the session response terminal in matching the candidate address pairs are similar or The same, therefore, the seventh embodiment can also implement the implementation of the fourth embodiment in this case. From the perspective of the user terminal C, this embodiment is a further extension of the fourth alternative in the second embodiment.
  • the user terminal A that is, the session initiating terminal in the third embodiment and the sixth embodiment, only has the ICE relay network management capability
  • the user terminal C that is, the session response terminal in the third embodiment and the sixth embodiment, With ICE relay network management capabilities.
  • user terminal A and user terminal B jointly use a NAT device, NAT_A, where user terminal A and user terminal C belong to the same local area network.
  • both the user terminal A and the user terminal B have network switching requirements, and the specific implementation steps are as follows:
  • the user terminal A collects candidate addresses, and the process is the same as step S301 in the third embodiment.
  • the user terminal A analyzes its own support information for the network management, and confirms that it only has the ICE relay network management, and only carries the relay address of the user terminal A and the support information of the user terminal A for network management in the generated call request;
  • the call request also carries the private address of the user terminal A.
  • the private address is used for the user terminal C to determine whether it belongs to the same local area network as the user terminal A.
  • the mobile phone candidate address process may also adopt the first optional solution in combination with the second embodiment; sending only the STUN/TURN server to the STUN/TUR server as the user The initial request for the relay address assigned by terminal A. Wherein, since the private address is known by the user terminal A, the user terminal A is further informed of the relay address and the support information of the relay address to the ICE relay network management.
  • the user terminal A sends a call request. And assigning the corresponding supported network management identifier to the candidate address in the manner of step S302 in the third embodiment.
  • the "a" line information in its call request is specifically as follows:
  • the call request is forwarded to the user terminal C by using the NAT_A device;
  • the user terminal C starts to collect its own candidate address.
  • the collecting process is similar to that of the user terminal A, and therefore is not described again.
  • the user terminal C analyzes the support status of the candidate address of both the user and the user terminal A for network management.
  • the user terminal C knows that the user terminal A only supports the ICE relay network management according to the identifier value of the CE-mobile-ability identifier in each candidate address of the user terminal A. Further, when determining that the priority of the private address is higher than the priority of the relay address connection test, the user terminal C carries the session attribute line including the private address and the relay address in the call response returned to the user terminal A ("a " Row).
  • the method for determining the priority of the session connection is: the user terminal C checks whether the NAT address assigned by the NAT_A device for the user terminal A and the NAT address assigned by the NAT_A device to the user terminal C are the same, and if they are the same, the probability is compared in the local area network. Further, according to whether the value of the private address of the user terminal C and the user terminal A is the same router address, if it is in a router address, it indicates that it has a high probability in the local area network; preferably, the above two conditions are met. One or both of them cause the private address to participate in the generated candidate address pair.
  • the user terminal C generates a call response by using its own private address and the collected relay address, where the last attribute field of the session attribute line where the private address is located is extended by a field, and a field is indicated to indicate the private address of the user terminal B and the user terminal A.
  • the private address is on a LAN.
  • the specific implementation manner can be extended by extending the value of the ICE-mobile-ability field in the third embodiment.
  • the call response is forwarded to the user terminal A through the NAT_A device;
  • the user terminal A After receiving the call response from the user terminal C, the user terminal A generates a connection test request according to the support of the network management by itself and the user terminal C.
  • the process is specifically as follows:
  • the user terminal A determines that the private address of the user terminal C and its private address are larger or are in a local area network according to the lan in the ICE-mobile-ability field of the corresponding session attribute line ("a" line) in the call response.
  • User The terminal A determines that the relay address of the user terminal C supports the ICE relay network management according to the identifier "relay" managed by the ICE relay network in the ICE-mobile-ability field of the corresponding session attribute line ("a" line) in the call response. It does not support ICE general network management.
  • the user terminal A generates a set of candidate address pairs according to the private addresses of the user terminal A and the user terminal C, and then generates a set of candidate address pairs according to the relay address of the user terminal A and the relay address of the user terminal C. For subsequent connection tests.
  • the candidate address pair based on the private address has a higher priority than the candidate address pair based on the relay address. Therefore, the connection test based on the candidate address pair based on the private address is performed first, and the connection of the candidate address pair is performed. In the case of a test failure, the connection test of the candidate address pair based on the relay address is performed.
  • connection test request of the candidate address pair based on the private address forwards the connection test request to the user terminal C through the NAT_A device device.
  • the user terminal C receives the candidate address of the user terminal C carried in the connection test request, and sends it to the user terminal A in the connection test response.
  • the connectivity test response is forwarded to user terminal A through the NAT_A device.
  • the user terminal C initiates a connection test request to the user terminal A by using the self-generated candidate address pair based on the private address.
  • the NAT_A device forwards the connection test to the user terminal A.
  • the user terminal A receives the private address of the user terminal A carried in the connection test request, and carries it in the connection test response to the user terminal B.
  • the user terminal A and the user terminal C negotiate that if the connection test of the candidate address pair based on the private address of both the user terminal A and the user terminal C is successful, the relay address between the user terminal A and the user terminal C is not necessary. Connect the test, and establish a connection by using the private address of the user terminal A and the private address of the user terminal C; otherwise, performing a connection test of the candidate address pair based on the relay address of both the user terminal A and the user terminal C, and in the relay After the connection test result of the address is successful, the connection is established by using the relay address of the user terminal A and the relay address of the user terminal C.
  • This embodiment is a further refinement of the combination scheme of the implementation three and the sixth embodiment, and introduces the highest priority principle for the user to establish a session connection in the local area network, thereby optimizing the existing scheme to be applied to a more complicated environment.
  • the optimal connection possibilities that may exist are guaranteed. This is when the friend enters a certain wifi domain at the same time.
  • using the LAN mode can reduce the network bandwidth burden and accelerate the transmission experience between users.
  • This embodiment is an application of the present invention in combination with a browser.
  • the user terminal A utilizes the rtcweb technology, that is, logs in a webpage that can provide real-time communication functions on the browser, and initiates ICE negotiation on the webpage, and Most The session is finally established on the browser with the user terminal B.
  • browser A is the browser software used by user terminal A
  • JS of user terminal A is a javascript program running on the browser of user terminal A, which can provide business capabilities.
  • the specific flow chart is as shown in Figure 12:
  • User terminal A initiates a user-oriented terminal B session on browser A, first of which user terminal A
  • a peer connection is established between JS and browser A.
  • the JS of the user terminal A uses the updatelce() interface to notify the browser A to start the ICE negotiation process, and expand the network switching requirement in the updatelce(), that is, to inform the browser that the user terminal A has the network management requirement during the call.
  • the interface is defined as:
  • the MediaConstraints parameter has the type of IceTransports.
  • the value of the type has "TURN” indicating that only the relay address is used for communication (such as the privacy requirement).
  • the value can also be extended, for example, named “ICE-mobility”. " , indicating that the user has the need for network management, and hopes to select the candidate address that can support the network management to give priority to the connection test;
  • the browser A After the ICE update interface updatelce() is received, the browser A starts to start the ICE negotiation process, and first needs to interact with the STUN/TUR server to collect candidate addresses.
  • the process is similar to step S301 in the third embodiment;
  • the browser A uses the ICE callback interface ICEcallback() to send the candidate address to the JS feedback of the user terminal A. For the associated candidate address, whether the user terminal A supports the ICE common network management identifier, for the collected Whether the user terminal A supports the ICE relay network management and/or the ICE common network management identifier according to the corresponding association of the addresses.
  • the association method is similar to the addition method described in step S302 in the third embodiment;
  • the JS of the user terminal A encapsulates the candidate address and other media information of the user terminal A received from the browser A into the information of the SDP protocol format (called SDP information), and carries the information in the call request message through the NAT device.
  • SDP information the information of the SDP protocol format
  • the STUN/TUR server is sent to the user terminal B;
  • the user terminal B performs local candidate address collection, and carries all the candidate addresses that are collected in the call response message, and also adds an identifier that can be used for network management in the candidate address, and the step is the same as that in FIG. 5 in the second embodiment. Similar to S305;
  • the JS of the user terminal A parses the SDP information therein, and obtains the candidate address information of the user terminal B included in the SDP information, and the JS selects the candidate address of the user terminal B and the candidate address.
  • the information managed by the network is fed back to the user terminal A browser through the addIceCandidate() function or a similar function channel;
  • the JS of the user terminal A learns the support of the network management by the user terminal A and the user terminal B through the S804 and the S806. In this embodiment, both the user terminal A and the user terminal B support the ICE common network management;
  • the browser of the user terminal A and the user terminal B perform the connection test of the ICE to confirm the address of the final communication.
  • the process is similar to the steps S307 to S311 in the second embodiment (FIG. 5).
  • the user terminal A side Use a non-relay address for communication;
  • the access information changes due to network switching of the user terminal A. For example, user terminal A switches from a wifi access point to a 3G access point;
  • the JS of the user terminal A knows that both the user terminal A and the user terminal B support the ICE common network management and the user terminal A uses the non-relay address to communicate during the call setup process. At this time, the JS of the user terminal A only needs to wait for the browser. Use ICE common network management to complete the recovery of the session;
  • User terminal A browser uses ICE common network management mode to complete session recovery
  • the user terminal A browser uses an ICEcallback or other similar method to feedback the address of the ICE renegotiation to the JS of the user terminal A;
  • This embodiment applies the inventive concept of the present invention from the perspective of practical application, in conjunction with the relevant interface functions of the browser and javascript, and makes a more comprehensive analysis of the field in which the present invention is implemented and implemented.
  • the present invention is a device description of a session initiation terminal in the method for establishing a session connection, which is mainly designed for the method described in Embodiment 2.
  • the structure relationship diagram of the terminal is shown in FIG.
  • the module specifically includes:
  • the candidate address collection and sending module 201 is configured to send a collection request to the STUN/TUR server in the network, where the collection request includes: indicating candidate address collection for the session initiation terminal and STUN/TUR server support for the ICE relay network management. Information collected by the information;
  • the candidate address collection and reception module 202 is configured to receive a collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management;
  • the call request sending module 203 is configured to send a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
  • the call response receiving module 204 is configured to receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
  • the candidate address matching module 206 is configured to generate one or more sets of candidate addresses according to the collected support information of the STUN/TURN server for the ICE relay network management, the candidate address of the matching session initiating terminal, and the candidate address of the session response terminal. Correct;
  • the connection test module 208 is configured to send a connection test request to the session response terminal according to the priority of the one or more sets of candidate address pairs, and establish a session initiation terminal and a session response terminal after successfully completing the connection test of the two parties. Session connection.
  • the candidate address matching module 206 and the network management determining module 207 are both sub-modules of the processing module 205, and the processing module 205 provides an interface connection with the candidate address collecting and transmitting module 201 and the candidate address collecting and receiving module 202, and responsible for passing the received information to the corresponding module.
  • the terminal of the embodiment further includes: a network management determining module 207, configured to determine, according to the support information of the ICE common network management, whether the session initiation terminal supports the ICE common network management, The support information of the ICE common network management is saved in the session initiation terminal before the session connection is established;
  • the call request sending module sends a call request carrying only the relay candidate address to the session responding terminal after confirming that the session initiating terminal side supports the ICE relay network management;
  • the session initiation terminal side supports the ICE relay network management, including: the STUN/TUR server in the network where the session initiation terminal and the session initiation terminal are located support the ICE relay network management;
  • the call request sending module sends a call request to the session response terminal, where the call request carries each candidate address of the session initiation terminal and the session initiation terminal to the ICE common network management. Support information.
  • the candidate address matches.
  • the module is specifically used to:
  • the matching candidate address collection and reception module 202 collects The candidate address to be reached and the candidate address of the session response terminal are generated with priority One or more sets of candidate address pairs.
  • the candidate address matching module further includes: a first determining sub-module 2061, configured to determine whether the session initiating terminal and the session responding terminal satisfy the ICE common network management. ;
  • the first matching sub-module 2062 is configured to match, according to the priority attribute of the candidate addresses of the two parties, one or more sets of candidate address pairs with priority, when the judgment result is that both parties support the ICE common network management, and initiate the session.
  • the terminal carries the MOBILITY-SUPPORT identifier when the connection test request is sent to the session response terminal according to the priority of the one or more sets of candidate address pairs, and is used for negotiating the ICE common network management with the session response terminal;
  • the second matching sub-module 2063 is configured to: when the judgment result is that both parties do not support the ICE common network management, and confirm that both the session initiation terminal and the STUN/TUR server support the ICE relay network management, the relay address of the session initiation terminal is The candidate addresses of the session response terminal are matched to the one or more sets of candidate address pairs having the priority according to the priority attribute of the candidate address.
  • the terminal further includes a handover requirement determination module 209, where the session initiation terminal sends a collection request to the STUN/TUR server in the network, which is in the handover requirement determination module. Confirm that the session initiating terminal has network switching requirements.
  • the acknowledging that the network has the network switching requirement specifically includes: the switching requirement determining module has a network switching requirement when entering a specific network domain or meeting a specific condition, where the specific network domain includes: a wifi network domain; : Set the network switching requirement for a specific call, or when the frequency of the session response terminal itself moves to a specified value.
  • the candidate address carried in the network and the support information of the network management corresponding to the candidate address are further combined with the support information of the network management corresponding to the candidate address of the session initiation terminal to generate a candidate address pair with priority, so that the connection can be performed more efficiently. test.
  • the connectivity test is performed only based on the priority of the candidate address itself, and the characteristics of the network management mode itself are removed, and a large number of redundant connection test processes are reduced.
  • the third embodiment and the seventh embodiment are specific implementations on the basis of the second embodiment. Therefore, the method in the third embodiment and the seventh embodiment can also be implemented by using the disclosed content, and details are not described herein again. .
  • the embodiment is a structure of a session initiation terminal in a method for establishing a session connection provided by the present invention. Compared with the hardware structure stated in the embodiment 9, the embodiment is characterized in that the implementation is through the application 3041 in the memory 304. with The processor 301 cooperates to complete.
  • the terminal of the present embodiment includes at least one processor 304 (e.g., CPU), at least one network interface 303 or other communication interface, memory 304, and at least one communication bus 302 for enabling connection communication between these devices.
  • the processor 301 is configured to execute executable modules, such as computer programs, stored in the memory 304.
  • the memory 304 may include a high speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory such as at least one disk memory.
  • the communication connection between the system gateway and at least one other network element is implemented by at least one network interface 303 (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network,
  • the memory 304 stores an application 3041, and the application 3041 can be executed by the processor 301.
  • the program includes:
  • the session initiation terminal sends a collection request to the STUN/TUR server in the network, the collection request includes: information indicating collection of candidate address collection of the session initiation terminal and support information of the STUN/TUR server to the ICE relay network management;
  • the session initiating terminal receives the collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TURN server to the ICE relay network management;
  • the session initiating terminal sends a call request to the session responding terminal, where the call request carries at least one candidate address among the collected candidate addresses of the session initiating terminal;
  • the session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server for the ICE relay network management, the matching candidate address and the candidate address of the session response terminal;
  • the session initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties.
  • the application 3041 can also store the program with the optional solution in the second embodiment, and the processor 301 can also respond to the method corresponding to the optional solution. Let me repeat.
  • the present invention is a device description of a session response terminal for establishing a session connection, which is mainly designed for the method described in Embodiment 4.
  • the structure relationship diagram of the terminal is shown in FIG. Module specific Includes:
  • a call request receiving module 401 configured to receive a call request of the session initiating terminal, where the call request carries one or more candidate addresses of the session initiating terminal;
  • the candidate address collecting module 402 is configured to collect its own candidate address according to the call request.
  • the call response sending module 403 is configured to send a call response to the session initiating terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
  • the candidate address matching module 404 is configured to generate, by the call response sending module 403, the candidate address carried in the call response and the candidate address of the session initiating terminal to generate one or more sets of candidate address pairs with priority;
  • the connection test module 405 is configured to send a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs, and establish a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test.
  • the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management
  • the candidate address matching module 404 also includes:
  • the first determining sub-module 4041 is configured to determine, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, whether the session initiation terminal and the session response terminal support the ICE common network management; a matching sub-module 4042, configured to: when both of the two support ICE common network management, when the session initiating terminal side supports the ICE relay network management, the session response terminal matches the call response sending module 403 in the call response.
  • the carried candidate address and the relay candidate address in the candidate address of the session initiating terminal generate one or more sets of candidate address pairs having priority.
  • the candidate address collecting module collects its own candidate address according to the call request, and collects the STUN/TUR server in the ICE in the network where the session response terminal is located.
  • the call response sending module 403 further includes:
  • the second determining sub-module 4031 is configured to determine whether the session initiating terminal and the session responding terminal support the ICE common network management
  • the call response sending module 403 is further configured to: when the judgment result is that both of the ICE common network management are supported, and the acknowledgment session response terminal side supports the ICE relay network management, the session response terminal sends a call to the session initiation terminal. In response, the call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
  • the call response sending module 403 is further configured to: when the judgment result is that both support ICE common network management, The response terminal sends a call response to the session initiation terminal, and the call response carries the candidate information collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
  • the terminal further includes a handover requirement determination module 406, wherein the execution of the first determination submodule 4041 is performed by the handover requirement determination module 406 to confirm that the session response terminal has After the network switching needs are performed, the confirmation that the network switching requirement itself includes:
  • the specific network domain includes: a wifi domain;
  • the satisfying specific conditions includes: setting a network switching requirement for a specific call, or According to the frequency of the session response terminal itself's movement to the specified value.
  • the core inventive point of the present invention is illustrated from the perspective of the session response terminal side, and the session response terminal is further combined by the candidate address of the session initiation terminal carried in the call request and the support information of the session initiation terminal to the network management.
  • the network management support information corresponding to the self-candidate address generates a candidate address pair with priority, which reduces the redundant connection test process, thereby enabling connection test to be performed more efficiently.
  • the fifth embodiment, the sixth embodiment and the seventh embodiment are specific implementations based on the second embodiment. Therefore, the embodiment XI can also implement the fifth embodiment, the sixth embodiment and the seventh embodiment. The method in this will not be repeated here.
  • the embodiment is a structure of another terminal provided by the present invention. Compared with the hardware structure set forth in the eleventh embodiment, the embodiment is characterized in that the implementation is completed by the application 5041 and the processor 501 in the memory 504.
  • the terminal of the present embodiment includes at least one processor 502 (e.g., a CPU), at least one network interface 503 or other communication interface, memory 504, and at least one communication bus 502 for enabling connection communication between the devices.
  • Processor 501 is for executing executable modules, such as computer programs, stored in memory 504.
  • the memory 504 may include a high speed random access memory (RAM: Random Access Memory) and may also include a non-volatile memory such as at least one disk memory.
  • the communication connection between the system gateway and at least one other network element is implemented by at least one network interface 503 (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
  • the memory 504 stores a program 5041, and the program 5041 can be executed by the processor 501.
  • the program includes:
  • the session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal;
  • the session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management according to the call request;
  • the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
  • the session response terminal matches the candidate address carried in the call response and the candidate address of the session initiation terminal to generate one or more sets of candidate address pairs with priority;
  • the session response terminal sends a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test.
  • the application 5041 can also store the program of the alternative in the fourth embodiment, and the processor 501 can also implement the corresponding alternative method. Let me repeat.
  • a main frame of a hardware module of the smart phone includes: one or more processors 601, a memory 602, and an I/O subsystem 603. Also based on the main frame is equipped with a touch sensor 604, an optical sensor 605, other input and output devices 606, a radio frequency circuit 607, an audio circuit 608, a proximity sensor 609, an accelerator 610, a speaker 611, and a microphone 612.
  • the above hardware modules work together to form a currently popular smartphone terminal.
  • the controller 6011 and the processor 6012 and the program modules in the memory 602 cooperate to implement various functions of the smart phone;
  • the program module further includes: an operating system 6021 and a communication module 6022
  • the processor 301 executes the process of the application 3041.
  • the implementation in this embodiment is specifically: the processor 6012 executes the program corresponding to the candidate collection module 6027(a) in the application module 6027, and is located in the network.
  • the STUN/TUR server sends a collection request, the collection request includes: information indicating collection of candidate address collection of the session initiation terminal and support information of the STUN/TUR server to the ICE relay network management; and receiving the collection of the STUN/TUR server In response, the collecting response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TURN server to the ICE relay network management;
  • the processor 6012 executes a program corresponding to the call request sending module 6027(b) in the application module 6027, and sends a call request to the session responding terminal, where the call request carries at least one candidate address among the collected candidate addresses of the session initiating terminal. ;
  • the processor 6012 executes a program corresponding to the call response receiving module 6027(c) in the application module 6027, and receives a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
  • the processor 6012 executes a program corresponding to the candidate address matching module 6027(d) in the application module 6027, and matches its own candidate address and the session response terminal according to the collected support information of the STUN/TURN server to the ICE relay network management.
  • the candidate address generates one or more sets of candidate address pairs;
  • the processor 6012 executes a program corresponding to the connection test module 6027(e) in the application module 6027, and the session initiation terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs;
  • the processor 6012 executes the program corresponding to the session establishment module 6027(f) in the application module 6027, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties.
  • the processor 6012 executes the application module 6027 and can complete other alternatives in the fourth embodiment, and details are not described herein again.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM > or technical fields Any other form of storage medium known.

Abstract

The present invention relates to the field of computers and communications, and in particular, to a session connection establishment method, apparatus and system, which enhances the efficiency of a connection test by improving a matching process of candidate address pairs in the prior art. The method comprises: a session initiating terminal sending a gathering request to an STUN/TURN server in a network the session initiating terminal is located in; the session initiating terminal receiving a gathering response sent by the STUN/TURN server for the gathering request, the gather response carrying one or more candidate addresses of the session initiating terminal and information about support of the STUN/TURN server to ICE relay network management; the session initiating terminal sending a calling request to a session responding terminal; and receiving a calling response of the session responding terminal, the session initiating terminal matching the candidate address of the session initiating terminal with a candidate address of the session responding terminal according to the gathered information about support of the STUN/TURN server to the ICE relay network management, and generating one or more groups of candidate address pairs.

Description

一种会话连接建立的方法、 装置和***  Method, device and system for establishing session connection
技术领域 Technical field
本发明涉及计算机、 通信领域, 尤其涉及一种会话连接建立的方法、 装置和***。  The present invention relates to the field of computers and communications, and in particular, to a method, an apparatus and a system for establishing a session connection.
背景技术 Background technique
交互式连接建立 (interactive connectivity establishment, ICE)是一种通过综合运用网络地 址转换 (Network Address Translator, NAT)会话传输应用 (Session Traversal Utilities for NAT, STUN)和基于中继的 NAT传输 (Traversal Using Relay NAT , TURN)两种传输技术的数据传 输框架, ICE框架能够在实现 NAT穿越过程中弥补两种技术在各自单独实现过程中存在的 固有的缺陷。 ICE可以被任何请求 /问答模式的协议利用, 例如: 通过会话描述协议 (Session Description Protocol, SDP)来完成相关功能的定义和实现。  Interactive connectivity establishment (ICE) is a combination of Network Address Translator (NAT) Session Transfer Application (SUN) and Relay-based NAT (Traversal Using Relay) NAT, TURN) The data transmission framework of two transmission technologies. The ICE framework can make up for the inherent defects of the two technologies in their respective implementations during the NAT traversal process. The ICE can be utilized by any request/question mode protocol, for example: The Session Description Protocol (SDP) is used to define and implement related functions.
当一个通过 ICE框架协商完成的会话连接在会话过程中某个终端发生网络切换, 如: 建立会话连接中的会话发起终端从 wifi网络切换到 3G网络; 此时该会话发起终端的网络 环境发生变化,例如:该会话发起终端信号所经过的会话连接网络中的 NAT设备发生改变。 现有的恢复会话连接的方法是双方会话终端重新进行 ICE的协商, 该 ICE的协商包括候选 地址搜集、 候选地址交互和连接测试等步骤, 所述候选地址交互包括对方会话终端的候选 地址的获取, 以及双方会话终端将候选地址匹配生成候选地址对过程。 这个重新进行 ICE 的协商过程会耗费较长的时间。 于是现有技术提出使用网络管理的改进方法, 该网络管理 方式主要通过省去地址交互以及缩短连接测试前的准备过程的手段来加快 ICE的重新协商 过程(ICE的重新协商过程即会话链路重新建立过程)。 上述网络管理方式包括两种: 一种 网络管理方式是 ICE普通网络管理方式, 该方式主要是要求建立会话的双方终端都要支持 ICE普通网络管理方式(或者描述为建立会话的双方终端都具备有 ICE普通网络管理能力), 并在建立所述会话的某一方终端要进行网络切换时应用; 另一种网络管理方式是 ICE中继 网络管理方式, 该方式主要是要求进行网络切换的会话终端 (可以是会话发起终端或会话 响应终端)和该会话终端所在网络中的 STUN/TUR 服务器具备 ICE中继网络管理能力, 并在该会话终端要进行网络切换时应用。  When a session connection negotiated through the ICE framework completes a network switch during a session, for example, the session initiation terminal in establishing a session connection switches from the wifi network to the 3G network; at this time, the network environment of the session initiation terminal changes. For example, the NAT device in the session connection network through which the session initiation terminal signal passes changes. The existing method for restoring the session connection is that the two parties' session terminals re-negotiate the ICE. The negotiation of the ICE includes the steps of candidate address collection, candidate address interaction, and connection test, and the candidate address interaction includes the acquisition of the candidate address of the other party's session terminal. And the process in which the two session terminals match the candidate addresses to generate candidate address pairs. This re-initiation of the ICE negotiation process will take a long time. Therefore, the prior art proposes an improved method of using network management, which speeds up the ICE renegotiation process by omitting the address interaction and shortening the preparation process before the connection test (the ICE renegotiation process is the session link re-re- Establishment process). The above network management methods include two types: One network management mode is an ICE common network management mode, which mainly requires that both terminals of the session establishment support the ICE common network management mode (or both terminals described as establishing a session have ICE common network management capability), and is applied when a certain terminal of the session is to be switched over the network; another network management mode is an ICE relay network management mode, which is mainly a session terminal that requires network switching ( The session initiating terminal or the session responding terminal) and the STUN/TUR server in the network where the session terminal is located have the ICE relay network management capability, and are applied when the session terminal is to perform network switching.
ICE普通网络管理方式: 要求通信的双方会话终端都支持 ICE普通网络管理, 当建立 会话的某一终端发生网络切换时, 使用 ICE普通网络管理方式进行快速的切换。 ICE普通 网络管理主要原理是: 以图 1为例, 用户终端 A (会话发起终端)在 S110中向用户终端 B (会话响应终端)发送连接测试请求, 在连接测试请求中会添加 MOBILITY-SUPPORT参 数, 该参数用来协商双方的 ICE普通网络管理的支持情况, 如果用户终端 B支持 ICE普通 网络管理, 则在连接测试响应中也添加 MOBILITY-SUPPORT参数, 这样双方就能知道对 方对 ICE普通网络管理的支持情况。 完成连接测试后, 并选定最终连接地址后开始通信。 当一方在通信过程中发生网络切换, 例如: 用户终端 A发生网络切换, 此时用户终端 A需 要在网络切换后搜集被分配的新的候选地址, 并使用搜集到的新的候选地址向用户终端 B 的候选地址发送新的连接测试请求, 并且用户终端 A在新的连接测试清求中添加标识名为 MOBILITY-EVENT的字段,用户终端 B收到该携带 MOBILITY-EVENT字段的新的连接测 试请求后, 根据该 MOBILITY-EVENT字段确定用户终端 A发生了网络切换, 且正在使用 ICE普通网络管理方式试图重新进行 ICE的协商, 此时用户终端 B清空之前匹配候选地址 对所留下的匹配信息,并根据新的连接测试中携带的用户终端 A的候选地址进行连接测试, 并在连接测试成功后建立会话, 避免了用户终端 B对于自身候选地址的重新搜集。 ICE common network management mode: Both session terminals that require communication support ICE common network management. When a network connection is established on a terminal that establishes a session, the ICE common network management mode is used for fast handover. The main principle of ICE common network management is as follows: In FIG. 1 , user terminal A (session initiation terminal) sends a connection test request to user terminal B (session response terminal) in S110, and adds MOBILITY-SUPPORT parameter in the connection test request. The parameter is used to negotiate the support of the ICE common network management. If the user terminal B supports ICE common network management, the MOBILITY-SUPPORT parameter is also added to the connection test response, so that both parties can know each other's ICE common network. Management support. After the connection test is completed, the communication is started after the final connection address is selected. When a party switches over the network during communication, for example: User terminal A has network switching. At this time, user terminal A needs to collect the allocated new candidate address after network switching, and uses the collected new candidate address to the user terminal. The candidate address of B sends a new connection test request, and user terminal A adds a field named MOBILITY-EVENT in the new connection test request, and user terminal B receives the new connection test request carrying the MOBILITY-EVENT field. After that, according to the MOBILITY-EVENT field, it is determined that the user terminal A has a network handover, and the ICE common network management mode is being used to attempt to re-negotiate the ICE. At this time, the user terminal B clears the matching information left by the matching candidate address pair. The connection test is performed according to the candidate address of the user terminal A carried in the new connection test, and the session is established after the connection test is successful, thereby avoiding the re-collection of the candidate address by the user terminal B.
ICE中继网络管理方式不要求通信的会话发起终端和会话响应终端双方都支持 ICE中 继网络管理, 本方式只要求有网络切换需求的会话终端 (会话发起终端或会话响应终端) 及该会话终端所在的网络中的 STUN/TUR 服务器支持 ICE中继网络管理便可以实现。 ICE 中继网络管理主要原理是: 以图 1为例, 在候选地址搜集过程 S101-S104中, 用户终端 A (会话发起终端)在向 STUN/TUR 服务器发送搜集候选地址的初始请求中添加一个值为 空的 MOBILITY-TICKET字段, STUN/TUR 服务器在向用户终端 A分配中继地址的同时 还向用户终端 A返回 MOBILITY-TICKET字段,并为所述 MOBILITY-TICKET字段分配一 个值。 假设用户终端 A和用户终端 B建立的会话使用的是该中继地址, 当在会话过程中用 户终端 A发生了网络切换,此时用户终端 A可以向该 STUN/TUR 服务器发起新的候选地 址搜集请求, 所述新的候选地址搜集请求中携带该分配有值的 MOBILITY-TICKET字段, STUN/TUR 服务器会根据该 MOBILITY-TICKET字段中的值确定在用户终端 A发生网络 切换后,仍然为用户终端 A分配在发生网络切换之前已经为用户终端 A分配过的同一个中 继地址; 这样对于用户终端 B (会话响应终端)来说, 与用户终端 B建立会话的用户终端 A的对外地址(在本例子中即用户终端 A的中继地址)在用户终端 A发生网络切换前后没 有发生改变, 来自用户终端 B的数据媒体还是可以通过该中继地址与发生网络切换后的用 户终端 A建立会话连接 ,从而使发生网络切换的用户终端 A恢复和用户终端 B之间的会话。  The ICE relay network management method does not require communication between the session initiation terminal and the session response terminal to support the ICE relay network management. In this mode, only the session terminal (session initiation terminal or session response terminal) having the network handover requirement and the session terminal are required. The STUN/TUR server in the network can support ICE relay network management. The main principle of the ICE relay network management is as follows: In the candidate address collecting process S101-S104, the user terminal A (session initiating terminal) adds a value to the initial request for sending the collecting candidate address to the STUN/TUR server in the candidate address collecting process S101-S104. In the empty MOBILITY-TICKET field, the STUN/TUR server also returns a MOBILITY-TICKET field to the user terminal A while assigning a relay address to the user terminal A, and assigns a value to the MOBILITY-TICKET field. It is assumed that the session established by the user terminal A and the user terminal B uses the relay address. When the user terminal A has a network switch during the session, the user terminal A can initiate a new candidate address collection to the STUN/TUR server. The request, the new candidate address collection request carries the MOBILITY-TICKET field with the assigned value, and the STUN/TUR server determines, according to the value in the MOBILITY-TICKET field, that the user terminal is still after the network switching occurs on the user terminal A. A allocates the same relay address that has been assigned to user terminal A before the network switch occurs; thus, for user terminal B (session response terminal), the external address of user terminal A establishing a session with user terminal B (in this case) In the example, the relay address of the user terminal A does not change before and after the network switching occurs in the user terminal A, and the data medium from the user terminal B can still establish a session connection with the user terminal A after the network switching occurs through the relay address. Thereby causing the user terminal A that has undergone network switching to resume the session with the user terminal B
实现 ICE框架的核心过程包括: 自身候选地址搜集、 对方候选地址获取、 候选地址配 对和连接测试四个过程。 现有技术中一个基于 ICE框架的会话建立的流程如图 1所示, 其 中包括 ICE普通网络管理和 ICE中继网络管理的应用; 不妨假设 , 用户终端 A (会话发起 终端) 同时支持 ICE普通网络管理方式和 ICE中继网络管理方式, 但用户终端 B (会话响 应终端)不支持 ICE普通网络管理, 用户终端 A要求在 ICE协商中选择可以满足网络管理 的地址进行通信过程如下: The core processes of implementing the ICE framework include: four processes of self-candidate address collection, peer candidate address acquisition, candidate address pairing, and connection testing. A flow of session establishment based on an ICE framework in the prior art is shown in FIG. 1 It includes the application of ICE common network management and ICE relay network management; it may be assumed that user terminal A (session initiation terminal) supports both ICE common network management mode and ICE relay network management mode, but user terminal B (session response terminal) ICE common network management is not supported. User terminal A requires the selection of an address that can satisfy the network management in ICE negotiation. The communication process is as follows:
S101、用户终端 A向其所在网络中的 STUN/TUR 服务器发送搜集自身候选地址的初 始请求。 在 STU 协议中该初始请求又被称为是 Binding请求。 用户终端 A在该初始请求 中添加标识名为 MOBILITY-TICKET的字段,该字段表明用户终端 A支持 ICE中继网络管 理, 此时用户终端 A添加的 MOBILITY-TICKET字段的值为空, 此时该初始清求的发送地 址为用户终端 A所在主机的地址及分配的端口号,目的地址为 STUN/TURN服务器的地址。  S101. User terminal A sends an initial request for collecting its own candidate address to the STUN/TUR server in its network. This initial request is also referred to as a Binding request in the STU protocol. The user terminal A adds a field named MOBILITY-TICKET to the initial request, and the field indicates that the user terminal A supports the ICE relay network management. At this time, the value of the MOBILITY-TICKET field added by the user terminal A is null. The sending address of the initial request is the address of the host where the user terminal A is located and the assigned port number, and the destination address is the address of the STUN/TURN server.
S102、 初始请求通过 NAT设备转发给 STUN/TUR 服务器。 该初始请求的发送地址 在经过 NAT设备转发时, 被替换成了当前 NAT设备的服务器映射地址, 所述服务器映射 地址是 NAT设备给用户终端 A分配的 (服务器映射地址也被称为 NAT地址), 并转发给 STUN/TUR 月艮务器。  S102. The initial request is forwarded to the STUN/TUR server through the NAT device. The sending address of the initial request is replaced with the server mapping address of the current NAT device when being forwarded by the NAT device, and the server mapping address is assigned by the NAT device to the user terminal A (the server mapping address is also referred to as a NAT address) And forwarded to the STUN/TUR server.
5103、 STUN/TURN服务器向用户终端 A回复初始响应, 其中携带上述 NAT地址及 STUN/TUR 服务器为用户终端 A 分配的中继地址。 由于收到的初始请求中携带有 5103. The STUN/TURN server replies to the user terminal A with an initial response, where the NAT address and the relay address assigned by the STUN/TUR server to the user terminal A are carried. Due to the initial request received
MOBILITY-TICKET字段, 如果 STUN/TUR 服务器也支持 ICE中继网络管理, 则在初始 响应中也携带一个 MOBILITY-TICKET字段, 并为 MOBILITY-TICKET字段赋值。 The MOBILITY-TICKET field, if the STUN/TUR server also supports ICE trunk network management, also carries a MOBILITY-TICKET field in the initial response and assigns a value to the MOBILITY-TICKET field.
5104、该初始响应通过 NAT设备转发后到达用户终端 A,此时用户终端 A就搜集到了 其候选地址并进行保存。所述候选地址包括用户终端 A自身的主机地址(也称为私有地址) 和初始响应中的 NAT地址和中继地址, 用户终端 A还需要保存服务器为其分配的  5104. The initial response is forwarded by the NAT device and then reaches the user terminal A. At this time, the user terminal A collects the candidate address and saves it. The candidate address includes the host address (also referred to as a private address) of the user terminal A itself and the NAT address and the relay address in the initial response, and the user terminal A also needs to save the server for its allocation.
MOBILITY-TICKET字段的值。 The value of the MOBILITY-TICKET field.
5105、用户终端 A向用户终端 B发送呼叫请求,所述呼叫请求携带用户终端 A搜集到 的自身所有候选地址。  5105. The user terminal A sends a call request to the user terminal B, where the call request carries all of its own candidate addresses collected by the user terminal A.
5106、 该呼叫请求通过 NAT设备转发到用户终端 B。  5106. The call request is forwarded to the user terminal B by using the NAT device.
S107、 用户终端 B在收到该呼叫请求后进行自己的候选地址的搜集, 其候选地址的搜 集过程同用户终端 A侧的类似。  S107. After receiving the call request, the user terminal B performs collection of its own candidate address, and the process of collecting the candidate address is similar to that of the user terminal A.
5108、用户终端 B向用户终端 A发送呼叫响应。用户终端 B将搜集到的自身所有候选 地址携带在呼叫响应中发送给用户终端 A。  5108. User terminal B sends a call response to user terminal A. The user terminal B carries all the collected candidate addresses in the call response and sends them to the user terminal A.
5109、 该呼叫响应经过 NAT设备转发到用户终端 A; S110、 用户终端 A在收到用户终端 B的呼叫响应后进行连接测试。 在进行连接测试之 前, 用户终端 A会根据双方候选地址本身的优先级进行候选地址的匹配, 生成包含有不同 优先级的候选地址对。 用户终端 A需要按照优先级逐个使用候选地址对向用户终端 B发送 连接测试请求, 并在连接测试请求中都携带有 MOBILITY-SUPPORT字段, 该参数用来协 商用户终端 A和用户终端 B的 ICE普通网络管理。 5109, the call response is forwarded to the user terminal A through the NAT device; S110. The user terminal A performs a connection test after receiving the call response of the user terminal B. Before performing the connection test, the user terminal A performs matching of the candidate addresses according to the priorities of the candidate addresses themselves, and generates candidate address pairs including different priorities. The user terminal A needs to send a connection test request to the user terminal B one by one according to the priority, and carries the MOBILITY-SUPPORT field in the connection test request, which is used to negotiate the ICE of the user terminal A and the user terminal B. Network management.
S 111、 该连接测试清求通过 NAT设备转发(对于中继地址的连接测试请求还需要通过 STUN/TUR 服务器的的转发)。 其中, 有些候选地址对的连接测试请求可以被转发到用户 终端 B, 而有些候选地址对的连接测试请求将无法转发到用户终端 B;  S 111. The connection test request is forwarded by the NAT device (the connection test request for the relay address also needs to be forwarded by the STUN/TUR server). The connection test request of some candidate address pairs may be forwarded to the user terminal B, and the connection test request of some candidate address pairs may not be forwarded to the user terminal B;
5112、 对于可以收到连接测试清求的用户终端 A的候选地址, 用户终端 B向该用户终 端 A候选地址回复连接性测试响应, 如果用户终端 B也支持 ICE普通网络管理方式, 则用 户终端 B会在连接性测试响应中携带赋值后的 MOBILITY- SUPPORT字段; 本例子中由于 用户终端 B不支持 ICE普通网络管理, 则在连接测试响应中的 MOBILITY-SUPPORT字段 没有被赋值;  5112. For the candidate address of the user terminal A that can receive the connection test request, the user terminal B replies with a connectivity test response to the candidate address of the user terminal A. If the user terminal B also supports the ICE common network management mode, the user terminal B The MOBILITY-SUPPORT field after the assignment is carried in the connectivity test response; in this example, since the user terminal B does not support the ICE general network management, the MOBILITY-SUPPORT field in the connection test response is not assigned;
5113、 该链接测试响应通过 NAT设备(对于中继地址还需要通过 STUN/TURN服务 器的转发)转发到用户终端 A;  5113, the link test response is forwarded to the user terminal A through the NAT device (for the relay address also needs to be forwarded by the STUN/TURN server);
其中, 步骤 S110-S113 , 按照私有地址、 NAT地址和中继地址三者的优先级从高到底 顺序匹配双方的候选地址生成具有优先级的候选地址对, 并依次进行候选地址对的连接测 试; 整个测试的示意图如图 2A所示, 其中地址 ll(host)为用户终端 A的私有地址; 地址 12(reflx)为用户终端 A的 NAT地址, 地址 13(relay)为用户终端的中继地址。  Step S110-S113, generating a candidate address pair with priority according to the priority of the private address, the NAT address, and the relay address from the highest to the bottom, and sequentially performing the connection test of the candidate address pair; A schematic diagram of the entire test is shown in FIG. 2A, where address ll (host) is the private address of user terminal A; address 12 (reflx) is the NAT address of user terminal A, and address 13 (relay) is the relay address of the user terminal.
可以看到现有技术中包括使用 ICE中继网络管理和 ICE普通网络管理的方案, 但现有 技术中在进行连接测试时过程比较繁瑣, 资源损耗较大。  It can be seen that the prior art includes a scheme of using ICE relay network management and ICE common network management, but in the prior art, the connection test is cumbersome and the resource loss is large.
发明内容 Summary of the invention
本发明提供了一种会话连接建立的方法、 装置和***, 通过对现有技术中候选地址对 匹配过程的改进, 从而提高了连接测试的效率; 其中, 具体包括:  The present invention provides a method, an apparatus, and a system for establishing a session connection. The efficiency of the connection test is improved by improving the matching process of the candidate address pair in the prior art.
本发明的第一方面, 提供的一种会话连接建立的方法, 包括:  A first aspect of the present invention provides a method for establishing a session connection, including:
会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求,所述搜集请求包括: 指示对所述会话发起终端的候选地址搜集和所述 STUN/TURN服务器对 ICE中继网络管理 的支持信息的搜集的信息;  The session initiation terminal sends a collection request to the STUN/TUR server in the network, where the collection request includes: indicating support address collection of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management. Information collected;
所述会话发起终端接收所述 STUN/TUR 服务器发送的针对所述收集请求的搜集响应, 所述搜集响应中携带所述会话发起终端的一个或多个候选地址和所述 STUN/TUR 服务器 对 ICE中继网络管理的支持信息; Receiving, by the session initiating terminal, a collection response sent by the STUN/TUR server for the collection request, The collecting response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TUR server to the ICE relay network management;
所述会话发起终端向会话响应终端发送呼叫请求, 所述呼叫请求中携带搜集到的所述 会话发起终端的候选地址中的至少一个候选地址;  The session initiating terminal sends a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带所述会话响应终端的一个或 者多个候选地址;  Receiving a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持 信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候选地址对; 所述会话发起终端根据所述一组或多组候选地址对向所述会话响应终端发送连接测试 请求,并在成功完成连接测试后,建立所述会话发起终端和所述会话响应终端的会话连接。  The session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server to the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal; The session initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test. .
结合第一方面的第一种可能的实现方式中, 所述会话发起终端向会话响应终端发送呼 叫请求之前, 还包括:  In conjunction with the first possible implementation of the first aspect, before the session initiating terminal sends the call request to the session response terminal, the method further includes:
所述会话发起终端根据 ICE普通网络管理的支持信息判断自己是否支持 ICE普通网络 管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中;  The session initiating terminal determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal;
当判断结果是所述会话发起终端自己不支持 ICE普通网络管理时, 则在确认所述会话 发起终端和所述 STUN/TUR 服务器同时支持 ICE中继网络管理后, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 所述会话发起终端在所 述呼叫请求中仅携带所述会话发起终端的中继候选地址;  When the result of the judgment is that the session initiating terminal does not support the ICE common network management, the call request is carried in the call request after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management. The at least one candidate address of the candidate address of the session initiation terminal is specifically: the session initiation terminal only carries the relay candidate address of the session initiation terminal in the call request;
当判断结果是所述会话发起终端自己支持 ICE普通网络管理时, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 所述会话发起终端在所 述呼叫请求中携带所述会话发起终端的所有候选地址和所述会话发起终端对 ICE普通网络 管理的支持信息。  When the result of the judgment is that the session initiating terminal supports the ICE common network management, the call request carries at least one candidate address in the candidate address of the collected session initiating terminal, specifically: the session initiating terminal is in the call. The request carries all candidate addresses of the session initiation terminal and support information of the session initiation terminal to the ICE common network management.
结合第一方面或结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中, 所述接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带所述会话响应终端的一个或 者多个候选地址, 还包括:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the receiving, by the session response terminal, a call response, where the call response carries the session response One or more candidate addresses of the terminal, further including:
所述呼叫响应中还包括所述会话响应终端对 ICE普通网络管理的支持信息; 则所述会话发起终端根据搜集到的所述 STUN/TURN服务器对 ICE中继网络管理的支 持信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候选地址 对, 具体包括: 所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持 信息、 所述会话发起终端对 ICE普通网络管理的支持信息和所述会话响应终端对 ICE普通 网络管理的支持信息, 匹配自己搜集到的候选地址和所述会话响应终端的候选地址, 生成 具有优先级的一组或多组候选地址对。 The call response further includes support information of the session response terminal to the ICE common network management; and the session initiation terminal matches the collected information of the STUN/TURN server to the ICE relay network management. And the candidate address and the candidate address of the session response terminal, and generating one or more sets of candidate address pairs, specifically: The session initiation terminal according to the collected support information of the STUN/TUR server to the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the session response terminal to the ICE common network management Supporting information, matching the candidate address collected by itself and the candidate address of the session response terminal, and generating one or more sets of candidate address pairs with priority.
结合第一方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述会话发起 终端根据搜集到的所述 STUN/TURN服务器对 ICE中继网络管理的支持信息、 所述会话发 起终端对 ICE普通网络管理的支持信息和所述会话响应终端对 ICE普通网络管理的支持信 息, 匹配自己搜集到的候选地址和所述会话响应终端的候选地址, 生成具有优先级的一组 或多组候选地址对, 具体为:  With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the session initiation terminal, according to the collected support information of the STUN/TURN server to the ICE relay network management, The support information of the session initiation terminal to the ICE common network management and the support information of the session response terminal to the ICE common network management match the candidate address collected by the session and the candidate address of the session response terminal to generate a priority group. Or multiple sets of candidate address pairs, specifically:
所述会话发起终端判断自己和所述会话响应终端是否都支持 ICE普通网络管理; 在判断结果为双方都支持 ICE普通网络管理时, 按照双方的候选地址的优先级属性匹 配成具有优先级的一组或多组候选地址对; 在判断结果为双方并非满足都支持 ICE普通网 络管理条件时, 确认所述会话发起终端和所述 STUN/TURN服务器都支持 ICE中继网络管 理, 则将所述会话发起终端的中继地址和所述会话响应终端的候选地址按照候选地址的优 先级属性匹配成具有优先级的一组或多组候选地址对。  The session initiating terminal determines whether both the self and the session response terminal support the ICE common network management; when the judgment result is that both parties support the ICE common network management, the priority attribute of the candidate addresses of the two parties is matched to the priority one. Group or groups of candidate address pairs; when the judgment result is that both parties do not satisfy the ICE common network management condition, and confirm that the session initiation terminal and the STUN/TURN server support ICE relay network management, the session is The relay address of the originating terminal and the candidate address of the session responding terminal are matched into one or more sets of candidate address pairs having priority according to the priority attribute of the candidate address.
结合第一方面或结合第一方面的上述几种可能的实现方式, 在第四种可能的实现方式 种中, 所述会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求和 /或会话发起 终端向会话响应终端发送呼叫请求和 /或匹配自己的候选地址和所述会话响应终端的候选 地址, 是在会话发起终端确认自身有网络切换需求后才进行。  With reference to the first aspect or the foregoing several possible implementation manners of the first aspect, in a fourth possible implementation manner, the session initiation terminal sends a collection request and/or a session to a STUN/TUR server in a network. The sending terminal sends a call request to the session responding terminal and/or matches its own candidate address and the candidate address of the session responding terminal, which is performed after the session initiating terminal confirms that it has a network switching requirement.
本发明的第二方面, 提供一种会话连接建立的方法, 包括:  A second aspect of the present invention provides a method for establishing a session connection, including:
会话响应终端接收会话发起终端的呼叫请求, 所述呼叫请求携带所述会话发起终端的 一个或多个候选地址;  The session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal;
所述会话响应终端根据所述呼叫请求搜集所述会话响应终端的候选地址和所述会话响 应终端对 ICE普通网络管理的支持信息;  And the session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management according to the call request;
所述会话响应终端向所述会话发起终端发送呼叫响应, 所述呼叫响应携带所述会话响 应终端搜集到的候选地址和所述会话响应终端对 ICE普通网络管理的支持信息;  The session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
所述会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选 地址, 生成一组或多组候选地址对;  The session response terminal matches a candidate address carried in the call response and a candidate address of the session initiation terminal, and generates one or more sets of candidate address pairs;
所述会话响应终端根据所述一组或多组候选地址对向所述会话发起终端发送连接测试 请求,并在成功完成连接测试后,建立所述会话发起终端和所述会话响应终端的会话连接。 结合第二方面的第一种可能的方案, 所述接收所述会话发起终端的呼叫请求中还携带 有所述会话发起终端对 ICE普通网络管理的支持信息, 则所述会话响应终端匹配自己在所 述呼叫响应中携带的候选地址和所述会话发起终端的候选地址, 生成一组或多组候选地址 对, 具体包括: The session response terminal sends a connection test to the session initiation terminal according to the one or more sets of candidate address pairs. Requesting, and after successfully completing the connection test, establishing a session connection between the session initiation terminal and the session response terminal. With the first possible solution of the second aspect, the call request receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, and the session response terminal matches the The candidate address carried in the call response and the candidate address of the session initiation terminal generate one or more sets of candidate address pairs, including:
所述会话响应终端根据所述呼叫请求中携带的会话发起终端对 ICE普通网络管理的支 持信息和所述会话响应终端自身的 ICE普通网络管理的支持信息, 确定会话发起终端和会 话响应终端两者是否都支持 ICE普通网络管理;  The session response terminal determines, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, and the support information of the ICE common network management of the session response terminal itself, determining both the session initiation terminal and the session response terminal. Whether it supports ICE common network management;
当两者不满足都支持 ICE普通网络管理时, 则在确定所述会话发起终端侧支持 ICE中 继网络管理时, 所述会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起 终端的候选地址中的中继候选地址, 生成具有优先级的一组或多组候选地址对。  When the two are not satisfied, the ICE common network management is supported, and when it is determined that the session initiation terminal side supports the ICE relay network management, the session response terminal matches the candidate address carried in the call response and the session initiation. The relay candidate address in the candidate address of the terminal generates one or more sets of candidate address pairs with priority.
结合第二方面或第二方面的第一种可能的方案, 在第三种可能的方案中, 所述会话响 应终端根据所述呼叫请求搜集自身的候选地址外, 还搜集所述会话响应终端所在网络中的 With the second aspect or the first possible solution of the second aspect, in a third possible solution, the session response terminal collects its own candidate address according to the call request, and collects the session response terminal In the network
STUN/TUR 服务器对 ICE中继网络管理的支持信息, 则所述会话响应终端向所述会话发 起终端发送所述呼叫响应, 所述呼叫响应携带所述会话响应终端搜集到的候选地址和会话 响应终端对 ICE普通网络管理的支持信息, 具体包括: The STUN/TUR server supports the information of the ICE relay network management, and the session response terminal sends the call response to the session initiation terminal, where the call response carries the candidate address and the session response collected by the session response terminal. Terminal support information for ICE common network management, including:
所述会话响应终端判断所述会话发起终端和所述会话响应终端是否都支持 ICE普通网 络管理;  The session response terminal determines whether the session initiation terminal and the session response terminal both support ICE common network management;
在判断结果为两者不满足都支持 ICE普通网络管理时, 并在确认所述会话响应终端侧 支持 ICE中继网络管理时, 所述会话响应终端向所述会话发起终端发送呼叫响应, 所述呼 叫响应携带所述会话响应终端搜集到的中继地址和会话响应终端对 ICE普通网络管理的支 持信息。  When the result of the determination is that the two are not satisfied, the ICE common network management is supported, and when the session response terminal side is confirmed to support the ICE relay network management, the session response terminal sends a call response to the session initiation terminal, where The call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
结合第二方面或结合第二方面的上述几种可能的实现方式, 在第四种可能的实现方式 种中, 所述会话响应终端根据所述呼叫请求搜集自身的候选地址和 /或所述会话响应终端向 所述会话发起终端发送呼叫响应和 /或所述会话响应终端匹配自己在呼叫响应中携带的候 选地址和所述会话发起终端的候选地址, 是在会话发起终端确认自身有网络切换需求后才 进行。  With reference to the second aspect or the foregoing several possible implementation manners of the second aspect, in a fourth possible implementation manner, the session response terminal collects its own candidate address and/or the session according to the call request. Responding to the terminal sending a call response to the session initiating terminal and/or the session responding terminal matching the candidate address carried in the call response and the candidate address of the session initiating terminal, the session initiating terminal confirming that there is a network switching requirement Only afterwards.
本发明的第三方面, 提供了一种会话连接建立的会话发起终端, 包括:  A third aspect of the present invention provides a session initiation terminal for establishing a session connection, including:
候选地址搜集发送模块, 用于向所述会话发起终端所在网络中的 STUN/TUR 服务器 发送搜集请求, 所述搜集请求包括: 指示对会话发起终端的候选地址搜集和所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息的搜集的信息; a candidate address collection sending module, configured to send a STUN/TUR server in a network where the terminal is located to the session Sending a collection request, the collection request includes: information indicating collection of candidate addresses of the session initiation terminal and collection of support information of the STUN/TUR server to the ICE relay network management;
候选地址搜集接收模块, 用于接收所述 STUN/TUR 服务器发送的针对所述收集请求 的搜集响应, 所述搜集响应中携带会话发起终端的一个或多个候选地址和所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息;  a candidate address collection and receiving module, configured to receive a collection response sent by the STUN/TUR server for the collection request, where the collection response carries one or more candidate addresses of the session initiation terminal and the STUN/TUR server pair Support information for ICE relay network management;
呼叫请求发送模块, 用于向会话响应终端发送呼叫请求, 所述呼叫请求中携带搜集到 的会话发起终端的候选地址中的至少一个候选地址;  a call request sending module, configured to send a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
呼叫响应接收模块, 用于接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带所 述会话响应终端的一个或者多个候选地址;  a call response receiving module, configured to receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
候选地址匹配模块, 用于根据搜集到的所述 STUN/TURN服务器对 ICE中继网络管理 的支持信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候选 地址对;  a candidate address matching module, configured to: according to the collected support information of the STUN/TURN server to the ICE relay network management, match the candidate address of the UE and the candidate address of the session response terminal, and generate one or more candidate addresses. Correct;
连接测试模块, 用于根据所述一组或多组候选地址对向会话响应终端发送连接测试请 求, 在成功完成双方的连接测试后, 建立所述会话发起终端和所述会话响应终端的会话连 接。  a connection test module, configured to send a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establish a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties .
结合第三方面的第一种可能的方案中, 所述会话发起终端还包括:  In conjunction with the first possible solution of the third aspect, the session initiation terminal further includes:
网络管理判断模块, 用于根据 ICE普通网络管理的支持信息判断所述会话发起终端是 否支持 ICE普通网络管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中; 当判断结果是所述会话发起终端不支持 ICE普通网络管理时, 则在确认所述会话发起 终端侧支持 ICE中继网络管理后, 所述呼叫请求发送模块向所述会话响应终端发送仅携带 中继候选地址的呼叫请求; 其中, 所述会话发起终端侧支持 ICE中继网络管理包括: 所述 会话发起终端和所述会话发起终端所在网络中的 STUN/TURN服务器都支持 ICE中继网络 管理;  a network management judging module, configured to determine, according to the support information of the ICE common network management, whether the session initiating terminal supports the ICE common network management, where the support information of the ICE common network management is stored in the session initiating terminal; When the session initiation terminal does not support the ICE common network management, after the session initiation terminal side supports the ICE relay network management, the call request sending module sends a call request carrying only the relay candidate address to the session response terminal. The session initiating terminal side supporting the ICE relay network management includes: the STUN/TURN server in the network where the session initiating terminal and the session initiating terminal are located support the ICE relay network management;
当判断结果是所述会话发起终端支持 ICE普通网络管理时, 则所述呼叫请求发送模块 在向所述会话响应终端发送呼叫请求, 所述呼叫请求中携带会话发起终端的所有候选地址 和所述会话发起终端对 ICE普通网络管理的支持信息。  When the result of the judgment is that the session initiation terminal supports the ICE common network management, the call request sending module sends a call request to the session response terminal, where the call request carries all candidate addresses of the session initiation terminal and the The session initiation terminal supports the ICE common network management.
结合第三方面或结合第三方面的第一种可能的方案, 在第二种可能的方案中, 所述呼 叫响应接收模块接收到的所述呼叫响应中还包括所述会话响应终端对 ICE普通网络管理的 支持信息时, 所述候选地址匹配模块具体用于: 根据搜集到的所述 STUN/TURN服务器对 ICE中继网络管理的支持信息、 所述会话发 起终端对 ICE普通网络管理的支持信息和所述会话响应终端对 ICE普通网络管理的支持信 息, 匹配自己搜集到的候选地址和所述会话响应终端的候选地址生成具有优先级的一组或 多组候选地址对。 With reference to the third aspect or the first possible solution of the third aspect, in the second possible solution, the call response receiving module receives the call response, and the session response terminal further includes an ICE common When the network management supports the information, the candidate address matching module is specifically configured to: According to the collected support information of the STUN/TURN server for the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, match the self. The collected candidate address and the candidate address of the session response terminal generate one or more sets of candidate address pairs with priority.
结合第三方面的第二种可能的方案,在第三种可能的方案中,所述候选地址匹配模块, 还包括:  With reference to the second possible solution of the third aspect, in the third possible solution, the candidate address matching module further includes:
第一判断子模块, 用于判断所述会话发起终端和所述会话响应终端是否满足都支持 ICE普通网络管理;  a first determining sub-module, configured to determine whether the session initiation terminal and the session response terminal are satisfied to support ICE common network management;
第一匹配子模块, 用于在所述第一判断子模块的判断结果为双方都支持 ICE普通网络 管理时, 按照双方的候选地址的优先级属性匹配, 生成具有优先级的一组或多组候选地址 对;  a first matching submodule, configured to: when the judgment result of the first determining submodule is that both parties support the ICE common network management, generate one or more groups with priority according to the priority attribute matching of the candidate addresses of the two parties Candidate address pair
第二匹配子模块, 用于在所述第一判断子模块的判断结果为双方并非满足都支持 ICE 普通网络管理时, 确认所述会话发起终端和所述 STUN/TURN服务器都支持 ICE中继网络 管理, 则将会话发起终端的中继地址和会话响应终端的候选地址按照候选地址的优先级属 性匹配, 生成具有优先级的一组或多组候选地址对。  a second matching submodule, configured to confirm that the session initiation terminal and the STUN/TURN server support the ICE relay network when the judgment result of the first determining submodule is that both parties do not satisfy the ICE common network management The management matches the relay address of the session initiation terminal and the candidate address of the session response terminal according to the priority attribute of the candidate address to generate one or more sets of candidate address pairs with priority.
结合第三方面或结合第三方面的上述几种可能的实现方式, 在第四种可能的实现方式 种中, 所述会话发起终端还包括切换需求判断模块,  With reference to the third aspect or the foregoing several possible implementation manners of the third aspect, in a fourth possible implementation manner, the session initiation terminal further includes a handover requirement determination module,
其中, 候选地址搜集发送模块向所在网络中的 STUN/TUR 服务器发送搜集请求; 和 / 或,  The candidate address collection and transmission module sends a collection request to the STUN/TUR server in the network; and/or,
呼叫请求发送模块向会话响应终端发送呼叫请求; 和 /或,  The call request sending module sends a call request to the session responding terminal; and/or,
候选地址匹配模块匹配自己的候选地址和所述会话响应终端的候选地址; 都是在切换 需求判断模块确认自身有网络切换需求后才进行。  The candidate address matching module matches its own candidate address and the candidate address of the session response terminal; all of which are performed after the handover requirement determination module confirms that it has a network switching requirement.
本发明的第四方面, 提供了一种会话连接建立的会话响应终端, 包括:  A fourth aspect of the present invention provides a session response terminal established by a session connection, including:
呼叫请求接收模块, 用于接收会话发起终端的呼叫请求, 所述呼叫请求携带所述会话 发起终端的一个或多个候选地址;  a call request receiving module, configured to receive a call request of the session initiating terminal, where the call request carries one or more candidate addresses of the session initiating terminal;
候选地址搜集模块, 用于根据所述呼叫请求搜集所述会话响应终端的候选地址; 呼叫响应发送模块, 用于向所述会话发起终端发送呼叫响应, 所述呼叫响应携带所述 候选地址搜集模块搜集到所述会话响应终端的候选地址和所述会话响应终端对 ICE普通网 络管理的支持信息; 候选地址匹配模块, 用于匹配在所述呼叫响应中携带的候选地址和所述会话发起终端 的候选地址, 生成一组或多组候选地址对; a candidate address collection module, configured to collect a candidate address of the session response terminal according to the call request; a call response sending module, configured to send a call response to the session initiation terminal, where the call response carries the candidate address collection module Collecting candidate addresses of the session response terminal and support information of the session response terminal to the ICE common network management; a candidate address matching module, configured to match a candidate address carried in the call response and a candidate address of the session initiating terminal, to generate one or more sets of candidate address pairs;
连接测试模块, 用于根据所述一组或多组候选地址对向所述会话发起终端发送连接测 试请求, 并在成功完成双方连接测试后, 建立所述会话发起终端和所述会话响应终端的会 话连接。  a connection test module, configured to send a connection test request to the session initiation terminal according to the one or more sets of candidate address pairs, and establish the session initiation terminal and the session response terminal after successfully completing the two-party connection test Session connection.
结合第四方面的第一种可能的方案中, 所述接收会话发起终端的呼叫请求中还携带有 所述会话发起终端对 ICE普通网络管理的支持信息, 则所述候选地址匹配模块还包括: 第一判断子模块, 用于根据所述呼叫请求中携带的所述会话发起终端对 ICE普通网络 管理的支持信息, 确定所述会话发起终端和所述会话响应终端两者是否都支持 ICE普通网 络管理;  In conjunction with the first possible solution of the fourth aspect, the call request of the receiving session initiating terminal further includes the information that the session initiating terminal supports the ICE common network management, and the candidate address matching module further includes: a first determining sub-module, configured to determine, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, whether the session initiation terminal and the session response terminal support the ICE common network Management
第一匹配子模块, 用于当所述第一判断子模块确定两者不是都支持 ICE普通网络管理 时, 则在确定所述会话发起终端侧支持 ICE中继网络管理时, 所述会话响应终端匹配自己 在呼叫响应中携带的候选地址和所述会话发起终端的中继候选地址生成具有优先级的一组 或多组候选地址对。  a first matching submodule, configured to: when the first determining submodule determines that both do not support ICE common network management, when the session initiating terminal side supports the ICE relay network management, the session responding terminal Matching the candidate address carried in the call response and the relay candidate address of the session initiating terminal to generate one or more sets of candidate address pairs having priority.
结合第四方面或结合第四方面的第一种可能的方案, 在第二种可能的方案中, 所述候 选地址搜集模块根据所述呼叫请求搜集自身的候选地址外, 还搜集所述会话响应终端所在 网络中的 STUN/TUR 服务器对 ICE中继网络管理的支持信息, 则所述呼叫响应发送模块 还包括:  With reference to the fourth aspect or the first possible solution of the fourth aspect, in the second possible solution, the candidate address collecting module collects the candidate address according to the call request, and collects the session response. The call response sending module of the STUN/TUR server in the network where the terminal is located, and the call response sending module further includes:
第二判断子模块, 用于判断所述会话发起终端和所述会话响应终端是否都支持 ICE普 通网络管理;  a second determining sub-module, configured to determine whether the session initiation terminal and the session response terminal support ICE common network management;
所述呼叫响应发送模块, 还用于在所述第二判断子模块的判断结果为两者不是都支持 ICE普通网络管理时, 并确认所述会话响应终端侧支持 ICE中继网络管理时, 所述呼叫响 应发送模块向会话发起终端发送呼叫响应, 所述呼叫响应携带所述候选地址搜集模块搜集 到的中继地址和所述会话响应终端对 ICE普通网络管理的支持信息。  The call response sending module is further configured to: when the judgment result of the second determining submodule is that both do not support the ICE common network management, and confirm that the session response terminal side supports the ICE relay network management, The call response sending module sends a call response to the session initiating terminal, where the call response carries the relay address collected by the candidate address collecting module and the support information of the session response terminal to the ICE common network management.
结合第三方面或结合第而方面的上述几种可能的实现方式, 在第三种可能的实现方式 种中, 所述会话响应终端还包括切换需求判断模块,  With reference to the third aspect or the foregoing several possible implementation manners of the foregoing aspect, in a third possible implementation manner, the session response terminal further includes a handover requirement determination module,
其中,候选地址搜集模块根据所述呼叫请求搜集所述会话响应终端的候选地址;和 /或, 呼叫响应发送模块向所述会话发起终端发送呼叫响应; 和 /或 ,  The candidate address collection module collects the candidate address of the session response terminal according to the call request; and/or, the call response sending module sends a call response to the session initiation terminal; and/or
候选地址匹配模块匹配在所述呼叫响应中携带的候选地址和所述会话发起终端的候选 地址; 都是在切换需求判断模块确认自身有网络切换需求后才进。 The candidate address matching module matches the candidate address carried in the call response and the candidate of the session initiation terminal The address; is entered after the handover requirement judgment module confirms that it has network switching requirements.
本发明结合会话发起终端自身候选地址对应的网络管理的支持信息生成候选地址对, 从而能够更高效的进行连接测试, 完成会话发起终端和会话响应终端的之间的会话连接建
Figure imgf000013_0001
The present invention combines the support information of the network management corresponding to the candidate address of the session initiation terminal to generate a candidate address pair, so that the connection test can be performed more efficiently, and the session connection between the session initiation terminal and the session response terminal is completed.
Figure imgf000013_0001
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例中所需要使用的 附图作筒单地介绍, 显而易见地, 下面所描述的附图仅仅是本发明的一些实施例, 对于本 领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的 附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in view of the drawings.
图 1、 本发明提供的现有技术中的一个基于 ICE框架会话建立的流程信令图;  FIG. 1 is a flow chart of a process based on an ICE framework session established in the prior art provided by the present invention;
图 2A、 本发明提供的现有技术中会话发起终端侧的候选地址的连接测试的示意图; 图 2B、 本发明提供的实施例中会话发起终端侧的候选地址的连接测试的示意图; 图 3、 本发明提供的一个 ICE框架的***结构示意图;  2A is a schematic diagram of a connection test of a candidate address on a session initiation terminal side in the prior art provided by the present invention; FIG. 2B is a schematic diagram of a connection test of a candidate address on a session initiation terminal side in an embodiment provided by the present invention; A schematic diagram of a system structure of an ICE framework provided by the present invention;
图 4、 本发明提供的会话发起终端侧的一种会话连接建立的方法的流程示意图; 图 5、 本发明提供的一种基于 ICE框架的建立会话连接的信令图;  FIG. 4 is a schematic flowchart of a method for establishing a session connection on a session initiating terminal side provided by the present invention; FIG. 5 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention;
图 6、 本发明提供的会话响应终端侧的一种会话连接建立方法的流程示意图;  FIG. 6 is a schematic flowchart diagram of a method for establishing a session connection on a session response terminal side provided by the present invention;
图 7、 本发明提供的一种改进后的会话响应终端搜集自身的候选地址的流程示意图; 图 8、 本发明提供的一种基于 ICE框架的建立会话连接的信令图;  FIG. 7 is a schematic flowchart of a method for collecting a candidate address of an improved session response terminal provided by the present invention; FIG. 8 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention;
图 9、 本发明提供的一种基于 ICE框架的建立会话连接的信令图;  FIG. 9 is a signaling diagram of establishing a session connection based on an ICE framework according to the present invention;
图 10、 本发明提供的 SDP协议中用于携带候选地址的会话属性行各字段的功能示意图; 图 11、 本发明提供的一种改进的能够携带候选地址对于网络管理的支持信息的会话属性行 各字段的功能示意图;  FIG. 10 is a schematic diagram of functions of fields of a session attribute row for carrying a candidate address in the SDP protocol provided by the present invention; FIG. 11 is an improved session attribute line capable of carrying support information of a candidate address for network management provided by the present invention. Functional diagram of each field;
图 12、 本发明提供的将本发明会话连接建立方法应用到浏览器中实现的信令图。  FIG. 12 is a signaling diagram of the present invention for applying the session connection establishment method of the present invention to a browser.
图 13、 本发明提供的一种可应用到本发明各实施例的会话发起终端的结构示意图; 图 14、 本发明提供的一种可应用到本发明各实施例的会话发起终端的结构示意图; 图 15、 本发明提供的一种可应用到本发明各实施例的会话响应终端的结构示意图; 图 16、 本发明提供的一种可应用到本发明各实施例的会话响应终端的结构示意图; 图 17、 本发明提供的一种建立会话连接的智能手机终端的结构示意图。  FIG. 13 is a schematic structural diagram of a session initiating terminal applicable to the embodiments of the present invention; FIG. 14 is a schematic structural diagram of a session initiating terminal applicable to the embodiments of the present invention; FIG. 15 is a schematic structural diagram of a session response terminal applicable to the embodiments of the present invention; FIG. 16 is a schematic structural diagram of a session response terminal applicable to the embodiments of the present invention; FIG. 17 is a schematic structural diagram of a smart phone terminal for establishing a session connection according to the present invention.
具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地 描述, 显然, 所描述的实施例是本发明的一部分实施例, 而不是全部实施例。 基于本发明 中的实施例, 本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施 例, 都应属于本发明保护的范围。 detailed description The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
本发明中术语 "和 /或,,, 仅仅是一种描述关联对象的关联关系, 表示可以存在三种关 系, 例如, A和 /或 B, 可以表示: 单独存在 A , 同时存在 A和 B,单独存在 B这三种情况。 另外, 本文中字符 "/" , 一般表示前后关联对象是一种 "或" 的关系。 本发明中网络管理 包含了网络切换。 本发明将私有地址和 NAT地址统称为非中继地址, 用来和中继地址区别 开。  In the present invention, the term "and/or," is merely an association relationship describing an associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and A and B exist at the same time. In addition, the character "/" in the present text generally indicates that the contextual object is an "or" relationship. The network management in the present invention includes network switching. The present invention collectively refers to a private address and a NAT address. It is a non-relay address and is used to distinguish it from the relay address.
本发明中在需要对支持 ICE普通网络管理进行的连接测试请求也会如背景技术中提到 的 S110-S113所述在连接测试请求中携带 MOBILITY-SUPPORT字段, 由于 ICE普通网络 管理方法和 ICE中继网络管理方法是现有技术,因此,下面各实施例中对于涉及具体的 ICE 普通网络管理和 ICE中继网络管理的内容没有做具体的陈述, 而是通过概括的描述如 "使 用 ICE普通网络管理" 方式表述。 本领域技术人员能够根据本发明中各实施例已公开的内 容结合具体的 ICE普通网络管理和 ICE中继网络管理将本发明的内容运用到实践中。  The connection test request required to support the ICE common network management in the present invention also carries the MOBILITY-SUPPORT field in the connection test request as described in S110-S113 mentioned in the background, due to the ICE common network management method and the ICE. The network management method is prior art. Therefore, the following embodiments do not specifically describe the content related to the specific ICE common network management and ICE relay network management, but through a general description such as "using the ICE common network. Management" mode representation. Those skilled in the art will be able to apply the present invention to practice in accordance with the disclosure of the various embodiments of the present invention in conjunction with specific ICE general network management and ICE relay network management.
本实施例的方法可以是通过原生 App应用安装在终端上实现, 也可以是作为终端中的 ***模块一部分实现, 还可以是以控件或者脚本的形式在终端种实现; 因此, 本发明的方 法在终端中实现时可能会遇到终端自身不具备 ICE普通网络管理和 /或 ICE中继网络管理的 情况。  The method in this embodiment may be implemented by installing the native App on the terminal, or may be implemented as part of the system module in the terminal, or may be implemented in the terminal in the form of a control or a script; therefore, the method of the present invention is When implemented in the terminal, the terminal itself may not have the ICE common network management and/or ICE relay network management.
本发明各实施例中描述的可选的方案仅仅是为了更清楚的列举出可能的组合方案, 而 并非是对本发明包含的技术方案的限定, 在权利要求书和已经罗列出的各实施例中的具体 实现内容, 本领域技术人员能够在不经过创造性思考过程而得出的其他可选的方案也在本 发明的保护范围之内。  The alternatives described in the various embodiments of the present invention are merely to clarify the possible combinations of the solutions, and are not intended to limit the technical solutions included in the present invention, the claims and the listed embodiments. Other implementations that can be made by those skilled in the art without a creative process are also within the scope of the present invention.
实施例一 Embodiment 1
本发明提供的一个基于 ICE框架的***实施例, 本发明后续的方法实施例都能运行在 该***之上, 所述***的结构示意图如图 3所示。 其中包括用户终端 A (会话发起终端)、 用户终端 A所在的网络侧 (也筒称用户终端 A侧) 的 NAT设备 ( NAT A )、 用户终端 B 侧的 NAT设备 ( NAT B )、 用户终端 B (会话响应终端)和 STUN/TUR 服务器。 在本发 明的各实施例中 NAT_A和 NAT_B是可选的,并且用户终端 A侧和 /或用户终端 B侧的 NAT 设备的数量也是不受限定的, 不局限于图 3所示的一个 NAT_A和/或一个 NAT_B。 其中根 据具体的应用环境 NAT设备可以是: GGSN、 无线路由器或普通的网关等等。 本发明中 STUN/TUR 服务器可以是如图 3所示用户终端 A和用户终端 B共同使用一个; 可选的, 用户终端 B和用户终端 A拥有各自终端侧的 STUN/TUR 服务器;在本发明中仅以用户终 端 A和用户终端 B公用一个 STUN/TUR 服务器为例。本领域技术人员能够容易根据所列 举的实施例中推出在上述用户终端 A和用户终端 B拥有各自终端侧的 STUN/TUR 服务器 情况。 在本发明中 STUN/TUR 服务器并不限定是单独的设备实体, 其自身也可以在已有 的服务器中实现,甚至是可以集成在用户终端 A和 /或用户终端 B的终端上。本发明中用户 终端 A和用户终端 B的终端实体可以是手机、 个人电脑、 平板电脑、 电子书或者其他智能 设备。 本***所使用的协议也不局限于本发明提到的 STU 协议、 SDP协议和 SIP协议, 还可以是拥有和本发明中各实施例流程和处理方式类似的请求 /问答模式的其他协议或者 规范。 The ICE framework-based system embodiment provided by the present invention, the subsequent method embodiments of the present invention can all run on the system, and the structure of the system is shown in FIG. 3 . The user equipment A (session initiation terminal), the NAT device (NAT A) on the network side (also referred to as the user terminal A side) where the user terminal A is located, the NAT device (NAT B) on the user terminal B side, and the user terminal B (session response terminal) and STUN/TUR server. NAT_A and NAT_B are optional in various embodiments of the present invention, and NAT on the user terminal A side and/or the user terminal B side The number of devices is also not limited, and is not limited to one NAT_A and/or one NAT_B as shown in FIG. The NAT device may be: a GGSN, a wireless router, or a general gateway, etc., depending on the specific application environment. In the present invention, the STUN/TUR server may be used in combination with the user terminal A and the user terminal B as shown in FIG. 3; optionally, the user terminal B and the user terminal A own the STUN/TUR server on the respective terminal side; in the present invention Take only one STUN/TUR server shared by user terminal A and user terminal B as an example. Those skilled in the art can easily derive the STUN/TUR server case on the respective terminal side of the above-mentioned user terminal A and user terminal B according to the enumerated embodiment. In the present invention, the STUN/TUR server is not limited to a single device entity, and itself may be implemented in an existing server, or even integrated on the terminals of the user terminal A and/or the user terminal B. The terminal entity of the user terminal A and the user terminal B in the present invention may be a mobile phone, a personal computer, a tablet computer, an e-book or other smart device. The protocol used in the system is not limited to the STU protocol, the SDP protocol, and the SIP protocol mentioned in the present invention, and may be other protocols or specifications having a request/question mode similar to the processes and processing modes of the embodiments of the present invention. .
在本***实施例中,若用户终端 A所在的网络侧部署有 NAT设备时,相应的用户终端 A在与其所在的网络侧的 STUN/TUR 服务器通信的过程中, STUN/TUR 服务器会获取 到 NAT设备为用户终端 A所分配的服务器映射地址(也称为 NAT地址)。如果在用户终端 A侧部署有多个 NAT设备时, 所述为用户终端 A所分配的 NAT地址为用户终端 A侧直接 与 STUN/TURN服务器相连的 NAT设备 (即用户终端 A侧最后与 STUN/TURN服务器通 信的 NAT设备) 为用户终端 A所分配的地址。 STUN/TUR 服务器可以在用户终端 A和 / 或用户终端 B进行候选地址搜集时, 为其分配中继地址和 /或从 NAT设备中获取到的 NAT 地址。 在本发明中, 将用户终端的本地地址 (也称为私有地址)和服务器映射地址(也称 为 NAT地址)统称为非中继地址; 中继地址则指 STU /TU RN服务器为用户终端分配的 地址。  In the embodiment of the present system, if the NAT device is deployed on the network side where the user terminal A is located, the STUN/TUR server obtains the NAT in the process of the user terminal A communicating with the STUN/TUR server on the network side where the user terminal A is located. The server maps the address (also known as the NAT address) assigned to user terminal A. If a plurality of NAT devices are deployed on the user terminal A side, the NAT address assigned to the user terminal A is a NAT device directly connected to the STUN/TURN server on the user terminal A side (ie, the user terminal A side is last with the STUN/ The NAT device that the TURN server communicates) is the address assigned to the user terminal A. The STUN/TUR server can assign a relay address and/or a NAT address obtained from the NAT device when the user terminal A and/or the user terminal B perform candidate address collection. In the present invention, the local address (also referred to as a private address) and a server mapped address (also referred to as a NAT address) of the user terminal are collectively referred to as a non-relay address; the relay address refers to the STU /TU RN server assigning to the user terminal. the address of.
在接下来的具体实施例中, 对于 SDP信息中携带的非中继地址通常都是以同时包含了 私有地址和 NAT地址作为具体情况; 若不是同时包含的请况, 会具体的描述为携带私有地 址或 NAT地址。  In the following specific embodiments, the non-relay address carried in the SDP information is usually a private address and a NAT address. If not, the specific description is carried as private. Address or NAT address.
实施例二 Embodiment 2
本发明提供的会话发起终端侧的一种会话连接建立的方法, 本方法可以在实施例一所 描述的***之上实现, 但是并不局限于实施例一所描述的***。 其中会话发起终端和会话 响应终端可以是个人电脑、 笔记本、 超极本、 平板电脑或智能手机; 还可是云端的某个操 作***, 甚至可以是云端提供的浏览器(这里可以认为该浏览器具备了普通终端所要求的 诸多功能); 还可以是 M2M领域内的智能终端 (其功能配置可能有别于现有的终端, 具有 更高的定制性)。 该方法包括: The method for establishing a session connection on the session initiation terminal side provided by the present invention may be implemented on the system described in Embodiment 1, but is not limited to the system described in Embodiment 1. The session initiation terminal and the session response terminal may be a personal computer, a notebook, an ultrabook, a tablet or a smart phone; As a system, it can even be a browser provided by the cloud (here, the browser can be considered to have many functions required by ordinary terminals); it can also be an intelligent terminal in the M2M field (the function configuration may be different from the existing terminal) , with higher customization). The method includes:
S201、 会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求, 所述搜集请 求包括: 指示对会话发起终端的候选地址搜集和 STUN/TURN服务器对 ICE中继网络管理 的支持信息的搜集的信息。  S201: The session initiation terminal sends a collection request to the STUN/TUR server in the network, where the collection request includes: collecting the candidate address collection of the session initiation terminal and the collection information of the STUN/TURN server to the ICE relay network management. information.
会话发起终端进行自身候选地址的搜集过程,主要是通过在会话发起终端中默认设置有 的 STUN/TURN服务器地址向 STUN/TUR 服务器发送用于自身候选地址搜集的搜集请求; 所述候选地址由会话发起终端所在的网络架构所决定, 可能的网络架构包括:  The session initiating terminal performs the collection process of the candidate address by itself, mainly by sending a collection request for the collection of the candidate address to the STUN/TUR server by using the STUN/TURN server address set by default in the session initiation terminal; the candidate address is used by the session. Determined by the network architecture in which the originating terminal is located, possible network architectures include:
第一种网络架构, 会话发起终端经过一个或多个 NAT 设备转接而最终连接到 In the first network architecture, the session initiating terminal is finally connected to the NAT device through one or more NAT devices.
STUN/TUR 服务器,此时,会话发起终端的候选地址包括以下几种: 1 )最邻近 STUN/TURN 服务器的 NAT设备为会话发起终端分配的地址, 在本发明中也筒称为 NAT地址; 2 )会话 发起终端的主机地址, 在本发明中也被称为会话发起终端的私有地址; 3 ) STUN/TURN服 务器为会话发起终端分配的地址, 在本发明中也被称为中继地址。 The STUN/TUR server, at this time, the candidate addresses of the session initiation terminal include the following: 1) The address assigned by the NAT device closest to the STUN/TURN server to the session initiation terminal is also referred to as a NAT address in the present invention; The host address of the session initiating terminal, also referred to as the private address of the session initiating terminal in the present invention; 3) the address assigned by the STUN/TURN server to the session initiating terminal, also referred to as a relay address in the present invention.
第二种网络架构, 会话发起终端不经由 NAT设备而直接连接服务器, 此时, 会话发起 终端的主机地址不再是上述私有地址, 而是具体呈现为互联网为会话发起终端分配的广域 网地址, 并且此时会话发起终端不再具有 NAT地址; 但是即便是第二种网络架构中, 会话 发起终端仍然可以拥有 STUN/TURN服务器为其分配的中继地址。  In the second network architecture, the session initiating terminal directly connects to the server without using the NAT device. In this case, the host address of the session initiating terminal is no longer the private address, but is specifically represented by the wide area network address allocated by the Internet for the session initiating terminal, and At this time, the session initiating terminal no longer has a NAT address; but even in the second network architecture, the session initiating terminal can still have the relay address assigned by the STUN/TURN server.
本发明将重点以第一种网络架构作为主要实现网络环境来描述,而本领域的技术人员能 够依据该实现容易的将其扩展到第二种网络架构中实现。  The present invention focuses on the first network architecture as the primary implementation network environment, and those skilled in the art can easily implement it to the second network architecture according to the implementation.
在结合本实施例二的第一种可选的方案中, 所述会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求, 还包括: 所述会话发起终端在确认自己不支持 ICE普 通网络管理, 而支持 ICE中继网络管理时, 在向所在网络中的 STUN/TUR 服务器发送的 搜集请求中携带类型标识, 所述类型标识指示 STUN/TURN服务器仅返回中继地址。  In the first optional solution of the second embodiment, the session initiation terminal sends a collection request to the STUN/TUR server in the network, and the method further includes: the session initiation terminal confirms that it does not support the ICE common network. Management, while supporting ICE relay network management, carries a type identifier in the collection request sent to the STUN/TUR server in the network, and the type identifier indicates that the STUN/TURN server only returns the relay address.
提出所述第一种可选的方案是因为: 会话发起终端优选的在进行会话建立过程中选取 The first optional solution is proposed because: the session initiation terminal preferably selects during the session establishment process.
ICE普通网络管理方式或 ICE中继网络管理方式中的一种方式, 因此, 在会话发起终端根 据自身的 ICE普通网络管理的支持信息确定自己不支持 ICE普通网络管理时, 则优选的会 选择 STUN/TURN服务器支持的 ICE中继网络管理(在所述第一种可选的方案中, 默认会 话发起终端所在网络中的 STUN/TURN服务器就是支持中继网络管理的);对于在发起初始 请求前便已确认不会采用的 ICE普通网络管理, 自然没有必要获取相应的非中继地址, 而 可以直接要求 STUN/TUR 服务器返回中继地址。从而减少了 NAT地址在网络带宽上的占 用, 也可以减少后续会话发起终端和会话响应终端匹配候选地址对时所占用的计算资源。 One of the ICE common network management methods or the ICE relay network management mode. Therefore, when the session initiation terminal determines that it does not support the ICE common network management according to the support information of its own ICE common network management, the preferred STUN is selected. ICE relay network management supported by the /TURN server (in the first optional solution, the STUN/TURN server in the network where the default session initiation terminal is located supports the relay network management); The ICE common network management that will not be used before the request is confirmed, naturally it is not necessary to obtain the corresponding non-relay address, and the STUN/TUR server can be directly requested to return the relay address. Therefore, the occupation of the NAT address on the network bandwidth is reduced, and the computing resources occupied by the subsequent session initiation terminal and the session response terminal matching the candidate address pair are also reduced.
优选的,在执行所述第一种可选的方案之前会话发起终端首先确定自身有网络切换需求 后才进行所述第一种可选的方案。  Preferably, the first optional solution is performed after the session initiating terminal first determines that it has a network switching requirement before performing the first optional solution.
其中,确定自身有网络切换需求具体包括: 用户在用户终端中设置的在进入特定网域中 或者满足特定条件时是具有网络切换需求的, 所述特定网域包括: wifi 网域; 所述满足特 定条件包括: 用户针对某次特定的通话对网络切换需求进行设置; 或根据会话响应终端自 身的移动的频繁程度达到指定值时。  The determining that the network switching requirement is provided by the user specifically includes: when the user enters a specific network domain or meets a specific condition, the network switching requirement is included, where the specific network domain includes: a wifi domain; Specific conditions include: The user sets the network switching requirement for a specific call; or when the frequency of the session response terminal itself moves to a specified value.
用户针对某次特定的通话对网络切换需求进行设置举例为: 用户在一个拥有免费 wifi 的网络中进行通信, 但是随时有可能移动出该 wifi区域, 所以此时的通话可以设定会有网 络切换需求。  The user sets the network switching requirements for a specific call as follows: The user communicates on a network with free wifi, but it is possible to move out of the wifi area at any time, so the call at this time can be set to have network switching. demand.
在本实施例中, 搜集 STUN/TUR 服务器对 ICE中继网络管理的支持信息的方式, 可 以直接使用背景技术中在搜集请求中携带 MOBILITY-TICKET的字段方式, 并通过搜集响 应中 MOBILITY-TICKET字段赋值内容来获取 STUN/TURN服务器对 ICE中继网络管的支 持信息。  In this embodiment, the manner of collecting the support information of the STUN/TUR server for the ICE relay network management may directly use the field method of carrying the MOBILITY-TICKET in the collection request in the background technology, and collecting the MOBILITY-TICKET field in the response. Assign content to obtain support information for the ICE trunk network management by the STUN/TURN server.
所述结合本实施例二的第一种可选的方案里的搜集请求可以是基于 STUN 协议中的 Binding请求(在背景技术中也称为初始请求) 消息的基础上实现, 具体为在 Binding请求 消息的消息属性 ( Message Attributes ) 中增设一个字段, 例如: 该字段名可以定义为 SUPPORTING-MANNAGE ,并可以定义 SUPPORTING-MANNAGE字段内容为 normal时, 则 STUN/TUR 服务器返回属于会话发起终端的可用于 ICE普通网络管理的候选地址; SUPPORTING-MANNAGE内容为 relay时, 则服务器仅返回属于会话发起终端的支持 ICE 中继网络管理的候选地址; 默认的在 SUPPORTING-MANNAGE内容为空时, 则服务器返 回会话发起终端的所有候选地址。  The collecting request in the first optional solution in combination with the second embodiment may be implemented based on a Binding request (also referred to as an initial request in the background art) message in the STUN protocol, specifically in the Binding request. A field is added to the message attribute (Message Attributes) of the message. For example: If the field name can be defined as SUPPORTING-MANNAGE and the content of the SUPPORTING-MANNAGE field is normal, the STUN/TUR server returns the available to the session originating terminal. ICE common network management candidate address; SUPPORTING-MANNAGE content is relay, then the server only returns the candidate address of the session initiation terminal supporting ICE relay network management; the default is when the SUPPORTING-MANNAGE content is empty, the server returns the session Initiate all candidate addresses of the terminal.
其中, 定义该 SUPPORTING-MANNAGE 字段内容为空的处理方式是为了与现有的方 案兼容。  Among them, the way to define the SUPPORTING-MANNAGE field is empty is to be compatible with the existing scheme.
S202、 会话发起终端接收 STUN/TUR 服务器的搜集响应, 所述搜集响应中携带会话 发起终端的一个或多个候选地址和 STUN/TURN服务器对 ICE中继网络管理的支持信息。  S202. The session initiation terminal receives the collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management.
结合第一种可选的方案的第一种可能, 步骤 S202具体执行为: STUN/TURN服务器在 接收到发自会话发起终端的搜集请求, 并根据该搜集请求中类型标识确认会话发起终端只 要求返回中继地址时, 则将自身为会话发起终端分配的中继地址和对 ICE中继网络管理的 支持信息携带在搜集响应中发送给会话发起终端; 可选的, 由于在第一种可选的方案中, 默认 STUN/TURN服务器支持 ICE中继网络管理方式, 因此, 可以只携带上述中继地址, 而可以省略上述 STUN/TUR 服务器对 ICE中继网络管理的支持信息。 In combination with the first possibility of the first alternative, step S202 is specifically performed as follows: STUN/TURN server is Receiving the collection request sent from the session initiating terminal, and confirming that the session initiating terminal only requests to return the relay address according to the type identifier in the collecting request, then the relay address assigned to the session initiating terminal and the management of the ICE relay network The support information is carried in the collection response and sent to the session initiation terminal. Optionally, in the first optional solution, the default STUN/TURN server supports the ICE relay network management mode, and therefore, only the foregoing relay may be carried. Address, and the support information of the above STUN/TUR server for ICE relay network management can be omitted.
结合第一种可选的方案的第二种可能, 其中, 相对于会话发起终端 STUN/TUR 服务 器并非默认就支持 ICE中继网络管理; 则步骤 S202具体执行为: STUN/TUR 服务器在接 收到发自会话发起终端的搜索请求后, 根据该搜索请求中类型标识确认会话发起终端只要 求返回中继地址时, 首先确认 STUN/TUR 服务器自身是否支持 ICE中继网络管理, 若确 认结果为支持 ICE中继网络管理则将自身为会话发起终端分配的中继地址和自身对 ICE中 继网络管理的支持信息携带在搜集响应中发送给会话发起终端; 若确认结果为不支持 ICE 中继网络管理则将会话发起终端的候选地址(这里的候选地址包括中继地址和 NAT地址) 和自身对 ICE中继网络管理的支持信息(即 STUN/TUR 服务器不支持 ICE中继网络管理) 携带在搜集响应中发送给会话发起终端。  In combination with the second possibility of the first optional solution, where the STUN/TUR server does not support the ICE relay network management by default, the step S202 is specifically executed as follows: The STUN/TUR server receives the transmission. After the search request of the session initiation terminal, according to the type identifier in the search request, when the session initiation terminal only requests to return the relay address, first confirm whether the STUN/TUR server itself supports the ICE relay network management, and if the confirmation result is supported by the ICE, After the network management, the relay address allocated by the session initiating terminal and the support information of the ICE relay network management are carried in the collection response and sent to the session initiating terminal; if the confirmation result is that the ICE relay network management is not supported, The candidate address of the session initiation terminal (the candidate address here includes the relay address and the NAT address) and its own support information for the ICE relay network management (ie, the STUN/TUR server does not support the ICE relay network management) is carried in the collection response. Initiate a terminal for the session.
S203、 会话发起终端向会话响应终端发送呼叫请求, 所述呼叫请求中携带搜集到的会 话发起终端的候选地址中的至少一个候选地址。  S203. The session initiating terminal sends a call request to the session response terminal, where the call request carries at least one candidate address in the candidate address of the collected session initiating terminal.
在本实施二的主方案中,所述呼叫请求是不需要携带会话发起终端的候选地址对于网络 管理的支持信息;而直接利用 SDP协议中的会话属性行承载所述会话发起终端的候选地址, 并通过呼叫请求发送给会话响应终端。 以便于会话响应终端在搜集到自身的候选地址后, 结合呼叫请求中会话发起终端的候选地址生成候选地址对,用于后续双方的连接测试过程。  In the main solution of the second implementation, the call request is a support address that does not need to carry the candidate address of the session initiation terminal for network management; and directly uses the session attribute line in the SDP protocol to carry the candidate address of the session initiation terminal. And sent to the session response terminal through a call request. Therefore, after the session response terminal collects its own candidate address, the candidate address pair is generated in combination with the candidate address of the session initiation terminal in the call request, and is used for the connection test process of both parties.
在结合本实施例二的第二种可选的方案中,所述会话发起终端向会话响应终端发送呼叫 请求, 之前, 还包括:  In the second optional solution of the second embodiment, the session initiating terminal sends a call request to the session response terminal, and further includes:
所述会话发起终端根据 ICE普通网络管理的支持信息判断自己是否支持 ICE普通网络 管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中;  The session initiating terminal determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal;
当判断结果是所述会话发起终端自己不支持 ICE普通网络管理时, 则在确认所述会话 发起终端和所述 STUN/TUR 服务器同时支持 ICE中继网络管理后, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 会话发起终端在所述呼 叫请求中仅携带会话发起终端的中继候选地址;  When the result of the judgment is that the session initiating terminal does not support the ICE common network management, the call request is carried in the call request after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management. The at least one candidate address of the candidate address of the session initiation terminal is specifically: the session initiation terminal carries only the relay candidate address of the session initiation terminal in the call request;
当判断结果是所述会话发起终端自己支持 ICE普通网络管理时, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 所述会话发起终端在所 述呼叫请求中携带会话发起终端的所以候选地址和所述会话发起终端对 ICE普通网络管理 的支持信息。 When the result of the judgment is that the session initiation terminal itself supports the ICE common network management, the call request is carried in the call request. The at least one candidate address of the candidate address of the session initiating terminal is specifically: the session initiating terminal carries the candidate address of the session initiating terminal and the session initiating terminal support for the ICE common network management in the call request. information.
在结合本实施例二的第三种可选的方案中,会话发起终端向所述会话响应终端发送呼叫 请求,所述呼叫请求中携带搜集到的所述会话发起终端的候选地址中的至少一个候选地址, 还包括: 所述呼叫请求还携带了所述会话发起终端对 ICE普通网络管理的支持信息和 /或会 话发起终端侧对 ICE中继网络管理的支持信息, 所述会话发起终端侧对 ICE中继网络管理 的支持信息包括所述会话发起终端和所述 STUN/TUR 服务器两者对 ICE中继网络管理的 支持信息。  In a third optional solution of the second embodiment, the session initiating terminal sends a call request to the session response terminal, where the call request carries at least one of the collected candidate addresses of the session initiating terminal. The candidate address further includes: the call request further carries the support information of the session initiation terminal to the ICE common network management and/or the support information of the session initiation terminal side to the ICE relay network management, where the session initiation terminal side The support information of the ICE relay network management includes support information of the session initiation terminal and the STUN/TUR server for the ICE relay network management.
会话响应终端在接收到所述第三种可选的方案中的呼叫请求后,在第一种可能的情况下: 会话响应终端确定会话发起终端和会话响应终端双方都支持 ICE普通网络管理后, 会 话响应终端选择自身的所有候选地址和自身对 ICE普通网络管理的支持信息携带在呼叫响 应中返回给会话发起终端;  After receiving the call request in the third optional solution, the session response terminal determines, in the first possible case: the session response terminal determines that both the session initiation terminal and the session response terminal support the ICE common network management. All the candidate addresses of the session response terminal and their own support information for the ICE common network management are carried in the call response and returned to the session initiation terminal;
会话响应终端在接收到所述第三种可选的方案中的呼叫请求后,在第二种可能的情况下: 会话响应终端在发送搜集请求之前,确定会话发起终端和会话响应终端双方不满足都支 持 ICE普通网络管理的条件时, 向服务器发送仅搜集自身的中继地址和 STUN/TUR 服务 器对中继网络管理的支持信息; 将所述搜集到的中继地址携带在呼叫响应中返回给会话发 起终端。  After receiving the call request in the third optional solution, the session response terminal is in the second possible case: the session response terminal determines that both the session initiation terminal and the session response terminal are not satisfied before sending the collection request When all the conditions of the ICE common network management are supported, the server only sends the relay address that collects itself and the support information of the STUN/TUR server to the relay network management; the collected relay address is carried in the call response and returned to the server. Session originating terminal.
上述第二种可能情况中,优选的还包括:会话响应终端确定自身存在网络切换需求后才 执行所述第二种可能情况。  In the second possible case, the method further includes: the second response case is performed after the session response terminal determines that the network switching requirement exists.
上述第二种可能情况的处理, 是考虑了 ICE普通网络管理在出现会话双方没有都支持 ICE普通网络管理条件情况下 ICE普通网络管理便不能在会话发起终端和 /或会话响应终端 发生网络切换时起作用, 上述第二种可能情况下只有会话响应终端的中继地址支持的 ICE 中继网络管理, 并能够在会话响应终端发生网络切换时起作用, 因此, 在上述二种可能情 况下选择在呼叫响应中只携带会话响应终端的中继地址在 ICE框架是最优的, 带来的进一 步有益效果是减少了会话双方匹配候选地址对、 计算候选地址对的优先级和非中继地址在 网络中传递所占用的带宽。  The second possible case is to consider that the ICE common network management cannot perform network switching when the session initiation terminal and/or the session response terminal fail when the ICE common network management does not support the ICE common network management condition. In the second possible case, only the ICE relay network management supported by the relay address of the session response terminal can be used, and it can function when the network responds to the session response terminal. Therefore, in the above two possible cases, the The relay address carrying only the session response terminal in the call response is optimal in the ICE framework, and the further beneficial effect is to reduce the matching candidate address pairs of the two parties, calculate the priority of the candidate address pair, and the non-relay address in the network. The bandwidth used by the transfer.
需要进一步补充的是,所述结合本实施例二的第一种可选方案和所述结合本实施例二的 第二种可选的方案, 两种可选方案是可以结合使用的, 因为他们所改进的是在信令流程的 不同步骤上, 可以一同作用于实施例提高效率; 同样的结合本实施例二的第一种可选方案 和所述结合本实施例二的第三种可选的方案, 两种可选的方案也是可以结合使用的; 还有 结合本实施例二的第一种可选的方案、 第二种可选的方案和所述结合本实施例二的第三种 可选的方案, 两种可选的方案也是可以结合使用的。 It should be further added that, in combination with the first alternative of the second embodiment and the second optional solution of the second embodiment, the two alternatives can be used in combination because they The improvement is in the signaling process In different steps, the efficiency can be improved together with the embodiment; the first alternative of the second embodiment is combined with the third alternative of the second embodiment, and two alternatives are provided. It can also be used in combination; there is also a first optional solution, a second optional solution, and a third optional solution combined with the second embodiment of the second embodiment. The solution can also be combined.
其中, 最明显的就是, 在第一种可选的方案中成功的通过搜集请求仅获取到 STUN/TUR 服务器为会话发起终端分配的中继地址时, 在步骤 S203 , 具体的, 可以选择 会话发起终端的中继地址携带在呼叫请求中直接向会话响应终端, 从而避免第二种可选的 方案中的判断过程。 而在第一种可选的方案中通过搜集请求获取到会话发起终端所有候选 地址时, 可以进一步结合第二种可选的方案和 /后第三种可选的方案来完成, 但是此时可以 省略第二种可选的方案中的判断过程, 而是直接利用第一种可选的方案中的判断的结果。  The most obvious one is that, in the first optional solution, if the relay address assigned by the STUN/TUR server to the session initiation terminal is successfully obtained through the collection request, in step S203, specifically, the session initiation may be selected. The relay address of the terminal is carried in the call request directly to the session response terminal, thereby avoiding the judging process in the second alternative solution. In the first optional solution, when all the candidate addresses of the session initiation terminal are obtained through the collection request, the second optional solution and/or the third optional solution may be further combined, but The judgment process in the second alternative scheme is omitted, but the result of the judgment in the first alternative scheme is directly utilized.
在可选的方案中, 步骤 S203 中发送的呼叫请求中携带背景技术中 S112 所述的 MOBILITY- SUPPORT标识方式, 从而在呼叫响应中获取会话响应终端对于 ICE普通网络 管理的支持信息。 当然, 也可以是通过自定义的扩展字段来实现, 在此不再赘述。  In an optional solution, the call request sent in step S203 carries the MOBILITY-SUPPORT identification mode described in S112 in the background, so as to obtain the support information of the session response terminal for the ICE common network management in the call response. Of course, it can also be implemented by a customized extension field, and details are not described herein again.
S204、 接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带所述会话响应终端的 一个或者多个候选地址。  S204. Receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal.
在结合本实施例二的第四种可选的方案中,所述呼叫响应中还包括所述会话响应终端对 ICE普通网络管理的支持信息;  In the fourth optional solution of the second embodiment, the call response further includes support information of the session response terminal to the ICE common network management;
在结合本实施例二的第四种可选的方案中,所述呼叫响应中携带会话响应终端所搜集的 一个或多个候选地址以及会话响应终端对 ICE普通网络管理的支持信息和 /或 ICE中继网络 管理的支持信息的方式可以是多样的, 下面将具体的列举几种方式:  In the fourth optional solution of the second embodiment, the call response carries one or more candidate addresses collected by the session response terminal and support information and/or ICE of the session response terminal to the ICE common network management. The way to support information for relay network management can be varied. Here are a few ways to enumerate:
第一种方式, 通过在 SDP协议的会话属性行("a"行)增加一个用来明确是否支持网络 管理的字段如图 11所示, 其中, SDP协议中用于携带候选地址的会话属性行各字段的功能 示意图如图 10所示; 其实现具体为在" a"行最后增加标识名为 ICE-mobile-ability的字段, 该字段的取值可以确定为 normal、 relay或 both标识。 并设置在 ICE-mobile-ability的值为 normal时, 表明该候选地址可用于 ICE普通网络管理; 当 ICE-mobile-ability的值为 relay 时, 表明该候选地址可用于 ICE中继网络管理; 当 ICE-mobile-ability的值为 both时, 表明 该候选地址可同时用于 ICE中继网络管理和 ICE普通网络管理; 当 ICE-mobile-ability的值 为 non时表明该候选地址不可用于网络管理(即 ICE普通网络管理和 ICE中继网络管理都 不支持)。 当然, 在未来技术发展中如果有新的基于 ICE框架的网络管理方式产生, 也可以 通过在 ICE-mobile-ability字段中扩展对应所述新的网络管理方式的取值, 来实现本发明的 功能的扩展。 In the first method, a field for specifying whether to support network management is added in the session attribute line ("a" line) of the SDP protocol, as shown in FIG. 11, where the session attribute line for carrying the candidate address in the SDP protocol is used. The function diagram of each field is as shown in FIG. 10; the implementation is specifically to add a field named ICE-mobile-ability at the end of the "a" line, and the value of the field may be determined as normal, relay or both. And when the value of ICE-mobile-ability is normal, it indicates that the candidate address can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the candidate address can be used for ICE relay network management; When the value of ICE-mobile-ability is both, it indicates that the candidate address can be used for both ICE relay network management and ICE common network management. When the value of ICE-mobile-ability is non, the candidate address is not available for network management. (ie ICE common network management and ICE relay network management are not supported). Of course, if there is a new network management method based on the ICE framework in the future technological development, it can also The expansion of the functions of the present invention is achieved by extending the value corresponding to the new network management mode in the ICE-mobile-ability field.
第二种方式, 在 SDP协议的会话属性行中增设用于承载所述网络管理的支持信息的属 性行, 表现为, 在呼叫响应中的 SDP信息中增加: "a=ICE-mobile-ability: normal" 0 该会话 属性行 " ICE-mobile-ability " 字段的取值可以确定为 normal、 relay 或 both。 当 ICE-mobile-ability的值为 normal时, 表明会话响应终端的候选地址可用于 ICE普通网络管 理; 当 ICE-mobile-ability的值为 relay时, 表明会话响应终端的中继地址可用于 ICE中继 网络管理; 当 ICE-mobile-ability的值为 both时, 表明会话响应终端的中继地址可用于 ICE 中继网络管理, 且会话响应终端的所有候选地址可用于 ICE普通网络管理。 In the second mode, an attribute line for supporting the network management support information is added to the session attribute line of the SDP protocol, and the performance is added to the SDP information in the call response: "a=ICE-mobile-ability: Normal" 0 The value of the "ICE-mobile-ability" field of the session attribute line can be determined as normal, relay or both. When the value of ICE-mobile-ability is normal, it indicates that the candidate address of the session response terminal can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the relay address of the session response terminal can be used in the ICE. Following the network management; when the value of ICE-mobile-ability is both, it indicates that the relay address of the session response terminal can be used for ICE relay network management, and all candidate addresses of the session response terminal can be used for ICE common network management.
第三种方式, 在 XMPP协议中增设代表网络管理的支持信息的标签, 所述标签可以为: In the third method, a label representing the support information of the network management is added to the XMPP protocol, and the label may be:
"<script>var ICE-mobile-ability=normal;</script>"。 该会话属性行 "ICE-mobile-ability" 字 段的取值可以确定为 normal、 relay或 both。 当 ICE-mobile-ability的值为 normal时, 表明 会话响应终端的候选地址可用于 ICE普通网络管理;当 ICE-mobile-ability的值为 relay时, 表明会话响应终端的中继地址可用于 ICE中继网络管理; 当 ICE-mobile-ability的值为 both 时, 表明会话响应终端的中继地址可用于 ICE中继网络管理, 且会话响应终端的候选地址 可用于 ICE普通网络管理。 "<script>var ICE-mobile-ability=normal;</script>". The value of the session attribute line "ICE-mobile-ability" field can be determined as normal, relay or both. When the value of ICE-mobile-ability is normal, it indicates that the candidate address of the session response terminal can be used for ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that the relay address of the session response terminal can be used in the ICE. Following the network management; when the value of ICE-mobile-ability is both, it indicates that the relay address of the session response terminal can be used for ICE relay network management, and the candidate address of the session response terminal can be used for ICE common network management.
本领域技术人员, 能够根据上述揭示的内容,将所述携带网络管理的支持信息的方法拓 展到其他可能运用到本发明中的协议里。  Those skilled in the art can extend the method of carrying network management support information to other protocols that may be applied to the present invention based on the above disclosure.
S205、 会话发起终端根据搜集到的 STUN/TUR 服务器对 ICE中继网络管理的支持信 息, 匹配自己候选地址和所述会话响应终端的候选地址生成一组或多组候选地址对。  S205. The session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server for the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal.
在本实施例中所述会话发起终端根据搜集到的 STUN/TUR 服务器对 ICE中继网络管 理的支持信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候 选地址对, 具体包括:  In this embodiment, the session initiating terminal matches one of the candidate address and the candidate address of the session response terminal according to the collected support information of the STUN/TUR server to the ICE relay network management, and generates one or more groups of candidates. Address pairs, including:
确认会话发起终端和 STUN/TUR 服务器都支持 ICE中继网络管理, 则将会话发起终 端的中继地址和会话响应终端的候选地址按照候选地址的优先级属性匹配生成具有优先级 的一组或多组候选地址对。 优选的, 此时无须匹配会话发起终端的非中继地址和会话响应 的候选地址, 从而减少了后续需要进行候选地址对连接测试的数量。  Acknowledging that both the session initiating terminal and the STUN/TUR server support the ICE relay network management, the relay address of the session initiating terminal and the candidate address of the session responding terminal are matched according to the priority attribute of the candidate address to generate one or more priorities. Group candidate address pair. Preferably, there is no need to match the non-relay address of the session initiating terminal and the candidate address of the session response, thereby reducing the number of subsequent candidate address pair connection tests.
在结合本实施例二第二种可选的方案中, 当判断结果是会话发起终端不支持 ICE普通 网络管理时,则在确认会话发起终端和 STUN/TUR 服务器同时支持 ICE中继网络管理后; 此时执行 S205匹配候选地址对时,会话发起终端直接用自身的中继地址匹配呼叫响应中的 候选地址, 生成一个或多个候选地址对。 In the second optional solution of the second embodiment, when the judgment result is that the session initiating terminal does not support the ICE common network management, after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management; When S205 matches the candidate address pair, the session initiating terminal directly matches the candidate address in the call response with its own relay address to generate one or more candidate address pairs.
在结合本实施例二第四种可选的方案, S205中会话发起终端根据搜集到的 STUN/TURN 服务器对 ICE中继网络管理的支持信息, 匹配自己的候选地址和会话响应终端的候选地址 生成一组或多组候选地址对, 具体包括:  In conjunction with the fourth optional solution of the second embodiment, the session initiating terminal in S205 matches the candidate address of the STUN/TURN server to the ICE relay network management, and matches the candidate address of the candidate address and the candidate address of the session response terminal. One or more sets of candidate address pairs, including:
所述会话发起终端根据搜集到的 STUN/TURN服务器对 ICE中继网络管理的支持信息、 会话发起终端对 ICE普通网络管理的支持信息和会话响应终端对 ICE普通网络管理的支持 信息, 匹配自己搜集到的候选地址和接收自会话响应终端的候选地址生成具有优先级的一 组或多组候选地址对。  The session initiating terminal matches the support information of the STUN/TURN server to the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, and matches the collection information. The candidate address to and the candidate address received from the session response terminal generate one or more sets of candidate address pairs with priority.
在本实施例的第五种可选的方案中,优选的会话发起终端判断自己和会话响应终端是否 都支持 ICE普通网络管理;  In a fifth optional solution of this embodiment, the preferred session initiation terminal determines whether both the self and the session response terminal support the ICE common network management;
在判断结果为双方都支持 ICE普通网络管理时, 按照双方的候选地址的优先级属性匹 配成具有优先级的一组或多组候选地址对; 在判断结果为双方并非满足都支持 ICE普通网 络管理条件时, 确认会话发起终端和 STUN/TUR 服务器都支持 ICE中继网络管理, 则将 会话发起终端的中继地址和会话响应终端的候选地址按照候选地址的优先级属性匹配成具 有优先级的一组或多组候选地址对。  When the result of the judgment is that both parties support the ICE common network management, the priority attribute of the candidate addresses of the two parties is matched into one or more sets of candidate address pairs having priority; if the judgment result is that both parties are not satisfied, the ICE common network management is supported. When the condition is confirmed, both the session initiating terminal and the STUN/TUR server support the ICE relay network management, and the relay address of the session initiating terminal and the candidate address of the session responding terminal are matched to the priority one according to the priority attribute of the candidate address. Group or groups of candidate address pairs.
通过对 ICE框架的分析, 其中, ICE普通网络管理的优先级高于 ICE中继网络管理。 并结合背景技术中介绍的 ICE普通网络管理和 ICE中继网络管理自身的原理, 得出用于会 话发起终端生成候选地址对的关系表 1 , 表 1 中给出了会话发起终端和会话响应终端的候 选地址对网络管理支持的几种可能的情况。  Through the analysis of the ICE framework, ICE common network management has higher priority than ICE relay network management. Combined with the principle of ICE common network management and ICE relay network management itself introduced in the background art, a relationship table 1 for generating a candidate address pair for the session initiation terminal is obtained, and a session initiation terminal and a session response terminal are given in Table 1. The candidate address addresses several possible scenarios for network management support.
表 1  Table 1
会话响应终端侧: 会话响应终端侧:  Session response terminal side: Session response terminal side:
支持: ICE普通网络管理 不支持: ICE普通网络管理 会话发起终端侧: I II  Support: ICE common network management Not supported: ICE common network management Session originating terminal side: I II
支持: ICE普通网络管理 会话发起终端使用可用于 会话发起终端只能选择使用可 支持: ICE中继网络管理 ICE普通网络管理和可用于 用于 ICE中继网络管理的候选地  Support: ICE general network management Session initiating terminal use can be used for session initiation terminal can only choose to use support: ICE relay network management ICE common network management and can be used for candidate for ICE relay network management
ICE中继网络管理的候选地 址生成具有优先级的候选地址 址与会话响应终端的候选地 对  Candidate addresses managed by the ICE relay network generate candidate addresses with priority candidate addresses and session response terminals
址生成具有优先级的候选地  Address generation candidate with priority
址对, 且前者生成的候选地  Address pair, and the candidate generated by the former
址对优先级高于后者  Address pair has higher priority than the latter
会话发起终端侧: III IV  Session Initiating Terminal Side: III IV
不支持: ICE普通网络管理 会话发起终端只能选择中继 会话发起终端只能选择可用于 支持: ICE中继网络管理 地址生成具有优先级的候选 ICE中继网络管理的候选地址生 Not supported: ICE common network management session initiation terminal can only select relay session initiation terminal can only choose to be available Support: ICE relay network management address generation candidate address candidate for priority candidate ICE relay network management
地址对 成具有优先级的候选地址对 会话发起终端侧: V VI  The address pair is a candidate address pair with priority. The session originating terminal side: V VI
支持: ICE普通网络管理 会话发起终端只能选择可用 会话发起终端无法使用上述两 不支持: ICE中继网络管理 于 ICE普通网络管理的候选 种网络管理方式, 而采用现有技  Support: ICE common network management Session initiating terminal can only choose to be available Session initiating terminal can not use the above two Unsupported: ICE relay network management ICE common network management candidate network management mode, and adopting existing technology
地址生成具有优先级的候选 术生成候选地址对  Address generation candidate generation candidate address pair with priority
地址对  Address pair
在实际情况中, 除了上述优先级外, 还要考虑会话发起终端自身的特殊需求, 比如会 话发起终端的隐私要求或会话发起终端侧的 NAT设备只允许中继地址通信等等。 其中, 所 述隐私要求比如: 用户终端不希望外网知道其私有地址; 会话发起终端侧的 NAT设备只允 许中继地址通信的如: 有些 NAT设备对于通过其自身的地址有限定, 不允许非中继地址通 过, 而只允许中继地址通过的情况。 这些特殊情况都能在明白本发明的实现方案后很容易 的结合到本发明中实现, 因此没有一一作陈述。  In the actual situation, in addition to the above priorities, the special requirements of the session initiating terminal itself, such as the privacy requirements of the session initiating terminal or the NAT device on the session initiating terminal side, only allow relay address communication and the like. The privacy requirement is as follows: The user terminal does not want the external network to know its private address; the NAT device on the session initiation terminal side only allows relay address communication such as: Some NAT devices have restrictions on their own addresses, and non-permitted The relay address passes, and only the relay address is allowed to pass. These special cases can be easily implemented in the present invention after understanding the implementation of the present invention, and therefore are not stated one by one.
S206、 话发起终端根据所述一组或多组候选地址对向会话响应终端发送连接测试请求。 当没有接收到连接测试响应或连接测试响应超时或连接测试响应为报错时,则表明连接 测试不成功; 并在还有其他候选地址对没有完成连接测试时, 逐一进行连接测试, 直到有 一组候选地址成功完成连接测试为止。  S206. The voice initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs. When the connection test response is not received or the connection test response times out or the connection test response is an error, the connection test is unsuccessful; and when there are other candidate address pairs that have not completed the connection test, the connection test is performed one by one until there is a set of candidates. The address successfully completes the connection test.
在结合本实施例二的第五种可选的方案后, S206具体实现为当没有接收到连接测试响 应或连接测试响应超时或连接测试响应为报错时, 则表明连接测试不成功; 并在还有其他 候选地址对没有完成连接测试时, 按照候选地址对的优先级逐一进行连接测试, 直到有一 组候选地址成功完成连接测试为止。  After the fifth optional solution of the second embodiment is combined, the S206 is specifically implemented to indicate that the connection test is unsuccessful when the connection test response is not received or the connection test response is timed out or the connection test response is an error; When there are other candidate address pairs that do not complete the connection test, the connection test is performed one by one according to the priority of the candidate address pair until a set of candidate addresses successfully completes the connection test.
S207、 在成功完成双方连接测试后, 建立会话发起终端和会话响应终端的会话连接。 这里成功完成连接测试, 具体为会话发起终端针对某一组候选地址对向会话响应终端 发送连接测试请求和接收到连接测试响应, 还包括会话响应终端针对同样一组候选地址对 向会话发起终端发送的连接测试请求, 并成功收到会话发起终端的连接测试响应, 此时, 才算成功完成了会话发起终端和会话响应终端间的连接测试的过程, 并依据成功完成连接 测试的候选地址对建立会话连接。  S207. After successfully completing the two-party connection test, establish a session connection between the session initiation terminal and the session response terminal. Here, the connection test is successfully completed, specifically, the session initiating terminal sends a connection test request to the session response terminal and receives the connection test response for a certain set of candidate address pairs, and further includes the session response terminal sending the same set of candidate address pairs to the session initiation terminal. The connection test request, and successfully receives the connection test response of the session initiation terminal, at this time, the connection test process between the session initiation terminal and the session response terminal is successfully completed, and the candidate address pair based on the successful completion of the connection test is established. Session connection.
本实施例, 从会话发起终端侧的角度阐述说明了本发明的核心发明点, 通过对呼叫响 应中携带的候选地址和所述候选地址对应的网络管理的支持信息, 进一步结合会话发起终 端自身候选地址对应的网络管理的支持信息生成候选地址对, 从而能够更高效的进行连接 测试。 克服了现有技术在进行连接测试时过程比较繁瑣, 较大的可能性造成非必要的候选 地址对(或者说不可能被后续建立会话连接所采用的候选地址对) 参与到连接测试过程中 来, 资源损耗较大的问题。 In this embodiment, the core inventing point of the present invention is explained from the perspective of the session initiating terminal side, and the session initiating terminal itself candidate is further combined by the candidate address carried in the call response and the network management support information corresponding to the candidate address. The support information of the network management corresponding to the address generates a candidate address pair, so that the connection test can be performed more efficiently. Overcoming the prior art, the process is relatively cumbersome in the connection test, and the greater possibility is a non-essential candidate. The address pair (or the candidate address pair that cannot be used by subsequent session establishment) participates in the connection test process, and the resource loss is large.
实施例三 Embodiment 3
本实施例是本发明在会话发起终端侧的运用,是实施例二结合具体应用环境下的描述, 其会话建立的信令流程图如图 5所示。 本实施例是基于 SDP协议实现, 但本领域技术人员 可以根据本发明中揭示的技术内容, 将该方法运用到基于同一 ICE框架的其他不同多媒体 信令协议中, 比如: XMPP协议。 本实施例中的用户终端 A, 即实施例二中的会话发起终 端, 同时具备 ICE普通网络管理和 ICE中继网络管理能力; 用户终端 B , 即实施例二中的 会话响应终端, 用户终端 B不具有 ICE普通网络管理能力, 但是具有 ICE中继网络管理能 力; 其中, STUN/TURN服务器具备 ICE中继网络管理的能力; 本实施例中对网络管理的 支持情况对应表 1 中的情况 II。 本实施例中用户终端 A和用户终端 B拥有各自网络侧的 NAT设备即 NAT_A和NAT_B, 并且双方共用一个 STUN/TURN服务器。 本实施例的方法 还可以运用到更为多样的 ICE环境, 如: 1 )用户终端 A和 /或用户终端 B的网络侧没有 NAT设备或者有多个 NAT设备; 2 )用户终端 A和用户终端 B各自网络侧拥有独立的 STUN/TUR 服务器; 或者是上述 1 )、 2 )种环境都存在的情况等等均可以基于本实施例公 开的内容通过调整候选地址和 /或 STUN/TUR 服务器间的通信来完成。本实施例的会话建 立流程的具体包括:  This embodiment is the operation of the present invention on the session initiating terminal side. It is described in the second embodiment in combination with the specific application environment. The signaling flowchart of the session establishment is shown in FIG. 5. This embodiment is implemented based on the SDP protocol, but those skilled in the art can apply the method to other different multimedia signaling protocols based on the same ICE framework, such as the XMPP protocol, according to the technical content disclosed in the present invention. The user terminal A in this embodiment, that is, the session initiation terminal in the second embodiment, has the ICE common network management and the ICE relay network management capability; the user terminal B, that is, the session response terminal in the second embodiment, the user terminal B It does not have the ICE common network management capability, but has the ICE relay network management capability. Among them, the STUN/TURN server has the capability of ICE relay network management; the support for network management in this embodiment corresponds to Case II in Table 1. In this embodiment, the user terminal A and the user terminal B have NAT devices A and NAT_B on their respective network sides, and both parties share a STUN/TURN server. The method of this embodiment can also be applied to a more diverse ICE environment, such as: 1) The network side of user terminal A and/or user terminal B does not have a NAT device or has multiple NAT devices; 2) user terminal A and user terminal B respective network side has an independent STUN/TUR server; or the above 1), 2) environments exist, etc., can be adjusted based on the content disclosed in this embodiment by adjusting the candidate address and / or between the STUN / TUR server Communication is done. The session establishment process of this embodiment specifically includes:
在本实施例中优选的完成了用户终端 A确定自身有网络切换需求的过程后才执行本实 施例的流程, 该判断可以是在用户终端 A搜集自身候选地址之前完成。  In the embodiment, the process of the embodiment is performed after the user terminal A determines that it has the network switching requirement, and the determination may be completed before the user terminal A collects its own candidate address.
所述确认自身有网络切换需求具体包括:  The confirmation that the network switching requirement itself includes:
会话发起终端中设置有在进入特定网域中或者满足特定条件时是具有网络切换需求的 , 所述特定网域包括: wifi 网域; 所述满足特定条件包括: 针对某次特定的通话对网络切换 需求进行设置, 或根据会话响应终端自身的移动的频繁程度达到指定值时。  The session initiating terminal is configured to have a network switching requirement when entering a specific network domain or when a specific condition is met, where the specific network domain includes: a wifi domain; the satisfying specific conditions include: for a specific call to the network Switch the requirements to set, or according to the frequency of the session response terminal's own movement to the specified value.
S301、用户终端 A搜集自身的候选地址和 STUN/TURN服务器对 ICE中继网络管理的 支持信息。  S301. The user terminal A collects its own candidate address and the support information of the STUN/TURN server for the ICE relay network management.
其中, 搜集自身的候选地址包括实施例二中的向 STUN/TUR 服务器发送搜集请求和 接收 STUN/TUR 服务器返回的搜集响应。 在本实施例中, 所述搜集请求包括: 指示对会 话发起终端的候选地址搜集和 STUN/TUR 服务器对 ICE中继网络管理的支持信息的搜集 的信息; STUN/TUR 服务器对 ICE中继网络管理的支持信息, 主要是通过在初始请求中 添加 STUN/TURN服务器识别的 MOBILITY-TICKET字段,使得 STUN/TUR 服务器在初 始清求中识别出 MOBILITY-TICKET字段后,在 MOBILITY-TICKET字段中携带自身对 ICE 中继网络管理的支持信息。 具体如: S101和 S104中所描述。 The candidate address for collecting itself includes sending a collection request to the STUN/TUR server and receiving the collection response returned by the STUN/TUR server in the second embodiment. In this embodiment, the collecting request includes: information indicating that the candidate address collection of the session initiating terminal and the support information of the STUN/TUR server to the ICE relay network management are collected; STUN/TUR server to the ICE relay network management Support information, mainly through the initial request The MOBILITY-TICKET field identified by the STUN/TURN server is added, so that the STUN/TUR server recognizes the MOBILITY-TICKET field in the initial clearing and carries its own support information for the ICE relay network management in the MOBILITY-TICKET field. Specifically as follows: S101 and S104 are described.
用户终端 A还根据 ICE普通网络管理的支持信息判断自己是否支持 ICE普通网络管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中; 所述 ICE普通网络管理的支持 信息可以是记录在文本中的数据, 也可以是用户终端 A通过对配置参数获取或者通过响应 端口的调用来获取。  The user terminal A also determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal; the support information of the ICE common network management may be recorded in The data in the text may also be obtained by the user terminal A by acquiring the configuration parameters or by calling the response port.
S302、 用户终端 A向用户终端 B发送呼叫请求, 所述呼叫请求中携带有 SDP信息, 呼叫请求中的 SDP信息携带有用户终端 A搜集到的用户终端 A的所有候选地址。  S302: The user terminal A sends a call request to the user terminal B, where the call request carries the SDP information, and the SDP information in the call request carries all the candidate addresses of the user terminal A collected by the user terminal A.
在结合实施例二的第三种可选的方案中, 其中, 呼叫请求还携带了会话发起终端的一 个或多个候选地址对于网络管理的支持信息具体在本实施例实现为: 对于呼叫请求的 SDP 信息中用于携带有非中继地址的会话属性行后添加支持 ICE普通网络管理的标识, 对于呼 叫请求的 SDP信息中用于携带有中继地址的会话属性行后则添力。同时支持 ICE中继网络管 理和 ICE普通网络管理的标识。  In the third optional solution of the second embodiment, the call request further carries one or more candidate addresses of the session initiating terminal, and the support information for the network management is specifically implemented in the embodiment as: After the session attribute line carrying the non-relay address is added to the SDP information, an identifier supporting the ICE common network management is added, and the SDP information for the call request is added to the session attribute line carrying the relay address. It also supports the identification of ICE trunk network management and ICE common network management.
为了具体说明如何添加支持网络管理的标识, 首先引用 RFC 5389中定义的在 SDP中 用于传递候选地址的消息格式,字段分部示意图如图 10所示,在标准中其各个字段定义为: candidate-attribute = "candidate" ":" foundation SP component-id SP  To specify how to add an identifier that supports network management, first refer to the message format used in SDP to deliver candidate addresses as defined in RFC 5389. The field segmentation diagram is shown in Figure 10. In the standard, each field is defined as: candidate -attribute = "candidate" ":" foundation SP component-id SP
transport SP  Transport SP
priority SP  Priority SP
connection-address SP ; from RFC 4566  Connection-address SP ; from RFC 4566
port ; ort from RFC 4566  Port ; ort from RFC 4566
SP cand-type  SP cand-type
[SP rel-addr]  [SP rel-addr]
[SP rel-port]  [SP rel-port]
*(SP extension-att-name SP  *(SP extension-att-name SP
extension-att-value)  Extension-att-value)
其中, RFC 5246定义了现有技术中一个候选地址可以携带的所有参数 , 包括地址支持 的类" candidate" , 传输的协议" transport" , 地址的优先级 "priority" , 默认连接地址 "connection-address" , 地址端口 "port"等。 一个具体的候选地址由 SDP信息中的会话属性行 ( "a"行)携带, 其展现形式如下: RFC 5246 defines all parameters that can be carried by a candidate address in the prior art, including the address supported class "candidate", the transmitted protocol "transport", the address priority "priority", and the default connection address "connection-address". " , address port "port" and so on. A specific candidate address is the session attribute line in the SDP information. ("a" line) is carried, and its presentation is as follows:
a=candidate: l 1 UDP 2130706431 10.0.1.1 8998 typ host  a=candidate: l 1 UDP 2130706431 10.0.1.1 8998 typ host
a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr  a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr
本实施例通过在 SDP协议的会话属性行( "a"行)增加一个用来明确该候选地址是否可 用于网络管理( ICE普通网络管理和 /或 ICE中继网络管理)的字段, 具体为在" a"行最后增 加命名为 ICE-mobile-ability的字段,该字段的取值可以确定为 normal、 relay或 both标识。 并设置在 ICE-mobile-ability的值为 normal时,表明用户终端 A支持 ICE普通网络管理(即 表明该候选地址可用于 ICE普通网络管理;); 当 ICE-mobile-ability的值为 relay时, 表明用 户终端 A和用户终端 A所在的网络中的 STUN/TURN服务器其都支持 ICE中继网络管理; 当 ICE-mobile-ability的值为 both时, 表明用户终端侧即支持 ICE中继网络管理也支持 ICE 普通网络管理; 当 ICE-mobile-ability的值为 non时, 表明用户终端 A侧并不支持网络管理 (即该候选地址对于 ICE普通网络管理和 ICE中继网络管理都不可用)。 当然, 在未来技 术发展中如果有新的基于 ICE框架的网络管理方式产生, 也可以通过在 ICE-mobile-ability 标识中扩展对应所述新的网络管理方式的取值, 来实现本发明的功能的扩展。 图 11为增加 了 ICE-mobile-ability标识后会话属性行( "a"行)各标识字段对应含义的示意图。  This embodiment adds a field for determining whether the candidate address is available for network management (ICE common network management and/or ICE relay network management) in the session attribute line ("a" line) of the SDP protocol, specifically The "a" line finally adds a field named ICE-mobile-ability, and the value of this field can be determined as normal, relay or both. And when the value of ICE-mobile-ability is normal, it indicates that user terminal A supports ICE common network management (ie, the candidate address is available for ICE common network management;); when the value of ICE-mobile-ability is relay, It indicates that the STUN/TURN server in the network where the user terminal A and the user terminal A are located support the ICE relay network management. When the value of the ICE-mobile-ability value is both, it indicates that the user terminal side supports the ICE relay network management. Support ICE common network management; When the value of ICE-mobile-ability is non, it indicates that the user terminal A side does not support network management (that is, the candidate address is not available for ICE common network management and ICE relay network management). Of course, if there is a new network management method based on the ICE framework in the future technology development, the function of the present invention can also be implemented by extending the value corresponding to the new network management mode in the ICE-mobile-ability identifier. Extension. Figure 11 is a schematic diagram showing the meaning of each identifier field of the session attribute line ("a" line) after the ICE-mobile-ability flag is added.
参考实施例一提供的本发明的***示意图 1 中候选地址参数, 经过本发明扩展后的来 自用户终端 A的呼叫请求, 具体呈现如下:  Referring to the first embodiment of the system of the present invention, the candidate address parameter, the call request from the user terminal A extended by the present invention, is specifically as follows:
v=0  V=0
o=Dodo 2890844730 2890844731 IN IP4 host.example_b.com  o=Dodo 2890844730 2890844731 IN IP4 host.example_b.com
s=  s=
c=IN IP4 215.75.211.130  c=IN IP4 215.75.211.130
t=0 0  t=0 0
m=audio 8076 RTP/AVP 0  m=audio 8076 RTP/AVP 0
a=candidate: l 1 UDP 2130706431 10.0.1.21 8998 typ host normal  a=candidate: l 1 UDP 2130706431 10.0.1.21 8998 typ host normal
a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal  a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both
其中的 "10.0.1.21"、 "211.25.21.30"和" 215.75.211.130"是由用户终端 A通过 S301所搜集 的候选地址, 而,, 211.25.21.30"和,, 215.75.211.130"是携带在搜集响应中返回给用户终端 A 的,"10.0.1.21"则是存储在用户终端 上的。其中"&=。&^1(^6: 1 1 UDP 2130706431 10.0.1.21 8998 typ host normal" , 最后的 "normal"标识, 表明用户终端 A的私有地址可以用于 ICE 普通网络管理; "a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal"最后 的" normal"标识, 表明用户终端 A 的搜集到的 NAT 地址可以用于 ICE普通网络管理; "a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both"最后的 "both"标识, 表明用户终端 A搜集到的由 STUN/TUR 服务器分配的中继地址即可以用于 ICE中继网络 管理也可以用于 ICE普通网络管理。 本实施例中, ICE中继网络管理并不需要双方进行能 力协商, 所以本实施例中也可以不添加该 ICE中继网络管理标识。 Among them, "10.0.1.21", "211.25.21.30" and "215.75.211.130" are candidate addresses collected by user terminal A through S301, and, 211.25.21.30" and, 215.75.211.130" are carried in the collection. The "10.0.1.21" returned to the user terminal A in the response is stored on the user terminal. Where "&=.&^1(^6: 1 1 UDP 2130706431 10.0.1.21 8998 typ host normal" , the last "normal" flag, indicating that the private address of user terminal A can be used for ICE common network management; "a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal" the last "normal" The identifier indicates that the collected NAT address of the user terminal A can be used for the ICE common network management; "a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both" the last "both" identifier, indicating that the user terminal A collects The relay address assigned by the STUN/TUR server can be used for ICE relay network management or ICE general network management. In this embodiment, the ICE relay network management does not need to perform capability negotiation between the two parties, so this implementation In this example, the ICE relay network management identifier may not be added.
本实施例中, 除了上述在会话属性行("a" 行)最后扩展字段方式外, 结合本实施例 三的第一种可选的方案中, 可以使用单独的会话属性行("a" 行)来实现呼叫请求携带会 话发起终端的一个或多个候选地址对于网络管理的支持信息, 如:  In this embodiment, in addition to the last extended field mode in the session attribute line ("a" line), in conjunction with the first alternative of the third embodiment, a separate session attribute line ("a" line may be used. To implement the call request carrying support information of one or more candidate addresses of the session initiation terminal for network management, such as:
v=0  V=0
o=Dodo 2890844730 2890844731 IN IP4 host.example_b.com  o=Dodo 2890844730 2890844731 IN IP4 host.example_b.com
s=  s=
c=IN IP4 215.75.211.130  c=IN IP4 215.75.211.130
t=0 0  t=0 0
m=audio 8076 RTP/AVP 0  m=audio 8076 RTP/AVP 0
a=ICE-mobile-ability: both  a=ICE-mobile-ability: both
a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host  a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host
a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx  a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay
其中, 添加了一个新的 "a= ICE-mobile-ability" 的会话属性行, 该会话属性行的取值 可以确定为 normal、 relay或 both。 当 ICE-mobile-ability的值为 normal时,表明用户终端 A 支持 ICE普通网络管理; 当 ICE-mobile-ability的值为 relay时,表明用户终端 A侧支持 ICE 中继网络管理, 其中, 用户终端 A侧包括: 用户终端 A和用户终端 A 所在的网络中的 STUN/TUR 服务器;当 ICE-mobile-ability的值为 both时,表明不仅用户终端 A侧支持 ICE 中继网络管理, 而且用户终端 A还支持 ICE普通网络管理; 当 SDP信息中不包含 "a= ICE-mobile-ability" 的会话属性行时, 表明该用户终端 A并不支持网络管理, 所在网络管 理包括 ICE中继网络管理和 ICE普通网络管理。  Among them, a new session attribute line of "a= ICE-mobile-ability" is added, and the value of the session attribute line can be determined as normal, relay or both. When the value of ICE-mobile-ability is normal, it indicates that user terminal A supports ICE common network management; when the value of ICE-mobile-ability is relay, it indicates that user terminal A side supports ICE relay network management, where user terminal The A side includes: the STUN/TUR server in the network where the user terminal A and the user terminal A are located; when the value of the ICE-mobile-ability is the both, it indicates that not only the user terminal A side supports the ICE relay network management, but also the user terminal A It also supports ICE common network management; when the SDP information does not contain the session attribute line of "a= ICE-mobile-ability", it indicates that the user terminal A does not support network management, and the network management includes ICE relay network management and ICE. Ordinary network management.
S303、 该呼叫请求被 NAT_A设备和 NAT_B设备转发到用户终端 B。 5304、 用户终端 B在接收到呼叫请求后, 开始搜集其自身的候选地址和所述候选地址 对网络管理的支持信息, 该搜集过程和用户终端 A类似。 S303. The call request is forwarded to the user terminal B by the NAT_A device and the NAT_B device. 5304. After receiving the call request, the user terminal B starts to collect support information of its own candidate address and the candidate address for network management, and the collecting process is similar to the user terminal A.
5305、 用户终端 B生成呼叫响应消息。  5305. The user terminal B generates a call response message.
由于用户终端 B不具备 ICE普通网络管理能力,所以构成呼叫响应消息的 SDP信息中 用于携带非中继地址的会话属性行最后设置为 non标识, 表明用户终端 B的非中继地址不 可用于 ICE普通网络管理(即用户终端 B不支持 ICE普通网络管理); 而用于携带中继地 址的会话属性行最后设置 relay标识, 表明用户终端 B的中继地址可用于 ICE中继网络管 理(即用户终端 B和用户终端 B所在网络的 STUN/TUR 服务器支持 ICE中继网络管理;)。 用户终端 B用于在呼叫响应消息中携带自身候选地址可用于的网络管理的信息方式和 S302 中用户终端 A用于在呼叫请求消息中携带自身候选地址可用于的网络管理的信息方式相同。  Since the user terminal B does not have the ICE common network management capability, the session attribute line for carrying the non-relay address in the SDP information constituting the call response message is finally set to a non-identity, indicating that the non-relay address of the user terminal B is unavailable. ICE common network management (ie, user terminal B does not support ICE common network management); and the session attribute line for carrying the relay address finally sets the relay identifier, indicating that the relay address of user terminal B can be used for ICE relay network management (ie, The STUN/TUR server of the network where user terminal B and user terminal B are located supports ICE relay network management; The information used by the user terminal B for carrying the network management information that the candidate address is available in the call response message is the same as the information for the network management that the user terminal A uses to carry the self-candidate address in the call request message.
在结合本实施例三的第一种可选的方案中, 可以通过在呼叫响应消息的 SDP信息中包 含" a= ICE-mobile-ability: relay"的会话属性行表明用户终端 B侧支持 ICE中继网络管理,但 用户终端 B不支持 ICE普通网络管理。  In the first optional solution of the third embodiment, the session attribute line including "a=ICE-mobile-ability: relay" in the SDP information of the call response message indicates that the user terminal B side supports the ICE. Following network management, user terminal B does not support ICE common network management.
5306、 该呼叫响应被 NAT_B设备和 NAT_A设备转发到用户终端 A。  5306. The call response is forwarded to the user terminal A by the NAT_B device and the NAT_A device.
对应实施例二中步骤 S205的内容, 在本实施中具体被执行为步骤 S307。  Corresponding to the content of step S205 in the second embodiment, it is specifically executed as step S307 in this embodiment.
5307、用户终端 A收到来自用户终端 B的呼叫响应,根据自身和用户终端 B两者对于 网络管理的支持信息进行配对, 并生成具有优先级的候选地址对, 用于连接测试。  5307. The user terminal A receives the call response from the user terminal B, and performs pairing according to the support information of the network management by itself and the user terminal B, and generates a candidate address pair with priority for connection test.
步骤 S307的过程具体为:  The process of step S307 is specifically as follows:
用户终端 A根据该呼叫响应中对应的携带非中继地址的会话属性行( "a=candidate"行) 中的的 ICE-mobile-ability 字段内容为 "non"标识, 而携带中继地址的会话属性行 ( "a=candidate"行) 中的的 ICE-mobile-ability字段中有" relay"标识, 判断出用户终端 B不 支持 ICE普通网络管理, 但是用户终端 B侧支持 ICE中继网络管理。  The user terminal A carries the session of the relay address according to the content of the ICE-mobile-ability field in the corresponding session attribute line ("a=candidate" line) carrying the non-relay address in the call response. The ICE-mobile-ability field in the attribute line ("a=candidate" line) has a "relay" flag, and it is determined that the user terminal B does not support the ICE common network management, but the user terminal B side supports the ICE relay network management.
在基于本实施例的第一种可选的方案中上述判断过程为: 用户终端 A根据呼叫响应的 SDP信息中携带有 "a= ICE-mobile-ability: relay" 的会话属性行来判断用户 B不支持 ICE 普通网络管理, 但用户终端 B侧支持 ICE中继网络管理。  In the first optional solution according to the embodiment, the determining process is: the user terminal A determines the user B according to the session attribute line carrying the "a= ICE-mobile-ability: relay" in the SDP information of the call response. ICE common network management is not supported, but the user terminal B side supports ICE relay network management.
由于用户终端 A有网络切换需求,用户终端 A优先选择能支持网络管理能力的候选地 址对进行连接测试, 可以结合表 1分析得到: 用户终端 A仅选择由自身的中继地址和用户 终端 B的候选地址生成具有优先级的一组或多组候选地址对。  Since the user terminal A has a network switching requirement, the user terminal A preferentially selects a candidate address pair capable of supporting the network management capability to perform a connection test, which can be analyzed in combination with Table 1: The user terminal A selects only its own relay address and user terminal B. The candidate address generates one or more sets of candidate address pairs with priority.
假设用户终端 B返回了其搜集到的用户终端 B的私有地址、 NAT地址和中继地址, 则 按照上述生成的具有优先级的候选地址对为: 1)用户终端 A的中继地址 < -- >用户终端 B的 私有地址、 2)用户终端 A的中继地址 < -- >用户终端 B的 NAT地址和 3)用户终端 A的中继 地址 <—- >用户终端 B的中继地址, 以上三组候选地址对的优先级排序为从高到低, 用户终 端 A侧的连接测试示意图如图 2B所示。 Suppose user terminal B returns the private address, NAT address, and relay address of user terminal B that it has collected. The candidate address pairs with priority generated according to the above are: 1) the relay address of the user terminal A <--> the private address of the user terminal B, 2) the relay address of the user terminal A < -- > the user terminal B The NAT address and 3) the relay address of the user terminal A <--> the relay address of the user terminal B, the priority order of the above three sets of candidate address pairs is from high to low, and the connection test diagram of the user terminal A side is as shown in the figure 2B is shown.
可选的, 用户终端 B的候选地址也与用户终端 A的非中继地址生成候选地址对, 且该 候选地址对仅在上述由用户终端 A的中继地址和用户终端 B生成的候选地址对在连接测试 结果为失败之后才进行连接测试。 这里描述的可选的情况, 是为了完善方案, 通常情况下 用户终端 A的中继地址与用户终端 B所生成的候选地址对连接测试成功的可能性高于用户 终端 A的非中继地址与用户终端 B所生成的候选地址对的连接测试成功的可能性。  Optionally, the candidate address of the user terminal B is also a non-relay address generation candidate address pair of the user terminal A, and the candidate address pair is only the candidate address pair generated by the relay address of the user terminal A and the user terminal B. The connection test is performed after the connection test result is a failure. The optional case described here is to improve the solution. Generally, the possibility that the relay address of the user terminal A and the candidate address generated by the user terminal B are successfully tested is higher than the non-relay address of the user terminal A. The possibility that the connection test of the candidate address pair generated by the user terminal B is successful.
其实, 通过上述候选地址对的生成可以知道, 本发明中生成的候选地址对的优先级包 含了两个参考因素:  In fact, it can be known from the generation of the candidate address pairs that the priority of the candidate address pairs generated in the present invention includes two reference factors:
因素 1 ,根据网络管理之间优先级得到第一级优先级,此时主要依据的是在用户终端 A 同时能实现 ICE普通网络管理和 ICE中继网络管理情况下, ICE普通网络管理的优先级高 于 ICE中继网络管理。 具体: 如表 1中各 I、 II VI情况中所描述。  Factor 1, according to the priority between the network management to get the first-level priority, this time mainly based on the user terminal A can achieve ICE common network management and ICE relay network management, ICE common network management priority Higher than ICE relay network management. Specific: As described in Table I, I, II VI.
因素 2, 根据候选地址自身的优先级得到第二级优先级, 并在判断出所述第一级优先 级后,在基于第一级优先级的基础上根据私有地址、 NAT地址、中级地址从高到低优先级, 得到最终的候选地址对的优先级。 该结论适用于本发明的其他各实施例。  Factor 2, obtaining a second-level priority according to the priority of the candidate address itself, and after determining the first-level priority, based on the first-level priority, based on the private address, the NAT address, and the intermediate address High to low priority, giving the priority of the final candidate address pair. This conclusion applies to other embodiments of the invention.
5308、用户终端 A依据所述一组或多组候选地址对的优先级依次向用户终端 B发送连 接测试请求。  5308. The user terminal A sends a connection test request to the user terminal B according to the priority of the one or more sets of candidate address pairs.
由于用户终端 A已经通过呼叫响应获知用户终端 B不具备 ICE普通网络管理能力, 因 此,在向用户终端 B发送的连接测试请求中便不必像 S110那样携带 MOBILITY- SUPPORT 字段 (用来完成用户终端 A和用户终端 B双方的 ICE普通网络管理的协商;)。  Since the user terminal A has learned through the call response that the user terminal B does not have the ICE common network management capability, it is not necessary to carry the MOBILITY-SUPPORT field like the S110 in the connection test request sent to the user terminal B (to complete the user terminal A). Negotiation with ICE common network management on both sides of user terminal B;).
5309、该用户终端 A的连接测试请求通过 NAT_A设备、 STUN/TUR 服务器和 NAT_B 设备转发给用户终端 B (需要注意的是, 若用户终端 A需要进行的连接测试请求的候选地 址对均是非中继地址时, 则 S309的转发过程不需要 STUN/TUR 服务器转发)。  5309. The connection test request of the user terminal A is forwarded to the user terminal B through the NAT_A device, the STUN/TUR server, and the NAT_B device. (Note that if the candidate address pair of the connection test request that the user terminal A needs to perform is non-relayed At the time of address, the forwarding process of S309 does not require STUN/TUR server forwarding.
5310、 用户终端 B接收连接测试请求, 并从该链接测试请求中提取其携带的候选地址 对; 然后, 用户终端 B将依据此提取自连接测试的候选地址对向用户终端 A发送连接测试 响应。  5310. The user terminal B receives the connection test request, and extracts the candidate address pair carried by the user from the link test request. Then, the user terminal B sends a connection test response to the user terminal A according to the candidate address pair extracted from the connection test.
在可选的方案中, 该连接测试请求也可以是从用户终端 B发出, 其具体执行过程, 仅 需要把步骤 S308-S310中的原成本执行主体用户终端 A和用户终端 B进行交换。 本可选的 方案多用于在用户终端 B具有才艮据用户终端 A的候选地址和用户终端 B的候选地址,以及 双方对网络管理的支持信息主动完成塞选和匹配的能力的情况下。 其中塞选即用户终端 B 确定自己具有网络切换需求后, 有针对性的是选择可用于 ICE中继网络管理的候选地址来 和呼叫请求中携带的候选地址进行匹配, 还是选择可用于 ICE普通网络管理的候选地址来 和呼叫请求中携带的候选地址进行匹配。 In an optional solution, the connection test request may also be sent from the user terminal B, and the specific execution process thereof is only The original cost execution subject user terminal A and the user terminal B in steps S308-S310 need to be exchanged. This optional solution is mostly used in the case where the user terminal B has the candidate address of the user terminal A and the candidate address of the user terminal B, and the ability of both parties to actively perform the selection and matching of the network management support information. After the user terminal B determines that it has the network switching requirement, it is targeted to select the candidate address that can be used for the ICE relay network management to match the candidate address carried in the call request, or to select the ICE common network. The managed candidate address is matched with the candidate address carried in the call request.
在可选的方案中, 候选地址对的生成按照本实施例的方式来完成, 而后续的连接测试 过程(包括连接测试请求的发送以及连接测试响应接收等)仍就按照现有的 ICE框架来完 成。由于,现有 ICE框架进行连接测试的顺序依照的就是候选地址对的优先级顺序, 因此, 在本实例生成了具有不同优先级的候选地址对后, 可以正常的应用现有 ICE框架来完成连 接测试过程。  In an optional solution, the generation of the candidate address pair is completed in the manner of the embodiment, and the subsequent connection test process (including the transmission of the connection test request and the connection test response reception, etc.) is still in accordance with the existing ICE framework. carry out. Because the order of the connection test of the existing ICE framework is in accordance with the priority order of the candidate address pairs, after the candidate address pairs with different priorities are generated in this example, the existing ICE framework can be applied to complete the connection. Testing process.
S31 用户终端 B发送的连接测试响应经过 NAT_B设备、 STUN/TUR 服务器和 NAT A设备转发到用户终端 A (需要注意的是, 若用户终端 B返回的连接测试响应中携带 的候选地址对均是非中继地址时, 则 S311的转发过程不需要经过 STUN/TUR 服务器)。  S31 The connection test response sent by the user terminal B is forwarded to the user terminal A through the NAT_B device, the STUN/TUR server, and the NAT A device. (Note that if the candidate address pair carried in the connection test response returned by the user terminal B is not in the middle When the address is followed, the forwarding process of S311 does not need to go through the STUN/TUR server).
S312、 成功完成连接测试后, 建立会话发起终端和会话响应终端的会话连接。 本实施 例中用户终端 A的中继地址 < -- >用户终端 B的 NAT地址的候选地址对 , 在用户终端 A和 用户终端 B分别依此候选地址对发起连接测试请求时, 均能收到对方的连接测试响应, 表 明成功完成连接测试。 用户终端 A选择该候选地址对建立与用户终端 B的会话连接。  S312. After successfully completing the connection test, establish a session connection between the session initiation terminal and the session response terminal. In this embodiment, the candidate address pair of the NAT address of the user terminal A of the user terminal A can be received when the user terminal A and the user terminal B initiate a connection test request according to the candidate address pair respectively. The other party's connection test response indicates that the connection test was successfully completed. User terminal A selects the candidate address pair to establish a session connection with user terminal B.
本实施例总结了, 在现有技术中为实现用户终端 A和用户终端 B的网络切换需求, 会 在网络切换时做大量的连接测试; 为减少网络切换时进行连接测试所占用的网络延时, 现 有技术又提出了 ICE普通网络管理和 ICE中继网络管理。 但是实际网络中用户终端和各网 络节点对于这两种网络管理的支持能力并不相同, 有可能都支持、 有可能只支持其中某一 个或者两种网络管理都不支持。而 ICE普通网络管理的支持的确认是在连接测试步骤中(所 述连接测试步骤, 如图 1中所示的步骤如 S110-S113 ), 现有方法无法在网络连接测试前知 道会话响应终端是否支持 ICE普通网络管理, 因此, 在会话响应终端不支持 ICE普通网络 管理情况下, 额外的浪费连接测试请求。 针对上述存在问题, 本实施例中采用的通过扩展 SDP信息中用来描述候选地址的 "a"行的字段,增设了网络管理标识,使得用户终端 A能够 在发送连接测试之前, 更确切的可以说是在生成用于连接测试的候选地址对前, 便获知用 户终端 B是否支持 ICE普通网络管理, 从而有效的减少了无效的连接测试, 节约了网络带 宽。 这里所说的无效的连接测试, 包括但不限定为经过测试后而不会使用到其测试结果的 情况。 This embodiment summarizes that in the prior art, in order to implement the network switching requirements of the user terminal A and the user terminal B, a large number of connection tests are performed during network switching; to reduce the network delay occupied by the connection test during network switching. The prior art also proposes ICE common network management and ICE relay network management. However, in the actual network, the user terminal and each network node have different support capabilities for the two types of network management, and may or may not support one or both of the network management. The confirmation of the support of the ICE common network management is in the connection test step (the connection test step, such as the steps shown in FIG. 1 such as S110-S113), the existing method cannot know whether the session response terminal is before the network connection test. It supports ICE common network management. Therefore, in the case that the session response terminal does not support ICE common network management, additional connection test requests are wasted. For the above problem, in the field used in the embodiment to extend the "a" line of the candidate address in the SDP information, a network management identifier is added, so that the user terminal A can accurately before sending the connection test. It is said that before generating the candidate address pair for the connection test, it is known whether the user terminal B supports the ICE common network management, thereby effectively reducing the invalid connection test and saving the network band. width. The invalid connection test mentioned here includes, but is not limited to, the case where the test result is not used after being tested.
还要说明的是,本实施例中 S302中呼叫请求里的候选地址对网络管理的支持信息在本 实施例中并非是必须的(是可以去掉的), 它的作用主要是在和本发明的实施例六结合在一 起作为一个完整***方案时才体现出来。  It should be noted that the support information of the candidate address in the call request in the S302 in the embodiment is not necessary (can be removed) in the embodiment, and its role is mainly in the present invention. Embodiment 6 is combined when it is combined as a complete system solution.
本领域的技术人员都知道, 实际情况中会话发起终端或者会话响应终端所搜集的候选 地址中可能只包含其中的某一个候选地址; 可能还因为会话发起终端或者会话响应终端的 某种需求, 在会话请求中只携带了私有地址或 NAT地址中的某一个。 在本实施例中对于缺 少了某一种候选地址情况, 则相应的在 SDP信息中去掉该缺少的候选地址对应的会话属性 行("a" 行), 在此不再赘述。  As is known to those skilled in the art, in the actual situation, the candidate address collected by the session initiation terminal or the session response terminal may only include one of the candidate addresses; possibly because of some requirements of the session initiation terminal or the session response terminal, The session request carries only one of the private address or the NAT address. In this embodiment, for a case where a certain candidate address is missing, the session attribute line ("a" line) corresponding to the missing candidate address is correspondingly deleted in the SDP information, and details are not described herein again.
本实施例中仅列举了用户终端 A同时具有 ICE中继网络管理的能力和 ICE普通网络管 理的能力, 而用户终端 B仅支持 ICE中继网络管理的能力情况下的方案。 而用户终端 A和 用户终端 B实际对于上述两种网络管理的支持情况的组合除本实施例列举情况外, 还包含 了如表 1所示的其他五种情况。 下面将结合本实施例的主要步骤逐一对所述表 1情况作分 析, 其中由于用户终端 B是否支持 ICE中继网络管理只与用户终端 B侧的网络有关, 用户 终端 B是否支持 ICE中继网络管理在本实施例及其相关扩展实施例中不作考虑; 默认的用 户终端 B在呼叫响应中返回其搜集到的所有候选地址, 默认的在匹配用户终端 A的候选地 址和用户终端 B的候选地址时候, 也是使用用户终端 B所有候选地址。  In this embodiment, only the user terminal A has the capability of ICE relay network management and the ICE common network management capability, and the user terminal B only supports the scheme of the ICE relay network management capability. The combination of the user terminal A and the user terminal B actually supporting the above two kinds of network management includes five other cases as shown in Table 1 in addition to the enumeration in the embodiment. In the following, the main steps of the embodiment will be analyzed on a case-by-case basis, wherein whether the user terminal B supports the ICE relay network management is only related to the network on the user terminal B side, and whether the user terminal B supports the ICE relay network. The management is not considered in this embodiment and its related extended embodiment; the default user terminal B returns all the candidate addresses it collects in the call response, and the default is matching the candidate address of the user terminal A and the candidate address of the user terminal B. At the same time, all candidate addresses of the user terminal B are also used.
实施例三的扩展实施例 α) Extended embodiment of the third embodiment α)
在用户终端 Α既拥有 ICE中继网络管理的能力(即用户终端 A支持 ICE中继网络管理) 又拥有 ICE普通网络管理的能力, 且用户终端 B拥有 ICE普通网络管理能力情况下: 根据表 1的结论 I , 用户终端 A使用可用于 ICE普通网络管理和可用于 ICE中继网络 管理的候选地址与用户终端 B的候选地址生成具有优先级的候选地址对, 且其中由可用于 ICE普通网络管理的用户终端 A的候选地址与用户终端 B的候选地址生成的候选地址对优 先级高于由可用于 ICE中继网络管理的用户终端 A的候选地址与用户终端 B的候选地址生 成的候选地址对的优先级, 因此在扩展实施例(1)中会优先进行可用于 ICE普通网络管理的 候选地址对的连接测试, 并仅在所述可用于 ICE普通网络管理的候选地址对的连接测试失 败情况才进行可用于 ICE中继网络管理的候选地址对的连接测试。  In the user terminal, both the ability to manage the ICE relay network (ie, the user terminal A supports the ICE relay network management) and the ICE common network management capability, and the user terminal B has the ICE common network management capability: According to Table 1 Conclusion I, User Terminal A generates a candidate address pair with priority using candidate addresses available for ICE general network management and available for ICE relay network management and candidate addresses of user terminal B, and wherein it can be used for ICE common network management The candidate address pair generated by the candidate address of the user terminal A and the candidate address of the user terminal B has a higher priority than the candidate address pair generated by the candidate address of the user terminal A available for the ICE relay network management and the candidate address of the user terminal B. Priority, therefore, in the extended embodiment (1), the connection test of candidate address pairs available for ICE common network management is preferentially performed, and only the connection test failure of the candidate address pair available for ICE common network management is performed. The connection test for candidate address pairs that can be used for ICE relay network management is performed.
接着, 通过将扩展实施例标识 "(1)" 和原实施例三中的步骤标识结合方式, 来陈述实 施例三的扩展实施例( 1 )中相对于实施例三的步骤的主要不同地方。 其它步骤内容只需适应 性修改,这里不再赘述。在 S305(l)中收到的来自用户终端 B的呼叫响应中将携带如下信息: (这是基于本发明***结构示意图 3中的参数来陈述的) Next, by combining the extension embodiment identification "(1)" with the step identification in the original embodiment 3, the statement is made. The main difference between the steps of the third embodiment of the third embodiment is relative to the steps of the third embodiment. Other steps need only be adapted, and will not be described here. The call response from the user terminal B received in S305(1) will carry the following information: (This is stated based on the parameters in the system structure diagram 3 of the present invention)
a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host normal  a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host normal
a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ relay normal  a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ relay normal
a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ srflx normal  a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ srflx normal
此时, 原 S307将被执行为 S307(l), 具体如下:  At this point, the original S307 will be executed as S307(l), as follows:
S307(l)-S309、 当用户终端 A收到来自用户终端 B的呼叫响应后, 才艮据自身和用户终 端 B两者的候选地址对于网络管理的支持信息, 生成具有优先级的候选地址对, 并才艮据所 述候选地址对的优先级依次向用户终端 B发送连接测试清求。 其过程具体为:  S307(l)-S309. After receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the support information of the candidate address of the user and the user terminal B for the network management. And sending a connection test request to the user terminal B in turn according to the priority of the candidate address pair. The process is specifically as follows:
用户终端 A根据该呼叫响应中携带的非中继地址所在的会话属性行( "a=candidate,,行) 中扩展的 ICE-mobile-ability字段的内容为 "normal" 确认用户终端 B的候选地址可用于 ICE 普通网络管理。 由于用户终端 A有网络切换需求, 该网络切换需求要求用户终端 A优先选 择可用于网络管理的候选地址建立会话连接, 实际中 ICE普通网络管理的优先级高于 ICE 中继网络管理, 所以用户终端 A优先选择自身可用于 ICE普通网络管理的候选地址与用户 终端 B的候选地址生成具有优先级的一组或多组候选地址对, 用户终端 A依据所述候选地 址对的优先级向会话响应终端发送连接测试清求。  The user terminal A confirms the candidate address of the user terminal B according to the content of the extended ICE-mobile-ability field in the session attribute line ("a=candidate", the row) of the non-relay address carried in the call response is "normal". It can be used for ICE common network management. Because user terminal A has network switching requirements, the network switching requirement requires user terminal A to preferentially select a candidate address that can be used for network management to establish a session connection. In practice, ICE common network management has higher priority than ICE. Following the network management, the user terminal A preferentially selects the candidate address that can be used for the ICE common network management and the candidate address of the user terminal B to generate one or more sets of candidate address pairs with priority, and the user terminal A according to the candidate address pair. The priority sends a connection test request to the session response terminal.
此时的连接测试请求, 还需要采用 S110-S112所述技术, 通过在连接测试请求中携带 MOBILITY-SUPPORT字段和在连接测试响应中携带 MOBILITY-SUPPORT字段的值来为 后续用户终端 A在发生网络切换时,利用 ICE普通网络管理方式完成 ICE重协商做准备工 作 (即完成用户终端 A和用户终端 B的 ICE普通网络管理协商)。 在实施例三中, 由于其 进行连接测试时不涉及 ICE普通网络管理, 所以并不需要上述 S110-S112描述的 ICE普通 网络管理能力协商的过程。 本领域技术人员也可以容易想到, 该 ICE普通网络管理能力协 商的过程能够进一步结合到用户终端 A 的呼叫请求中实现, 即在发送呼叫请求时便携带 MOBILITY-SUPPORT 字段, 似的在发送呼叫清求和接收呼叫响应阶段便完成用户终端 A 和用户终端 B的 ICE普通网络管理的协商。 但是这样会给现有协议带来较大的改变, 在本 发明中仅为可选方案。  At this time, the connection test request needs to adopt the technology described in S110-S112 to generate a network for the subsequent user terminal A by carrying the MOBILITY-SUPPORT field in the connection test request and carrying the value of the MOBILITY-SUPPORT field in the connection test response. When switching, the ICE common network management mode is used to complete the ICE renegotiation preparation (that is, the ICE common network management negotiation of the user terminal A and the user terminal B is completed). In the third embodiment, since the ICE general network management is not involved in the connection test, the process of the ICE common network management capability negotiation described in the above S110-S112 is not required. Those skilled in the art can also easily think that the process of the ICE common network management capability negotiation can be further implemented in the call request of the user terminal A, that is, the portable MOMIS-SUPPORT field is sent when the call request is sent, and the call is cleared. The negotiation of the ICE general network management of the user terminal A and the user terminal B is completed in the summing and receiving call response phase. However, this will bring about major changes to the existing protocol, and is only an alternative in the present invention.
S310(l)、 用户终端 B接收连接测试请求, 并从该链接测试请求中提取其携带的候选地 址对; 然后, 用户终端 B将依据此提取自连接测试的候选地址对向用户终端 A发送连接测 试响应。 该连接测试响应中携带 MOBILITY-SUPPORT字段和相应的值。 在 S311(l)返回连 接测试响应超时表明该非中继地址的连接测试结果失败时, 则用户终端 A会继续依照候选 地址对的优先级, 选择下一优先级的候选地址对进行后序连接测试。 S310(1), the user terminal B receives the connection test request, and extracts the candidate address pair carried by the user from the link test request; then, the user terminal B sends a connection to the user terminal A according to the candidate address pair extracted from the connection test. Measurement Try to respond. The connection test response carries the MOBILITY-SUPPORT field and the corresponding value. When the connection test response timeout in S311(1) indicates that the connection test result of the non-relay address fails, the user terminal A continues to follow the priority of the candidate address pair, and selects the candidate address pair of the next priority to perform the subsequent connection. test.
此时, 原 S312将被执行为 S312(1), 具体如下:  At this point, the original S312 will be executed as S312(1), as follows:
S312(l)、 成功完成连接测试后, 建立会话发起终端和会话响应终端的会话连接。 本实 施例中用户终端 A的 NAT地址 < -- >用户终端 B的 NAT地址的候选地址对,在用户终端 A 和用户终端 B分别依此发起连接测试请求时, 均能收到对方的连接测试响应, 表明成功完 成连接测试。 用户终端 A选择该的候选地址对建立与用户终端 B的会话连接。  S312(l), after successfully completing the connection test, establish a session connection between the session initiation terminal and the session response terminal. In this embodiment, the NAT address of the user terminal A is a candidate address pair of the NAT address of the user terminal B. When the user terminal A and the user terminal B respectively initiate a connection test request, they can receive the connection test of the other party. A response indicating that the connection test was successfully completed. User terminal A selects the candidate address pair to establish a session connection with user terminal B.
当然本扩展实施例(1)在针对会话属性行的扩展方式中, 除了采用上述实施例三所采用 的方式外, 还可以采用实施例三中的第一种可选方案。 其过程类似实施例三, 在此不再赘 述。  Of course, in the extension mode of the extended embodiment (1) for the session attribute line, in addition to the manner adopted by the third embodiment, the first option in the third embodiment may be adopted. The process is similar to the third embodiment and will not be described here.
实施例三的扩展实施例 (2) Extended embodiment of the third embodiment (2)
在用户终端 A仅支持 ICE中继网络管理, 而不支持 ICE普通网络管理情况下, 此时, 用户终端 B对于 ICE普通网络管理包括支持的或不支持的情况。将用扩展实施例标识" (2),, 和原实施例三中的步骤标识结合的方式, 来陈述实施例三的扩展实施例 (2)中相对于实施例 三的步骤的主要不同地方。 其它步骤内容只需要适应性修改, 这里不再赘述。 在 S305(2) 中接收到的来自用户终端 B的呼叫响应中,对应" a"行所携带的用户终端 B的候选地址有所 不同, 根据表 1中 III和 IV的结论, 具体表现为:  In the case that the user terminal A only supports the ICE relay network management, and does not support the ICE common network management, at this time, the user terminal B includes or does not support the ICE common network management. The main difference in the steps of the expanded embodiment (2) of the third embodiment with respect to the third embodiment will be described by way of the combination of the extension embodiment designation "(2), and the step identification in the original embodiment 3. The content of the other steps only needs to be modified, and will not be described here. In the call response from the user terminal B received in S305(2), the candidate addresses of the user terminals B carried in the corresponding "a" line are different. According to the conclusions of III and IV in Table 1, the specific performance is as follows:
在用户终端 B支持 ICE普通网络管理时(这里艮设用户终端 B不支持 ICE中继网络管 理, 因为, 用户终端 B是否支持 ICE中继网络管理并非本实施例所关注的), S305(2)中接 收到的呼叫响应中将携带如下信息 (这是基于本发明***结构示意图 3的参数来陈述的): a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host normal  When the user terminal B supports the ICE common network management (the user terminal B does not support the ICE relay network management, because the user terminal B supports the ICE relay network management is not the focus of this embodiment), S305(2) The received call response will carry the following information (this is stated based on the parameters of the system structure diagram 3 of the present invention): a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host normal
a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ srflx normal  a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ srflx normal
a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ relay normal  a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ relay normal
在用户终端 B不支持 ICE普通网络管理时(这里艮设用户终端 B不支持 ICE中继网络 管理, 因为, 用户终端 B是否支持 ICE中继网络管理并非本实施例所关注的), S305(2)中 接收到的呼叫响应中将携带如下信息(这是基于本发明***结构示意图 3的参数来陈述的): a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host non  When the user terminal B does not support the ICE common network management (the user terminal B does not support the ICE relay network management, because the user terminal B supports the ICE relay network management is not the focus of this embodiment), S305 (2) The received call response will carry the following information (this is stated based on the parameters of the system architecture diagram 3 of the present invention): a=candidate:l 1 UDP 3134126431 192.168.1.25 8678 typ host non
a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ srflx non a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ relay non a=candidate:2 1 UDP 2494367815 202.205.21.30 33664 typ srflx non a=candidate:3 1 UDP 1984498123 215.75.211.130 45633 typ relay non
原 S307将被执行为 S307(2)如下:  The original S307 will be executed as S307(2) as follows:
S307(2)、 当用户终端 A收到来自用户终端 B的呼叫响应后, 才艮据自身和用户终端 B 两者的候选地址可用于的网络管理的信息, 生成具有优先级的候选地址对, 并才艮据所述优 先级依次根据候选地址对向用户终端 B发送连接测试请求。 其过程具体为:  S307 (2), after receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the network management information available for the candidate addresses of both the user and the user terminal B, And then, according to the priority, the connection test request is sent to the user terminal B according to the candidate address pair. The process is specifically as follows:
根据该呼叫响应中候选地址所在的会话属性行 ( " a=candidate,, 行) 中的 ICE-mobile-ability字段的内容为" normal"确认用户终端 B的候选地址可用于 ICE普通网络 管理; 若所述 ICE-mobile-ability字段内容为 "non"确认用户终端 B不可用于 ICE普通网络 管理。 由于用户终端 A有网络切换需求, 用户终端 A优选选择可用于网络管理的候选地址 建立通信, 由于用户终端 A不支持 ICE普通网络管理, 所以用户终端 A选择可用于 ICE 中继网络管理的中继地址与用户终端 B的候选地址生成候选地址对, 并向用户终端 B发送 连接测试请求。  Confirming that the candidate address of the user terminal B is available for ICE common network management according to the content of the ICE-mobile-ability field in the session attribute line ("a=candidate,") of the candidate address in the call response is "normal"; The content of the ICE-mobile-ability field is "non" to confirm that the user terminal B is not available for ICE general network management. Since the user terminal A has a network handover requirement, the user terminal A preferably selects a candidate address available for network management to establish communication, User terminal A does not support ICE general network management, so user terminal A selects a relay address that can be used for ICE relay network management and a candidate address of user terminal B to generate a candidate address pair, and sends a connection test request to user terminal B.
原 S312将被执行为 S312(2)如下:  The original S312 will be executed as S312(2) as follows:
S312(2)中用户终端 A接收到来自用户终端 B的连接测试响应后,从该连接测试响应中 得知所述中继地址的连接测试通过时,则在 S312(2)中最后协商使用的通信地址是该通过连 接测试的中继地址。  After receiving the connection test response from the user terminal B, the user terminal A in S312(2) knows from the connection test response that the connection test of the relay address passes, and finally negotiates the use in S312(2). The communication address is the relay address of the connection test.
当然本扩展实施例 (2)在针对会话属性行的扩展方式中, 除了采用上述实施例三所采用 的方式外, 还可以采用实施例三中的第一种可选方案。 其过程类似实施例三, 在此不再赘 述。  Of course, in the extended manner of the session attribute line, in addition to the manner adopted by the foregoing embodiment 3, the first option in the third embodiment may be adopted. The process is similar to the third embodiment and will not be described here.
在结合本扩展实施例 (2)的第一种可选方案中,用户终端 A在确认自己仅能支持 ICE中 继网络管理后, 在确认用户终端 A只具有有 ICE中继网络管理能力后, 可以跳过对呼叫响 应中携带的用户终端 B对网络管理是否支持的分析, 直接采用可用于 ICE中继网络管理的 中继地址进行连接测试。 也就是步骤 S307(2)可选的执行为:  In the first alternative of the extended embodiment (2), after confirming that the user terminal A can only support the ICE relay network management, after confirming that the user terminal A only has the ICE relay network management capability, The analysis of whether the user terminal B carried in the call response supports network management can be skipped, and the connection test that can be used for the ICE relay network management is directly used for the connection test. That is, the optional execution of step S307(2) is:
S307(2)\ 当用户终端 A收到来自用户终端 B的呼叫响应后, 由于自身只具有 ICE中 继网络管理的能力, 于是直接使用自己的中继地址和用户终端 B所返回的候选地址生成具 有优先级的候选地址对, 用于连接测试(而无需分析用户终端 B的候选地址是否可用于网 络管理的信息)。  S307(2)\ When the user terminal A receives the call response from the user terminal B, since it only has the capability of the ICE relay network management, the user terminal A directly uses its own relay address and the candidate address returned by the user terminal B to generate A candidate address pair with priority for connection testing (without analyzing whether the candidate address of user terminal B is available for network management).
实施例三的扩展实施例 (3) Extended embodiment of the third embodiment (3)
在用户终端 A的候选地址可用于 ICE普通网络管理, 而不可用于 ICE中继网络管理, 且用户终端 B支持 ICE普通网络管理情况下, 根据表 1中 V的结论: The candidate address at user terminal A can be used for ICE general network management, and not for ICE relay network management. And when user terminal B supports ICE common network management, according to the conclusion of V in Table 1:
此时, 实施例三中步骤 S307将被执行为 S307(3), 具体如下:  At this time, step S307 in the third embodiment will be executed as S307(3), as follows:
S307(3)、 当用户终端 A收到来自用户终端 B的呼叫响应后, 才艮据自身和用户终端 B 两者对于网络管理的支持信息, 生成具有优先级的候选地址对, 并根据所述优先级依次根 据候选地址对向用户终端 B发送连接测试请求。 其过程具体为:  S307 (3), after receiving the call response from the user terminal B, the user terminal A generates a candidate address pair with priority according to the support information of the network management itself and the user terminal B, and according to the The priority sequentially sends a connection test request to the user terminal B according to the candidate address pair. The process is specifically as follows:
根据该呼叫响应中非中继地址所在的会话属性行 ( " a=candidate,, 行) 中的 ICE-mobile-ability字段的内容为 "normal" 确认用户终端 B的候选地址可用于 ICE普通网 络管理;由于用户终端 A有网络切换需求,用户终端 A需要尽量选择能可用于网络管理(包 括 ICE中继网络管理和 ICE普通网络管理)的候选地址建立通信。 由于用户终端 A和用户 终端 B都支持 ICE普通网络管理,所以用户终端 A选择可以用于 ICE普通网络管理的候选 地址与用户终端 B的候选地址生成具有优先级的候选地址对。  According to the content of the ICE-mobile-ability field in the session attribute line ("a=candidate,") where the non-relay address is located in the call response is "normal", confirm that the candidate address of the user terminal B is available for ICE common network management. Since user terminal A has network switching requirements, user terminal A needs to select a candidate address that can be used for network management (including ICE relay network management and ICE common network management) to establish communication. Since both user terminal A and user terminal B support ICE general network management, so user terminal A selects a candidate address that can be used for ICE general network management and a candidate address of user terminal B to generate a candidate address pair with priority.
原 S312将被执行为 S312(3)如下:  The original S312 will be executed as S312(3) as follows:
S312(3)、用户终端 A接收到来自用户终端 B的连接测试响应, 并从该连接测试响应中 得知用户终端 A的 NAT地址 < -- >用户终端 B的 NAT地址的连接测试通过时,则在 S312(3) 中最后协商使用的通信地址是该通过连接测试的候选地址对。  S312 (3), the user terminal A receives the connection test response from the user terminal B, and learns from the connection test response that the connection test of the NAT address of the user terminal A is less than the NAT address of the user terminal B, Then, the communication address finally used in the negotiation in S312(3) is the candidate address pair of the connection test.
当然本扩展实施例 (3)在针对会话属性行的扩展方式中, 除了采用上述实施例三所采用 的方式外, 还可以采用实施例三中的第一种可选方案。 其过程类似实施例三, 在此不再赘 述。  Of course, in the extended manner for the session attribute line, the first option in the third embodiment can be used in addition to the manner adopted in the third embodiment. The process is similar to the third embodiment and will not be described here.
实施例三的扩展实施例 (4) Extended embodiment of the third embodiment (4)
在用户终端 A仅支持 ICE普通网络管理, 而根据呼叫响应确认用户终端 B不支持 ICE 普通网络管理时, 如表 1中 VI结论, 无法采用任一所述网络管理方式, 则按照现有方法进 行连接测试, 具体为本实施例中步骤 S307及其之后的步骤按照步骤 S110-S113来完成。 并 且因为已经确认用户终端 B不支持 ICE普通网络管理,因此 S 110中的 MOBILITY-SUPPORT 标识在本扩展实施例 (4 ) 中不再需要携带。  In the user terminal A only supports the ICE common network management, and according to the call response, it is confirmed that the user terminal B does not support the ICE common network management, as the VI conclusion in Table 1 can not adopt any of the network management methods, according to the existing method The connection test is specifically performed in steps S307 and subsequent steps in this embodiment in accordance with steps S110-S113. And since it has been confirmed that the user terminal B does not support the ICE general network management, the MOBILITY-SUPPORT flag in the S 110 is no longer required to be carried in the extended embodiment (4).
通过上述不同情况方案的补充, 结合本实施例能够更全面的将本发明应用到各种实际 情况中, 使其涵盖用户终端 A和用户终端 B对于是否具有网络管理能力的各种情况, 并对 于其中的特定情况做了方案的优化, 如扩展实施例 (2)中跳过对于用户终端 B的候选地址是 否支持网络管理的分析, 进一步筒化了信令交互和操作复杂程度。  With the addition of the above different scenarios, the present invention can be more fully applied to various practical situations in combination with the present embodiment, so as to cover various situations in which the user terminal A and the user terminal B have network management capabilities, and The specific case is optimized by the scheme, such as skipping the analysis of whether the candidate address of the user terminal B supports the network management in the extended embodiment (2), further simplifying the signaling interaction and the operation complexity.
实施例四 本实施例是本发明一种会话连接建立的方法, 在另一个方面上, 本实施例和实施例二 的第四种可选的方案是分别就会话响应终端和会话发起终侧端两角度撰写的, 本实施例可 以作为一个单独的改进方案实现, 也可以和实施例二结合为一个方案来实现。 所述结合即 可以是实施例二中的会话发起终端在本实施例中是以会话响应终端身份存在, 还可以是本 实施例中的会话响应终端就是实施例二中会话响应终端的存在。 其过程具体包括: Embodiment 4 This embodiment is a method for establishing a session connection according to the present invention. In another aspect, the fourth optional solution of the embodiment and the second embodiment is to write the two sides of the session response terminal and the session initiation end side respectively. The embodiment can be implemented as a single improvement solution, or can be implemented as a solution in combination with the second embodiment. The combination may be that the session initiation terminal in the second embodiment exists as the session response terminal in the embodiment, and the session response terminal in the embodiment is the existence of the session response terminal in the second embodiment. The process specifically includes:
5401、 会话响应终端接收所述会话发起终端的呼叫请求, 所述呼叫请求携带会话发起 终端的一个或多个候选地址。  S401: The session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal.
所述呼叫请求中包含了会话发起终端搜集到的属于会话发起终端的一个或多个候选地 址, 使得会话响应终端在搜集到自身的候选地址后能够依据候选地址的优先级排序, 组合 出不同优先级的候选地址对, 用来进行会话响应终端侧后续的连接测试的过程。  The call request includes one or more candidate addresses that are collected by the session initiating terminal and belong to the session initiating terminal, so that the session responding terminal can sort according to the priority of the candidate addresses after collecting the candidate addresses of the terminals, and combine different priorities. The candidate address pair of the level is used to perform the process of the subsequent connection test on the terminal side of the session response.
5402、 会话响应终端根据所述呼叫请求搜集会话响应终端的候选地址和会话响应终端 对 ICE普通网络管理的支持信息。  S402. The session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal for the ICE common network management according to the call request.
在结合本实施例四的第一种可选的方案中: 在步骤 S401里, 所述接收所述会话发起终 端的呼叫请求中还携带有所述会话发起终端对 ICE普通网络管理的支持信息,则所述会话响 应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选地址生成具有优 先级的一组或多组候选地址对, 具体包括: 会话响应终端根据所述呼叫请求中携带的会话 发起终端对 ICE普通网络管理的支持信息和会话响应终端自身的 ICE普通网络管理的支持 信息,确定会话发起终端和会话响应终端两者是否都支持 ICE普通网络管理; 当两者不满足 都支持 ICE普通网络管理时, 则在确定会话发起终端侧支持 ICE中继网络管理时, 所述会话 响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选地址中的中继 候选地址生成具有优先级的一组或多组候选地址对。  In the first optional solution of the fourth embodiment, in the step S401, the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management. And the session responding terminal matches the candidate address carried in the call response and the candidate address of the session initiating terminal to generate a group or groups of candidate address pairs having a priority, and the method includes: the session response terminal according to the call request The support information carried by the session initiation terminal to the ICE common network management and the support information of the ICE common network management of the session response terminal itself determine whether both the session initiation terminal and the session response terminal support the ICE common network management; When the ICE common network management is supported, the session response terminal matches the candidate address carried in the call response and the candidate address of the session initiation terminal in determining the session initiation terminal side to support the ICE relay network management. Relay candidate address generates one or more sets of candidates with priority Access right.
之所以提出结合本实施例四的第一种可选的方案, 是因为会话响应终端在收到呼叫请 求中发现会话发起终端只支持 ICE中继网络管理时,会话响应终端实际上就获知了两条信息: 1、根据本发明实施例二的第四种可选的方案改进后的会话发起终端会在收到会话响应终端 的呼叫响应后只利用会话发起终端的中继地址和呼叫响应中携带的候选地址匹配生成候选 地址对; 因此, 可以进一步通过在会话响应终端侧预先感知这一匹配动作, 从而可以减少 会话响应终端生成的无效候选地址对(即会话发起终端不会采用的候选地址对); 进一步提 高后续连接测试的效率。  The first alternative solution of the fourth embodiment is proposed because the session response terminal actually knows that the session initiating terminal only supports the ICE relay network management when receiving the call request. The following information is provided: 1. The fourth optional solution according to the second embodiment of the present invention improves the session initiation terminal and uses only the relay address of the session initiation terminal and the call response after receiving the call response of the session response terminal. The candidate address match generates the candidate address pair; therefore, the matching action can be further perceived in advance on the session response terminal side, so that the invalid candidate address pair generated by the session response terminal (ie, the candidate address pair that the session initiation terminal does not adopt) can be reduced. ); further improve the efficiency of subsequent connection tests.
在结合本实施例四的第二种可选的方案中: 在步骤 S401里, 在所述接收所述会话发起 终端的呼叫请求中还携带有所述会话发起终端对 ICE普通网络管理的支持信息时,则所述搜 集自身的候选地址具体包括: In the second optional solution of the fourth embodiment: in step S401, the receiving the session is initiated. When the call request of the terminal further carries the support information of the session initiation terminal to the ICE common network management, the candidate address of the collection itself includes:
会话响应终端根据所述呼叫请求中携带的会话发起终端对 ICE普通网络管理的支持信 息确定会话发起终端和会话响应终端不满足同时支持 ICE普通网络管理,而会话响应终端自 身支持 ICE中继网络管理时; 则会话响应终端在向所在网络中的 STUN/TUR 服务器发送的 搜集请求中携带会话响应终端对 ICE普通网络管理支持信息和会话响应终端对 ICE中继网 络管理的支持信息, 以便于 STUN/TUR 服务器在判断自身支持 ICE中继网络管理时, 向会 话发起终端仅返回其自身的中继地址。  The session response terminal determines that the session initiation terminal and the session response terminal do not satisfy the ICE common network management according to the support information of the session initiation terminal and the ICE common network management carried in the call request, and the session response terminal itself supports the ICE relay network management. The session response terminal carries the support information of the session response terminal to the ICE common network management support information and the session response terminal to the ICE relay network management in the collection request sent to the STUN/TUR server in the network, so as to facilitate the STUN/ When the TUR server determines that it supports the ICE relay network management, it only returns its own relay address to the session originating terminal.
可知,在实施例四中基于会话响应终端侧的方法中,对于向 STUN/TUR 服务器搜集候 选地址的过程可以模仿实施例二中的搜集过程, 因此, 上述搜集请求中可以像实施例二中 描述一样只携带会话响应终端对 ICE中继网络管理的支持信息和 /或在搜集请求中携带要求 STUN/TUR 服务器仅返回中继地址的类型标识; 对应在实施例二中 STUN/TUR 服务器针 对上述搜集请求中的信息的判断过程也可以运用于本实施例四的搜集过程中来; 基于上述 技术手段的描述, 本领域技术人员能够进行可能方式的扩展, 以实现在搜集请求过程中减 少候选地址占用网络带宽, 和后续过程中筒化匹配的目的。 相关描述可见实施例二的步骤 S205中的描述。  It can be seen that, in the method based on the session response terminal side in the fourth embodiment, the process of collecting the candidate address to the STUN/TUR server can be simulated in the collection process in the second embodiment. Therefore, the foregoing collection request can be described in the second embodiment. It only carries the support information of the session response terminal to the ICE relay network management and/or carries the type identifier that requires the STUN/TUR server to return only the relay address in the collection request; corresponding to the STUN/TUR server for the above collection in the second embodiment The process of determining the information in the request may also be applied to the collecting process of the fourth embodiment. Based on the description of the foregoing technical means, a person skilled in the art may perform an extension of the possible manner to reduce the occupation of the candidate address in the process of collecting the request. Network bandwidth, and the purpose of matching in the subsequent process. A description will be given of the description in step S205 of the second embodiment.
结合本实施例四的第三种可选的方案中: 所述会话响应终端根据所述呼叫请求搜集自 身的候选地址外, 还搜集会话响应终端所在网络中的 STUN/TURN服务器对 ICE中继网络管理 的支持信息, 则所述会话响应终端向会话发起终端发送呼叫响应, 所述呼叫响应携带所述 会话响应终端搜集到的候选地址和会话响应终端对 ICE普通网络管理的支持信息, 具体包括: 会话响应终端判断会话发起终端和会话响应终端是否都支持 ICE普通网络管理; 在判断 结果为两者不满足都支持 ICE普通网络管理时,并在确认会话响应终端侧支持 ICE中继网络管 理时, 会话响应终端向会话发起终端发送呼叫响应, 所述呼叫响应携带所述会话响应终端 搜集到的中继地址和会话响应终端对 ICE普通网络管理的支持信息。  In conjunction with the third optional solution of the fourth embodiment, the session response terminal collects its own candidate address according to the call request, and collects the STUN/TURN server to the ICE relay network in the network where the session response terminal is located. The management response information, the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management, which specifically includes: The session response terminal determines whether the session initiation terminal and the session response terminal both support ICE common network management; when the judgment result is that both of them do not satisfy the ICE common network management, and when the confirmation response response terminal side supports the ICE relay network management, The session response terminal sends a call response to the session initiation terminal, where the call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
在判断结果为两者都支持 ICE普通网络管理时, 会话响应终端向会话发起终端发送呼叫 响应, 所述呼叫响应携带所述会话响应终端搜集到的候选地址和会话响应终端对 ICE普通网 络管理的支持信息。  When the result of the judgment is that both support the ICE common network management, the session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the session response terminal manages the ICE common network. support information.
结合本实施例四的第一种可选的方案中, 匹配搜集到的一个或多个候选地址对网络管 理的支持信息和所述呼叫请求中携带的会话发起终端对 ICE普通网络管理的支持信息之前, 优选的还包括判断会话响应终端具有网络切换需求时, 然后再执行所述结合本实施例四的 第一种可选方案。 In conjunction with the first optional solution of the fourth embodiment, the support information of the collected one or more candidate addresses for network management and the support information of the session initiation terminal to the ICE common network management carried in the call request are matched. prior to, Preferably, the method further includes: determining that the session response terminal has a network switching requirement, and then performing the first option in combination with the fourth embodiment.
结合本实施例的第二种可选的方案中,所述会话响应终端搜集自身的候选地址以及所述 候选地址对网络管理的支持信息之前, 优选的还包括判断会话响应终端具有网络切换需求 时, 然后再执行所述结合本实施例四的第二种可选方案。  In conjunction with the second optional solution of the embodiment, before the session response terminal collects the candidate address of the terminal and the support information of the candidate address for the network management, the method further includes: determining that the session response terminal has the network switching requirement Then, the second alternative combined with the fourth embodiment is performed.
针对上述结合本实施例四的第一种可选的方案、第二种可选的方案和第三种可选的方案 中提到的 "判断会话响应终端具有网络切换需求" 过程, 相应的设置会话响应终端自身具 有网络切换需求具体包括:  The process of determining the session response terminal having the network switching requirement mentioned in the first optional solution, the second optional solution, and the third optional solution of the fourth embodiment, the corresponding setting The session response terminal itself has network switching requirements specifically including:
用户在会话响应终端中设置的在进入特定网域中或者满足特定条件时是具有网络切换 需求的, 所述特定网域包括: wifi 网域; 所述满足特定条件包括: 或用户针对某次特定的 通话对网络切换需求进行设置;或根据会话响应终端自身的移动的频繁程度达到指定值时。  The user set in the session response terminal has a network switching requirement when entering a specific network domain or meets a specific condition, and the specific network domain includes: a wifi domain; the satisfying specific conditions include: or the user is specific to a certain time The call is set to the network switching requirement; or when the frequency of the session response terminal itself moves to a specified value.
5403、 会话响应终端向会话发起终端发送呼叫响应, 所述呼叫响应携带会话响应终端 的搜集到的候选地址和会话响应终端对 ICE普通网络管理的支持信息。  S403. The session response terminal sends a call response to the session initiation terminal, where the call response carries the collected candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management.
所述呼叫响应携带会话响应终端的候选地址和会话响应终端对 ICE普通网络管理的支 持信息, 以便于会话发起终端根据自身对网络管理的支持信息(所述网络管理包括 ICE中继 网络管理和 ICE普通网络管理)和所述呼叫响应中携带的会话响应终端对 ICE普通网络管理 的支持信息, 利用会话发起终端和会话响应终端双方的候选地址生成具有优先级的一组或 多组候选地址对。  The call response carries the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management, so that the session initiation terminal supports the network management according to its own support information (the network management includes the ICE relay network management and the ICE). The common network management) and the session response terminal carried in the call response support information of the ICE common network management, and the candidate addresses of both the session initiation terminal and the session response terminal are used to generate one or more sets of candidate address pairs with priority.
5404、 会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的 候选地址生成具有优先级的一组或多组候选地址对。  S404: The session response terminal matches one of the candidate addresses carried in the call response and the candidate address of the session initiation terminal to generate one or more sets of candidate address pairs with priority.
5405、 会话响应终端根据所述一组或多组候选地址对的优先级向会话发起终端发送 连接测试请求。  S405. The session response terminal sends a connection test request to the session initiation terminal according to the priority of the one or more groups of candidate address pairs.
5406、 在成功完成连接测试后, 建立会话发起终端和会话响应终端的会话连接。  5406. After successfully completing the connection test, establish a session connection between the session initiation terminal and the session response terminal.
本实施例, 从会话响应终端侧出发阐述了本发明的发明点, 通过在呼叫响应中携带会 话响应终端所搜集的候选地址和所述会话响应终端对 ICE普通网络管理的支持信息。以便于 会话发起终端能够根据会话发起终端自身对网络管理的支持信息和会话响应终端对 ICE普 通网络管理的支持信息, 利用会话发起终端和会话响应终端的候选地址生成具有优先级的 候选地址对, 从而能够更高效的进行后续的连接测试, 减少了大量冗余的连接测试过程。  In this embodiment, the invention of the present invention is described from the side of the session response terminal, by carrying the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management in the call response. In order to enable the session initiating terminal to generate support information of the network management according to the session initiation terminal and the support information of the session response terminal to the ICE common network management, the candidate address of the priority is generated by using the candidate addresses of the session initiation terminal and the session response terminal. This enables more efficient subsequent connectivity testing and reduces the number of redundant connection testing processes.
实施例五 在本发明中, 基于会话响应终端的改进并不局限于实施例四所描述的内容。 实施例四 是在会话发起终端经过本发明改进后的前提下实现的。 而本发明所应用的实际情况中, 可 能存在会话发起终端就是现有技术中的会话发起终端, 或者还可以是不具备本发明实施例 二的第三种可选的方案的功能的会话发起终端, 而会话响应终端却拥有本发明实施例二中 对于会话发起终端和会话响应终端双方对于网络管理分析的功能, 所述网络管理分析为在 参考表 2情况下做出的有利于减少连接测试中信令交互的方法。 则本实例五提供了一种在 上述只有会话响应终端单侧应用了本发明改进的实施例, 其流程包括: Embodiment 5 In the present invention, the improvement based on the session response terminal is not limited to the content described in the fourth embodiment. The fourth embodiment is implemented on the premise that the session initiation terminal is improved by the present invention. In the actual application of the present invention, the session initiation terminal may be a session initiation terminal in the prior art, or may be a session initiation terminal that does not have the function of the third alternative scheme of the second embodiment of the present invention. The session response terminal has the function of analyzing the network management for both the session initiation terminal and the session response terminal in the second embodiment of the present invention, and the network management analysis is beneficial to reduce the connection test in the case of referring to Table 2. The method of signaling interaction. Then, the fifth embodiment provides an embodiment in which the improvement of the present invention is applied to one side of the above-mentioned only session response terminal, and the flow includes:
S401 \ 会话响应终端接收所述会话发起终端的呼叫请求, 所述呼叫请求中包含了会话 发起终的一个或多个候选地址。  S401: The session response terminal receives the call request of the session initiation terminal, where the call request includes one or more candidate addresses of the session initiation end.
本实施例五中所述呼叫请求中不包含所述会话发起终端对网络管理的支持信息。 在本 实施例中对应的候选地址在 SDP信息中表现形式具体为:  The call request in the fifth embodiment does not include the support information of the session initiation terminal for network management. In this embodiment, the corresponding candidate address is expressed in the SDP information as follows:
a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host  a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host
a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx  a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay
本实施例中会话响应终端可以根据呼叫请求中仅携带了候选地址, 而不包含相应候选 地址的网络管理支持信息 ( 即对应携带候选地址的会话属性行不携带扩展的 ICE-mobile-ability字段相应的标识), 判断出会话发起终端不具备本发明实施例二提出的改 进方案的功能。  In this embodiment, the session response terminal may carry only the candidate address, and does not include the network management support information of the corresponding candidate address according to the call request (that is, the session attribute line corresponding to the candidate address does not carry the extended ICE-mobile-ability field correspondingly. The identification of the session initiation terminal does not have the function of the improvement proposed by the second embodiment of the present invention.
S402,、 会话响应终端搜集自身的候选地址以及所述候选地址对 ICE普通网络管理和 ICE中继网络管理的支持信息。  S402. The session response terminal collects its own candidate address and the support information of the candidate address to the ICE common network management and the ICE relay network management.
该步骤 S402'的细化如图 7所述, 具体包括:  The refinement of the step S402' is as described in FIG. 7, and specifically includes:
S501、 会话响应终端搜集自身的候选地址以及所述候选地址对网络管理的支持信息; 本实施例中, 会话响应终端所搜集到的包括: STUN/TUR 服务器为会话响应终端分 配的中继地址以及 STUN/TUR 服务器对 ICE中继网络管理的支持信息; 非中继地址及会 话响应终端对 ICE普通网络管理的支持信息。  S501. The session response terminal collects the candidate address of the terminal and the support information of the candidate address to the network management. In this embodiment, the session response terminal collects the relay address allocated by the STUN/TUR server for the session response terminal. STUN/TUR server support information for ICE relay network management; non-relay address and session response terminal support information for ICE common network management.
S502、会话响应终端确定自身是否有网络切换需求。判断结果为没有网络切换需求时, 则执行 S503; 在判断结果为会话响应终端有网络切换需求时, 则执行 S504。  S502. The session response terminal determines whether it has a network handover requirement. If the result of the determination is that there is no network switching requirement, then S503 is performed; when the result of the determination is that the session response terminal has a network switching requirement, then S504 is performed.
对于 "判断会话响应终端具有网络切换需求"过程, 相应的设置会话响应终端自身具有 网络切换需求具体包括: 用户在会话响应终端中设置的在进入特定网域中或者满足特定条件时是具有网络切换 需求的, 所述特定网域包括: wifi 网域; 所述满足特定条件包括: 或用户针对某次特定的 通话对网络切换需求进行设置;或根据会话响应终端自身的移动的频繁程度达到指定值时。 For the process of "determining the session response terminal having the network switching requirement", the corresponding setting session response terminal itself has the network switching requirement, which specifically includes: The user set in the session response terminal has a network switching requirement when entering a specific network domain or meets a specific condition, and the specific network domain includes: a wifi domain; the satisfying specific conditions include: or the user is specific to a certain time The call is set to the network switching requirement; or when the frequency of the session response terminal itself moves to a specified value.
5503、 会话响应终端在生成的呼叫响应中携带非中继地址和中继地址(本实施例中, 呼叫响应中可选的还可以携带 ICE普通网络管理支持的信息和 /或 ICE中继网络管理的支持 的信息)。  5503. The session response terminal carries the non-relay address and the relay address in the generated call response. (In this embodiment, the call response may optionally carry the information of the ICE common network management support and/or the ICE relay network management. Supported information).
5504、 会话响应终端判断自身和 STUN/TUR 服务器是否满足都支持 ICE中继网络管 理的条件, 在判断结果为是时执行 S505; 在判断结果为否时执行 S506。  5504. The session response terminal determines whether the self and the STUN/TUR server satisfy the condition that the ICE relay network management is supported. When the determination result is yes, S505 is performed; when the determination result is negative, S506 is performed.
5505、 会话响应终端在生成的呼叫响应中仅携带搜集到的中继地址(本实施例中, 可 选的呼叫响应中还携带会话响应终端对 ICE中继网络管理的支持的信息)。  5505. The session response terminal only carries the collected relay address in the generated call response (in the embodiment, the optional call response further carries information about the support of the session response terminal to the ICE relay network management).
5506、 会话响应终端在生成的呼叫响应中携带非中继地址和中继地址(本实施例中, 可选的呼叫响应中还可以携带会话响应终端 ICE普通网络管理支持的信息和 ICE中继网络 管理的支持的信息);  5506. The session response terminal carries the non-relay address and the relay address in the generated call response. In this embodiment, the optional call response may further carry the session response terminal ICE common network management support information and the ICE relay network. Managed support information);
S403 '、 会话响应终端向会话发起终端发送呼叫响应。  S403. The session response terminal sends a call response to the session initiation terminal.
S404'、会话响应终端根据呼叫响应中携带的候选地址和所述会话请求中携带的会话发 起终端的候选地址生成具有优先级的一组或多组候选地址对。  S404. The session response terminal generates one or more sets of candidate address pairs with priority according to the candidate address carried in the call response and the candidate address of the session initiation terminal carried in the session request.
S405,、 会话响应终端依据所述一组或多组候选地址对的优先级依次向会话发起终端发 送连接测试请求。  S405. The session response terminal sequentially sends a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs.
S406,、 在成功完成连接测试后, 建立会话发起终端和会话响应终端的会话连接。 在结合本实施例第一种可选方案中, 步骤 S502的判断会话响应终端是否有网络切换需 求可以在步骤 S501的搜集会话响应终端的候选地址之前执行, 类似于如结合实施例四的第 三种可选方案描述。 此时, 若判断会话响应终端没有网络切换需求时, 则后续的执行的过 程和现有技术没有什么区别在此不再赘述; 若判断会话响应终端有网络切换需求时, 则向 STUN/TUR 服务器发送的搜索候选地址请求中要求服务器仅返回中继地址和 STUN/TUR 服务器对 ICE中继管理的支持信息; 生成的呼叫响应中携带所述中继地址, 并 以所述中继地址完成后续的候选地址对的生成和连接测试过程。  S406. After the connection test is successfully completed, establish a session connection between the session initiation terminal and the session response terminal. In conjunction with the first alternative of the embodiment, determining whether the session response terminal in the step S502 has a network handover requirement may be performed before the candidate address of the collection session response terminal in step S501, similar to the third method as in the fourth embodiment. An alternative description. At this time, if it is determined that the session responding terminal does not have a network switching requirement, the subsequent execution process is no different from the prior art and will not be described here. If the session response terminal has a network switching requirement, the STUN/TUR server is sent to the STUN/TUR server. The sent search candidate address request requires the server to return only the relay address and the support information of the STUN/TUR server to the ICE relay management; the generated call response carries the relay address, and completes the subsequent address with the relay address. The generation and connection test process of candidate address pairs.
本实施例是对于实施例五在实际应用中可能遇到情况的扩展, 具体包括将本发明的应 用覆盖到会话发起终端仍然是背景技术(图 1 ) 中的用户终端 A (不具有本发明设计的方 案中提到的功能),而会话响应终端具备了本发明实施例四中所涉及的功能的环境下;于是, 在本实施例中描述的情况下, 保证了网络切换需求的前提下, 尽可能的减少了呼叫响应中 所携带的候选地址,有效的减少了后续连接测试和候选地址对生成所需占用的计算机资源。 This embodiment is an extension of the situation that may be encountered in the practical application of the fifth embodiment, and specifically includes the application of the present invention to the session initiation terminal, which is still the user terminal A in the background technology (FIG. 1) (does not have the design of the present invention) The function mentioned in the scheme), and the session response terminal is provided in the environment of the functions involved in the fourth embodiment of the present invention; thus, In the case described in the embodiment, the network address switching requirement is ensured, the candidate address carried in the call response is reduced as much as possible, and the computer required for subsequent connection test and candidate address pair generation is effectively reduced. Resources.
实施例六 Embodiment 6
本实施例是本发明在会话响应终端侧的运用,是实施例四结合具体应用环境下的描述。 本实施例是基于 SDP协议实现, 但本领域技术人员可以根据本发明中揭示的技术内容, 将 该方法运用到基于同一 ICE框架的其他不同多媒体信令协议中, 比如: XMPP协议。 本实 施例可以作为一个单独的改进方案实现, 也可以和实施例三结合为一个方案来实现, 其中 实施例三中的呼叫请求中不仅要携带会话发起终端的候选地址, 还要携带会话发起终端对 网络管理的支持信息。 本实施例中用户终端 A , 也称为会话发起终端, 同时支持 ICE普通 网络管理和 ICE中继网络管理; 用户终端 B, 也称为会话响应终端, 不支持 ICE普通网络 管理, 但是却支持 ICE中继网络管理, 并且被叫用户终端 B有网络切换需求。 通过本发明 优化后的会话建立的部分流程, 如图 8所示:  This embodiment is an operation of the present invention on the side of the session response terminal, and is a description of the fourth embodiment in combination with a specific application environment. This embodiment is implemented based on the SDP protocol, but those skilled in the art can apply the method to other different multimedia signaling protocols based on the same ICE framework, such as the XMPP protocol, according to the technical content disclosed in the present invention. This embodiment may be implemented as a single improvement solution, or may be implemented in combination with the third embodiment. The call request in the third embodiment not only carries the candidate address of the session initiation terminal, but also carries the session initiation terminal. Support information for network management. In this embodiment, the user terminal A, also called the session initiation terminal, supports ICE common network management and ICE relay network management at the same time; the user terminal B, also called the session response terminal, does not support ICE common network management, but supports ICE. Relay network management, and called user terminal B has network switching requirements. The partial flow of the session establishment after optimization by the present invention is as shown in FIG. 8:
S601-S602, 用户终端 B收到来自用户终端 A的呼叫请求, 才艮据该呼叫请求里候选地 址所在的会话属性行( "a" 行)所携带的网络管理的标识判断用户终端 A具备 ICE普通网 络管理能力和 ICE中继网络管理能力。  S601-S602, the user terminal B receives the call request from the user terminal A, and determines that the user terminal A has the ICE according to the identifier of the network management carried in the session attribute line ("a" line) where the candidate address is located in the call request. General network management capabilities and ICE relay network management capabilities.
上述判断方式原理具体为: 在" a"行最后增加命名为 ICE-mobile-ability的字段, 该字段 的取值定义为 normaK relay > both或 ηοη» 并设置在 ICE-mobile-ability的值为 normal时, 确定该候选地址可用于 ICE普通网络管理方式; 当 ICE-mobile-ability的值为 relay时, 表 明该候选地址可用于 ICE中继网络管理方式; 当 ICE-mobile-ability的值为 both时, 表明该 候选地址可以同时用于 ICE 普通网络管理方式和 ICE 中继网络管理方式; 当 ICE-mobile-ability的值为 non时, 表明该地址并不可用于上述两种网络管理。 在本实施例 中, SDP信息中携带网络管理信息的具体实现为:  The principle of the above judgment method is specifically as follows: At the end of the "a" line, a field named ICE-mobile-ability is added, and the value of the field is defined as normaK relay > both or ηοη» and the value of ICE-mobile-ability is set to normal. When the ICE-mobile-ability value is relay, it indicates that the candidate address is available for the ICE relay network management mode; when the ICE-mobile-ability value is both , indicating that the candidate address can be used in both the ICE common network management mode and the ICE relay network management mode; when the value of ICE-mobile-ability is non, it indicates that the address is not available for the above two types of network management. In this embodiment, the specific implementation of carrying the network management information in the SDP information is:
a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host normal  a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host normal
a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal  a=candidate:2 1 UDP 1694498815 211.25.21.30 45664 typ srflx normal
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay both
其中, "normal"和" both"表明用户终端 A的所有候选地址可用于 ICE普通网络管理且其 中继地址可用于 ICE中继网络管理。  Among them, "normal" and " both" indicate that all candidate addresses of user terminal A are available for ICE general network management and their relay addresses are available for ICE relay network management.
在实际实现中, 除了上述在 "a" 行最后增加扩展字段的方式外, 基于本实施例六的第 一种可选的方案中, 还可以使用单独的 "a"行来实现确定用户终端是否支持 ICE普通网络 管理的能力或 ICE中继网络管理能力, 相比本实施例已经采用的方式具有更高的集成性, 其实现具体为: In an actual implementation, in addition to the manner in which the extension field is added last in the "a" line, in the first optional solution according to the sixth embodiment, a separate "a" line may be used to determine whether the user terminal is determined. Support ICE common network The management capability or the ICE relay network management capability has higher integration than the method that has been adopted in this embodiment, and the implementation thereof is specifically as follows:
在呼叫请求的 SDP信息中添力。一个新的会话属性行: "a= ICE-mobile-ability: normal" , 该会话属性行的取值可以定义为 normal、 relay、 both或 non。 当 ICE-mobile-ability的值为 normal时,表明用户终端 Α支持 ICE普通网络管理方式; 当 ICE-mobile-ability的值为 relay 时, 表明用户终端 A支持 ICE中继网络管理方式; 当 ICE-mobile-ability的值为 both时, 表明用户终端 A支持 ICE普通网络管理方式且用户终端 A支持 ICE中继网络管理方式;当 ICE-mobile-ability的值为 non时, 表明用户终端 A不支持上述两种网络管理。  Add force to the SDP information of the call request. A new session attribute line: "a= ICE-mobile-ability: normal" , the value of the session attribute line can be defined as normal, relay, both or non. When the value of ICE-mobile-ability is normal, it indicates that the user terminal supports the ICE common network management mode; when the value of ICE-mobile-ability is relay, it indicates that the user terminal A supports the ICE relay network management mode; When the value of the mobility-ability is both, it indicates that the user terminal A supports the ICE common network management mode and the user terminal A supports the ICE relay network management mode. When the value of the ICE-mobile-ability is non, it indicates that the user terminal A does not support the above. Two network management.
S603、用户终端 B通过类似实施例三(图 5 )中的步骤 S301方法搜集自身的候选地址。 用户终端 B 根据收到的呼叫请求中各候选地址所在的会话属性行 ( " a" 行) 中的 ICE-mobile-ability字段的内容确定用户终端 A同时支持 ICE普通网络管和 ICE中继网络管 理。  S603. The user terminal B collects its own candidate address by using the method of step S301 in the third embodiment (FIG. 5). The user terminal B determines that the user terminal A supports both the ICE common network management and the ICE relay network management according to the content of the ICE-mobile-ability field in the session attribute line ("a" line) of each candidate address in the received call request. .
在基于本实施例的第一种可选的方案中, 用户终端 B才艮据收到的呼叫请求中携带会话 属性行 "a=ICE-mobile-ability: both" , 确定用户终端 Α同时支持 ICE普通网络管理和 ICE 中继网络管理。  In the first optional solution according to the embodiment, the user terminal B determines that the user terminal supports the ICE at the same time according to the received session request carrying the session attribute line "a=ICE-mobile-ability: both". General network management and ICE relay network management.
而本实施例中优选的已经判断了会话响应终端的用户终端 B有网络切换需求前提下, 由于用户终端 B不支持 ICE普通网络管理, 而仅支持 ICE中继网络管理(实施例四的第三 种可选的方案在本实施例中的实现), 所以用户终端 B优选使用 ICE中继网络管理。 则只 需要返回携带用户终端 B的中继地址和会话响应终端对 ICE普通网络管理的支持信息的连 接测试响应给用户终端 A即可;  However, in the preferred embodiment, the user terminal B that has determined that the session responding terminal has the network switching requirement, the user terminal B does not support the ICE common network management, but only supports the ICE relay network management (the third in the fourth embodiment) An alternative solution is implemented in this embodiment), so the user terminal B preferably uses ICE relay network management. Then, it is only necessary to return a connection test result of the relay address carrying the user terminal B and the support information of the session response terminal to the ICE common network management to the user terminal A;
基于本实施例的第二种可选的方案中, 用户终端 B在向 STUN/TUR 服务器发送用于 搜集自身候选地址的初始请求时, 可以在该初始请求中扩展使用一个新的字段, 该字段的 名字可以是 SUPPORTING-MANNAGE, 当其出现在请求中时, 表明用户希望搜集到的地 址类型, STUN/TUR 服务器在响应消息中只返回 SUPPORTING-MANNAGE字段中对应 的地址类型, SUPPORTING-MANNAGE字段的取值可以定义为: normal, relay或 all。 可 选的, 除采用 all标识用以让 STUN/TUR 服务器返回搜集到的用户终端 B的所有候选地 址外, 还可以采用该 SUPPORTING-MANNAGE字段内容为空, 也表示让 STUN/TUR 服 务器将能搜集到的所有地址类型都携带在响应消息中。  According to the second optional solution of the embodiment, when the user terminal B sends an initial request for collecting the candidate address to the STUN/TUR server, the new request may be extended to use a new field in the initial request. The name can be SUPPORTING-MANNAGE. When it appears in the request, it indicates the type of address that the user wants to collect. The STUN/TUR server only returns the corresponding address type in the SUPPORTING-MANNAGE field in the response message. The SUPPORTING-MANNAGE field The value can be defined as: normal, relay or all. Optionally, in addition to using the all identifier to enable the STUN/TUR server to return all the candidate addresses of the collected user terminal B, the SUPPORTING-MANNAGE field may be empty, and the STUN/TUR server may be collected. All address types arrived are carried in the response message.
所述初始请求可以是基于 STU 协议中的 Binding请求上实现, 具体为在 Binding请求 的消息属性(Message Attributes ) 中增设一个 SUPPORTING-MA AGE字段, 并可以定 义其内容为 normal时,要求 STUN/TURN服务器仅返回会话响应终端的支持 ICE普通网络 管理的候选地址; 其内容为 relay时,要求 STUN/TUR 服务器仅返回会话响应终端的可用 于 ICE中继网络管理的候选地址; 其内容为 all时, 要求 STUN/TURN服务器返回会话响 应终端的所有候选地址。 The initial request may be implemented on a Binding request based on the STU protocol, specifically in the Binding request. The message attribute (Message Attributes) is added with a SUPPORTING-MA AGE field, and when the content is normal, the STUN/TURN server is required to return only the candidate address of the session response terminal supporting the ICE common network management; the content is relay The STUN/TUR server is required to return only the candidate addresses of the session response terminal that can be used for ICE relay network management; when the content is all, the STUN/TURN server is required to return all candidate addresses of the session response terminal.
S604、用户终端 B向用户终端 A发送呼叫响应, 并在呼叫响应的 SDP信息中只添加用 户终端 B获取到的中继地址和用户终端 B对 ICE普通网络管理的支持信息; 其在 SDP信 息中具体表现为:  S604. The user terminal B sends a call response to the user terminal A, and adds only the relay address acquired by the user terminal B and the support information of the user terminal B to the ICE common network management in the SDP information of the call response; The specific performance is:
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay
S605、 呼叫响应经过 NAT_B设备和 NAT_A设备的转发, 被转发给用户终端 A;  S605, the call response is forwarded by the NAT_B device and the NAT_A device, and is forwarded to the user terminal A;
S606、用户终端 B向用户终端 A发送连接测试请求。在发送连接测试之前,因为在 S604 中用户终端 B已经确定只向用户终端 A发送中继地址作为候选地址, 于是, 用户终端 B根 据自身的中继地址和用户终端 A的候选地址生成具有优先级的候选地址对。 并依据所述候 选地址对的优先级依次向用户终端 A发送连接测试清求。  S606. The user terminal B sends a connection test request to the user terminal A. Before transmitting the connection test, since the user terminal B has determined in S604 that only the relay address is transmitted as the candidate address to the user terminal A, the user terminal B generates the priority according to the own relay address and the candidate address of the user terminal A. Candidate address pair. And sending a connection test request to the user terminal A in turn according to the priority of the candidate address pair.
S607、 用户终端 B的连接测试请求经过 NAT_B设备、 STU /TR 服务器和 NAT_A设 备的转发, 最后转发给用户终端 A;  S607, the connection test request of the user terminal B is forwarded by the NAT_B device, the STU /TR server, and the NAT_A device, and finally forwarded to the user terminal A;
5608、 用户终端 A生成连接测试响应, 以告知用户终端 B连接测试通过。  5608. The user terminal A generates a connection test response to notify the user terminal B that the connection test passes.
5609、 用户终端 A的连接测试响应经过 NAT_B设备、 STUN/TURN服务器和 NAT_A 设备的转发, 被转发给用户终端 B;  5609, the connection test response of the user terminal A is forwarded to the user terminal B after being forwarded by the NAT_B device, the STUN/TURN server, and the NAT_A device;
S610, 最终在本例的协商中用户终端 B选择中继地址进行通信, 从而可以满足用户终 端 B网络管理的需求。  S610. Finally, in the negotiation of this example, the user terminal B selects a relay address for communication, thereby satisfying the requirement of the network management of the user terminal B.
本实施例是以会话响应终端侧作为在考虑其自身是否有网络切换需求后, 决定呼叫响 应中所携带的候选地址; 从本实施例自身角度考虑, 可以减少用户终端 A所获取到的属于 用户终端 B的候选地址, 相比实施例三不同, 实施例三是通过减少无效候选地址对所占用 的连接测试资源, 而本实施例则是减少了用户终端 A所需要测试的属于用户终端 B的候选 地址; 当然实施例三方案和各可选的方案, 和本实施例的方案以及相关的可选的方案是可 以组合的, 其有益效果也是可以叠加的, 基于网络切换需求优化了网络切换时因为连接性 测试所带来资源的浪费。  In this embodiment, the session responding terminal side determines the candidate address carried in the call response after considering whether it has a network switching requirement. The user terminal A can reduce the number of users that are acquired by the user terminal A. The candidate address of the terminal B is different from that of the third embodiment. The third embodiment reduces the connection test resources occupied by the invalid candidate address pair, and the embodiment reduces the user terminal B that needs to be tested by the user terminal A. The candidate address; of course, the third embodiment and the optional solution, and the solution of the embodiment and related optional solutions are combined, and the beneficial effects thereof can also be superimposed, and the network switching time is optimized based on the network switching requirement. Because of the waste of resources brought about by connectivity testing.
本实施例仅是列举了用户终端 A在同时具有 ICE普通网络管理和 ICE中继网络管理能 力, 并且用户终端 B只具有 ICE中继网络管理能力情况下完成连会话建立的方法。 This embodiment only enumerates that user terminal A has both ICE common network management and ICE relay network management capability. Force, and the user terminal B only has the ICE relay network management capability to complete the connection establishment method.
才艮据用户终端 B具有网络切换需求、 用户终端 B对于网络管理的多种支持情况、 用户 终端 A对于网络管理的多种支持情况和网络管理之间的优先级等因素考虑, 类似表 1的生 成方法, 制作用户终端 B在各情况下生成候选地址对的参考表 2。  According to factors such as the network switching requirement of the user terminal B, the various support situations of the user terminal B for network management, the various support situations of the user terminal A for network management, and the priority between network management, etc., similar to Table 1 The generation method creates a reference table 2 in which the user terminal B generates a candidate address pair in each case.
用户终端 B在步骤 S603中,首先对接收到的呼叫请求分析,获取用户终端 A的候选地 址对网络管理支持的情况, 其中, 用户终端 A的候选地址对网络管理支持的情况都被包含 于表 2的标有 "用户终端 A" 第一列各项中, 而本实施例中用户终端 A的候选地址就是第 一列、 最后一行情况; 然后, 用户终端 B根据自身搜集候选地址过程中获取的自身对于网 络管理的支持情况, 该情况包含在表 2中标有 "用户终端 B" 第一行各项中 (其中, 没有 罗列用户终端 B的候选地址不支持任何一种网络管理的情况)。进一步,在遇到如表 2中的 其他行项和列项的组合情况中, 则依据表 2中对应操作方法完成连接性测试, 此处不再赘 述。  In step S603, the user terminal B first analyzes the received call request, and obtains a case where the candidate address of the user terminal A is supported by the network management. The case where the candidate address of the user terminal A supports the network management is included in the table. 2 is labeled as "user terminal A" in the first column, and in this embodiment, the candidate address of the user terminal A is the first column and the last row; then, the user terminal B obtains the candidate address according to itself. Its own support for network management, which is included in the first line of the "User Terminal B" in Table 2 (where the candidate address of the user terminal B is not listed does not support any kind of network management). Further, in the case of the combination of other line items and column items as in Table 2, the connectivity test is completed according to the corresponding operation method in Table 2, and will not be described here.
表 2  Table 2
用户终端 B 用户终端 B 用户终端 B 支持: ICE普通网络管理 不支持: ICE普通网络管理 支持: ICE普通网络 支持: ICE中继网络管理 支持: ICE中继网络管理 管理  User terminal B User terminal B User terminal B Support: ICE common network management Not supported: ICE common network management Support: ICE common network Support: ICE relay network management Support: ICE relay network management
不支持: ICE中继网 络管理  Not supported: ICE Relay Network Management
用户终端 A I II III 支持: ICE普通网络管理 用户终端 B使用可用于 用户终端 B只选择中继地 用户终端 B只选择 支持: ICE中继网络管理 ICE普通网络管理和可用 址和用户终端 A的候选地 使用非中继地址和 于 ICE中继网络管理的候 址生成候选地址对 用户终端 A的候选 选地址生成具有优先级的 地址生成候选地址 候选地址对, 且前者生成 对  User terminal AI II III support: ICE general network management user terminal B can be used for user terminal B to select only relayed user terminal B only to support: ICE relay network management ICE common network management and available addresses and user terminal A candidates Generating a candidate address with a non-relay address and a candidate address generated by the ICE relay network to generate a candidate address candidate address address pair with a priority for the candidate selected address of the user terminal A, and the former generates a pair
的候选地址对优先级高于  Candidate address pair has higher priority
后者  the latter
用户终端 A IV V VI 不支持: 用户终端 B只选择中继地 用户终端 B只选择中继地 用户终端 B无法使 User terminal A IV V VI does not support: User terminal B only selects the relay destination User terminal B only selects the relay destination User terminal B cannot make
ICE普通网络管理 址和用户终端 A的候选地 址和用户终端 A的候选地 用上述两种网络管 支持: 址生成候选地址对 址生成候选地址对 理方式 The ICE common network management address and the candidate address of the user terminal A and the candidate location of the user terminal A are supported by the above two types of network pipes: Address generation candidate address address generation candidate address management mode
ICE中继网络管理  ICE relay network management
用户终端 A VII VIII IX 支持: 用户终端 B只选择使用非 用户终端 B只选择中继地 用户终端 B只选择 User terminal A VII VIII IX Support: User terminal B only chooses to use non-user terminal B only selects relay location User terminal B only selects
ICE普通网络管理 中继地址和用户终端 A的 址和用户终端 A的候选地 使用非中继地址和 不支持: 候选地址生成候选地址对 址生成候选地址对 用户终端 A的候选ICE general network management relay address and user terminal A address and user terminal A candidate use non-relay address and no support: candidate address generation candidate address address generation candidate address pair candidate for user terminal A
ICE中继网络管理 地址生成候选地址 对 用户终端 A XI XII XIII 不支持: 用户终端 B只选择使用中 用户终端 B只选择使用中 用户终端 B无法使ICE relay network management address generation candidate address pair User terminal A XI XII XIII does not support: User terminal B only selects the user terminal B in use, only selects the user terminal B in use.
ICE普通网络管理 继地址和用户终端 A的候 继地址和用户终端 A的候 用上述两种网络管 不支持: 选地址生成候选地址对 选地址生成候选地址对 理 ICE common network management The address of the address and user terminal A and the candidate of user terminal A. The above two types of network management do not support: Select address generation candidate address pair selection address generation candidate address pairing
ICE中继网络管理  ICE relay network management
实施例七 Example 7
本实施例是结合实施例三和实施例六中的一种情况做为本实施例的环境, 并在前面的 基础上进一步增加局域网优先级的判断, 这并不表明实施例三和实施例六中没有考虑局域 网情况, 而是为了突出各实施例的说明重点, 将其作为不同实施例来描述。 毫无疑问的, 本实施例七所涉及的局域网优先级判断也同样属于实施例二的细化, 而由于会话发起终端 和会话响应终端在匹配候选地址对时候所采用的技术手段是相似或者说相同的, 因此, 本 实施例七同样可以推出实施例四在本情况下的实现。 从用户终端 C的角度来说, 本实施例 是实施例二中的第四种可选方案的进一步扩展。 在考虑双方候选地址对 ICE普通网络管理 和 ICE中继网络管理的支持信息基础上, 进一步, 考虑了会话发起终端和会话响应终端存 在于局域网的情况。 本实施例中用户终端 A, 即实施例三和实施例六中的会话发起终端, 只具有 ICE中继网络管理能力; 用户终端 C, 即实施例三和实施例六中的会话响应终端, 只具有 ICE中继网络管理能力。 本实施例中用户终端 A和用户终端 B共同使用一个 NAT 设备即 NAT_A, 其中用户终端 A和用户终端 C属于同一个局域网。 在本实施例中用户终 端 A和用户终端 B都有网络切换需求, 具体实现步骤如下:  This embodiment combines the case of the third embodiment and the sixth embodiment as the environment of the embodiment, and further increases the priority of the local area network on the basis of the foregoing, which does not indicate the third embodiment and the sixth embodiment. The LAN case is not considered, but the description of each embodiment is highlighted to describe it as a different embodiment. Undoubtedly, the LAN priority judgment involved in the seventh embodiment also belongs to the refinement of the second embodiment, and the technical means adopted by the session initiation terminal and the session response terminal in matching the candidate address pairs are similar or The same, therefore, the seventh embodiment can also implement the implementation of the fourth embodiment in this case. From the perspective of the user terminal C, this embodiment is a further extension of the fourth alternative in the second embodiment. Based on the support information of the candidate address to the ICE common network management and the ICE relay network management, further consider that the session initiation terminal and the session response terminal exist in the local area network. In this embodiment, the user terminal A, that is, the session initiating terminal in the third embodiment and the sixth embodiment, only has the ICE relay network management capability; the user terminal C, that is, the session response terminal in the third embodiment and the sixth embodiment, With ICE relay network management capabilities. In this embodiment, user terminal A and user terminal B jointly use a NAT device, NAT_A, where user terminal A and user terminal C belong to the same local area network. In this embodiment, both the user terminal A and the user terminal B have network switching requirements, and the specific implementation steps are as follows:
S701、 用户终端 A搜集候选地址, 该过程和实施例三中步骤 S301相同。  S701. The user terminal A collects candidate addresses, and the process is the same as step S301 in the third embodiment.
用户终端 A分析自身对网络管理的支持信息, 确认自己只具有 ICE中继网络管理, 则 在生成的呼叫请求中只携带用户终端 A的中继地址和用户终端 A对网络管理的支持信息; 所述呼叫请求中还携带用户终端 A的私有地址。 其中私有地址是为了用于用户终端 C判断 自身是否和用户终端 A属于同一个局域网使用。  The user terminal A analyzes its own support information for the network management, and confirms that it only has the ICE relay network management, and only carries the relay address of the user terminal A and the support information of the user terminal A for network management in the generated call request; The call request also carries the private address of the user terminal A. The private address is used for the user terminal C to determine whether it belongs to the same local area network as the user terminal A.
结合本实施例七的第一种可选的方案中, 该手机候选地址过程还可以采用结合实施例 二的第一种可选的方案; 向 STUN/TUR 服务器发送仅搜集 STUN/TURN服务器为用户终 端 A分配的中继地址的初始请求。 其中, 由于私有地址是用户终端 A自己知道的, 通过搜 集请求用户终端 A进一步获知了其中继地址以及该中继地址对 ICE中继网络管理的支持信 息。  In the first optional solution of the seventh embodiment, the mobile phone candidate address process may also adopt the first optional solution in combination with the second embodiment; sending only the STUN/TURN server to the STUN/TUR server as the user The initial request for the relay address assigned by terminal A. Wherein, since the private address is known by the user terminal A, the user terminal A is further informed of the relay address and the support information of the relay address to the ICE relay network management.
S702、用户终端 A发送呼叫请求。 并按照实施例三中步骤 S302的方式为所述候选地址 分配对应支持的网络管理标识。 其呼叫请求中的 "a"行信息具体呈现如下: S702. The user terminal A sends a call request. And assigning the corresponding supported network management identifier to the candidate address in the manner of step S302 in the third embodiment. The "a" line information in its call request is specifically as follows:
a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host  a=candidate:l 1 UDP 2130706431 10.0.1.21 8998 typ host
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay
S703、 该呼叫请求通过 NAT_A设备转发到用户终端 C;  S703, the call request is forwarded to the user terminal C by using the NAT_A device;
S704、 用户终端 C开始搜集其自身的候选地址, 该搜集过程和用户终端 A类似, 因此 不再赘述;  S704. The user terminal C starts to collect its own candidate address. The collecting process is similar to that of the user terminal A, and therefore is not described again.
S705、 用户终端 C分析自己和用户终端 A双方的候选地址对于网络管理的支持情况。 用户终端 C根据用户终端 A各候选地址中的 CE-mobile-ability标识的标识值获知用户 终端 A只支持 ICE中继网络管理。 进一步, 确定私有地址的优先级高于中继地址连接测试 优先级时, 用户终端 C在向用户终端 A返回的呼叫响应中会同时携带包含了私有地址和中 继地址的会话属性行("a" 行)。  S705. The user terminal C analyzes the support status of the candidate address of both the user and the user terminal A for network management. The user terminal C knows that the user terminal A only supports the ICE relay network management according to the identifier value of the CE-mobile-ability identifier in each candidate address of the user terminal A. Further, when determining that the priority of the private address is higher than the priority of the relay address connection test, the user terminal C carries the session attribute line including the private address and the relay address in the call response returned to the user terminal A ("a " Row).
会话连接上述优先级的判断方法优选的为:用户终端 C核对 NAT_A设备为用户终端 A 分配的 NAT地址和 NAT_A设备为用户终端 C分配的 NAT地址是否相同, 若相同则表明 其在局域网内概率较大; 进一步还可以依据用户终端 C和用户终端 A的私有地址的值是否 同一个路由器地址下, 若在一个路由器地址下中则表明其在局域网内概率较大; 优选的在 满足上述两个条件中的一个或两个时, 使得私有地址参与到生成的候选地址对中。  Preferably, the method for determining the priority of the session connection is: the user terminal C checks whether the NAT address assigned by the NAT_A device for the user terminal A and the NAT address assigned by the NAT_A device to the user terminal C are the same, and if they are the same, the probability is compared in the local area network. Further, according to whether the value of the private address of the user terminal C and the user terminal A is the same router address, if it is in a router address, it indicates that it has a high probability in the local area network; preferably, the above two conditions are met. One or both of them cause the private address to participate in the generated candidate address pair.
最后用户终端 C利用自身的私有地址和搜集的中继地址生成呼叫响应, 其中, 私有地 址所在的会话属性行的最后扩展一字段, 并分配一字段表明用户终端 B的私有地址和用户 终端 A的私有地址在一个局域网内。  Finally, the user terminal C generates a call response by using its own private address and the collected relay address, where the last attribute field of the session attribute line where the private address is located is extended by a field, and a field is indicated to indicate the private address of the user terminal B and the user terminal A. The private address is on a LAN.
其具体实现方式可以通过扩展实施例三中的 ICE-mobile-ability字段的取值, 当取值为 The specific implementation manner can be extended by extending the value of the ICE-mobile-ability field in the third embodiment.
"lan" 时, 表明该私有地址和用户终端 A的私有地址可能存在于一个局域网内。 所述呼叫 响应中的 "a"行内容具体如下: "lan" indicates that the private address and the private address of user terminal A may exist in a local area network. The contents of the "a" line in the call response are as follows:
a=candidate:l 1 UDP 2130706431 10.0.1.25 8968 typ host lan  a=candidate:l 1 UDP 2130706431 10.0.1.25 8968 typ host lan
a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay  a=candidate:3 1 UDP 1294498217 215.75.211.130 4324 typ relay relay
S706、 该呼叫响应通过 NAT_A设备转发到用户终端 A;  S706, the call response is forwarded to the user terminal A through the NAT_A device;
S707、 当用户终端 A收到来自用户终端 C的呼叫响应后,根据自身和用户终端 C两者 对于网络管理的支持, 生成连接测试请求。 其过程具体为:  S707. After receiving the call response from the user terminal C, the user terminal A generates a connection test request according to the support of the network management by itself and the user terminal C. The process is specifically as follows:
用户终端 A根据呼叫响应中对应会话属性行( "a" 行) 的 ICE-mobile-ability字段中有 lan, 判断用户终端 C的私有地址和自身的私有地址较大可能或就是在一个局域网内; 用户 终端 A根据呼叫响应中对应会话属性行( "a" 行)的 ICE-mobile-ability字段中有 ICE中继 网络管理的标识 "relay" ,判断用户终端 C的中继地址支持 ICE中继网络管理而不支持 ICE 普通网络管理。故用户终端 A根据用户终端 A和用户终端 C各自的私有地址生成一组候选 地址对, 然后才艮据用户终端 A的中继地址和用户终端 C的中继地址生成一组候选地址对, 用于后续的连接测试。 其中基于私有地址的候选地址对的优先级高于基于中继地址的候选 地址对的优先级, 因此, 会按照先进行基于私有地址的候选地址对的连接测试, 并在该候 选地址对的连接测试失败情况下, 才进行基于中继地址的候选地址对的连接测试。 The user terminal A determines that the private address of the user terminal C and its private address are larger or are in a local area network according to the lan in the ICE-mobile-ability field of the corresponding session attribute line ("a" line) in the call response. User The terminal A determines that the relay address of the user terminal C supports the ICE relay network management according to the identifier "relay" managed by the ICE relay network in the ICE-mobile-ability field of the corresponding session attribute line ("a" line) in the call response. It does not support ICE general network management. Therefore, the user terminal A generates a set of candidate address pairs according to the private addresses of the user terminal A and the user terminal C, and then generates a set of candidate address pairs according to the relay address of the user terminal A and the relay address of the user terminal C. For subsequent connection tests. The candidate address pair based on the private address has a higher priority than the candidate address pair based on the relay address. Therefore, the connection test based on the candidate address pair based on the private address is performed first, and the connection of the candidate address pair is performed. In the case of a test failure, the connection test of the candidate address pair based on the relay address is performed.
S708、 所述基于私有地址的候选地址对的连接测试请求通过 NAT_A设备设备将连接 测试请求转发给用户终端 C。  S708. The connection test request of the candidate address pair based on the private address forwards the connection test request to the user terminal C through the NAT_A device device.
S709、 用户终端 C将收到连接测试请求中携带的用户终端 C的候选地址, 携带在连接 测试响应中发送给用户终端 A。  S709. The user terminal C receives the candidate address of the user terminal C carried in the connection test request, and sends it to the user terminal A in the connection test response.
5710、 连接性测试响应通过 NAT_A设备转发到用户终端 A。  5710. The connectivity test response is forwarded to user terminal A through the NAT_A device.
5711、 用户终端 C使用自身生成的基于私有地址的候选地址对, 向用户终端 A发起连 接测试请求。  5711. The user terminal C initiates a connection test request to the user terminal A by using the self-generated candidate address pair based on the private address.
S712、 NAT_A设备将连接测试转发给用户终端 A。  S712. The NAT_A device forwards the connection test to the user terminal A.
5713、 用户终端 A将收到连接测试请求中携带的用户终端 A的私有地址, 携带在连接 测试响应中发送给用户终端 B。  5713. The user terminal A receives the private address of the user terminal A carried in the connection test request, and carries it in the connection test response to the user terminal B.
5714、用户终端 A和用户终端 C协商, 若用户终端 A和用户终端 C双方的基于私有地 址的候选地址对的连接测试都成功, 则不必进行用户终端 A和用户终端 C间的中继地址的 连接测试, 并利用用户终端 A的私有地址和用户终端 C的私有地址建立连接; 否则, 进行 用户终端 A和用户终端 C双方的基于中继地址的候选地址对的连接测试, 并在该中继地址 的连接测试结果成功后, 利用用户终端 A的中继地址和用户终端 C的中继地址建立连接。  5714. The user terminal A and the user terminal C negotiate that if the connection test of the candidate address pair based on the private address of both the user terminal A and the user terminal C is successful, the relay address between the user terminal A and the user terminal C is not necessary. Connect the test, and establish a connection by using the private address of the user terminal A and the private address of the user terminal C; otherwise, performing a connection test of the candidate address pair based on the relay address of both the user terminal A and the user terminal C, and in the relay After the connection test result of the address is successful, the connection is established by using the relay address of the user terminal A and the relay address of the user terminal C.
本实施例是对于实施三和实施例六结合方案的进一步细化, 引入了局域网内用户建立 会话连接的优先级最高原则,从而优化了现有方案使其能够应用于更复杂的环境下。同时, 保证了可能存在的最优连接可能情况。 这对于朋友之间同时进入某个 wifi领域时, 此时, 使用局域网模式既可以减少网络带宽负担, 也能加快用户之间的传输体验。  This embodiment is a further refinement of the combination scheme of the implementation three and the sixth embodiment, and introduces the highest priority principle for the user to establish a session connection in the local area network, thereby optimizing the existing scheme to be applied to a more complicated environment. At the same time, the optimal connection possibilities that may exist are guaranteed. This is when the friend enters a certain wifi domain at the same time. At this time, using the LAN mode can reduce the network bandwidth burden and accelerate the transmission experience between users.
实施例八 Example eight
本实施例是本发明与浏览器结合后的一个应用, 本实施例中用户终端 A利用了 rtcweb 技术, 即在浏览器上登录可以提供实时通信功能的网页, 并在网页上发起 ICE协商, 并最 终实现在浏览器上与用户终端 B的会话建立。 This embodiment is an application of the present invention in combination with a browser. In this embodiment, the user terminal A utilizes the rtcweb technology, that is, logs in a webpage that can provide real-time communication functions on the browser, and initiates ICE negotiation on the webpage, and Most The session is finally established on the browser with the user terminal B.
本实例中, 浏览器 A是用户终端 A使用的浏览器软件, 用户终端 A的 JS是运行在用 户终端 A浏览器上的 javascript程序, 该 javascript能够提供业务能力。 具体流程图如图 12 所述:  In this example, browser A is the browser software used by user terminal A, and the JS of user terminal A is a javascript program running on the browser of user terminal A, which can provide business capabilities. The specific flow chart is as shown in Figure 12:
S801、 用户终端 A在浏览器 A上发起一个面向用户终端 B会话, 首先用户终端 A的 S801. User terminal A initiates a user-oriented terminal B session on browser A, first of which user terminal A
JS和浏览器 A之间先建立一个 peerconnection连接; A peer connection is established between JS and browser A.
5802、 用户终端 A的 JS使用 updatelce()接口通知浏览器 A开始 ICE协商流程, 在该 updatelce()中扩展增加网络切换需求, 即告知浏览器 A用户终端 A在通话中有网络管理的 需求。 接口定义为:  5802. The JS of the user terminal A uses the updatelce() interface to notify the browser A to start the ICE negotiation process, and expand the network switching requirement in the updatelce(), that is, to inform the browser that the user terminal A has the network management requirement during the call. The interface is defined as:
updatelce (optional RTCConfiguration? configuration = null, optional MediaConstraints? constraints = null);  Updatelce (optional RTCConfiguration? configuration = null, optional mediaConstraints? constraints = null);
其中 MediaConstraints参数中有 IceTransports的类型, 类型的取值有 "TURN" 表明只 使用中继地址进行通信 (比如隐私性的需求), 在该类型中还可以扩展取值, 比如命名为 "ICE-mobility" , 表明用户有网络管理的需求, 希望尽量选择能支持网络管理的候选地址 对优先进行连接测试;  The MediaConstraints parameter has the type of IceTransports. The value of the type has "TURN" indicating that only the relay address is used for communication (such as the privacy requirement). In this type, the value can also be extended, for example, named "ICE-mobility". " , indicating that the user has the need for network management, and hopes to select the candidate address that can support the network management to give priority to the connection test;
5803、 浏览器 A收到 ICE更新接口 updatelce()后开始启动 ICE协商流程, 首先需要同 STUN/TUR 服务器交互进行候选地址的搜集, 该过程同实施例三中的步骤 S301相似; After the ICE update interface updatelce() is received, the browser A starts to start the ICE negotiation process, and first needs to interact with the STUN/TUR server to collect candidate addresses. The process is similar to step S301 in the third embodiment;
5804、 浏览器 A使用 ICE回调接口 ICEcallback()向用户终端 A的 JS反馈搜集到的候 选地址,对于搜集的候选地址相应的关联上用户终端 A是否支持 ICE普通网络管理的标识, 对于搜集的中继地址相应的关联上用户终端 A是否支持 ICE中继网络管理和 /或 ICE普通 网络管理的标识。 其关联方法同实施例三中步骤 S302中描述的添加方法相似; 5804. The browser A uses the ICE callback interface ICEcallback() to send the candidate address to the JS feedback of the user terminal A. For the associated candidate address, whether the user terminal A supports the ICE common network management identifier, for the collected Whether the user terminal A supports the ICE relay network management and/or the ICE common network management identifier according to the corresponding association of the addresses. The association method is similar to the addition method described in step S302 in the third embodiment;
5805、 用户终端 A的 JS将从浏览器 A收到的用户终端 A的候选地址以及其他媒体信 息封装成 SDP协议格式的信息(筒称 SDP信息), 并携带在呼叫请求消息中, 通过 NAT设 备、 STUN/TUR 服务器发向用户终端 B;  5805. The JS of the user terminal A encapsulates the candidate address and other media information of the user terminal A received from the browser A into the information of the SDP protocol format (called SDP information), and carries the information in the call request message through the NAT device. The STUN/TUR server is sent to the user terminal B;
S806、 用户终端 B进行本地候选地址搜集, 并在呼叫响应消息中携带搜集到的所有候 选地址, 同时也在候选地址里添加是否可用于网络管理的标识, 该步骤同实施例二中图 5 的 S305相似;  S806, the user terminal B performs local candidate address collection, and carries all the candidate addresses that are collected in the call response message, and also adds an identifier that can be used for network management in the candidate address, and the step is the same as that in FIG. 5 in the second embodiment. Similar to S305;
S807、 用户终端 A的 JS收到呼叫响应后, 解析其中的 SDP信息, 获取所述 SDP信息 中包含的用户终端 B的候选地址信息, JS将用户终端 B的候选地址和该候选地址是否可用 于网络管理的信息通过 addIceCandidate()函数或类似函数通道反馈给用户终端 A浏览器;S807, after receiving the call response, the JS of the user terminal A parses the SDP information therein, and obtains the candidate address information of the user terminal B included in the SDP information, and the JS selects the candidate address of the user terminal B and the candidate address. The information managed by the network is fed back to the user terminal A browser through the addIceCandidate() function or a similar function channel;
5808、 用户终端 A的 JS通过 S804和 S806获知用户终端 A和用户终端 B对网络管理 的支持情况, 本实施例中用户终端 A和用户终端 B双方都支持 ICE普通网络管理; 5808. The JS of the user terminal A learns the support of the network management by the user terminal A and the user terminal B through the S804 and the S806. In this embodiment, both the user terminal A and the user terminal B support the ICE common network management;
5809、用户终端 A的浏览器和用户终端 B进行 ICE的连接测试,确认最终通信的地址, 该过程同实施例二(图 5 ) 中的第 S307~S311步相似, 本例中用户终端 A侧使用非中继地 址进行通信;  5809. The browser of the user terminal A and the user terminal B perform the connection test of the ICE to confirm the address of the final communication. The process is similar to the steps S307 to S311 in the second embodiment (FIG. 5). In this example, the user terminal A side Use a non-relay address for communication;
5810、 由于用户终端 A发生网络切换, 接入信息发生改变。 例如用户终端 A从 wifi接 入点切换到 3G接入点;  5810. The access information changes due to network switching of the user terminal A. For example, user terminal A switches from a wifi access point to a 3G access point;
5811、 用户终端 A的 JS在呼叫建立过程中获知用户终端 A和用户终端 B都支持 ICE 普通网络管理且用户终端 A使用是非中继地址进行通信, 此时用户终端 A的 JS只需要等 待浏览器使用 ICE普通网络管理方式完成会话的恢复;  5811. The JS of the user terminal A knows that both the user terminal A and the user terminal B support the ICE common network management and the user terminal A uses the non-relay address to communicate during the call setup process. At this time, the JS of the user terminal A only needs to wait for the browser. Use ICE common network management to complete the recovery of the session;
5812、 用户终端 A浏览器使用 ICE普通网络管理方式完成会话的恢复;  5812. User terminal A browser uses ICE common network management mode to complete session recovery;
5813、 用户终端 A浏览器使用 ICEcallback或其他功能类似方法向用户终端 A的 JS反 馈 ICE重协商后的地址;  5813. The user terminal A browser uses an ICEcallback or other similar method to feedback the address of the ICE renegotiation to the JS of the user terminal A;
S814、 发送更新请求, 并携带 SDP包括更新成功的地址信息;  S814. Send an update request, and carry the SDP, including the address information that is successfully updated.
5815、 更新应答;  5815, update response;
5816、 完成 ICE重协商过程。  5816. Complete the ICE renegotiation process.
本实施例从实际应用的角度, 结合了浏览器和 javascript的相关接口函数来应用本发明 的发明构思, 对于本发明如何实现以及实现的领域做了更全面的分析。  This embodiment applies the inventive concept of the present invention from the perspective of practical application, in conjunction with the relevant interface functions of the browser and javascript, and makes a more comprehensive analysis of the field in which the present invention is implemented and implemented.
实施例九 Example nine
本实施例是本发明提供的一种建立会话连接方法中的会话发起终端的装置描述, 主要 是针对实施例二中描述的方法而设计, 所述终端的结构关系图如图 13所示终端 200, 其模 块具体包括:  The present invention is a device description of a session initiation terminal in the method for establishing a session connection, which is mainly designed for the method described in Embodiment 2. The structure relationship diagram of the terminal is shown in FIG. The module specifically includes:
候选地址搜集发送模块 201 , 用于向所在网络中的 STUN/TUR 服务器发送搜集请求, 所述搜集请求包括: 指示对会话发起终端的候选地址搜集和 STUN/TUR 服务器对 ICE中 继网络管理的支持信息的搜集的信息;  The candidate address collection and sending module 201 is configured to send a collection request to the STUN/TUR server in the network, where the collection request includes: indicating candidate address collection for the session initiation terminal and STUN/TUR server support for the ICE relay network management. Information collected by the information;
候选地址搜集接收模块 202, 用于接收 STUN/TUR 服务器的搜集响应, 所述搜集响应 中携带会话发起终端的一个或多个候选地址和 STUN/TURN服务器对 ICE中继网络管理的 支持信息; 呼叫请求发送模块 203 , 用于向会话响应终端发送呼叫请求, 所述呼叫请求中携带搜集 到的会话发起终端的候选地址中的至少一个候选地址; The candidate address collection and reception module 202 is configured to receive a collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management; The call request sending module 203 is configured to send a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
呼叫响应接收模块 204, 用于接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带 所述会话响应终端的一个或者多个候选地址;  The call response receiving module 204 is configured to receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
候选地址匹配模块 206 ,用于根据搜集到的 STUN/TURN服务器对 ICE中继网络管理的 支持信息, 匹配会话发起终端的候选地址和所述会话响应终端的候选地址生成一组或多组 候选地址对;  The candidate address matching module 206 is configured to generate one or more sets of candidate addresses according to the collected support information of the STUN/TURN server for the ICE relay network management, the candidate address of the matching session initiating terminal, and the candidate address of the session response terminal. Correct;
连接测试模块 208,用于会话发起终端根据所述一组或多组候选地址对的优先级向会话 响应终端发送连接测试请求, 在成功完成双方的连接测试后, 建立会话发起终端和会话响 应终端的会话连接。  The connection test module 208 is configured to send a connection test request to the session response terminal according to the priority of the one or more sets of candidate address pairs, and establish a session initiation terminal and a session response terminal after successfully completing the connection test of the two parties. Session connection.
本实施例优选的,候选地址匹配模块 206和网络管理判断模块 207都属于处理模块 205 的子模块,而处理模块 205提供与候选地址搜集发送模块 201和候选地址搜集接收模块 202 的接口连接, 并负责将接收到的信息传递给相应的模块。  In this embodiment, the candidate address matching module 206 and the network management determining module 207 are both sub-modules of the processing module 205, and the processing module 205 provides an interface connection with the candidate address collecting and transmitting module 201 and the candidate address collecting and receiving module 202, and Responsible for passing the received information to the corresponding module.
结合本实施例九的第一种可选的方案,本实施例的终端还包括: 网络管理判断模块 207, 用于根据 ICE普通网络管理的支持信息判断会话发起终端是否支持 ICE普通网络管理, 所 述 ICE普通网络管理的支持信息在进行会话连接建立前便保存在会话发起终端中;  With reference to the first optional solution of the ninth embodiment, the terminal of the embodiment further includes: a network management determining module 207, configured to determine, according to the support information of the ICE common network management, whether the session initiation terminal supports the ICE common network management, The support information of the ICE common network management is saved in the session initiation terminal before the session connection is established;
当判断结果是会话发起终端不支持 ICE普通网络管理时, 则在确认会话发起终端侧支 持 ICE中继网络管理后, 呼叫请求发送模块向会话响应终端发送仅携带中继候选地址的呼 叫请求; 其中, 会话发起终端侧支持 ICE中继网络管理包括: 会话发起终端和会话发起终 端所在网络中的 STUN/TUR 服务器都支持 ICE中继网络管理;  When the result of the judgment is that the session initiating terminal does not support the ICE common network management, the call request sending module sends a call request carrying only the relay candidate address to the session responding terminal after confirming that the session initiating terminal side supports the ICE relay network management; The session initiation terminal side supports the ICE relay network management, including: the STUN/TUR server in the network where the session initiation terminal and the session initiation terminal are located support the ICE relay network management;
当判断结果是会话发起终端支持 ICE普通网络管理时, 则呼叫请求发送模块在向会话 响应终端发送呼叫请求, 所述呼叫请求中携带会话发起终端的各候选地址和会话发起终端 对 ICE普通网络管理的支持信息。  When the judgment result is that the session initiation terminal supports the ICE common network management, the call request sending module sends a call request to the session response terminal, where the call request carries each candidate address of the session initiation terminal and the session initiation terminal to the ICE common network management. Support information.
结合本实施例九的第二种可选的方案中, 所述呼叫响应接收模块 204接收到的呼叫响 应中还包括所述会话响应终端对 ICE普通网络管理的支持信息时, 所述候选地址匹配模块 具体用于:  In the second optional solution of the ninth embodiment, when the call response received by the call response receiving module 204 further includes the support information of the session response terminal to the ICE common network management, the candidate address matches. The module is specifically used to:
根据搜集到的 STUN/TUR 服务器对 ICE中继网络管理的支持信息、 会话发起终端对 ICE普通网络管理的支持信息和会话响应终端对 ICE普通网络管理的支持信息, 匹配候选 地址搜集接收模块 202搜集到的候选地址和所述会话响应终端的候选地址生成具有优先级 的一组或多组候选地址对。 According to the collected support information of the STUN/TUR server for the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, the matching candidate address collection and reception module 202 collects The candidate address to be reached and the candidate address of the session response terminal are generated with priority One or more sets of candidate address pairs.
结合本实施例九的第三种可选的方案中, 所述候选地址匹配模块, 还包括: 第一判断子模块 2061 , 用于判断会话发起终端和会话响应终端是否满足都支持 ICE普 通网络管理;  In the third optional solution of the ninth embodiment, the candidate address matching module further includes: a first determining sub-module 2061, configured to determine whether the session initiating terminal and the session responding terminal satisfy the ICE common network management. ;
第一匹配子模块 2062, 用于在判断结果为双方都支持 ICE普通网络管理时, 按照双方 的候选地址的优先级属性匹配成具有优先级的一组或多组候选地址对, 并在会话发起终端 根据所述一组或多组候选地址对的优先级向会话响应终端发送连接测试请求时携带 MOBILITY-SUPPORT标识, 用于和会话响应终端进行 ICE普通网络管理的协商;  The first matching sub-module 2062 is configured to match, according to the priority attribute of the candidate addresses of the two parties, one or more sets of candidate address pairs with priority, when the judgment result is that both parties support the ICE common network management, and initiate the session. The terminal carries the MOBILITY-SUPPORT identifier when the connection test request is sent to the session response terminal according to the priority of the one or more sets of candidate address pairs, and is used for negotiating the ICE common network management with the session response terminal;
第二匹配子模块 2063 , 用于在判断结果为双方并非都支持 ICE普通网络管理时, 确认 会话发起终端和 STUN/TUR 服务器都支持 ICE中继网络管理, 则将会话发起终端的中继 地址和会话响应终端的候选地址按照候选地址的优先级属性匹配成具有优先级的一组或多 组候选地址对。  The second matching sub-module 2063 is configured to: when the judgment result is that both parties do not support the ICE common network management, and confirm that both the session initiation terminal and the STUN/TUR server support the ICE relay network management, the relay address of the session initiation terminal is The candidate addresses of the session response terminal are matched to the one or more sets of candidate address pairs having the priority according to the priority attribute of the candidate address.
结合本实施例九的第四种可选的方案中, 所述终端还包括切换需求判断模块 209, 其中, 会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求, 是在切换需 求判断模块确认会话发起终端有网络切换需求后才进行。  In conjunction with the fourth optional solution of the ninth embodiment, the terminal further includes a handover requirement determination module 209, where the session initiation terminal sends a collection request to the STUN/TUR server in the network, which is in the handover requirement determination module. Confirm that the session initiating terminal has network switching requirements.
所述确认自身有网络切换需求具体包括: 切换需求判断模块在进入特定网域中或者满 足特定条件时是具有网络切换需求的, 所述特定网域包括: wifi网域;所述满足特定条件包 括:针对某次特定的通话对网络切换需求进行设置, 或根据会话响应终端自身的移动的频繁 程度达到指定值时。 应中携带的候选地址和所述候选地址对应的网络管理的支持信息, 进一步结合会话发起终 端自身候选地址对应的网络管理的支持信息生成具有优先级的候选地址对, 从而能够更高 效的进行连接测试。 克服了现有技术仅根据候选地址自身的优先级进行连接性测试, 而脱 离了网络管理方式自身的特性, 减少了大量冗余的连接测试过程。  The acknowledging that the network has the network switching requirement specifically includes: the switching requirement determining module has a network switching requirement when entering a specific network domain or meeting a specific condition, where the specific network domain includes: a wifi network domain; : Set the network switching requirement for a specific call, or when the frequency of the session response terminal itself moves to a specified value. The candidate address carried in the network and the support information of the network management corresponding to the candidate address are further combined with the support information of the network management corresponding to the candidate address of the session initiation terminal to generate a candidate address pair with priority, so that the connection can be performed more efficiently. test. Overcoming the prior art, the connectivity test is performed only based on the priority of the candidate address itself, and the characteristics of the network management mode itself are removed, and a large number of redundant connection test processes are reduced.
可以知道是实施例三和实施例七是在实施例二基础上的具体实现, 因此通过所揭示的 内容, 实施例九也能够实现实施例三和实施例七中的方法, 在此不再赘述。  It can be understood that the third embodiment and the seventh embodiment are specific implementations on the basis of the second embodiment. Therefore, the method in the third embodiment and the seventh embodiment can also be implemented by using the disclosed content, and details are not described herein again. .
实施例十 Example ten
本实施例是本发明提供的一种建立会话连接的方法中会话发起终端的结构, 相比实施 例九所陈述的硬件结构,本实施例特点是其实现都是通过存储器 304中的应用程序 3041和 处理器 301配合完成。 本实施例终端包括至少一个处理器 304 (例如 CPU ), 至少一个网络 接口 303或者其他通信接口, 存储器 304, 和至少一个通信总线 302, 用于实现这些装置之 间的连接通信。 处理器 301用于执行存储器 304中存储的可执行模块, 例如计算机程序。 存储器 304可能包含高速随机存取存储器(RAM: Random Access Memory ), 也可能还包 括非不稳定的存储器(non-volatile memory ), 例如至少一个磁盘存储器。 通过至少一个网 络接口 303 (可以是有线或者无线)实现该***网关与至少一个其他网元之间的通信连接, 可以使用互联网, 广域网, 本地网, 城域网等。 The embodiment is a structure of a session initiation terminal in a method for establishing a session connection provided by the present invention. Compared with the hardware structure stated in the embodiment 9, the embodiment is characterized in that the implementation is through the application 3041 in the memory 304. with The processor 301 cooperates to complete. The terminal of the present embodiment includes at least one processor 304 (e.g., CPU), at least one network interface 303 or other communication interface, memory 304, and at least one communication bus 302 for enabling connection communication between these devices. The processor 301 is configured to execute executable modules, such as computer programs, stored in the memory 304. The memory 304 may include a high speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory such as at least one disk memory. The communication connection between the system gateway and at least one other network element is implemented by at least one network interface 303 (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
在一些实施方式中, 存储器 304存储了应用程序 3041 , 应用程序 3041可以被处理器 301执行, 这个程序包括:  In some embodiments, the memory 304 stores an application 3041, and the application 3041 can be executed by the processor 301. The program includes:
会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求,所述搜集请求包括: 指示对会话发起终端的候选地址搜集和 STUN/TUR 服务器对 ICE中继网络管理的支持信 息的搜集的信息;  The session initiation terminal sends a collection request to the STUN/TUR server in the network, the collection request includes: information indicating collection of candidate address collection of the session initiation terminal and support information of the STUN/TUR server to the ICE relay network management;
会话发起终端接收 STUN/TUR 服务器的搜集响应, 所述搜集响应中携带会话发起终 端的一个或多个候选地址和 STUN/TURN服务器对 ICE中继网络管理的支持信息;  The session initiating terminal receives the collection response of the STUN/TUR server, where the collection response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TURN server to the ICE relay network management;
会话发起终端向会话响应终端发送呼叫请求,所述呼叫请求中携带搜集到的会话发起终 端的候选地址中的至少一个候选地址;  The session initiating terminal sends a call request to the session responding terminal, where the call request carries at least one candidate address among the collected candidate addresses of the session initiating terminal;
接收所述会话响应终端的呼叫响应,所述呼叫响应中携带所述会话响应终端的一个或者 多个候选地址;  Receiving a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
会话发起终端根据搜集到的 STUN/TUR 服务器对 ICE中继网络管理的支持信息, 匹 配自己的候选地址和所述会话响应终端的候选地址生成一组或多组候选地址对;  The session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server for the ICE relay network management, the matching candidate address and the candidate address of the session response terminal;
会话发起终端根据所述一组或多组候选地址对向会话响应终端发送连接测试请求, 并 在成功完成双方的连接测试后, 建立会话发起终端和会话响应终端的会话连接。  The session initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties.
本实施的终端除上述能够完成的基本功能外, 应用程序 3041还可以存储有实施例二中 的可选方案的程序, 而处理器 301也能响应的实现对应可选方案的方法, 在此不再赘述。  In addition to the basic functions that can be performed in the foregoing, the application 3041 can also store the program with the optional solution in the second embodiment, and the processor 301 can also respond to the method corresponding to the optional solution. Let me repeat.
本领域技术人员不难通过实施例九中揭示的终端各模块的功能, 将其转化为本实施例 中通过应用程序 3041和处理器 301来实现的方案, 因此, 不再赘述。  A person skilled in the art can easily convert the functions of the modules of the terminal disclosed in the ninth embodiment into the solution implemented by the application program 3041 and the processor 301 in the embodiment, and therefore, details are not described herein.
实施例十一 Embodiment 11
本实施例是本发明提供的一种建立会话连接的会话响应终端的装置描述, 主要是针对 实施例四中描述的方法而设计, 所述终端的结构关系图如图 15所示终端 400, 其模块具体 包括: The present invention is a device description of a session response terminal for establishing a session connection, which is mainly designed for the method described in Embodiment 4. The structure relationship diagram of the terminal is shown in FIG. Module specific Includes:
呼叫请求接收模块 401 , 用于接收所述会话发起终端的呼叫请求, 所述呼叫请求携带会 话发起终端的一个或多个候选地址;  a call request receiving module 401, configured to receive a call request of the session initiating terminal, where the call request carries one or more candidate addresses of the session initiating terminal;
候选地址搜集模块 402, 用于根据所述呼叫请求搜集自身的候选地址;  The candidate address collecting module 402 is configured to collect its own candidate address according to the call request.
呼叫响应发送模块 403 , 用于向会话发起终端发送呼叫响应, 所述呼叫响应携带所述会 话响应终端搜集到的候选地址和会话响应终端对 ICE普通网络管理的支持信息;  The call response sending module 403 is configured to send a call response to the session initiating terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
候选地址匹配模块 404, 用于匹配呼叫响应发送模块 403在呼叫响应中携带的候选地址 和所述会话发起终端的候选地址生成具有优先级的一组或多组候选地址对;  The candidate address matching module 404 is configured to generate, by the call response sending module 403, the candidate address carried in the call response and the candidate address of the session initiating terminal to generate one or more sets of candidate address pairs with priority;
连接测试模块 405,用于根据所述一组或多组候选地址对的优先级向会话发起终端发送 连接测试请求,并在成功完成连接测试后,建立会话发起终端和会话响应终端的会话连接。  The connection test module 405 is configured to send a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs, and establish a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test.
结合本实施例十一的第一种可选的方案中, 所述接收所述会话发起终端的呼叫请求中 还携带有所述会话发起终端对 ICE普通网络管理的支持信息, 则候选地址匹配模块 404还 包括:  In conjunction with the first optional solution of the eleventh embodiment, the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, and the candidate address matching module 404 also includes:
第一判断子模块 4041 , 用于才艮据所述呼叫请求中携带的会话发起终端对 ICE普通网络 管理的支持信息, 确定会话发起终端和会话响应终端两者是否都支持 ICE普通网络管理; 第一匹配子模块 4042, 用于当两者不是都支持 ICE普通网络管理时, 则在确定会话发 起终端侧支持 ICE中继网络管理时, 所述会话响应终端匹配呼叫响应发送模块 403在呼叫 响应中携带的候选地址和所述会话发起终端的候选地址中的中继候选地址生成具有优先级 的一组或多组候选地址对。  The first determining sub-module 4041 is configured to determine, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, whether the session initiation terminal and the session response terminal support the ICE common network management; a matching sub-module 4042, configured to: when both of the two support ICE common network management, when the session initiating terminal side supports the ICE relay network management, the session response terminal matches the call response sending module 403 in the call response. The carried candidate address and the relay candidate address in the candidate address of the session initiating terminal generate one or more sets of candidate address pairs having priority.
结合本实施例十一的第二种可选的方案中, 所述候选地址搜集模块根据所述呼叫请求 搜集自身的候选地址外, 还搜集会话响应终端所在网络中的 STUN/TUR 服务器对 ICE中 继网络管理的支持信息, 则所述呼叫响应发送模块 403还包括:  With reference to the second optional solution in the eleventh embodiment, the candidate address collecting module collects its own candidate address according to the call request, and collects the STUN/TUR server in the ICE in the network where the session response terminal is located. The call response sending module 403 further includes:
第二判断子模块 4031 , 用于判断会话发起终端和会话响应终端是否都支持 ICE普通网 络管理;  The second determining sub-module 4031 is configured to determine whether the session initiating terminal and the session responding terminal support the ICE common network management;
所述呼叫响应发送模块 403 ,还用于在判断结果为两者不是都支持 ICE普通网络管理时, 并在确认会话响应终端侧支持 ICE中继网络管理时, 会话响应终端向会话发起终端发送呼 叫响应, 所述呼叫响应携带所述会话响应终端搜集到的中继地址和会话响应终端对 ICE普 通网络管理的支持信息。  The call response sending module 403 is further configured to: when the judgment result is that both of the ICE common network management are supported, and the acknowledgment session response terminal side supports the ICE relay network management, the session response terminal sends a call to the session initiation terminal. In response, the call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
所述呼叫响应发送模块 403 , 还用于在判断结果为两者都支持 ICE普通网络管理时, 会 话响应终端向会话发起终端发送呼叫响应, 所述呼叫响应携带所述会话响应终端搜集到的 各候选地址和会话响应终端对 ICE普通网络管理的支持信息。 The call response sending module 403 is further configured to: when the judgment result is that both support ICE common network management, The response terminal sends a call response to the session initiation terminal, and the call response carries the candidate information collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
结合本实施例十一的第三种可选的方案中, 所述终端还包括切换需求判断模块 406, 其中, 第一判断子模块 4041的执行, 是在切换需求判断模块 406确认会话响应终端有 网络切换需求后才进行 , 所述确认自身有网络切换需求具体包括:  In conjunction with the third optional solution of the eleventh embodiment, the terminal further includes a handover requirement determination module 406, wherein the execution of the first determination submodule 4041 is performed by the handover requirement determination module 406 to confirm that the session response terminal has After the network switching needs are performed, the confirmation that the network switching requirement itself includes:
在进入特定网域中或者满足特定条件时是具有网络切换需求的, 所述特定网域包括: wifi网域;所述满足特定条件包括:针对某次特定的通话对网络切换需求进行设置,或根据会 话响应终端自身的移动的频繁程度达到指定值时。  There is a network switching requirement when entering a specific network domain or when a specific condition is met, the specific network domain includes: a wifi domain; the satisfying specific conditions includes: setting a network switching requirement for a specific call, or According to the frequency of the session response terminal itself's movement to the specified value.
本实施例, 从会话响应终端侧的角度阐述说明了本发明的核心发明点, 通过对呼叫请 求中携带的会话发起终端的候选地址和会话发起终端对网络管理的支持信息, 进一步结合 会话响应终端自身候选地址对应的网络管理的支持信息生成具有优先级的候选地址对, 减 少了冗余的连接测试过程, 从而能够更高效的进行连接测试。  In this embodiment, the core inventive point of the present invention is illustrated from the perspective of the session response terminal side, and the session response terminal is further combined by the candidate address of the session initiation terminal carried in the call request and the support information of the session initiation terminal to the network management. The network management support information corresponding to the self-candidate address generates a candidate address pair with priority, which reduces the redundant connection test process, thereby enabling connection test to be performed more efficiently.
可以知道是实施例五、 实施例六和实施例七是在实施例二基础上的具体实现, 因此通 过所揭示的内容, 实施例十一也能够实现实施例五、 实施例六和实施例七中的方法, 在此 不再赘述。  It can be understood that the fifth embodiment, the sixth embodiment and the seventh embodiment are specific implementations based on the second embodiment. Therefore, the embodiment XI can also implement the fifth embodiment, the sixth embodiment and the seventh embodiment. The method in this will not be repeated here.
实施例十二 Example twelve
本实施例是本发明提供的另一个终端的结构, 相比实施例十一所陈述的硬件结构, 本 实施例特点是其实现都是通过存储器 504中的应用程序 5041和处理器 501配合完成。本实 施例终端包括至少一个处理器 502(例如 CPU ),至少一个网络接口 503或者其他通信接口, 存储器 504, 和至少一个通信总线 502, 用于实现这些装置之间的连接通信。 处理器 501用 于执行存储器 504中存储的可执行模块, 例如计算机程序。 存储器 504可能包含高速随机 存取存储器( RAM: Random Access Memory ),也可能还包括非不稳定的存储器( non-volatile memory ), 例如至少一个磁盘存储器。 通过至少一个网络接口 503 (可以是有线或者无线) 实现该***网关与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网, 城域网等。  The embodiment is a structure of another terminal provided by the present invention. Compared with the hardware structure set forth in the eleventh embodiment, the embodiment is characterized in that the implementation is completed by the application 5041 and the processor 501 in the memory 504. The terminal of the present embodiment includes at least one processor 502 (e.g., a CPU), at least one network interface 503 or other communication interface, memory 504, and at least one communication bus 502 for enabling connection communication between the devices. Processor 501 is for executing executable modules, such as computer programs, stored in memory 504. The memory 504 may include a high speed random access memory (RAM: Random Access Memory) and may also include a non-volatile memory such as at least one disk memory. The communication connection between the system gateway and at least one other network element is implemented by at least one network interface 503 (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
在一些实施方式中, 存储器 504存储了程序 5041 , 程序 5041可以被处理器 501执行, 这个程序包括:  In some embodiments, the memory 504 stores a program 5041, and the program 5041 can be executed by the processor 501. The program includes:
会话响应终端接收所述会话发起终端的呼叫请求, 所述呼叫请求携带会话发起终端的 一个或多个候选地址; 会话响应终端根据所述呼叫请求搜集会话响应终端的候选地址和会话响应终端对 ICE 普通网络管理的支持信息; The session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal; The session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management according to the call request;
会话响应终端向会话发起终端发送呼叫响应, 所述呼叫响应携带所述会话响应终端搜 集到的候选地址和会话响应终端对 ICE普通网络管理的支持信息;  The session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选地址 生成具有优先级的一组或多组候选地址对;  The session response terminal matches the candidate address carried in the call response and the candidate address of the session initiation terminal to generate one or more sets of candidate address pairs with priority;
会话响应终端根据所述一组或多组候选地址对的优先级向会话发起终端发送连接测试 请求, 并在成功完成连接测试后, 建立会话发起终端和会话响应终端的会话连接。  The session response terminal sends a connection test request to the session initiation terminal according to the priority of the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test.
本实施的终端除上述能够完成的基本功能外, 应用程序 5041还可以存储有实施例四中 的可选方案的程序, 而处理器 501也能相应的实现对应可选方案的方法, 在此不再赘述。  In addition to the basic functions that can be performed in the foregoing, the application 5041 can also store the program of the alternative in the fourth embodiment, and the processor 501 can also implement the corresponding alternative method. Let me repeat.
本领域技术人员不难通过实施例十一中揭示的终端各模块的功能, 将其转化为本实施 例中通过应用程序 5041和处理器 501来实现的方案, 因此, 不再赘述。  It is not difficult for a person skilled in the art to convert the functions of the modules of the terminal disclosed in the embodiment 11 into the scheme implemented by the application program 5041 and the processor 501 in the embodiment, and therefore, details are not described herein.
实施例十三 Example thirteen
图 17是本发明的实施例十在一个具体的智能手机终端中的应用, 其中所述智能手机的 硬件模块的主框架包括: 一个或多个处理器 601、 内存 602、 I/O子*** 603; 基于所述主 框架上还有配备有触摸传感器 604、光学传感器 605、其他输入输出设备 606、射频电路 607、 音频电路 608、 接近传感器 609、 加速器 610、 扬声器 611和麦克风 612。 上述硬件模块共 同协作组成了一个当前流行的智能手机终端。  17 is an application of a tenth embodiment of the present invention in a specific smart phone terminal, wherein a main frame of a hardware module of the smart phone includes: one or more processors 601, a memory 602, and an I/O subsystem 603. Also based on the main frame is equipped with a touch sensor 604, an optical sensor 605, other input and output devices 606, a radio frequency circuit 607, an audio circuit 608, a proximity sensor 609, an accelerator 610, a speaker 611, and a microphone 612. The above hardware modules work together to form a currently popular smartphone terminal.
所述智能手机终端运行起来后,控制器 6011和处理器 6012和内存 602中的各程序模块 共同协作, 来实现智能手机的各种功能; 所述程序模块又包括: 操作*** 6021、 通信模块 6022、交互模块 6023、 图形模块 6024、文本输入模块 6025、 GPS模块 6026、应用模块 6027 和其他模块 6028; 而其中的应用模块 6027正是在本发明的实施例十中的应用程序 3041在 本实施例的智能手机终端中的实现;  After the smart phone terminal is running, the controller 6011 and the processor 6012 and the program modules in the memory 602 cooperate to implement various functions of the smart phone; the program module further includes: an operating system 6021 and a communication module 6022 The interaction module 6023, the graphics module 6024, the text input module 6025, the GPS module 6026, the application module 6027, and other modules 6028; wherein the application module 6027 is the application 3041 in the tenth embodiment of the present invention in this embodiment Implementation in a smartphone terminal;
则实施例十中, 处理器 301执行应用程序 3041的过程, 在本实施例的实现具体为: 处理器 6012执行应用模块 6027中的候选搜集模块 6027(a)对应的程序, 向所在网络中 的 STUN/TUR 服务器发送搜集请求, 所述搜集请求包括: 指示对会话发起终端的候选地 址搜集和 STUN/TUR 服务器对 ICE 中继网络管理的支持信息的搜集的信息; 并接收 STUN/TUR 服务器的搜集响应, 所述搜集响应中携带会话发起终端的一个或多个候选地 址和 STUN/TURN服务器对 ICE中继网络管理的支持信息; 处理器 6012执行应用模块 6027中的呼叫请求发送模块 6027(b)对应的程序, 向会话响 应终端发送呼叫请求, 所述呼叫请求中携带搜集到的会话发起终端的候选地址中的至少一 个候选地址; In the tenth embodiment, the processor 301 executes the process of the application 3041. The implementation in this embodiment is specifically: the processor 6012 executes the program corresponding to the candidate collection module 6027(a) in the application module 6027, and is located in the network. The STUN/TUR server sends a collection request, the collection request includes: information indicating collection of candidate address collection of the session initiation terminal and support information of the STUN/TUR server to the ICE relay network management; and receiving the collection of the STUN/TUR server In response, the collecting response carries one or more candidate addresses of the session initiating terminal and support information of the STUN/TURN server to the ICE relay network management; The processor 6012 executes a program corresponding to the call request sending module 6027(b) in the application module 6027, and sends a call request to the session responding terminal, where the call request carries at least one candidate address among the collected candidate addresses of the session initiating terminal. ;
处理器 6012执行应用模块 6027中的呼叫响应接收模块 6027(c)对应的程序, 接收所述 会话响应终端的呼叫响应, 所述呼叫响应中携带所述会话响应终端的一个或者多个候选地 址;  The processor 6012 executes a program corresponding to the call response receiving module 6027(c) in the application module 6027, and receives a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
处理器 6012执行应用模块 6027中的候选地址匹配模块 6027(d)对应的程序, 根据搜集 到的 STUN/TURN服务器对 ICE中继网络管理的支持信息, 匹配自己的候选地址和所述会 话响应终端的候选地址生成一组或多组候选地址对;  The processor 6012 executes a program corresponding to the candidate address matching module 6027(d) in the application module 6027, and matches its own candidate address and the session response terminal according to the collected support information of the STUN/TURN server to the ICE relay network management. The candidate address generates one or more sets of candidate address pairs;
处理器 6012执行应用模块 6027中的连接测试模块 6027(e)对应的程序, 会话发起终端 根据所述一组或多组候选地址对向会话响应终端发送连接测试请求;  The processor 6012 executes a program corresponding to the connection test module 6027(e) in the application module 6027, and the session initiation terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs;
处理器 6012执行应用模块 6027中的会话建立模块 6027(f)对应的程序, 在成功完成双 方的连接测试后, 建立会话发起终端和会话响应终端的会话连接。  The processor 6012 executes the program corresponding to the session establishment module 6027(f) in the application module 6027, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties.
本实施的终端除上述能够完成的基本功能外, 处理器 6012执行应用模块 6027还可以 完成实施例四中其他可选方案, 在此不再赘述。  In addition to the basic functions that can be performed by the terminal of the present embodiment, the processor 6012 executes the application module 6027 and can complete other alternatives in the fourth embodiment, and details are not described herein again.
本领域普通技术人员可以意识到, 结合本文中所公开的实施例中描述的各方法步骤和 单元, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为了清楚地说明硬件和软件 的可互换性, 在上述说明中已经按照功能一般性地描述了各实施例的步骤及组成。 这些功 能究竟以硬件还是软件方式来执行, 取决于技术方案的特定应用和设计约束条件。 本领域 普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能, 但是这种实现 不应认为超出本发明的范围。  Those skilled in the art will appreciate that the various method steps and elements described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the steps and composition of the various embodiments have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或步骤可以用硬件、 处理器执行的软件程序, 或者二者的结合来实施。软件程序可以置于随机存储器( RAM )、内存、只读存储器( ROM )、 电可编程 ROM、 电可擦除可编程 ROM、 寄存器、 硬盘、 可移动磁盘、 CD-ROM > 或技术 领域内所公知的任意其它形式的存储介质中。  The methods or steps described in connection with the embodiments disclosed herein may be implemented in hardware, a software program executed by a processor, or a combination of both. Software programs can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM > or technical fields Any other form of storage medium known.
尽管通过参考附图并结合优选实施例的方式对本发明进行了详细描述, 但本发明并不 限于此。 在不脱离本发明的精神和实质的前提下, 本领域普通技术人员可以对本发明的实 施例进行各种等效的修改或替换, 而这些修改或替换都应在本发明的涵盖范围内。  Although the present invention has been described in detail by reference to the accompanying drawings in the preferred embodiments, the invention is not limited thereto. Various equivalent modifications and alterations to the embodiments of the present invention may be made by those skilled in the art without departing from the spirit and scope of the invention.

Claims

权 利 要 求 Rights request
1、 一种会话连接建立的方法, 其特征在于, 包括:  A method for establishing a session connection, comprising:
会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求,所述搜集请求包括: 指示对所述会话发起终端的候选地址搜集和所述 STUN/TURN服务器对 ICE中继网络管理 的支持信息的搜集的信息;  The session initiation terminal sends a collection request to the STUN/TUR server in the network, where the collection request includes: indicating support address collection of the session initiation terminal and support information of the STUN/TURN server to the ICE relay network management. Information collected;
所述会话发起终端接收所述 STUN/TUR 服务器发送的针对所述收集请求的搜集响应, 所述搜集响应中携带所述会话发起终端的一个或多个候选地址和所述 STUN/TUR 服务器 对 ICE中继网络管理的支持信息;  The session initiating terminal receives the collection response sent by the STUN/TUR server for the collection request, where the collection response carries one or more candidate addresses of the session initiation terminal and the STUN/TUR server pair ICE Support information for relay network management;
所述会话发起终端向会话响应终端发送呼叫请求,所述呼叫请求中携带搜集到的所述会 话发起终端的候选地址中的至少一个候选地址;  The session initiating terminal sends a call request to the session response terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
接收所述会话响应终端的呼叫响应,所述呼叫响应中携带所述会话响应终端的一个或者 多个候选地址;  Receiving a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持 信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候选地址对; 所述会话发起终端根据所述一组或多组候选地址对向所述会话响应终端发送连接测试 请求,并在成功完成连接测试后,建立所述会话发起终端和所述会话响应终端的会话连接。  The session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server to the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal; The session initiating terminal sends a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test. .
2、 根据权利要求 1所述的方法, 其特征在于, 所述会话发起终端向会话响应终端发送呼叫 请求之前, 还包括: The method according to claim 1, wherein before the session initiating terminal sends a call request to the session response terminal, the method further includes:
所述会话发起终端根据 ICE普通网络管理的支持信息判断自己是否支持 ICE普通网络 管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中;  The session initiating terminal determines whether it supports the ICE common network management according to the support information of the ICE common network management, and the support information of the ICE common network management is stored in the session initiation terminal;
当判断结果是所述会话发起终端自己不支持 ICE普通网络管理时, 则在确认所述会话 发起终端和所述 STUN/TUR 服务器同时支持 ICE中继网络管理后, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 所述会话发起终端在所 述呼叫请求中仅携带所述会话发起终端的中继候选地址;  When the result of the judgment is that the session initiating terminal does not support the ICE common network management, the call request is carried in the call request after confirming that the session initiating terminal and the STUN/TUR server simultaneously support the ICE relay network management. The at least one candidate address of the candidate address of the session initiation terminal is specifically: the session initiation terminal only carries the relay candidate address of the session initiation terminal in the call request;
当判断结果是所述会话发起终端自己支持 ICE普通网络管理时, 所述呼叫请求中携带 搜集到的会话发起终端的候选地址中的至少一个候选地址具体为: 所述会话发起终端在所 述呼叫请求中携带所述会话发起终端的所有候选地址和所述会话发起终端对 ICE普通网络 管理的支持信息。 When the result of the judgment is that the session initiating terminal supports the ICE common network management, the call request carries at least one candidate address in the candidate address of the collected session initiating terminal, specifically: the session initiating terminal is in the call. The request carries all candidate addresses of the session initiation terminal and support information of the session initiation terminal to the ICE common network management.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述接收所述会话响应终端的呼叫响应, 所述呼叫响应中携带所述会话响应终端的一个或者多个候选地址, 还包括: The method according to claim 1 or 2, wherein the receiving the response of the session response terminal, the call response carrying one or more candidate addresses of the session response terminal, further comprising :
所述呼叫响应中还包括所述会话响应终端对 ICE普通网络管理的支持信息;  The call response further includes support information of the session response terminal to the ICE common network management;
则所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支 持信息, 匹配自己的候选地址和所述会话响应终端的候选地址, 生成一组或多组候选地址 对, 具体包括:  And the session initiating terminal generates one or more sets of candidate address pairs according to the collected support information of the STUN/TUR server to the ICE relay network management, matching the candidate address of the UE and the candidate address of the session response terminal. Specifically, including:
所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持 信息、 所述会话发起终端对 ICE普通网络管理的支持信息和所述会话响应终端对 ICE普通 网络管理的支持信息, 匹配自己搜集到的候选地址和所述会话响应终端的候选地址, 生成 具有优先级的一组或多组候选地址对。  The session initiation terminal according to the collected support information of the STUN/TUR server to the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the session response terminal to the ICE common network management Supporting information, matching the candidate address collected by itself and the candidate address of the session response terminal, and generating one or more sets of candidate address pairs with priority.
4、 根据权利要求 3所述的方法, 其特征在于, 所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息、 所述会话发起终端对 ICE普通网络管 理的支持信息和所述会话响应终端对 ICE普通网络管理的支持信息,匹配自己搜集到的候选 地址和所述会话响应终端的候选地址,生成具有优先级的一组或多组候选地址对,具体为: 所述会话发起终端判断自己和所述会话响应终端是否都支持 ICE普通网络管理; 在判断结果为双方都支持 ICE普通网络管理时, 按照双方的候选地址的优先级属性匹 配成具有优先级的一组或多组候选地址对; 在判断结果为双方并非满足都支持 ICE普通网 络管理条件时, 确认所述会话发起终端和所述 STUN/TURN服务器都支持 ICE中继网络管 理, 则将所述会话发起终端的中继地址和所述会话响应终端的候选地址按照候选地址的优 先级属性匹配成具有优先级的一组或多组候选地址对。 The method according to claim 3, wherein the session initiating terminal manages the information of the ICE relay network management according to the collected STUN/TUR server, and the session initiation terminal manages the ICE common network. The support information and the support information of the session response terminal to the ICE common network management match the candidate address collected by the session and the candidate address of the session response terminal, and generate one or more candidate address pairs with priority, specifically The session initiating terminal determines whether both the self and the session response terminal support the ICE common network management; when the judgment result is that both parties support the ICE common network management, the priority attribute of the candidate addresses of the two parties are matched to have priority. One or more sets of candidate address pairs; when the result of the judgment is that both parties do not satisfy the ICE common network management condition, it is confirmed that the session initiation terminal and the STUN/TURN server support ICE relay network management, Decoding the relay address of the session initiation terminal and the candidate address of the session response terminal Priority attribute matches the candidate address priority to have one or more sets of candidate address pairs.
5、 根据权利要求 1或 2所述的方法, 其特征在于, 所述会话发起终端根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息, 匹配自己的候选地址和所述会话响应 终端的候选地址, 生成一组或多组候选地址对, 具体包括: The method according to claim 1 or 2, wherein the session initiating terminal matches the candidate information of the STUN/TUR server to the ICE relay network management, and matches the candidate address and the The session responds to the candidate address of the terminal, and generates one or more sets of candidate address pairs, including:
确认会话发起终端和 STUN/TUR 服务器都支持 ICE中继网络管理, 则将会话发起终 端的中继地址和会话响应终端的候选地址按照候选地址的优先级属性匹配, 生成具有优先 级的一组或多组候选地址对。 Acknowledging that both the session initiating terminal and the STUN/TUR server support the ICE relay network management, the relay address of the session initiating terminal and the candidate address of the session responding terminal are matched according to the priority attribute of the candidate address to generate a group with priority or Multiple sets of candidate address pairs.
6、 根据权利要求 1-5任一所述的方法, 其特征在于, 所述会话发起终端向所述会话响应终 端发送呼叫请求, 所述呼叫请求中携带搜集到的所述会话发起终端的候选地址中的至少一 个候选地址, 还包括: The method according to any one of claims 1-5, wherein the session initiating terminal sends a call request to the session response terminal, where the call request carries the collected candidate of the session initiation terminal. At least one candidate address in the address, further including:
所述呼叫请求还携带了所述会话发起终端对 ICE普通网络管理的支持信息和 /或会话发 起终端侧对 ICE中继网络管理的支持信息, 所述会话发起终端侧对 ICE中继网络管理的支 持信息包括所述会话发起终端和所述 STUN/TUR 服务器两者对 ICE中继网络管理的支持 信息。  The call request further carries the support information of the session initiation terminal to the ICE common network management and/or the support information of the session initiation terminal side to the ICE relay network management, where the session initiation terminal side manages the ICE relay network. The support information includes support information for the ICE relay network management by both the session originating terminal and the STUN/TUR server.
7、 根据权利要求 1-6任一所述的方法, 其特征在于, 所述会话发起终端向所在网络中的 STUN/TUR 服务器发送搜集请求, 还包括: The method according to any one of claims 1-6, wherein the session initiating terminal sends a collection request to a STUN/TUR server in the network, and the method further includes:
所述会话发起终端在确认自己不支持 ICE普通网络管理,而支持 ICE中继网络管理时, 在向所在网络中的 STUN/TUR 服务器发送的搜集请求中携带类型标识, 所述类型标识指 示 STUN/TURN服务器仅返回中继地址。  The session initiating terminal carries the type identifier in the collection request sent by the STUN/TUR server in the network, and the type identifier indicates STUN/, when it confirms that it does not support the ICE common network management and supports the ICE relay network management. The TURN server only returns the relay address.
8、 根据权利要求 1-7所述的方法, 其特征在于, 会话发起终端向所在网络中的 STUN/TURN 服务器发送搜集请求和 /或会话发起终端向会话响应终端发送呼叫请求和 /或匹配自己的候 选地址和所述会话响应终端的候选地址, 是在会话发起终端确认自身有网络切换需求后才 进行。 8. The method according to claims 1-7, wherein the session initiating terminal sends a collection request to the STUN/TURN server in the network and/or the session initiating terminal sends a call request to the session response terminal and/or matches itself. The candidate address and the candidate address of the session response terminal are performed after the session initiating terminal confirms that it has a network switching requirement.
9、 根据权利要求 8所述的方法, 其特征在于, 所述确认自身有网络切换需求具体包括: 所述会话发起终端中设置有在进入特定网域中或者满足特定条件时是具有网络切换需 求的, 所述特定网域包括: wifi 网域; 所述满足特定条件包括: 针对某次特定的通话对网 络切换需求进行设置, 或根据会话响应终端自身的移动的频繁程度达到指定值时。 The method according to claim 8, wherein the confirming that the network has a network switching requirement specifically includes: the session initiating terminal is configured to have a network switching requirement when entering a specific network domain or meeting a specific condition. The specific domain includes: a wifi domain; the satisfying the specific condition includes: setting a network handover requirement for a specific call, or when the frequency of the session response terminal itself moves to a specified value.
10、 根据权利要求 1-9所述的方法, 其特征在于, 所述会话发起终端具体为浏览器, 则所 述方法具体包括: The method according to any one of claims 1-9, wherein the session initiating terminal is specifically a browser, and the method specifically includes:
所述浏览器发送搜集请求, 并将搜集响应中的候选地址和所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息传递给 Javascript; 其中, javascrip运行于浏览器中; Javascript根据所述浏览器和所述会话响应终端各自对 ICE普通网络管理和 ICE中继网 络管理的支持信息, 生成具有优先级的候选地址对, 并返回给浏览器; The browser sends a collection request, and transmits the candidate address in the collection response and the support information of the STUN/TUR server to the ICE relay network management to the Javascript; wherein, the javascrip runs in the browser; The Javascript generates a candidate address pair with priority according to the support information of the browser and the session response terminal for the ICE common network management and the ICE relay network management, and returns the candidate address pair to the browser;
所述浏览器完成后续的连接测试和会话建立过程。  The browser completes the subsequent connection test and session establishment process.
11、 一种会话连接建立的方法, 其特征在于, 包括: A method for establishing a session connection, comprising:
会话响应终端接收会话发起终端的呼叫请求, 所述呼叫请求携带所述会话发起终端的 一个或多个候选地址;  The session response terminal receives a call request of the session initiation terminal, where the call request carries one or more candidate addresses of the session initiation terminal;
所述会话响应终端根据所述呼叫请求搜集所述会话响应终端的候选地址和所述会话响 应终端对 ICE普通网络管理的支持信息;  And the session response terminal collects the candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management according to the call request;
所述会话响应终端向所述会话发起终端发送呼叫响应, 所述呼叫响应携带所述会话响 应终端搜集到的候选地址和所述会话响应终端对 ICE普通网络管理的支持信息;  The session response terminal sends a call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the support information of the session response terminal to the ICE common network management;
所述会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选 地址, 生成一组或多组候选地址对;  The session response terminal matches a candidate address carried in the call response and a candidate address of the session initiation terminal, and generates one or more sets of candidate address pairs;
所述会话响应终端根据所述一组或多组候选地址对向所述会话发起终端发送连接测试 请求,并在成功完成连接测试后,建立所述会话发起终端和所述会话响应终端的会话连接。  The session response terminal sends a connection test request to the session initiation terminal according to the one or more sets of candidate address pairs, and establishes a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test. .
12、 根据权利要求 11所述的方法, 其特征在于, 所述接收所述会话发起终端的呼叫请求中 还携带有所述会话发起终端对 ICE普通网络管理的支持信息,则所述会话响应终端匹配自己 在所述呼叫响应中携带的候选地址和所述会话发起终端的候选地址, 生成一组或多组候选 地址对, 具体包括: The method according to claim 11, wherein the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, and the session response terminal The candidate addresses that are carried in the call response and the candidate addresses of the session initiating terminal are matched, and one or more sets of candidate address pairs are generated, including:
所述会话响应终端根据所述呼叫请求中携带的会话发起终端对 ICE普通网络管理的支 持信息和所述会话响应终端自身的 ICE普通网络管理的支持信息, 确定会话发起终端和会话 响应终端两者是否都支持 ICE普通网络管理;  The session response terminal determines, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, and the support information of the ICE common network management of the session response terminal itself, determining both the session initiation terminal and the session response terminal. Whether it supports ICE common network management;
当两者不满足都支持 ICE普通网络管理时,则在确定所述会话发起终端侧支持 ICE中继网 络管理时, 所述会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端 的候选地址中的中继候选地址, 生成具有优先级的一组或多组候选地址对。  When the two are not satisfied, the ICE common network management is supported, and when it is determined that the session initiation terminal side supports the ICE relay network management, the session response terminal matches the candidate address carried in the call response and the session initiation. The relay candidate address in the candidate address of the terminal generates one or more sets of candidate address pairs with priority.
13、 根据权利要求 11或 12所述方法, 其特征在于, 所述会话响应终端根据所述呼叫请求搜 集自身的候选地址外, 还搜集所述会话响应终端所在网络中的 STUN/TURN服务器对 ICE中继 网络管理的支持信息, 则所述会话响应终端向所述会话发起终端发送所述呼叫响应, 所述 呼叫响应携带所述会话响应终端搜集到的候选地址和会话响应终端对 ICE普通网络管理的 支持信息, 具体包括: The method according to claim 11 or 12, wherein the session response terminal collects its own candidate address according to the call request, and collects the STUN/TURN server pair ICE in the network where the session response terminal is located. Relay The network management support information, the session response terminal sends the call response to the session initiation terminal, where the call response carries the candidate address collected by the session response terminal and the session response terminal supports the ICE common network management. Information, including:
所述会话响应终端判断所述会话发起终端和所述会话响应终端是否都支持 I CE普通网 络管理;  The session response terminal determines whether the session initiation terminal and the session response terminal support I CE common network management;
在判断结果为两者不满足都支持 ICE普通网络管理时, 并在确认所述会话响应终端侧支 持 ICE中继网络管理时, 所述会话响应终端向所述会话发起终端发送呼叫响应, 所述呼叫响 应携带所述会话响应终端搜集到的中继地址和会话响应终端对 ICE普通网络管理的支持信 息。  When the result of the determination is that the two are not satisfied, the ICE common network management is supported, and when the session response terminal side is confirmed to support the ICE relay network management, the session response terminal sends a call response to the session initiation terminal, where The call response carries the relay address collected by the session response terminal and the support information of the session response terminal to the ICE common network management.
14、 根据权利要求 11所述的方法, 其特征在于, 在所述接收所述会话发起终端的呼叫请求 中还携带有所述会话发起终端对 ICE普通网络管理的支持信息时,则所述搜集所述会话响应 终端的候选地址和所述会话响应终端对 ICE普通网络管理的支持信息具体包括: The method according to claim 11, wherein when the call request for receiving the session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, the collecting The candidate address of the session response terminal and the support information of the session response terminal to the ICE common network management specifically include:
所述会话响应终端根据所述呼叫请求中携带的所述会话发起终端对 ICE普通网络管理 的支持信息确定所述会话发起终端和所述会话响应终端不满足同时支持 ICE普通网络管理, 而所述会话响应终端自身支持 ICE中继网络管理时;  The session response terminal determines that the session initiation terminal and the session response terminal are not satisfied and supports ICE common network management according to the support information of the session initiation terminal and the ICE common network management carried in the call request. When the session response terminal itself supports ICE relay network management;
则所述会话响应终端在向所在网络中的 STUN/TUR 服务器发送的搜集请求中携带所 述会话响应终端对 ICE普通网络管理支持信息和所述会话响应终端对 ICE中继网络管理的 支持信息, 以便于所述 STUN/TURN服务器在判断自身支持 ICE中继网络管理时, 向所述 会话发起终端仅返回其自身的中继地址。  And the session response terminal carries the support information of the session response terminal to the ICE common network management support information and the session response terminal to the ICE relay network management in the collection request sent by the STUN/TUR server in the network. In order for the STUN/TURN server to determine that it supports the ICE relay network management, the session originating terminal only returns its own relay address.
15、 根据权利要求 11-14任一所述的方法, 其特征在于, 所述会话响应终端根据所述呼叫请 求搜集自身的候选地址和 /或所述会话响应终端向所述会话发起终端发送呼叫响应和 /或所 述会话响应终端匹配自己在呼叫响应中携带的候选地址和所述会话发起终端的候选地址, 是在会话发起终端确认自身有网络切换需求后才进行。 The method according to any one of claims 11-14, wherein the session response terminal collects its own candidate address according to the call request and/or the session response terminal sends a call to the session initiation terminal. The response and/or the session response terminal matching the candidate address carried in the call response and the candidate address of the session initiation terminal are performed after the session initiation terminal confirms that it has a network handover requirement.
16、 根据权利要求 15所述的方法, 其特征在于, 所述确认自身有网络切换需求具体包括: 会话响应终端中设置有在进入特定网域中或者满足特定条件时是具有网络切换需求的, 所述特定网域包括: wifi 网域; 所述满足特定条件包括: 针对某次特定的通话对网络切换 需求进行设置, 或根据会话响应终端自身的移动的频繁程度达到指定值时。 The method according to claim 15, wherein the confirming that the network has a network switching requirement specifically includes: the session response terminal is configured to have a network switching requirement when entering a specific network domain or meeting a specific condition, The specific domain includes: a wifi domain; the satisfying specific conditions include: switching to a specific call to the network The requirements are set, or when the frequency of the session response terminal itself moves to a specified value.
17、 一种会话连接建立的会话发起终端, 其特征在于, 包括: A session initiating terminal established by a session connection, comprising:
候选地址搜集发送模块, 用于向所述会话发起终端所在网络中的 STUN/TUR 服务器 发送搜集请求, 所述搜集请求包括: 指示对会话发起终端的候选地址搜集和所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息的搜集的信息;  a candidate address collection and sending module, configured to send a collection request to a STUN/TUR server in a network where the session initiation terminal is located, where the collection request includes: indicating candidate address collection for the session initiation terminal and the STUN/TUR server to the ICE Information collected by the support information of the relay network management;
候选地址搜集接收模块, 用于接收所述 STUN/TUR 服务器发送的针对所述收集请求 的搜集响应, 所述搜集响应中携带会话发起终端的一个或多个候选地址和所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息;  a candidate address collection and receiving module, configured to receive a collection response sent by the STUN/TUR server for the collection request, where the collection response carries one or more candidate addresses of the session initiation terminal and the STUN/TUR server pair Support information for ICE relay network management;
呼叫请求发送模块,用于向会话响应终端发送呼叫请求,所述呼叫请求中携带搜集到的 会话发起终端的候选地址中的至少一个候选地址;  a call request sending module, configured to send a call request to the session responding terminal, where the call request carries at least one candidate address of the collected candidate addresses of the session initiating terminal;
呼叫响应接收模块,用于接收所述会话响应终端的呼叫响应,所述呼叫响应中携带所述 会话响应终端的一个或者多个候选地址;  a call response receiving module, configured to receive a call response of the session response terminal, where the call response carries one or more candidate addresses of the session response terminal;
候选地址匹配模块, 用于根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理 的支持信息, 匹配会话发起终端的候选地址和所述会话响应终端的候选地址, 生成一组或 多组候选地址对;  a candidate address matching module, configured to: according to the collected support information of the STUN/TUR server to the ICE relay network management, match the candidate address of the session initiation terminal and the candidate address of the session response terminal, and generate one or more groups. Candidate address pair
连接测试模块,用于根据所述一组或多组候选地址对向会话响应终端发送连接测试请求 , 在成功完成双方的连接测试后, 建立所述会话发起终端和所述会话响应终端的会话连接。  a connection test module, configured to send a connection test request to the session response terminal according to the one or more sets of candidate address pairs, and establish a session connection between the session initiation terminal and the session response terminal after successfully completing the connection test of the two parties .
18、 根据权利要求 17所述的会话发起终端, 其特征在于, 所述会话发起终端还包括: The session initiation terminal according to claim 17, wherein the session initiation terminal further includes:
网络管理判断模块, 用于根据 ICE普通网络管理的支持信息判断所述会话发起终端是 否支持 ICE普通网络管理, 所述 ICE普通网络管理的支持信息存储于会话发起终端中; 当判断结果是所述会话发起终端不支持 ICE普通网络管理时, 则在确认所述会话发起 终端侧支持 ICE中继网络管理后, 所述呼叫请求发送模块向所述会话响应终端发送仅携带 中继候选地址的呼叫请求; 其中, 所述会话发起终端侧支持 ICE中继网络管理包括: 所述 会话发起终端和所述会话发起终端所在网络中的 STUN/TURN服务器都支持 ICE中继网络 管理;  a network management judging module, configured to determine, according to the support information of the ICE common network management, whether the session initiating terminal supports the ICE common network management, where the support information of the ICE common network management is stored in the session initiating terminal; When the session initiation terminal does not support the ICE common network management, after the session initiation terminal side supports the ICE relay network management, the call request sending module sends a call request carrying only the relay candidate address to the session response terminal. The session initiating terminal side supporting the ICE relay network management includes: the STUN/TURN server in the network where the session initiating terminal and the session initiating terminal are located support the ICE relay network management;
当判断结果是所述会话发起终端支持 ICE普通网络管理时, 则所述呼叫请求发送模块 在向所述会话响应终端发送呼叫请求, 所述呼叫请求中携带会话发起终端的所有候选地址 和所述会话发起终端对 ICE普通网络管理的支持信息。 When the result of the judgment is that the session initiation terminal supports the ICE common network management, the call request sending module sends a call request to the session response terminal, where the call request carries all candidate addresses of the session initiation terminal. And the session initiating terminal support information for the ICE common network management.
19、 根据权利要求 17或 18所述的终端, 其特征在于, 所述呼叫响应接收模块接收到的所述 呼叫响应中还包括所述会话响应终端对 ICE普通网络管理的支持信息时, 所述候选地址匹配 模块具体用于: The terminal according to claim 17 or 18, wherein, when the call response received by the call response receiving module further includes the support information of the session response terminal to the ICE common network management, The candidate address matching module is specifically used to:
根据搜集到的所述 STUN/TUR 服务器对 ICE中继网络管理的支持信息、 所述会话发 起终端对 ICE普通网络管理的支持信息和所述会话响应终端对 ICE普通网络管理的支持信 息, 匹配自己搜集到的候选地址和所述会话响应终端的候选地址生成具有优先级的一组或 多组候选地址对。  According to the collected support information of the STUN/TUR server for the ICE relay network management, the support information of the session initiation terminal to the ICE common network management, and the support information of the session response terminal to the ICE common network management, match the self. The collected candidate address and the candidate address of the session response terminal generate one or more sets of candidate address pairs with priority.
20、 根据权利要求 19所述的终端, 其特征在于, 所述候选地址匹配模块, 还包括: The terminal according to claim 19, wherein the candidate address matching module further includes:
第一判断子模块,用于判断所述会话发起终端和所述会话响应终端是否满足都支持 ICE 普通网络管理;  a first determining sub-module, configured to determine whether the session initiation terminal and the session response terminal are satisfied to support ICE common network management;
第一匹配子模块, 用于在所述第一判断子模块的判断结果为双方都支持 ICE普通网络 管理时, 按照双方的候选地址的优先级属性匹配, 生成具有优先级的一组或多组候选地址 对;  a first matching submodule, configured to: when the judgment result of the first determining submodule is that both parties support the ICE common network management, generate one or more groups with priority according to the priority attribute matching of the candidate addresses of the two parties Candidate address pair
第二匹配子模块, 用于在所述第一判断子模块的判断结果为双方并非满足都支持 ICE 普通网络管理时, 确认所述会话发起终端和所述 STUN/TURN服务器都支持 ICE中继网络 管理, 则将会话发起终端的中继地址和会话响应终端的候选地址按照候选地址的优先级属 性匹配, 生成具有优先级的一组或多组候选地址对。  a second matching submodule, configured to confirm that the session initiation terminal and the STUN/TURN server support the ICE relay network when the judgment result of the first determining submodule is that both parties do not satisfy the ICE common network management The management matches the relay address of the session initiation terminal and the candidate address of the session response terminal according to the priority attribute of the candidate address to generate one or more sets of candidate address pairs with priority.
21、 根据权利要求 17-20所述的会话发起终端, 其特征在于, 所述会话发起终端还包括切换 需求判断模块, The session initiation terminal according to any one of claims 17 to 20, wherein the session initiation terminal further includes a handover requirement determination module.
其中, 候选地址搜集发送模块向所在网络中的 STUN/TUR 服务器发送搜集请求; 和 / 或,  The candidate address collection and transmission module sends a collection request to the STUN/TUR server in the network; and/or,
呼叫请求发送模块向会话响应终端发送呼叫请求; 和 /或 ,  The call request sending module sends a call request to the session responding terminal; and/or ,
候选地址匹配模块匹配自己的候选地址和所述会话响应终端的候选地址;都是在切换需 求判断模块确认自身有网络切换需求后才进行。 The candidate address matching module matches its own candidate address and the candidate address of the session response terminal; both are performed after the handover requirement determination module confirms that it has a network handover requirement.
22、 一种会话连接建立的会话响应终端, 其特征在于, 包括: 22. A session response terminal established by a session connection, comprising:
呼叫请求接收模块,用于接收会话发起终端的呼叫请求,所述呼叫请求携带所述会话发 起终端的一个或多个候选地址;  a call request receiving module, configured to receive a call request of the session initiating terminal, where the call request carries one or more candidate addresses of the session initiation terminal;
候选地址搜集模块, 用于根据所述呼叫请求搜集所述会话响应终端的候选地址; 呼叫响应发送模块, 用于向所述会话发起终端发送呼叫响应, 所述呼叫响应携带所述 候选地址搜集模块搜集到所述会话响应终端的候选地址和所述会话响应终端对 ICE普通网 络管理的支持信息;  a candidate address collection module, configured to collect a candidate address of the session response terminal according to the call request; a call response sending module, configured to send a call response to the session initiation terminal, where the call response carries the candidate address collection module Collecting candidate addresses of the session response terminal and support information of the session response terminal to the ICE common network management;
候选地址匹配模块,用于匹配在所述呼叫响应中携带的候选地址和所述会话发起终端的 候选地址, 生成一组或多组候选地址对;  a candidate address matching module, configured to match a candidate address carried in the call response and a candidate address of the session initiating terminal, to generate one or more sets of candidate address pairs;
连接测试模块,用于根据所述一组或多组候选地址对向所述会话发起终端发送连接测试 请求, 并在成功完成双方连接测试后, 建立所述会话发起终端和所述会话响应终端的会话 连接。  a connection test module, configured to send a connection test request to the session initiation terminal according to the one or more sets of candidate address pairs, and after successfully completing the two-party connection test, establish the session initiation terminal and the session response terminal Session connection.
23、 根据权利要求 22所述的会话响应终端, 其特征在于, 所述接收会话发起终端的呼叫请 求中还携带有所述会话发起终端对 ICE普通网络管理的支持信息,则所述候选地址匹配模块 还包括: The session response terminal according to claim 22, wherein the call request of the receiving session initiation terminal further carries the support information of the session initiation terminal to the ICE common network management, and the candidate address matches. The module also includes:
第一判断子模块, 用于根据所述呼叫请求中携带的所述会话发起终端对 ICE普通网络管 理的支持信息, 确定所述会话发起终端和所述会话响应终端两者是否都支持 ICE普通网络管 理;  a first determining sub-module, configured to determine, according to the support information of the session initiation terminal to the ICE common network management carried in the call request, whether the session initiation terminal and the session response terminal support the ICE common network Management
第一匹配子模块, 用于当所述第一判断子模块确定两者不是都支持 ICE普通网络管理时 , 则在确定所述会话发起终端侧支持 ICE中继网络管理时, 所述会话响应终端匹配自己在呼叫 响应中携带的候选地址和所述会话发起终端的中继候选地址生成具有优先级的一组或多组 候选地址对。  a first matching submodule, configured to: when the first determining submodule determines that both do not support ICE common network management, when the session initiating terminal side supports the ICE relay network management, the session responding terminal Matching the candidate address carried in the call response and the relay candidate address of the session initiating terminal to generate one or more sets of candidate address pairs having priority.
24、 根据权利要求 22或 23所述的会话响应终端, 其特征在于, 所述候选地址搜集模块根据 所述呼叫请求搜集自身的候选地址外, 还搜集所述会话响应终端所在网络中的 STUN/TURN 服务器对 ICE中继网络管理的支持信息, 则所述呼叫响应发送模块还包括: The session response terminal according to claim 22 or 23, wherein the candidate address collection module collects its own candidate address according to the call request, and collects STUN/ in the network where the session response terminal is located. The call response sending module of the TURN server supports the ICE relay network management, and the call response sending module further includes:
第二判断子模块, 用于判断所述会话发起终端和所述会话响应终端是否都支持 ICE普通 网络管理; a second determining submodule, configured to determine whether the session initiating terminal and the session response terminal both support ICE common Network management;
所述呼叫响应发送模块, 还用于在所述第二判断子模块的判断结果为两者不是都支持 ICE普通网络管理时, 并确认所述会话响应终端侧支持 ICE中继网络管理时, 所述呼叫响应发 送模块向会话发起终端发送呼叫响应, 所述呼叫响应携带所述候选地址搜集模块搜集到的 中继地址和所述会话响应终端对 ICE普通网络管理的支持信息。  The call response sending module is further configured to: when the judgment result of the second determining submodule is that both do not support the ICE common network management, and confirm that the session response terminal side supports the ICE relay network management, The call response sending module sends a call response to the session initiating terminal, where the call response carries the relay address collected by the candidate address collecting module and the support information of the session response terminal to the ICE common network management.
25、 根据权利要求 22-24所述的会话响应终端, 其特征在于, 所述会话响应终端还包括切换 需求判断模块, The session response terminal according to any one of claims 22-24, wherein the session response terminal further includes a handover requirement determination module.
其中,候选地址搜集模块根据所述呼叫请求搜集所述会话响应终端的候选地址;和 /或, 呼叫响应发送模块向所述会话发起终端发送呼叫响应; 和 /或 ,  The candidate address collection module collects the candidate address of the session response terminal according to the call request; and/or, the call response sending module sends a call response to the session initiation terminal; and/or
候选地址匹配模块匹配在所述呼叫响应中携带的候选地址和所述会话发起终端的候选 地址; 都是在切换需求判断模块确认自身有网络切换需求后才进。  The candidate address matching module matches the candidate address carried in the call response and the candidate address of the session initiating terminal; both of them are entered after the handover requirement judging module confirms that it has a network switching requirement.
PCT/CN2013/076331 2013-05-28 2013-05-28 Session connection establishment method, apparatus and system WO2014190487A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201380000701.9A CN104521211B (en) 2013-05-28 2013-05-28 The methods, devices and systems that a kind of session connection is established
PCT/CN2013/076331 WO2014190487A1 (en) 2013-05-28 2013-05-28 Session connection establishment method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/076331 WO2014190487A1 (en) 2013-05-28 2013-05-28 Session connection establishment method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2014190487A1 true WO2014190487A1 (en) 2014-12-04

Family

ID=51987848

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/076331 WO2014190487A1 (en) 2013-05-28 2013-05-28 Session connection establishment method, apparatus and system

Country Status (2)

Country Link
CN (1) CN104521211B (en)
WO (1) WO2014190487A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671944A (en) * 2020-12-18 2021-04-16 杭州叙简科技股份有限公司 Audio and video interaction method based on webrtc and ice detection

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10237236B2 (en) * 2015-06-25 2019-03-19 Microsoft Technology Licensing, Llc Media Session
CN110545248B (en) * 2018-05-28 2022-03-01 中国电信股份有限公司 Communication method and edge access control equipment
CN111787590B (en) * 2018-07-20 2022-09-06 Oppo广东移动通信有限公司 Session management method, terminal device and network device
CN111836133B (en) * 2020-07-16 2022-03-01 鸣飞伟业技术有限公司 Voice program-controlled exchange system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968226A (en) * 2006-04-18 2007-05-23 华为技术有限公司 Method for crossing network address conversion in point-to-point communication
CN101179581A (en) * 2007-12-13 2008-05-14 北京邮电大学 Method for performing media transmission using ICE relay candidate address
EP2079222A1 (en) * 2008-01-10 2009-07-15 Alcatel Lucent An address translator traversal method for SIP signaling messages by temporary use of TCP transport protocol
CN102457580A (en) * 2010-10-18 2012-05-16 中兴通讯股份有限公司 NAT (Network Address Translation) traversing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101123582B (en) * 2007-09-21 2011-08-24 中兴通讯股份有限公司 A communication method between private network terminals
CN101242360B (en) * 2008-03-13 2010-12-01 中兴通讯股份有限公司 A network address conversion method and system based on priority queue

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968226A (en) * 2006-04-18 2007-05-23 华为技术有限公司 Method for crossing network address conversion in point-to-point communication
CN101179581A (en) * 2007-12-13 2008-05-14 北京邮电大学 Method for performing media transmission using ICE relay candidate address
EP2079222A1 (en) * 2008-01-10 2009-07-15 Alcatel Lucent An address translator traversal method for SIP signaling messages by temporary use of TCP transport protocol
CN102457580A (en) * 2010-10-18 2012-05-16 中兴通讯股份有限公司 NAT (Network Address Translation) traversing method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112671944A (en) * 2020-12-18 2021-04-16 杭州叙简科技股份有限公司 Audio and video interaction method based on webrtc and ice detection

Also Published As

Publication number Publication date
CN104521211A (en) 2015-04-15
CN104521211B (en) 2018-04-27

Similar Documents

Publication Publication Date Title
WO2020259509A1 (en) Method and device for application migration
US10250646B2 (en) Method and device for establishing channel
JP6009630B2 (en) Simultaneous packet data network (PDN) access
CN102571587B (en) Method and equipment for forwarding messages
WO2022206452A1 (en) Data transmission method, apparatus and device in service integration, and storage medium and computer program product
KR20150013860A (en) Clientless cloud computing
CN108141409B (en) Communication system, address notification device, communication control device, terminal, communication method, and program
WO2014190487A1 (en) Session connection establishment method, apparatus and system
JP6291085B2 (en) Load distribution apparatus, load distribution method and program
US20230291706A1 (en) Method for accessing network, media gateway, electronic device and storage medium
JP2015534677A (en) Instant messaging method, terminal, server and system
KR20120059077A (en) System and method for peer-to-peer connection in multiple network environment
Li et al. 6G cloud-native system: Vision, challenges, architecture framework and enabling technologies
US11659012B2 (en) Relayed communication channel establishment
CN110475296B (en) Service quality negotiation method and device
KR101996337B1 (en) Switch processing method, controller, switch, and switch processing system
US11743180B2 (en) System and method for routing traffic onto an MPLS network
CN112235840B (en) Session terminal switching method, device, entity and system
JP2004104357A (en) Network system and communication method, information processing apparatus and method therefor, as well as program
CN114691351A (en) Information processing method, device, equipment and storage medium
EP2993865A1 (en) Method, system and related device for processing service
CN105556921A (en) A mobile-device based proxy for browser-originated procedures
JP2015201758A (en) Repeater, communication system, information processing method, and program
Mosudi et al. Multi-access edge computing deployments for 5G networks
US10834184B2 (en) Sending a sensor node a request for sensor data that identifies another node to process the data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13885630

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13885630

Country of ref document: EP

Kind code of ref document: A1