WO2014101159A1 - 设置、处理交互式连接建立ice地址的方法、装置和服务器 - Google Patents

设置、处理交互式连接建立ice地址的方法、装置和服务器 Download PDF

Info

Publication number
WO2014101159A1
WO2014101159A1 PCT/CN2012/087968 CN2012087968W WO2014101159A1 WO 2014101159 A1 WO2014101159 A1 WO 2014101159A1 CN 2012087968 W CN2012087968 W CN 2012087968W WO 2014101159 A1 WO2014101159 A1 WO 2014101159A1
Authority
WO
WIPO (PCT)
Prior art keywords
ice
address
browser
service
web application
Prior art date
Application number
PCT/CN2012/087968
Other languages
English (en)
French (fr)
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 CN201280002626.5A priority Critical patent/CN104255014A/zh
Priority to PCT/CN2012/087968 priority patent/WO2014101159A1/zh
Publication of WO2014101159A1 publication Critical patent/WO2014101159A1/zh

Links

Classifications

    • 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/256NAT traversal
    • H04L61/2575NAT traversal using address mapping retrieval, e.g. simple traversal of user datagram protocol through session traversal utilities for NAT [STUN]

Definitions

  • the present invention relates to WebRTC technology, and more particularly to a method and apparatus for handling an interactive connection establishment ICE address and a method, apparatus and server for setting an ICE address processing indication.
  • Web Real-Time Communication is a technology for real-time video and audio communication inside a browser.
  • the technology mainly uses hypertext markup language (HyperTextMark-upLanguage 5, HTML5) to discuss and JavaScript. (JS) language, which enables communication between browsers without using plugins.
  • JS JavaScript.
  • To implement a WebRTC session you need to negotiate the browser's respective media information (including the media send/receive address, the codec used by the media transfer, protocols, etc.) during the session establishment process.
  • Session Description Protocol Session Description
  • Protocol, SDP is a protocol described as media information. In the process of session establishment, the OFFER/ANSWER mechanism of SDP is used to negotiate media information.
  • Web application A and Web application B negotiate to establish a WebRTC session.
  • the content of the negotiation includes: Interactive Connectivity Establishment (ICE) address and SDP parameters.
  • ICE Interactive Connectivity Establishment
  • the browser of Terminal B may collect a new ICE address.
  • the web application B will first send the HTTP message of the new ICE address of the browser carrying the terminal B to the WebRTC service server, and then the WebRTC service server will carry it again.
  • the HTTP message of the new ICE address of the browser of the terminal B is sent to the web application A.
  • Web application A The new ICE address of the browser of the terminal B can be sent to the browser of the terminal A by the candidate address addition (addlceCandidate) message.
  • How the browser of terminal A uses the new ICE address of the browser of the terminal B is determined internally by the browser of the terminal A, and the web application A is the use of the new ICE address of the browser that cannot participate in the decision terminal B. .
  • the browser of the terminal A receives the new ICE address of the browser of the terminal B, if it detects that the new ICE address of the browser of the terminal B is available, no matter what service is currently being performed by the browser of the terminal A or what kind of network is present.
  • the new ICE address of the browser of the terminal B is discarded; or the browser of the terminal A replaces the ICE address of the browser of the terminal B that is performing the WebRTC session between the web application A and the web application B.
  • the new ICE address for the browser of terminal B is determined internally by the browser of the terminal A, and the web application A is the use of the new ICE address of the browser that cannot participate in the decision terminal B.
  • the service does not want to be interrupted or wants to be interrupted, that is, the service does not want to adopt the new ICE address of the browser of the terminal B or the new ICE address of the browser of the terminal B is desired;
  • the browser cannot decide whether to use the new ICE address of the browser of terminal B according to the needs of the business.
  • the browser of terminal B may replace the ICE address of the browser of the terminal B in the WebRTC session between the web application A and the web application B with the new ICE address of the browser of the terminal B, which is This led to the interruption of the business.
  • the new ICE address of the browser of terminal B must be used, but the browser of terminal A cannot decide whether to use the new ICE address of the browser of terminal B according to the requirements of the network.
  • the old Network Address Translator (NAT) Traversal Using NAT (TURN) server that serves the browser of Terminal B needs maintenance due to overload or failure, etc., WebRTC service
  • the server must use the new TURN server, that is, the ICE address of the browser of the terminal B has changed, and the new ICE address of the browser of the terminal B needs to be used to communicate with the browser of the terminal A, but the terminal A
  • the browser does not know the need to connect between web application A and web application B.
  • the ICE address of the browser of the terminal B that is performing the WebRTC session is replaced with the new ICE address of the browser of the terminal B.
  • the browser of the terminal A may simply save the new ICE address of the browser of the terminal B or discard the browser of the terminal B.
  • the new ICE address which will not meet the needs of the business, and will have a greater impact on the business.
  • a method for processing an ICE address is applied to a webpage real-time communication WebRCT session, where the WebRTC session is passed by the first web application through the browser's ICE address of the first terminal and the second web application passes through the second terminal.
  • the first web application is a web application loaded on the browser of the first terminal
  • the second web application is a web application loaded on the browser of the second terminal
  • the method includes The browser of the first terminal receives the address increase candidate message sent by the first web application, where the address increase candidate message includes the second ICE address of the browser of the second terminal and the processing instruction of the browser of the first terminal to the second ICE address
  • the browser of the first terminal recognizes the processing indication, and performs corresponding processing on the second ICE address according to the identified processing instruction.
  • the browser of the first terminal recognizes the processing indication, and performs corresponding processing on the second ICE address according to the identified processing indication, including: the browser of the first terminal recognizes When the processing indication is saving, detecting whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, saving the ICE address of the browser of the first terminal and the address pair of the second ICE address; When the second ICE address is unreachable, the second ICE address is discarded; or when the browser of the first terminal recognizes that the processing indication is replacement, detecting whether the second ICE address is reachable, and detecting that the second ICE address is reachable The first ICE address is replaced with the second ICE address; when it is detected that the second ICE address is unreachable, the second ICE address is discarded; or, when the browser of the first terminal recognizes that the processing indication is an autonomous decision, the detection is performed.
  • the second ICE address is reachable, and when detecting that the second ICE address is reachable, checking that the second ICE address is carried Priority of carrying; if the carrying priority of the second ICE address is higher than the priority carried by the first ICE address, the first ICE address is replaced with the second ICE address; if the second ICE address carries the priority lower than Or equal to the priority carried by the first ICE address, the second ICE address is discarded; when it is detected that the second ICE address is unreachable, the second ICE address is discarded.
  • detecting whether the second ICE address is reachable specifically: sending a reachability detection request to the browser of the second terminal, if During the specified time, the browser of the first terminal receives the reachable detection response returned by the browser of the second terminal, and the second ICE address is reachable; if the browser of the first terminal does not receive the first time within the specified time The reachable detection response returned by the browser of the second terminal is that the second ICE address is unreachable.
  • the browser of the first terminal identifies the processing indication, and performs corresponding processing on the second ICE address according to the identified processing indication, which specifically includes: browser identification of the first terminal And outputting the processing instruction, modifying the state of the ICE proxy state machine in the browser of the first terminal according to the identified processing instruction, so that the modified state corresponds to the processing indication; according to the state of the ICE proxy state machine, the first terminal The browser processes the second ICE address accordingly.
  • the state of the ICE proxy state machine in the browser of the first terminal is modified according to the identified processing indication, so that the modified The state corresponds to the processing indication.
  • the browser of the first terminal performs corresponding processing on the second ICE address, and specifically includes: modifying the state of the ICE proxy state machine to a hold state according to the processing indication;
  • the browser of the first terminal detects whether the second ICE address is reachable, and saves the address of the ICE address of the browser of the first terminal and the address of the second ICE address when detecting that the second ICE address is reachable;
  • the state of the ICE proxy state machine is modified to be the detection state;
  • the browser of the first terminal detects whether the second ICE address is reachable, and When detecting that the second ICE address is reachable, the first ICE address is replaced with
  • the address increase candidate message is determined by the first web application to receive the address transmission message sent by the second web application, and determined according to the service ID and the processing indication table of the current service. After the processing of the second ICE address by the browser of the terminal is sent to the browser of the first terminal, the address transmission message includes the second ICE address of the browser of the second terminal.
  • the WebRTC service server sets each service supported by the WebRTC service server separately.
  • the processing instruction indicates that the service ID of the service and the corresponding processing instruction of the service are saved in the correspondence table between the service and the processing indication.
  • the WebRTC service server sends a table save request including the processing indication table to the first web application.
  • the processing indication table is specifically a service and processing indication correspondence table, and the first web application receives the table saving response including the permission update flag, and sends an permission update message to the second web application according to the permission update flag, so as to allow the second
  • the web application sends a second ICE address to the first web application; or, the WebRTC service server separately classifies all services supported by the WebRTC service server, and sets corresponding processing instructions for each type, and sets the service ID and service of the service.
  • the corresponding type ID is stored in the correspondence between the service and the type.
  • the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the type and processing indication correspondence table.
  • the WebRTC service server sends the table including the processing indication table to the first web application.
  • a request where the processing indication table includes a correspondence table between the service and the type correspondence type and the type and the processing indication correspondence table, and receives the first web response
  • the response is saved with a table containing the allowable update flag, and an allow update message is sent to the second web application based on the allowable update flag to allow the second web application to send the second ICE address to the first web application.
  • the first web application when the processing indication table is specifically a service and processing indication correspondence table, obtains the current service.
  • the service ID where the service ID is allocated by the WebRTC service server when the current service is created; the first web application obtains a processing instruction corresponding to the service ID according to the service ID and the service and processing indication correspondence table, and confirms the processing instruction corresponding to the service ID.
  • the first web application obtains the service ID of the current service, and the first web application obtains the service ID of the current service when the processing indication table includes the service and the type correspondence table and the type and the processing indication correspondence table.
  • the service ID is allocated by the WebRTC service server when the current service is created.
  • the first web application obtains the type ID corresponding to the service ID according to the service ID and the service and type correspondence table, and obtains the type according to the type and the processing instruction correspondence table.
  • the processing instruction corresponding to the ID, the processing instruction corresponding to the confirmation type ID is the The processing of the second ICE address by the browser of a terminal.
  • the method for setting an ICE address processing indication includes: the first webpage web application negotiates with the second web application through the first ICE address of the browser of the first terminal by using the ICE address of the browser of the first terminal And establishing a webpage real-time communication WebRTC session, wherein the first web application is a web application loaded on the browser of the first terminal, and the second web application is a web application loaded on the browser of the second terminal; during the webRTC session
  • the first web application receives the address transmission message sent by the second web application, where the address transmission message includes the second ICE address of the browser of the second terminal; the first web application determines the first according to the service ID and the processing indication table of the current service.
  • An instruction for processing the second ICE address by the browser of the terminal sending an address increase candidate message to the browser of the first terminal, where the address increase candidate message includes the second ICE address and the browser of the first terminal processes the second ICE address indication So that the browser of the first terminal performs corresponding processing on the second ICE address according to the processing instruction.
  • the first web application is based on the current service
  • the service ID and the processing indication table determine the processing instruction of the browser of the first terminal to the second ICE address, specifically: when the processing indication table is a correspondence table between the service ID and the processing indication, the first web application obtains the current service The service ID, wherein the service ID is allocated by the WebRTC service server when the current service is created; the first web application obtains a processing instruction corresponding to the service ID according to the correspondence table between the service ID and the service ID and the processing indication, and confirms the service ID corresponding to The first web application obtains the service ID of the current service, where the processing indication indication is a processing indication of the second ICE address by the browser of the first terminal; or, when the processing indication table is a correspondence table of the type table and the type and the processing indication, the first web application obtains the service ID of the current service, where The service ID is allocated by the WebRTC service server when the current service is created.
  • the first web application obtains the type ID corresponding to the service ID according to the service ID and the type table, and obtains the type ID according to the correspondence table between the type ID and the processing indication.
  • Processing indication the processing indication corresponding to the confirmation type ID is a processing instruction of the browser of the first terminal to the second ICE address.
  • the WebRTC service server sets each service supported by the WebRTC service server separately. Processing the indication, and storing the service ID and the corresponding processing instruction of the service in the service and processing indication correspondence table.
  • the WebRTC service server sends a table save request including the processing indication table to the first web application.
  • the processing indication table is specifically a service and processing indication correspondence table, and the first web application receives the table saving response including the permission update flag, and sends an permission update message to the second web application according to the permission update flag, so as to allow the second web.
  • the application sends the second ICE address to the first web application; or the WebRTC service server separately classifies all the services supported by the WebRTC service server, and sets corresponding processing instructions for each type, and correspondingly associates the service ID of the service with the service.
  • the type ID is stored in the business and type correspondence table.
  • the WebRTC service server sends a table save request including the processing indication table to the first web application,
  • the processing indication table includes a service and type correspondence table and a type and processing indication correspondence table, and receives a table save response including the permission update flag by the first web application, and applies the second web application according to the permission update flag.
  • the send permission update message is sent to allow the second web application to send the second ICE address to the first web application.
  • a method for processing an ICE address is characterized in that, when applied to a webpage real-time communication WebRCT session, the WebRTC session is an ICE address of the browser of the first terminal web application through the first terminal and the first The web application is established by the first ICE address negotiation of the browser of the second terminal, where the first web application is a web application loaded on the browser of the first terminal, and the second web application is a browser loaded in the second terminal.
  • the web application includes: receiving, by the browser of the first terminal, a state modification request sent by the first web application, where the state modification request includes browsing by the browser of the first terminal to all the second terminals received during the WebRTC session a unified processing indication of the second ICE address of the device, wherein the second ICE address is an updated ICE address of the browser of the second terminal; and modifying the ICE proxy status in the browser of the first terminal according to the unified processing indication
  • the state of the machine so that the modified state corresponds to the processing indication; during the WebRTC session, the browser of the first terminal receives An address increase candidate message including a second ICE address sent by the web application, where the address increase candidate message is sent by the first web application after receiving the address transmission message including the second ICE address sent by the second web application;
  • the state of the proxy state machine the browser of the first terminal processes the second ICE address accordingly.
  • the state of the ICE proxy state machine is modified according to the processing indication, and the modified state is corresponding to the processing indication
  • the specific information includes: when the processing indication is specifically saved, according to the processing indication
  • the state of the ICE proxy state machine is changed to a hold state; correspondingly, according to the state of the ICE proxy state machine, the browser of the first terminal performs corresponding processing on the second ICE address, specifically: the state of the ICE proxy state machine is When the state is maintained, the browser of the first terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, saves the address pair of the ICE address of the browser of the first terminal and the second ICE address; When it is detected that the second ICE address is unreachable, the second ICE address is discarded; or, according to the processing instruction, the state of the ICE proxy state machine is modified, and the modified state is corresponding to the processing indication, specifically: the processing indication is specifically When replacing,
  • the state of the state machine is the detection state; correspondingly, according to the state of the ICE agent state machine, the browser of the first terminal performs corresponding processing on the second ICE address, specifically: when the state of the ICE agent state machine is the detection state, the first The browser of the terminal detects whether the second ICE address is reachable, and replaces the first ICE address with the second ICE address when detecting that the second ICE address is reachable; and discards when detecting that the second ICE address is unreachable The second ICE address; or, according to the processing instruction, modifying the state of the ICE proxy state machine, so that the modified state corresponds to the processing indication, specifically: the processing instruction is specifically an autonomous decision, and the MSC is modified according to the processing instruction, and the ICE is modified.
  • the state of the proxy state machine is an automatic state; correspondingly, according to the state of the ICE proxy state machine, the browser of the first terminal performs corresponding processing on the second ICE address, specifically: when the state of the ICE proxy state machine is an automatic state, The browser of a terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, check the a priority carried by the second ICE address; if the priority carried by the second ICE address is greater than the priority carried by the first ICE address, the first ICE address is replaced with the second ICE address; if the priority of the second ICE address is carried If the priority is less than or equal to the first ICE address, the second ICE address is discarded; when the second ICE address is unreachable, the second ICE address is discarded.
  • detecting whether the second ICE address is reachable specifically: sending a reachability detection request to the browser of the second terminal, if The browser of the first terminal receives the reachable detection response returned by the browser of the second terminal within the specified time, and the second ICE address is reachable; if the browser of the first terminal does not receive the message within the specified time The reachable detection response returned by the browser of the second terminal, the second ICE address is unreachable.
  • the state modification request is determined by the first web application according to the service ID and the processing indication table of the current service, and the browser of the first terminal is determined to be received during the WebRTC session. After the unified processing indication of all the second ICE addresses, it is sent to the browser of the first terminal.
  • the method further includes: before the WebRTC session is established, the WebRTC service server sends the WebRTC service All the services supported by the server respectively set corresponding processing instructions, and store the service ID of the service and the corresponding processing instruction of the service in the correspondence table between the service and the processing indication. After the WebRTC session is established, the WebRTC service server goes to the first Web.
  • the application sends a table save request including a processing indication table, where the processing indication table is specifically a service and processing indication correspondence table, and receives a first web application sending table save response, where the table save response does not include an allow update flag; or, the WebRTC service server All the services supported by the WebRTC service server are classified separately, and corresponding processing instructions are set for each type, and the service ID of the service and the type ID corresponding to the service are stored in the service and type correspondence table, and the service is corresponding.
  • the processing instruction corresponding to the type ID and the type ID is stored in the type and processing indication correspondence table.
  • the WebRTC service server sends a table save request including the processing indication table to the first web application, where the processing indication table includes Business and type correspondence table and type And processing a correspondence correspondence table, receiving a first web application sending table save response, where the table save response does not include an allow update flag.
  • the method before the browser of the first terminal receives the address increase candidate message that is sent by the first web application and includes the second ICE address, the method further includes: The first web application sends a state modification response including an allowable update flag, so that the first web application notifies the WebRTC service server to allow the second web application to send the second ICE address to the first web application according to the allowable update flag.
  • a fourth aspect a method for setting an ICE address processing indication, comprising: a first web application passing an ICE address of a browser of a first terminal and a first ICE address of a second web browser through a browser of the second terminal Negotiating and establishing a webpage real-time communication WebRTC session, wherein the first web application is a web application loaded on a browser of the first terminal, and the second web application is a web application loaded on a browser of the second terminal; the first web The application determines, according to the service ID and the processing indication table of the current service, a unified processing instruction of the browser of the first terminal to all the second I CE addresses received during the WebRTC session; the first web application browses to the first terminal Transmitting a state modification request, the state modification request including a unified processing of the browser of the first terminal to the second ICE address of the browser of all the second terminals received during the WebRTC session Instructing, wherein the second ICE address is an updated ICE address of the browser of the second terminal; so that the browser
  • the first web application determines, according to the service ID and the processing indication table of the current service, all the second ICE addresses received by the browser of the first terminal during the WebRTC session.
  • the unified processing indication is specifically: when the processing indication table is specifically a service and processing indication correspondence table, the first web application obtains a service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; A web application obtains a processing instruction corresponding to the service ID according to the service ID and the service and processing indication correspondence table, and confirms that the processing instruction corresponding to the service ID is the browser of the first terminal to all the second ICEs received during the WebRTC session.
  • the type correspondence relationship table obtains the type ID corresponding to the service ID, and obtains a processing instruction corresponding to the type ID according to the type ID and the type and the processing instruction correspondence table, and the processing instruction corresponding to the confirmation type ID is the browser pair of the first terminal.
  • the method further includes: before the establishment of the WebRTC session, the WebRTC service server separately sets all services supported by the WebRTC service server. Corresponding processing instructions are set, and the service ID and the corresponding processing instruction of the service are saved in the service and processing indication correspondence table. After the WebRTC session is established, the WebRTC service server sends the table including the processing indication table to the first web application.
  • the processing indication table is specifically a service and processing indication correspondence table, and receives a first web application sending table save response, where the table save response does not include an allow update flag; or the WebRTC service server supports the WebRTC service server All businesses are classified separately and corresponding processing instructions are set for each type, and the business of the business
  • the type ID corresponding to the service ID is stored in the service and type correspondence table, and the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the correspondence table of the type and the processing indication.
  • the WebRTC The service server sends a table save request including a processing indication table to the first web application, where the processing indication table includes a service-type correspondence relationship table and a type and processing indication correspondence table, and receives a first web application sending table save response, where the table The save response does not include the allow update flag.
  • the method further includes: receiving, by the browser of the first terminal, a status including the permission update flag The tamper response, and based on the allowable update flag, the first web application sends an address initiation message to the WebRTC service server, so that the WebRTC service server allows the second web application to send the second ICE address to the first web application.
  • an apparatus for processing an ICE address for processing an ICE address during a web page real-time communication WebRTC session the webRTC session being passed by the first web application and the second web application by the device itself
  • the ICE address is negotiated with a first ICE address of a browser running the second web application, the first web application being a web application loaded on the device, the device comprising a transceiver and a processor, wherein: And receiving an address increase candidate message sent by the first web application, where the address increase candidate message includes a second ICE address of a browser running the second web application and a processing indication of the second ICE address by the processor; a processing instruction for sending a second ICE address to the processor and the processor to the second ICE address; the processor, configured to receive a second ICE address sent by the transceiver and a processing indication of the second ICE address by the processor, and identify The processing instruction is output, and the second ICE address is processed correspondingly according to the identified processing instruction.
  • the processor includes: a detecting module and a discarding module, where: the detecting module is configured to detect whether the second ICE address received from the transceiver is reachable; When the detecting module detects that the second ICE address is unreachable, the second ICE address is discarded.
  • the processor specifically includes one or more of a first save module, a first replacement module, and a first autonomous decision module, where the first save module is configured to: when the detection module detects that the second ICE address is reachable And storing an address pair of the ICE address and the second ICE address of the device itself when the processor recognizes that the processing indication is saved; the first replacement module is configured to: when the detecting module detects that the second ICE address is reachable, and When the processor recognizes that the processing indication is replacement, replacing the first ICE address with the second ICE address; the first autonomous decision module is configured to: when the detecting module detects that the second ICE address is reachable, and when the processor recognizes When the processing indication is an autonomous decision, the priority carried by the second ICE address received from the transceiver is checked; if the priority carried by the second ICE address is greater than the priority carried by the first ICE address, the first ICE address is replaced.
  • the first save module is configured to: when the detection module detects that the second ICE address is reachable And
  • the second ICE address is sent to the discarding module if the priority carried by the second ICE address is less than or equal to the priority carried by the first ICE address.
  • the discarding module is further configured to receive a discard command sent by the first auto-determination module, and discard the second ICE address.
  • the processor is further configured to: identify the processing indication, and modify the operation manner according to the identified processing indication
  • the state of the ICE proxy state machine in the browser of the second web application is such that the modified state corresponds to the processing indication; according to the state of the ICE proxy state machine, the device performs corresponding processing on the second ICE address.
  • the processor specifically includes one of a second save module, a second replacement module, and a second autonomous decision module a plurality of, wherein, the second saving module is configured to modify the state of the ICE proxy state machine to be a hold state according to the processing indication; and when the detecting module detects that the second ICE address is reachable, save the ICE address of the device itself and the first a second pair of ICE addresses; a second replacement module, configured to replace, according to the processing indication, a state of the ICE proxy state machine as a detection state; when the detecting module detects that the second ICE address is reachable, the first ICE address is replaced a second ICE address; a second autonomous decision module, configured to modify the state of the ICE proxy state machine to be an automatic state according to the processing indication; and when the state of the ICE proxy state machine is an automatic state, when the detecting module detects the second When the ICE address is reachable, check the
  • an apparatus for setting an ICE address processing indication comprising: a session module, configured to negotiate, by using an ICE address of a browser of the first terminal, with a first ICE address of a browser of the second terminal by the web application of the second terminal, And establishing a webpage real-time communication WebRTC session, wherein the web application is a web application loaded on the browser of the second terminal; the transceiver is configured to receive an address transmission message sent by the web application during the webRTC session, and the address transmission message includes a second ICE address of the browser of the second terminal; a processor, configured to determine, according to the service ID and the processing indication table of the current service, a processing instruction of the browser of the first terminal to the second ICE address received by the transceiver, and The transceiver sends a processing instruction of the browser of the first terminal to the second ICE address; the transceiver is further configured to receive a processing instruction of the browser of the first terminal sent by the processor to the second ICE address, and to the first
  • the processor is configured to obtain a service ID of the current service, where the service ID is to create a current service, when the processing indication table is specifically a service and processing indication correspondence table. And being processed by the WebRTC service server; and obtaining a processing instruction corresponding to the service ID according to the service ID and the service and processing indication correspondence table, and confirming that the processing instruction corresponding to the service ID is the processing instruction of the browser of the first terminal to the second ICE address
  • the processor is configured to obtain a service ID of the current service when the processing indication table includes a service-type correspondence relationship table and a correspondence relationship between the type and the processing indication, where the service ID is a WebRTC service server allocation when the current service is created.
  • Obtaining a type ID corresponding to the service ID according to the service ID and the service-type correspondence table, and obtaining a processing instruction corresponding to the type ID according to the type and the processing instruction correspondence table, and the processing instruction corresponding to the confirmation type ID is the first terminal.
  • the browser's processing instructions for the second ICE address is the first terminal.
  • an apparatus for processing an interactive connection establishment ICE address is configured to process an ICE address during a web page real-time communication WebRTC session, the WebRTC session being passed by the first web application and the second web application
  • the device's own ICE address is negotiated with a first ICE address of a browser running the second web application, the first web application being a web application loaded on the device, the device comprising a transceiver and a processor And a transceiver, configured to receive a state modification request sent by the first web application, where the state modification request includes, by the processor, all second ICE addresses of the browser running the second web application received during the entire WebRTC session a unified processing indication, where the second ICE address is an updated ICE address of a browser running the second web application; the transceiver is further configured to send, to the processor, the second ICE received by the processor in the WebRTC session An address processing instruction; a processor, configured to receive a processing indication sent by the transceiver, and modify a state of
  • the processor includes: a detecting module and a discarding module, where: the detecting module is configured to detect whether the second ICE address received from the transceiver is reachable; and the discarding module is configured to be used When the detecting module detects that the second ICE address is unreachable, the second ICE address is discarded.
  • the processor includes one or more of a saving module, a replacement module, and an autonomous decision module, where the saving module is configured to: when the processing indication is saved, modify the ICE proxy status.
  • the state of the machine is a hold state, and when the detection module detects that the second ICE address is reachable, and when the state of the ICE proxy state machine is the hold state, the address pair of the ICE address of the device itself and the second ICE address is saved;
  • the transceiver is further configured to: after the state of the ICE agent is successfully modified, send a state modification response including the permission update flag to the first web application, so as to facilitate the first web.
  • the application notifies the WebRTC service server of the second web application to send the second ICE address to the first web application according to the allowable update flag.
  • an apparatus for setting an indication of processing of an ICE address comprising: a session module, configured to negotiate with a web application of a first terminal by a first ICE address of a browser of a second terminal through an ICE address of a browser of the first terminal And establishing a webpage real-time communication WebRTC session, wherein the web application is a web application loaded on the browser of the second terminal; the processor is configured to determine a browser pair of the first terminal according to the service ID and the processing indication table of the current service a unified processing indication of all the second ICE addresses received during the WebRTC session; the transceiver, configured to send a status modification request to the browser of the first terminal, the status modification request including the browser of the first terminal determined by the processor a unified processing indication of a second ICE address of a browser of all second terminals received during a WebRTC session, wherein the second ICE address is an updated ICE address of the browser of the second terminal;
  • the browser of the terminal modifies the ICE proxy state machine in
  • the processor is configured to: when the processing indication table is specifically a service and a processing indication correspondence table, obtain a service ID of the current service, where the service ID is when the current service is created.
  • the network RTRT service server allocates; according to the service ID and the service and processing indication correspondence table, obtains a processing instruction corresponding to the service ID, and confirms the service ID pair.
  • the processing indication is a unified processing indication of the browser of the first terminal to all the second ICE addresses received during the WebRTC session; or the processor is further configured to process the indication table as a service and type correspondence table.
  • the transceiver is further configured to receive, by the browser of the first terminal, a state modification response that includes an allow update flag, and send the ICE to the WebRTC service server according to the permission update flag.
  • the address initiates a message so that the WebRTC service server allows the second web application to send a second ICE address to the first web application.
  • a WebRTC service server comprising a transceiver and a processor, wherein the processor is configured to respectively set corresponding processing instructions for all services supported by the WebRTC service server, and corresponding to the service ID of the service
  • the processing indication is stored in the correspondence table between the service and the processing indication.
  • the processing indication table is specifically a correspondence table between the service and the processing indication, or all the services supported by the WebRTC service server are separately classified and correspondingly set for each type.
  • the processing instruction indicates that the service ID corresponding to the service and the type ID corresponding to the service are stored in the service and type correspondence table, and the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the correspondence table of the type and the processing indication.
  • the processing indication table includes a service and type correspondence table and a correspondence table between the type and the processing indication; the transceiver is configured to send the inclusion processing to the first web application loaded on the browser of the first terminal after the WebRTC session is established.
  • the table of the indication table saves the request, and receives the first web application to send Save response.
  • the transceiver is further configured to: when the table save response includes the permission update flag, according to the permission update flag, to the second web application loaded on the browser of the second terminal Sending an allow update message to allow the second web application to send a second ICE address to the first web application; also receiving when the save response does not include an allow update flag
  • the permission update notification including the permission update flag sent by the first web application sends an permission update message to the second web application according to the permission update flag, so as to allow the second web application to send the second ICE address to the first web application.
  • the first web application can set a corresponding processing indication to the received second ICE address according to the service ID and the processing indication table of the current service, and can cause the browser of the first terminal to Processing the indication, correspondingly processing the second ICE address, so that the first web application can control the processing instruction of the browser of the first terminal to the second ICE address.
  • FIG. 1 is a schematic structural diagram of a typical WebRTC service network system
  • FIG. 1 is a flowchart of a method for processing an ICE address according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for setting an ICE address processing indication according to an embodiment of the present invention
  • FIG. 4 is a flowchart of another method for processing an ICE address according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of another method for setting an ICE address processing indication according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of another method for processing an ICE address according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of an apparatus for processing an ICE address according to an embodiment of the present invention
  • FIG. 10 is a schematic structural diagram of an apparatus for setting an ICE address processing indication according to an embodiment of the present invention
  • FIG. 11 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention
  • FIG. 12 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention
  • FIG. 13 is a schematic structural diagram of another apparatus for setting an ICE address processing indication according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of a WebRTC service server according to an embodiment of the present invention
  • FIG. 15 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention
  • a schematic structural diagram of an apparatus for setting an ICE address processing indication
  • FIG. 17 is a schematic structural diagram of another WebRTC service server according to an embodiment of the present invention.
  • the terminal 103, 106 is a device that can run a browser, and the web application can be loaded on the browser.
  • the browser is a software for accessing the Internet.
  • the web application is a service module stored on the WebRTC service server 101. When the browser accesses the WebRTC service server 101, the web application is loaded from the WebRTC service server 101 to the browser.
  • the terminals 103, 106 can be computers, smart phones, tablets (Pad), e-book readers, thin clients, and the like.
  • the WebRTC service server 101 is used for session control, addressing, and business logic processing of a web application loaded in a browser.
  • the TURN server 104 can be used to help the browser obtain an ICE address that the browser can use to communicate with other browsers and relay media streams between browsers.
  • the NAT gateway 102 is a network device for accessing an Internet (Internet) service for a browser or converting an intranet address to an external network address when communicating with a public network user. Because in the real network, the private network using the private network IP address is widely deployed due to insufficient IP address of the public network. In order to allow the computer in the private network environment to communicate with the outside world, the company will use the NAT (Network Address Translator) device. Conversion of the network address to the external network address.
  • NAT Network Address Translator
  • the above ICE address is an address that the browser can access from the various network interfaces of the terminals 103, 106 where the browser is located, with the assistance of the TURN server.
  • the ICE address contains the address, media stream id (sdpMid), and media line bow I (sdpMLinelndex) information.
  • ICE Address Address: ICE Address No. IP Address No. Transport Layer Protocol Priority IP Address Port Number Type
  • SDP media line index For example: A specific ICE address is:
  • the ICE address number in the ICE address refers to: the location of the ICE address in the ICE address information obtained by the terminal where the current browser is located, for example, the terminal where the current browser is located collects three ICE addresses, then the first The serial number of the ICE address is 1, and the serial number of the second ICE address is 2.
  • the IP address number refers to: When the terminal where the browser is located supports multiple IP addresses, the number of the IP address, for example, if the terminal supports multiple network interfaces, there are three IP addresses, then the IP address number can be 1, 2 , number 3 of 3.
  • the transport layer protocol refers to: The transport layer protocol used by the browser.
  • the transport layer protocol may have TCP, UDP or other protocols.
  • the priority can be indicated by the priority parameter of the ICE address, for example: A priority parameter of 1 indicates that the priority is the highest.
  • the browser can calculate a series of values of the ICE address according to some algorithms. The value is higher and the priority is higher. If the value is smaller, the priority is lower.
  • the type refers to: The type of the ICE address, the type includes the host type, the relay type, and the server type.
  • the SDP media stream ID refers to:
  • the ICE address corresponds to the ID of a media stream in the WebRTC session.
  • the SDP media line index refers to a media line that contains a media stream in the SDP, and an SDP media line index corresponding to the media stream line in the ICE address.
  • Each SDP media line is indexed to each media stream in the SDP so that the browser can know which media stream the ICE address is for by the SDP media line index in the ICE address.
  • a method for processing an ICE address is applied to a webpage real-time communication WebRCT session, and the WebRTC session is an ICE of the first terminal web application through the browser of the first terminal.
  • the address is established by the second web application being negotiated by the first ICE address of the browser of the second terminal, where the first web application is a web application loaded on the browser of the first terminal, and the second web application is loaded on the second terminal.
  • Web application on the browser the method specifically includes:
  • the browser of the first terminal receives the address increase candidate message sent by the first web application, where the address increase candidate message includes the second ICE address of the browser of the second terminal and the processing of the second ICE address by the browser of the first terminal.
  • the browser of the first terminal identifies the processing indication, and performs corresponding processing on the second ICE address according to the identified processing indication.
  • the browser of the first terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, saves the ICE address of the browser of the first terminal and the first Address pair of the second ICE address; when detecting that the second ICE address is unreachable, The second ICE address is discarded.
  • the browser of the first terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, replaces the first ICE address of the browser of the second terminal with the second ICE address; discards the second ICE address when it detects that the second ICE address is unreachable.
  • the browser of the first terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, checks the priority carried by the second ICE address; if the second ICE The priority carried by the address is greater than the priority carried by the first ICE address, and the first ICE address is replaced with the second ICE address; if the priority of the second ICE address is less than or equal to the priority carried by the first ICE address, The second ICE address is discarded; when it is detected that the second ICE address is unreachable, the second ICE address is discarded.
  • the foregoing detects whether the second ICE address is reachable, specifically:
  • the browser of the first terminal receives the reachable detection response returned by the browser of the second terminal within a specified time, the second ICE address is reachable; During the specified time, the browser of the first terminal does not receive the reachable detection response returned by the browser of the second terminal, and the second ICE address is unreachable.
  • the browser of the first terminal recognizes the processing indication, and performs corresponding processing on the second ICE address according to the identified processing indication, specifically: the browser of the first terminal recognizes the processing indication, according to the identified processing indication Modifying the state of the ICE proxy state machine in the browser of the first terminal, so that the modified state corresponds to the processing indication; according to the state of the ICE proxy state machine, the browser of the first terminal performs corresponding processing on the second ICE address .
  • the browser processes the second ICE address, and specifically includes: modifying, according to the processing indication, the state of the ICE proxy state machine to be in a hold state; the browser of the first terminal detecting whether the second ICE address is reachable, and detecting When the second ICE address is reachable, the address of the ICE address of the browser of the first terminal and the address of the second ICE address are saved; When the second ICE address is unreachable, the second ICE address is discarded; or, according to the processing indication, the state of the ICE proxy state machine is modified to be the detection state; the browser of the first terminal detects whether the second ICE address is reachable, and When the second ICE address is reachable, the first ICE address is replaced with the second ICE address; when the second ICE address is unreachable, the second ICE
  • the state of the ICE proxy state machine is an automatic state; when the state of the ICE proxy state machine is an automatic state, the browser of the first terminal detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, check the a priority carried by the second ICE address; if the priority carried by the second ICE address is greater than the priority carried by the first ICE address, the first ICE address is replaced with the second ICE address; if the priority of the second ICE address is carried If the priority is less than or equal to the first ICE address, the second ICE address is discarded. When the second ICE address is unreachable, the second ICE address is discarded.
  • the address increase candidate message is that the first web application receives the address transmission message sent by the second web application, and determines the browser of the first terminal to the second ICE address according to the service ID and the processing indication table of the current service. After the processing indication is sent to the browser of the first terminal, where the address transmission message includes the second ICE address of the browser of the second terminal.
  • the method further includes: before the establishment of the WebRTC session, the WebRTC service server sets corresponding processing instructions for all services supported by the WebRTC service server, and saves the service ID of the service and the corresponding processing instruction of the service in the service.
  • the processing indication correspondence table after the WebRTC session is established, the WebRTC service server sends a table save request including a processing indication table to the first web application, where the processing indication table is specifically a service and processing indication correspondence table, and receives the first web.
  • the application sends a table save response including an allow update flag, and sends an allow update message to the second web application according to the allow update flag, so as to allow the second web application to send the second ICE address to the first web application; or, the WebRTC service server will All the services supported by the WebRTC service server are classified separately, and corresponding processing instructions are set for each type, and the service ID of the service and the type ID corresponding to the service are stored in the service and type correspondence table, and the service is corresponding.
  • Processing of the type ID corresponding to the type ID indicates storage
  • the type of processing instruction correspondence table after establishing a session in WebRTC, WebRTC
  • the service server sends a table save request including a processing indication table to the first web application, where the processing indication table includes a service and type correspondence relationship table and a type and processing indication correspondence table, and receives the first web application to send a table with an allowable update flag.
  • an allow update message is sent to the second web application based on the allowable update flag to facilitate the second web application to send the second ICE address to the first web application.
  • the method further includes: when the processing indication table is specifically a service and processing indication correspondence table, the first web application obtains a service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; a web application obtains a processing instruction corresponding to the service ID according to the service ID and the correspondence table between the service and the processing indication, and confirms that the processing instruction corresponding to the service ID is a processing instruction of the browser of the first terminal to the second ICE address; or, when processing The first web application obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created, and the first web application is configured according to the service and the type correspondence table and the type and the processing indication correspondence table.
  • the business ID and the service-type correspondence relationship table obtain the type ID corresponding to the service ID, and obtain the processing instruction corresponding to the type ID according to the type and the processing instruction correspondence table, and the processing instruction corresponding to the confirmation type ID is the browser of the first terminal.
  • FIG. 3 it is a method for setting an ICE address processing indication according to an embodiment of the present invention, where the method specifically includes:
  • the first web application negotiates with the second web application through the first ICE address of the browser of the first terminal by using the ICE address of the browser of the first terminal, and establishes a WebRTC session, where the first web application is loaded.
  • a web application on a browser of the first terminal, and a second web application is a web application loaded on a browser of the second terminal;
  • the first web application receives an address transmission message sent by the second web application, where the address transmission message includes a second ICE address of the browser of the second terminal.
  • the first web application determines, according to the service ID and the processing indication table of the current service, a processing instruction of the browser of the first terminal to the second ICE address.
  • the browser that includes the second ICE address and the first terminal processes the second ICE address indication, so that the browser of the first terminal performs corresponding processing on the second ICE address according to the processing indication.
  • the processing instruction is specifically: saving, replacing, or autonomous decision making.
  • the first web application determines, according to the service ID and the processing indication table of the current service, the processing instruction of the browser of the first terminal to the second ICE address, specifically: when the processing indication table is the correspondence between the service ID and the processing indication In the relational table, the first web application obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; the first web application obtains the service according to the correspondence table between the service ID and the service ID and the processing indication.
  • the processing instruction corresponding to the ID indicates that the processing indication corresponding to the service ID is a processing instruction of the browser of the first terminal to the second ICE address; or, when the processing indication table is a correspondence table between the type table and the type and the processing indication,
  • a web application obtains a service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; the first web application obtains the type ID corresponding to the service ID according to the service ID and the type table, and processes according to the type ID and the process Corresponding relationship table of the indication, obtaining a processing instruction corresponding to the type ID, and confirming the type ID corresponding
  • the processing indication is an indication of the processing of the second ICE address by the browser of the first terminal.
  • the method further includes: before the establishment of the WebRTC session, the WebRTC service server sets corresponding processing instructions for all services supported by the WebRTC service server, and saves the service ID of the service and the corresponding processing instruction of the service in the service.
  • the processing indication correspondence table after the WebRTC session is established, the WebRTC service server sends a table save request including a processing indication table to the first web application, where the processing indication table is specifically a service and processing indication correspondence table, and receives the first web.
  • the application sends a table containing the permission update flag to save the response, and sends an allow update message to the second web application according to the permission update flag, so as to allow the second web application to send the second ICE address to the first web application; or, the WebRTC service server will All the services supported by the WebRTC service server are classified separately, and corresponding processing instructions are set for each type, and the service ID of the service and the type ID corresponding to the service are stored in the service and type correspondence table, and the service is corresponding.
  • the processing instruction corresponding to the type ID and the type ID is stored in Type and the correspondence table processing instruction, after establishing a session in WebRTC, WebRTC
  • the service server sends a table save request including a processing indication table to the first web application, where the processing indication table includes a service and type correspondence relationship table and a type and processing indication correspondence table, and receives the first web application to send a table with an allowable update flag.
  • an allow update message is sent to the second web application based on the allowable update flag to facilitate the second web application to send the second ICE address to the first web application.
  • another method for processing an ICE address includes:
  • the negotiation includes: negotiation of ICE address and negotiation of SDP parameters.
  • Web application A and Web application B can be the same kind of web application, for example: Web application A and Web application B are both WebQQ, but Web application A and Web application B have different accounts, and Web application A and Web application B are also Can be used for different kinds of web applications, such as: Web application A is WebQQ and Web application B is WeChat.
  • the embodiment of the present invention can make the following assumptions: During the WebRTC session, the ICE address of the browser B itself collected by the browser B is the second ICE address of the browser B, and is used for the web application A and The ICE address of browser B of the ongoing WebRTC session between web applications B is the first ICE address of browser B.
  • the WebRTC service server Before establishing a WebRTC session, the WebRTC service server sets corresponding processing instructions for all the services supported by the WebRTC service server, and saves the service ID and the corresponding processing instruction of the service in the correspondence table between the service and the processing indication.
  • the WebRTC service server sends a table save request including a processing indication table to the web application A, where the processing indication table is specifically a service and processing indication correspondence table, and the receiving web application A sends a table save response including the permission update flag. Sending an allow update message to the web application B according to the permission update flag, in order to allow the web application B to send the second ICE to the web application A.
  • the WebRTC service server classifies all the services supported by the WebRTC service server and sets corresponding processing instructions for each type, and stores the service ID of the service and the type ID corresponding to the service in the service and type correspondence.
  • the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the type and processing indication correspondence table.
  • the WebRTC service server sends a table save request including the processing indication table to the web application A.
  • the processing indication table includes a service and type correspondence table and a correspondence table between the type and the processing indication, and the receiving web application A sends a table saving response including the permission update flag, and sends an permission update message to the web application B according to the permission update flag, so that The web application B is allowed to send the second ICE address to the web application A.
  • the WebRTC service server can determine the processing indication corresponding to each service or the processing instruction corresponding to the type corresponding to each service according to the service requirements of each service. If the requirements of the service are uninterruptible, for example: emergency call, video call, etc., such service is set as a saved processing instruction, and if the requirement of the service does not need to be connected for a long time, it can be interrupted. For example: Weibo service, WeChat service, etc., the service is set as an alternative processing indication, and such service can also be set as a processing instruction of the autonomous decision.
  • the web application B After receiving the permission update message sent by the WebRTC service server, the web application B confirms that the new ICE address of the browser B can be sent to the web application A. Therefore, according to the business requirement or the network requirement, the browser B needs to collect the browser. B's own new ICE address.
  • Web Application B will determine and instruct Browser B to collect a new ICE address. 1), when the TURN server is overloaded or fails, the TURN server needs to be replaced for the browser B service, that is, the address of the TURN server has changed, so the WebRTC service server informs the Web application B that the address of the TURN server has changed. Web application B determines that browser B needs to be instructed to collect a new ICE address. 2), when user B manually selects to switch to a different carrier server through web application B. Since different operators maintain their own TURN servers, if user B switches the network where terminal B is located from the first carrier to the second carrier, then it will naturally serve the browser B running on terminal B.
  • a TURN server switches to the second TURN server, and the second TURN server will assign a new ICE to browser B.
  • Web application B selects different ICE addresses for different services according to the context of the current different services. For example, the operator has ten TURN servers, TURN servers 1, 2 and 3 are the servers with the largest bandwidth, and TURN server 10 is the server with the worst bandwidth. For some services with strong bandwidth requirements, such as video, TURN is required.
  • the server 1, 2 or 3 serves the service; and some services that do not require strong bandwidth, such as transmitting small data, can use the TURN server 10 to serve the service, that is, when the current service changes, the TURN server address occurs. With the change, the web application B determines that it is necessary to instruct browser B to collect the new ICE address.
  • browser B's own ICE address collected by browser B is the second ICE address of browser B, and browser B of the ongoing WebRTC session between web application A and web application B.
  • the ICE address is the first ICE address of browser B.
  • the web application B sends an address update (updatelCE) message to the browser B, and notifies the browser B to collect the second ICE address of the browser B itself, and the updatelCE message carries the new TURN server address.
  • updatelCE address update
  • the browser B receives the updatelCE message sent by the web application B, and obtains the second ICE address of the browser B itself from the new TURN server according to the address of the new TURN server carried by the updatelCE message.
  • Browser B can determine the priority of the ICE address according to the combination of ICE address type, presence and number of intermediate nodes, IP address type, security, and distance from the host.
  • the ICE address type includes: host address, TURN address, and session.
  • STUN Session Traversal Utilities for NAT
  • STUN Session Traversal Utilities for NAT
  • the priority of the media stream passing through the intermediate node will be lower than the priority of the media stream through the intermediate node, for example: Media Stream
  • the TURN server is the intermediate node.
  • IPv6 address type is higher than IPv6 address to IPv4 address (IPv6toIPv4)
  • IPv6toIPv4 type is higher than IPv4 address type
  • Security priority order Yes Virtual Private Network (VPN) is higher than the normal network
  • Gateway is away from the host
  • the order of priority is: The priority of the gateway from the host is higher than the priority of the gateway from the host.
  • the browser B can also send the updatelCE without receiving the web application B.
  • the second ICE address of browser B is directly collected, and steps 402-404 need not be performed.
  • the browser where the browser B is located is originally on the 3G network, but now the location is moved, and the new location is connected to the WIFI.
  • the terminal where the browser B is located can be used in addition to the 3G network, and the WIFI network can be used, although the 3G network Or the WIFI network may still be the same carrier network, the TURN server is unchanged, but the new WIFI network interface is added, and the TURN server will still assign an ICE address to the browser B that is more suitable for the new network interface.
  • the wireless module of the terminal B When the wireless module of the terminal B detects that the terminal B is connected to the WIFI network, the wireless module of the terminal B sends a network interface addition message to the browser B, and adds a message on the network interface to include the IP address of the WIFI interface at this time.
  • the port number the browser B sends a STUN request to the TURN server according to the IP address and the port number; the TURN server allocates a suitable ICE address to the browser according to the STUN request, and sends a STUN response to the browser B, the STUN response includes The above ICE address.
  • the browser B After collecting the second ICE address, the browser B sends an address candidate (onlCEcandidate) message to the web application B, where the onlCEcandidate message carries the second ICE address of the browser B.
  • the onlCEcandidate message is used to transfer the browser's own new ICE address from the browser to the web application.
  • the web application B After receiving the onlCEcandidate message, the web application B extracts the second ICE address of the browser B from the message.
  • the web application B can transmit a message through the address connection with the WebRTC service server and through the WebRTC service server to the web application A to send an address containing the second ICE address of the browser B.
  • the signaling connection between the above web application and the WebRTC service server can be based on
  • the signaling connection of HTTP can also be a signaling connection based on Websocket. If it is an HTTP-based signaling connection, the Web application A needs to maintain an HTTP long polling connection with the WebRTC service server, so that when the WebRTC service server needs to send the second ICE address of the browser B to the Web application A, The second ICE address of the browser B can be sent to the web application A through the HTTP response in the HTTP long polling.
  • the address transmission message may specifically be an HTTP message.
  • the WebRTC service server can maintain a long Websocket connection with the Web application A and the Web application B, and can send signaling to the Web application A or the Web application B at any time, or can receive the Web interface at any time. Applying the signaling of A or Web application B.
  • the Web application B can carry the second ICE address of the browser B in the Web Socket packet.
  • the address transmission message can be a Websocket packet and The WebRTC service server sends the Websocket message to the Web application A.
  • the web application A receives the address transmission message sent by the web application B, and obtains the second ICE address of the browser B from the address transmission message.
  • the web application A determines the processing instruction of the browser A to the second ICE address of the browser B according to the service ID and the processing indication table of the current service, and sends an address increase candidate (addlceCandidate) message to the browser A, which is carried in the addlceCandidate
  • addlceCandidate address increase candidate
  • the web application A obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; and the web application A is based on the service ID and the service and processing.
  • the web application A obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; and the web application A obtains the service ID according to the service ID and the service and type correspondence table.
  • Type ID and according to the type and processing indication correspondence table, obtain a processing instruction corresponding to the type ID, and confirm the type ID pair
  • the processing indication should be the processing indication of the second ICE address by browser A.
  • Processing instructions can be varied, such as replacement, saving, and autonomous decision making.
  • the processing indication can be expressed in two ways, which can be represented by processing parameters.
  • the processing parameter can be replace, and the replace parameter has three values. 1), Yes, the processing indication is replaced, that is, browser A needs to use the browser preferentially.
  • the second ICE address of B that is, when detecting that the second ICE address of browser B is reachable, the first ICE address of the address of browser B is replaced with the second ICE address of browser B, and the browser is detected.
  • browser A discards the second ICE address of browser B;
  • No indicates that the processing indication is save, that is, browser A preferentially saves the second ICE address of browser B.
  • the browser A when detecting that the second ICE address of the browser B is reachable, the browser A only saves the address pair of the ICE address of the browser A and the second ICE address of the browser B, and detects the browser B.
  • the processing instruction is an autonomous decision, that is, how the browser A itself decides how to use the browser B
  • Two ICE addresses It is also possible to use different processing parameters to indicate different processing indications. For example, when the processing parameter is replace, the meaning of the replace value is the same as yes, and when the processing parameter is store, the meaning of the replace value is no, and the processing is the same.
  • the argument is auto, it has the same meaning as the value of replace above.
  • the browser A After receiving the addlceCandidate message, the browser A processes the second ICE address of the browser B according to the processing instruction in the addlceCandidate message.
  • browser A When browser A receives the addlceCandidate message of web application A, browser A first determines whether there is a corresponding connection in the existing WebRTC session.
  • the ICE address contains an M-row index parameter.
  • the browser compares the M-line index with the index of all M rows in the existing SDP. If an M-line with the same M-line index of the ICE address is found, it is considered to exist.
  • the connection corresponding to the ICE address otherwise it does not exist.
  • browser A ignores the processing indication in the addlceCandidate message and detects whether the second ICE address of browser B is Reachable, if browser B's second ICE address is reachable, browser A pairs the browser B's second ICE address with browser A's own ICE address and saves it in browser A's ICE address pair list. . If browser B's second ICE address is unreachable, browser A discards the browser B's second ICE address.
  • browser A analyzes the processing instructions in the addlceCandidate message. If the processing indication is replacement, browser A detects whether the second ICE address of the browser B is reachable, and if the second ICE address of the browser B is unreachable, discarding the second ICE address of the browser B; if the browsing The second ICE address of the device B is reachable, and the browser A replaces the first ICE address of the browser B with the second ICE address of the browser B. If the processing indication is saving, browser A detects whether the second ICE address of browser B is reachable. If browser B's second ICE address is reachable, browser A then browses browser B's second ICE address and browses.
  • the A's own ICE address is paired and stored in the browser A's ICE address pair list; if browser B's second ICE address is unreachable, browser A discards the browser B's second ICE address.
  • browser A can process the second ICE address of the browser B according to the autonomous decision, for example: browser A detects whether the second ICE address of the browser B is reachable, if the browser B If the first ICE is reachable, the priority of the second ICE address of the browser B is checked; if the second ICE address of the browser B carries a priority greater than the priority carried by the first ICE address of the browser B, Then replacing the first ICE address of the browser B with the second ICE address of the browser B, otherwise discarding the second ICE address of the browser B; if the second ICE address of the browser B is unreachable, discarding the The second ICE address of browser B.
  • processing the second ICE address of the browser B according to the processing indication in the addlceCandidate message specifically: when the processing indication is saving, modifying the state of the ICE proxy state machine to be the hold state according to the processing indication;
  • the device A detects whether the second ICE address is reachable, and when detecting that the second ICE address is reachable, saves the address pair of the browser address of the browser A and the second ICE address;
  • the time is up, the second ICE address is discarded; when the processing indication is replacement, the ICE generation is modified according to the processing indication.
  • the state of the state machine is the detection state; the browser A detects whether the second ICE address is reachable, and replaces the first ICE address with the second ICE address when detecting that the second ICE address is reachable; When the ICE address is unreachable, the second ICE address is discarded; when the processing indication is an autonomous decision, the state of the ICE proxy state machine is modified to be an automatic state according to the processing instruction; the state of the ICE proxy state machine is an automatic state.
  • the browser A checks whether the second ICE address is reachable, and checks the priority carried by the second ICE address when detecting that the second ICE address is reachable; if the second ICE address carries the priority greater than the first ICE address Carrying the priority, the first ICE address is replaced with the second ICE address; if the priority carried by the second ICE address is less than or equal to the priority carried by the first ICE address, the second ICE address is discarded; When the second ICE address is unreachable, the second ICE address is discarded.
  • browser A sends a reachability detection request to browser B
  • the reachability detection request may specifically be a STUN request to detect "the ICE address of browser A: the second ICE address of browser B".
  • the STUN request includes the source address of the request to be sent and the destination address to which the request is sent, for example: the source address here is the ICE address of browser A, and the destination address is the second ICE address of browser B.
  • the reachable detection response may specifically be a STUN response, where the STUN response includes the source address of the response and the purpose of the request. Address, confirm "Browser A's ICE address: Browser B's second ICE address"
  • the address pair can be used for WebRTC session with Browser B, then the browser B's second ICE address is reachable. For example: where the source address of the STUN response is the second ICE address of browser B, and the destination address is the ICE address of browser A; if the reachable detection response returned by browser B is not received within the specified time, then the browsing The second ICE address of device B is unreachable.
  • browser B may also send a reachability detection request to browser A, and the reachability detection request may specifically be a STUN request to detect "the second ICE address of browser B: The address of the ICE address of browser A is reachable.
  • the STUN request contains the source address of the request and the destination address to which the request is sent.
  • the source address here is the second ICE address of browser B.
  • the address is the ICE address of browser A.
  • the reachable detection response may specifically be a STUN response, where the STUN response includes the source address of the response and the purpose of the request.
  • Address confirm "Browser B's second ICE address: Browser A's ICE address"
  • the address pair can be used for WebRTC session with browser A, then the browser A's ICE address is reachable.
  • the source address here is the ICE address of browser A
  • the destination address is the second ICE address of browser B. If the reachable detection response returned by browser A is not received within the specified time, the browser A The ICE address is unreachable.
  • the WebRTC service server configures a corresponding processing manner for all the services that the WebRTC service server can support according to the service requirement, so that the Web application A can be based on the service ID and the processing indication table of the current service. Setting a corresponding processing indication to the received second browser address of the browser B, and allowing the browser A to process the second ICE address of the browser B according to the processing instruction, so that the web application A can be implemented.
  • the browser A controls the processing of the second ICE address of the browser B.
  • the granularity of the web application control is small, the impact is small, and the strategy for adjusting the ICE address is flexibly adjusted according to different services.
  • FIG. 5 another method for processing an ICE address according to an embodiment of the present invention is applied to a WebRCT session, where the WebRTC session is the ICE address of the browser of the first terminal by the first Web application.
  • the WebRTC session is the ICE address of the browser of the first terminal by the first Web application.
  • the first web application is a web application loaded on the browser of the first terminal, and the second web application is loaded on the second terminal.
  • the web application on the browser specifically includes:
  • the browser of the first terminal receives a state modification request sent by the first webpage web application, where the state modification request includes a browser of the first terminal to the browser of all the second terminals received during the WebRTC session.
  • Uniform processing indication of the second ICE address wherein, the second The ICE address is the updated ICE address of the browser of the second terminal;
  • the state modification response including the permission update flag is sent to the first web application, so that the first web application notifies the WebRTC service server to allow the second web application to send the second ICE address to the first web application according to the permission update flag.
  • the browser of the first terminal receives the address increase candidate message that is sent by the first web application and includes the second ICE address during the webRTC session, where the address increase candidate message is sent by the first web application to the second web application.
  • the address transmission message containing the second ICE address is sent after the message.
  • the browser of the first terminal performs corresponding processing on the second ICE address according to the state of the ICE proxy state machine.
  • the browser of the first terminal detects whether the second ICE address is reachable, and if the second ICE address is reachable, saves the ICE address of the browser of the first terminal and The address of the second ICE address; if the second ICE address is unreachable, the second ICE address is discarded; when the state of the ICE proxy state machine is the detection state, the browser of the first terminal detects whether the second ICE address is reachable.
  • the browser of the first terminal detects whether the second ICE address is reachable, and if the second ICE address is reachable, checks the priority carried by the second ICE address; if the second ICE address carries the priority greater than the first The priority carried by the ICE address is replaced with the first ICE address as the second ICE address; if the priority carried by the second ICE address is less than or equal to the priority carried by the first ICE address, The second ICE address is discarded; if the second ICE address is unreachable, the second ICE address is discarded.
  • the detecting whether the second ICE address is reachable is specifically: sending a reachability detection request to the browser of the second terminal, if the browser of the first terminal receives the reachability of the browser returned by the second terminal within a specified time If the response is detected, the second ICE address is reachable; if the browser of the first terminal does not receive the capability detection response returned by the browser of the second terminal within the specified time, the second ICE address is unreachable.
  • the state modification request is determined by the first web application according to the service ID and the processing indication table of the current service, and the unified processing indication of the browser of the first terminal to all the second ICE addresses received during the WebRTC session is determined. After that, it is sent to the browser of the first terminal.
  • the method further includes: before the establishment of the WebRTC session, the WebRTC service server sets corresponding processing instructions for all services supported by the WebRTC service server, and saves the service ID of the service and the corresponding processing instruction of the service in the service.
  • the processing indication correspondence table after the WebRTC session is established, the WebRTC service server sends a table save request including a processing indication table to the first web application, where the processing indication table is specifically a service and processing indication correspondence table, and receives the first web.
  • the application sending table saves the response, wherein the table save response does not include the permission update flag; or the WebRTC service server separately classifies all the services supported by the WebRTC service server and sets corresponding processing instructions for each type, and the service of the service
  • the type ID corresponding to the ID is stored in the service and type correspondence table, and the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the correspondence table of the type and the processing indication.
  • a web application sends a table save request including a processing indication table, where the processing indication table includes a service and type correspondence table and a type and processing indication correspondence table, and receives a first web application sending table save response, where the table save response does not include permission Update the logo.
  • a method for setting an ICE address processing indication includes:
  • the first web application negotiates with the second web application through the first ICE address of the browser of the second terminal by using the ICE address of the browser of the first terminal, and establishes a WebRTC session.
  • the first web application is a web application loaded on a browser of the first terminal
  • the second web application is a web application loaded on a browser of the second terminal.
  • the first web application determines, according to the service ID and the processing indication table of the current service, a unified processing indication of the browser of the first terminal to all the second ICE addresses received during the WebRTC session.
  • the first web application sends a state modification request to the browser of the first terminal, where the state modification request includes the browser of the first terminal to the second ICE address of the browser of all the second terminals received during the WebRTC session.
  • a unified processing indication where the second ICE address is an updated ICE address of the browser of the second terminal; so that the browser of the first terminal modifies the ICE proxy status in the browser of the first terminal according to the unified processing indication
  • the state of the machine so that the modified state corresponds to the processing instruction;
  • the first web application further receives a state modification response that is sent by the browser of the first terminal and includes the permission update flag, and updates the flag according to the permission.
  • the first web application sends an ICE address initiation message to the WebRTC service server, so that the WebRTC service server allows the second web application to send the second ICE address to the first web application.
  • the first web application determines, according to the service ID and the processing indication table of the current service, that the unified processing indication of the browser of the first terminal to all the second ICE addresses received during the WebRTC session is:
  • the indication table is specifically the correspondence table between the service and the processing indication
  • the first web application obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; the first web application is based on the service ID and the service and processing.
  • the first web application obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created, where the processing indication table includes the service and type correspondence table and the correspondence between the type and the processing indication; Obtain the type corresponding to the service ID according to the service ID and the service and type correspondence table.
  • the method further includes: before the establishment of the WebRTC session, the WebRTC service server sets corresponding processing instructions for all services supported by the WebRTC service server, and saves the service ID of the service and the corresponding processing instruction of the service in the service.
  • the processing indication correspondence table after the WebRTC session is established, the WebRTC service server sends a table save request including a processing indication table to the first web application, where the processing indication table is specifically a service and processing indication correspondence table, and receives the first web.
  • the application sending table saves the response, wherein the table save response does not include the permission update flag; or the WebRTC service server separately classifies all the services supported by the WebRTC service server and sets corresponding processing instructions for each type, and the service
  • the service ID and the type ID corresponding to the service are stored in the service and type correspondence table, and the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the correspondence table of the type and the processing indication. After the WebRTC session is established, the WebRTC is configured.
  • the first web application sends a table save request including a processing indication table, where the processing indication table includes a service and type correspondence relationship table and a type and processing indication correspondence table, and receives a first web application sending table save response, where the table save response is not Contains the Allow Updates flag.
  • another method for processing an ICE address includes:
  • the WebRTC service server receives the table save response sent by the web application A, and sends an allow update message to the web application B according to the allowable update flag, so as to allow the web application B to send the second ICE address to the web application A, and the step
  • the other content is the same as the step 401, and the details are not described herein.
  • the WebRTC service server receives the table save response sent by the web application A and does not include the allow update flag. Further, since the current WebRTC service server has not received the allowable update flag sent by the web application A, No permission update message was sent to web application B. 702.
  • the web application A determines, according to the service ID and the processing indication table of the current service, a unified processing instruction of the browser A to the second ICE address of all browsers B received during the WebRTC session, and the browser A sends a status modification request, the status modification request is specifically an updatelCE message, and the updatelCE message includes a unified processing indication of browser A for the second ICE address of all browsers B received during the WebRTC session.
  • Processing instructions can be varied, such as replacement, saving, and autonomous decision making.
  • the processing indication can be expressed in two ways, which can be expressed by processing parameters.
  • the processing parameter can be replace, and the replace parameter has three values. 1), Yes, the processing indication is replaced, that is, browser A needs to use priority browsing.
  • the second ICE address of the device B that is, when detecting that the second ICE address of the browser B is reachable, the first ICE address of the browser B is replaced with the second ICE address of the browser B, and the browser is detected.
  • browser A discards the second ICE address of browser B;
  • No indicates that the processing indication is save, that is, browser A preferentially saves the second ICE address of browser B.
  • the browser A when detecting the reachability of the second ICE address of the browser B, the browser A only saves the address pair of the ICE address of the browser A and the second ICE address of the browser B, and detects the browser B.
  • the second ICE address is unreachable, browser A discards the second ICE address of the browser B;
  • Auto indicates that the processing indication is autonomous decision, that is, how to use browser B by browser A itself Second ICE address. It is also possible to express different processing indications by using different processing parameters. For example, when the processing parameter is replace, the meaning of the replace value is the same as yes, and when the processing parameter is store, the meaning of the replace value is no, and the processing is the same.
  • the argument is auto, it has the same meaning as the value of replace above.
  • the web application A obtains the service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; and the web application A is based on the service ID and the service and processing. Instructing the correspondence table to obtain a processing instruction corresponding to the service ID, and confirming that the processing instruction corresponding to the service ID is a unified processing instruction of the browser A to all the second ICE addresses received during the WebRTC session; or, when processing the indication table When the service-type correspondence table and the correspondence between the type and the processing indication are included, the Web application A obtains the service ID of the current service, where the service ID is the current service.
  • the Web application is assigned by the WebRTC service server; the Web application A obtains the type ID corresponding to the service ID according to the service ID and the service and type correspondence table, and obtains a processing instruction corresponding to the type ID according to the type ID and the type and the processing instruction correspondence table.
  • the processing indication corresponding to the confirmation type ID is a unified processing indication of the browser A to all the second ICE addresses received during the WebRTC session.
  • the browser A modifies the state of the ICE proxy state machine in the browser A according to the unified processing instruction in the updatelCE message.
  • Browser A modifies the state of the ICE proxy state machine in browser A according to the unified processing instructions in the updatel CE message. For example, when the processing instruction is saved, browser A changes the state of the ICE proxy state machine in browser A to the hold state (HOLD). In this state, during this WebRTC session, browser A After receiving the second ICE address of the browser B, when detecting the reachability of the second ICE address of the browser B, the browser A only saves the ICE address of the browser A and the second ICE address of the browser B. The address pair, when detecting that the second ICE address of the browser B is unreachable, the browser A discards the second ICE address of the browser B; when the processing indication is replacement, the browser A will use the ICE proxy in the browser A.
  • HOLD hold state
  • the state machine state is modified to the detection state (CHECKING).
  • CHECKING detection state
  • browser A detects the second browser address of browser B after receiving the second ICE address of browser B.
  • the first ICE address of the browser B is replaced with the second ICE address of the browser B.
  • the browser A discards the browser B.
  • browser A changes to the automatic state (AUTO) in the ICE proxy state machine state.
  • AUTO automatic state
  • browser A subsequently receives the second ICE address of browser B.
  • Browser A itself decides how to use browser B's second ICE address.
  • browser A detects whether the second ICE address of the browser B is reachable, and if the first ICE of the browser B is reachable, checks the priority carried by the second ICE address of the browser B; if the browsing The second ICE address of the device B carries a priority greater than the priority carried by the first ICE address of the browser B, and the first ICE address of the browser B is replaced with the second ICE address of the browser B, otherwise the packet is discarded.
  • the second ICE address of the browser B if the first ICE of the browser B is unreachable, the second ICE address of the browser B is discarded.
  • the browser A After modifying the state of the ICE proxy state machine, the browser A sends a status modification response to the web application A that allows the update flag.
  • the web application A receives a state modification response that allows the update flag, and sends an address start message to the WebRTC service server according to the permission update flag, and the WebRTC service server starts a message to the web application B address to allow the web application B to send the browse to the web application A.
  • the second ICE address of the B wherein the second ICE address is the updated ICE address of the browser of the second terminal.
  • the web application B receives the address initiation message sent by the WebRTC service server, confirms that the second ICE address of the browser B can be sent to the web application A, and determines that the browser B needs to collect the browser B itself according to the service requirement or the network requirement. New ICE address.
  • the web application A After receiving the address transmission message from the WebRTC service server, the web application A obtains the second ICE address of the browser B from the address transmission message; and sends an addlceCandidate message to the browser A, where the addlceCandidate message carries the browser B.
  • the second ICE address After receiving the address transmission message from the WebRTC service server, the web application A obtains the second ICE address of the browser B from the address transmission message; and sends an addlceCandidate message to the browser A, where the addlceCandidate message carries the browser B.
  • the second ICE address After receiving the address transmission message from the WebRTC service server, the web application A obtains the second ICE address of the browser B from the address transmission message; and sends an addlceCandidate message to the browser A, where the addlceCandidate message carries the browser B.
  • the second ICE address After receiving the address transmission message from the WebRTC service server, the web application A obtains the second ICE address of the browser B from the
  • the browser A receives the addlceCandidate message, obtains the second ICE address of the browser B, and determines the second browser B according to the state of the ICE proxy state machine in the current browser A saved in step 703.
  • browser A When browser A receives the addlceCandidate message of web application A, browser A first determines whether there is a corresponding connection in the existing WebRTC session.
  • the ICE address contains an M-row index parameter.
  • the browser compares the M-line index with the index of all M rows in the existing SDP. If an M-line with the same M-line index of the ICE address is found, it is considered to exist.
  • the connection corresponding to the ICE address otherwise it does not exist.
  • browser A If there is no corresponding connection in the existing WebRTC session, then browser A will The processing mode corresponding to the state of the ICE proxy state machine in the current browser A is detected, and it is detected whether the second ICE address of the browser B is reachable. If the second ICE address of the browser B is reachable, the browser A The second ICE address of browser B is paired with browser A's own ICE address and stored in browser A's list of ICE address pairs. If the second ICE address of the browser B is unreachable, the browser A discards the second ICE address of the browser B.
  • browser A analyzes the state of the current ICE proxy state machine in browser A. If the status is the detection status, the browser A detects whether the second ICE address of the browser B is reachable, and if the second ICE address of the browser B is unreachable, discarding the second ICE address of the browser B; The second ICE address of browser B is reachable, and browser A replaces the first ICE address of browser B with the second ICE address of browser B. If the processing mode is the hold state, browser A detects whether the second ICE address of browser B is reachable, and if the second ICE address of browser B is reachable, browser A then the second ICE address of browser B.
  • the browser A detects whether the second ICE address of the browser B is reachable. If the second ICE address of the browser B is reachable, the second ICE address of the browser B is checked. Priority; if the second ICE address of the browser B has a priority greater than the priority of the first ICE address of the browser B, the first ICE address of the browser B is replaced with the browser B. The second ICE address, otherwise discarding the second ICE address of the browser B; if the second ICE address of the browser B is unreachable, discarding the second ICE address of the browser B.
  • the specific process of the browser A detecting whether the second ICE address of the browser B is reachable is the same as the specific process of the browser A detecting whether the second ICE address of the browser B is reachable in step 408, and the details are not described here. .
  • the web application A determines, in the current WebRTC session, the unified processing manner of the second ICE address of all browsers B received by the browser A, and Send a status modification request to browser A.
  • the solution includes a unified processing method of the browser ACK to the second ICE address of all browsers B received during the WebRTC session, so that the web application A is uniformly set in a WebRTC session.
  • the processing method of the second ICE address of the browser B, the further web application A does not need to separately set the processing mode for the second ICE address of the browser B sent by each browser B, thereby reducing the number of the web application A to the browser B The judgment of the processing of the second ICE address.
  • FIG. 8 is a schematic structural diagram of an apparatus for processing an ICE address according to an embodiment of the present invention, configured to process an ICE address in a webpage real-time communication WebRTC session, where the WebRTC session is performed by a first webpage web application and a second webpage application Established by the ICE address of the device itself and the first ICE address of the browser running the second web application, the first web application is a web application loaded on the device, and the device includes: 81 and processor 82, wherein:
  • the transceiver 81 is configured to receive an address increase candidate message sent by the first web application, where the address increase candidate message includes a processing indication and a second ICE address of the second ICE address of the browser running the second web application by the processor;
  • the transceiver 81 is further configured to send, to the processor 82, a processing indication of the second ICE address by the processor and a second ICE address;
  • the processor 82 is configured to receive a processing instruction of the second ICE address and a second ICE address sent by the processor sent by the transceiver 81, and identify the processing indication, and perform corresponding processing on the second ICE address according to the identified processing indication. .
  • FIG. 9 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention.
  • the processor 82 specifically includes a detecting module 821 and a discarding module 822, where: the detecting module 821 is configured to detect receiving from the transceiver. Whether the second ICE address is reachable or not; the discarding module 822 is configured to discard the second ICE address when the detecting module detects that the second ICE address is unreachable.
  • the processor 82 includes one or more of a first saving module 823, a first replacement module 824, and a first autonomous decision module 825.
  • the first saving module 823 is configured to detect when the detecting module detects When the second ICE address is reachable, and when the processor recognizes that the processing indication is When saving, the address pair of the ICE address of the device processing the ICE address and the address of the second ICE address is saved;
  • the first replacement module 824 is configured to: when the detecting module 821 detects that the second ICE address is reachable, and when the processor recognizes When the processing indicates that the replacement is performed, the first ICE address of the browser running the second web application is replaced with the second ICE address;
  • the first autonomous decision module 825 is configured to: when the detecting module detects that the second ICE address is reachable And checking, when the processor recognizes that the processing indication is an autonomous decision, checking a priority carried by the second ICE address received from the transceiver; if the second ICE address carries a priority greater than
  • the processor is further configured to: identify the processing indication, modify the state of the ICE proxy state machine in the device according to the identified processing indication, and make the modified state correspond to the processing indication; according to the ICE proxy state machine
  • the state of the device itself processes the second ICE address accordingly.
  • the processor 82 specifically includes one or more of the second saving module 826, the second replacing module 827, and the second autonomous decision module 828, where the second saving module 826 is configured to save according to the processing indication.
  • the state of the ICE proxy state machine is changed to the hold state; when the detection module detects that the second ICE address is reachable, the address pair of the ICE address of the device itself and the second ICE address is saved; and the second replacement module 827 is configured to For the replacement, the state of the ICE proxy state machine is modified to be the detection state; when the detection module detects that the second ICE address is reachable, the first ICE address is replaced with the second ICE address; and the second autonomous decision module 828 is configured to process
  • the indication is an autonomous decision, and the state of the ICE proxy state machine is changed to an automatic state; when the state of the ICE proxy state machine is an automatic state, when the detecting module detects that the second ICE address is reachable, the priority of the second ICE address is checked; If the second ICE address
  • FIG. 10 is a schematic structural diagram of an apparatus for setting an indication of processing an ICE address according to an embodiment of the present invention, including: a session module 1001, configured to pass an ICE address of a browser of a first terminal and a web application of a webpage through a second terminal The first ICE address of the browser is negotiated, and a webpage real-time communication WebRTC session is established, where the web application is a web application loaded on the browser of the second terminal, and the web application is the second corresponding to the method embodiment of FIG. a web application; the transceiver 1002, configured to receive, during a WebRTC session, an address transmission message sent by the web application, where the address transmission message includes a second ICE address of the browser of the second terminal;
  • the processor 1003 is configured to determine, according to the service ID and the processing indication table of the current service, a processing instruction of the browser of the first terminal to the second ICE address received by the transceiver 1002, and send the transceiver 1002 to browse the first terminal.
  • the transceiver 1002 is further configured to receive a processing instruction of the browser of the first terminal sent by the processor to the second ICE address, and send an address increase candidate message to the browser of the first terminal, where the address increase candidate message includes the second ICE
  • the address and the browser of the first terminal process the indication of the second ICE address, so that the browser of the first terminal performs corresponding processing on the second ICE address according to the processing instruction.
  • the processor 1003 is configured to: when the processing indication table is specifically a service and processing indication correspondence table, obtain a service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created;
  • the service ID and the service and the processing instruction correspondence table obtain the processing instruction corresponding to the service ID, and confirm that the processing instruction corresponding to the service ID is a processing instruction of the browser of the first terminal to the second ICE address; or, the processor 1003, specifically
  • the service ID of the current service is obtained when the processing indication table includes a service-type correspondence table and a correspondence table between the type and the processing indication, where the service ID is allocated by the WebRTC service server when the current service is created; and according to the service ID and the service
  • the type correspondence table obtains the type ID corresponding to the service ID, and obtains a processing instruction corresponding to the type ID according to the type and the processing instruction correspondence table, and the processing instruction corresponding to the confirmation type ID is the browser of the first terminal to the second I CE Address Processing instructions.
  • FIG. 11 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention, configured to process an ICE address during a webpage real-time communication WebRTC session, where the WebRTC session is used by the first web application and the first webpage
  • the web application is established by the ICE address of the device itself and the first ICE address of the browser running the second web application.
  • the first web application is a web application loaded on the device, and the device includes: A transceiver 1101 and a processor 1102 are included,
  • the transceiver 1101 is configured to receive a state modification request sent by the first web application, where the state modifier request includes a unified processing indication of the processor to all the second ICE addresses received during the WebRTC session;
  • the transceiver 1101 is further configured to send, to the processor 1102, a unified processing indication that the processor receives all second ICE addresses that are running the second web application during the WebRTC session, where the second ICE address is An updated ICE address of the browser running the second web application; the processor 1102, configured to receive a unified processing indication sent by the transceiver 1101, and modify the state of the ICE proxy state machine according to the unified processing instruction, so that the modified The status corresponds to the processing indication.
  • the transceiver 1101 is further configured to: after the state of the ICE proxy state machine is successfully modified, send a state modification response including an allow update flag to the first web application, so that the first web application notifies the WebRTC service according to the permission update flag.
  • the server allows the second web application to send the second ICE address to the first web application.
  • the transceiver 1101 is further configured to receive an address increase candidate message that is sent by the first web application and includes a second ICE address, and send an address increase candidate message to the processor 1102.
  • the processor 1102 is configured to receive an address increase candidate message sent by the transceiver 1101, obtain a state of the ICE proxy state machine, and perform corresponding processing on the second ICE address according to the state.
  • FIG. 12 is a schematic structural diagram of another apparatus for processing an ICE address according to an embodiment of the present invention.
  • the processor 1103 includes a detection module 11021 and a discarding module 11022, where: the detecting module 11021 is configured to detect the slave transceiver 1101. Whether the received second ICE address is reachable;
  • the discarding module 11022 is configured to discard the second ICE address when the detecting module 11021 detects that the second ICE address is unreachable.
  • the processor 1102 is configured to: when the processing indication is saved, modify the state of the ICE proxy state machine to a hold state; when the processing indication is to replace, modify the state of the ICE proxy state machine to a detection state; when the processing indication is Independent decision, modify the state of the ICE agent state machine to be automatic;
  • the processor 1102 further includes a saving module 11023, configured to save, when the detecting module 11021 detects that the second ICE address is reachable, and when the state of the ICE proxy state machine is in a hold state, save the device that processes the ICE address.
  • the processor 1102 further includes a replacement module 11024, configured to: when the detection module 11021 detects that the second ICE address is reachable, when the state of the ICE proxy state machine is the detection state, the browser that runs the second web application is used. The first ICE address is replaced with the second ICE address.
  • a replacement module 11024 configured to: when the detection module 11021 detects that the second ICE address is reachable, when the state of the ICE proxy state machine is the detection state, the browser that runs the second web application is used. The first ICE address is replaced with the second ICE address.
  • the processor 1102 further includes an autonomous decision module 11025, configured to: when the detecting module 11021 detects that the second ICE address is reachable, and when the state of the ICE proxy state machine is an automatic state, check that the second ICE address is carried. Priority, if the second ICE address carries a priority greater than the priority carried by the first ICE address, the first ICE address is replaced with the second ICE address; if the second ICE address carries a priority less than or equal to the first Sending a discard command to the discarding module 11022, where the priority is carried by the ICE address;
  • an autonomous decision module 11025 configured to: when the detecting module 11021 detects that the second ICE address is reachable, and when the state of the ICE proxy state machine is an automatic state, check that the second ICE address is carried. Priority, if the second ICE address carries a priority greater than the priority carried by the first ICE address, the first ICE address is replaced with the second ICE address; if the second ICE address carries a
  • the discarding module 11022 is further configured to receive a discard command and discard the second ICE address.
  • FIG. 13 is a schematic structural diagram of another apparatus for setting an indication of processing an ICE address according to an embodiment of the present invention, where the method further includes: a session module 1301, configured to pass the ICE address of the browser of the first terminal and the second-party web application through the second The first ICE address of the browser of the terminal is negotiated, and a WebRTC session is established, where the web application is a web application loaded on the browser of the second terminal, where the web application corresponds to the second web application of the embodiment of FIG. 6;
  • a session module 1301 configured to pass the ICE address of the browser of the first terminal and the second-party web application through the second The first ICE address of the browser of the terminal is negotiated, and a WebRTC session is established, where the web application is a web application loaded on the browser of the second terminal, where the web application corresponds to the second web application of the embodiment of FIG. 6;
  • the processor 1302 is configured to determine, according to the service ID and the processing indication table of the current service, a uniformity of the browsers of the first terminal to all the second ICE addresses received during the WebRTC session. Processing instructions.
  • the transceiver 1303 is configured to send a state modification request to the browser of the first terminal, where the state modification request includes the browser of the first terminal determined by the processor 1302 to the browser of all the second terminals received during the WebRTC session.
  • a unified processing indication of the second ICE address wherein the second ICE address is an updated ICE address of the browser of the second terminal; so that the browser of the first terminal modifies the browsing of the first terminal according to the unified processing indication
  • the state of the ICE proxy state machine in the device, so that the modified state corresponds to the processing indication.
  • the transceiver 1303 is further configured to receive a status modification response that is sent by a browser of the first terminal and that includes an allowable update flag, and send an address start message to the WebRTC service server according to the allowable update flag, so that the WebRTC service server allows the second web application. Send a second ICE address to the first web application.
  • the processor 1302 is configured to: when the processing indication table is specifically a service and processing indication correspondence table, obtain a service ID of the current service, where the service ID is allocated by the WebRTC service server when the current service is created; Corresponding to the service and processing indication correspondence table, obtaining a processing instruction corresponding to the service ID, and confirming that the processing instruction corresponding to the service ID is a unified processing instruction of the browser of the first terminal to all the second ICE addresses received during the WebRTC session Or the processor 1302 is further configured to: when the processing indication table is a service-type correspondence relationship table and a type and processing indication correspondence table, obtain a service ID of the current service, where the service ID is a WebRTC service server when the current service is created.
  • the type ID corresponding to the service ID is obtained, and according to the correspondence table between the type ID and the processing indication, the processing instruction corresponding to the type ID is obtained, and the processing indication corresponding to the confirmation type ID is the first terminal.
  • Browser to all second ICEs received during the WebRTC session A uniform processing indication of the address.
  • a WebRTC service server including a transceiver and a processor, where the processor 1401 is configured to set corresponding processing instructions for all services supported by the WebRTC service server, and the service is The processing instruction corresponding to the service ID and the service is stored in the correspondence table between the service and the processing indication.
  • the processing indication table is specifically a service and processing indication pair. Should be related to the table, or classify all the services supported by the WebRTC service server, and set corresponding processing instructions for each type, and store the service ID of the service and the type ID corresponding to the service in the service and type correspondence table.
  • the processing instruction corresponding to the type ID and the type ID corresponding to the service is stored in the type and processing indication correspondence table.
  • the processing indication table includes a service and type correspondence table and a type and processing indication correspondence table.
  • the transceiver 1402 And after the WebRTC session is established, sending a table save request including a processing indication table to the first web application loaded on the browser of the first terminal, and receiving the first web application sending table save response.
  • the transceiver 1402 is further configured to: when the table save response includes the allow update flag, send an allow update message to the second web application loaded on the browser of the second terminal according to the allow update flag, so as to allow the first
  • the second web application sends a second ICE address to the first web application; when the save response does not include the allow update flag, the first web application further receives an allow update notification that includes the allow update flag, according to the allowable update flag, to the second web.
  • the application sends an allow update message to facilitate the second web application to send the second ICE address to the first web application.
  • the apparatus for processing an ICE address in an embodiment of the present invention may be implemented based on a computer system, and the methods illustrated in FIGS. 2, 4-5, and 7 may all be implemented in a device based on a computer system that processes an ICE address.
  • Figure 15 illustrates an embodiment of an apparatus for processing an ICE address implemented based on a computer system.
  • the apparatus for processing an ICE address in this embodiment may include: a processor 1501, a memory 1502, and a communication interface 1503.
  • the memory 1502 is for storing program code.
  • the processor 1501 is configured to execute program code stored in the memory 1502.
  • the memory 1502 stores the first program code
  • the processor 1501 is configured to execute the first program code, and the following operations are performed: during the WebRCT session, the WebRTC session is first by the first web application.
  • the ICE address of the browser of the terminal is established by the second web application being negotiated by the first ICE address of the browser of the second terminal.
  • the first web application is a web application loaded on the browser of the first terminal, and the second web application is used.
  • the web application loaded on the browser of the second terminal, and the browser of the first terminal receives the address increase candidate message sent by the first web application, where the address increase candidate message includes the second ICE address of the browser of the second terminal and The browser of the first terminal instructs processing of the second ICE address; the browser of the first terminal recognizes the processing indication, according to the identified processing indication The second ICE address is processed accordingly.
  • the memory 1502 stores the second program code
  • the processor 1501 is configured to execute the second program code, including performing the following operations: during the WebRCT session, the WebRTC session is passed by the first web application.
  • the ICE address of the browser of the first terminal is established by the second web application being negotiated by the first ICE address of the browser of the second terminal.
  • the first web application is a web application loaded on the browser of the first terminal
  • the second The web application is a web application loaded on the browser of the second terminal
  • the browser of the first terminal receives the state modification request sent by the first web application, and the state modification request includes the browser pair of the first terminal during the webRTC session a unified processing indication of all the received second ICE addresses; modifying the state of the ICE proxy state machine in the browser of the first terminal according to the unified processing instruction, so that the modified state corresponds to the processing indication;
  • the browser sends a status modification response containing the permission update flag to the first web application, so that the first web application updates the flag according to the permission Notifying the WebRTC service server to allow the second web application to send the second ICE address to the first web application; during the webRTC session, the browser of the first terminal receives the address increase candidate message including the second ICE address sent by the first web application,
  • the address increase candidate message is sent by the first web application after receiving the address transmission message that is sent by the second web application
  • the address is processed accordingly.
  • the communication interface 1403 is configured to communicate with an external device, such as a web application. Messages that interact between the device processing the ICE address and the web application (as shown in FIG. 2, FIG. 4-5, and FIG. 7 of the method embodiment) are both transmitted and received through the communication interface 1503.
  • the processor 1501 processes the message received by the communication interface 1503 according to the program code in the memory 1502, and interacts with the external device through the communication interface 1503.
  • the processor 1501 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like.
  • the device for processing the ICE address in this embodiment may include a bus 1504.
  • the processor 1501, the memory 1502, and the communication interface 1503 can be connected and communicated via the bus 1504.
  • the memory 1502 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function. Calling up and down in the embodiment of the present invention The text can be cached in RAM
  • the apparatus for setting the processing indication of the ICE address in the embodiment of the present invention may be implemented based on a computer system, and the methods shown in FIGS. 3-4 and 6-7 may be implemented in an apparatus for processing an address based on an ICE of a computer system.
  • Figure 16 illustrates an embodiment of an apparatus for processing an ICE address implemented based on a computer system.
  • the apparatus for processing an ICE address in this embodiment may include: a processor 1601, a memory 1602, and a communication interface 1603.
  • the memory 1602 is for storing program code.
  • the processor 1601 is configured to execute program code stored in the memory 1602.
  • the memory 1602 stores a first program code
  • the processor 1601 is configured to execute the first program code, including: performing an operation of: the first web application passes the ICE address of the browser of the first terminal, and the second The web application negotiates with the first ICE address of the browser of the first terminal, and establishes a webpage real-time communication WebRTC session, where the first web application is a web application loaded on the browser of the first terminal, and the second web application is loaded.
  • the first web application receives the address transmission message sent by the second web application, and the address transmission message includes the second ICE address of the browser of the second terminal; Determining, by the web application, a processing instruction of the browser of the first terminal to the second ICE address according to the service ID and the processing indication table of the current service; sending an address increase candidate message to the browser of the first terminal, where the address increase candidate message includes the second The ICE address and the browser of the first terminal process the indication to the second ICE address, so that the browser of the first terminal according to the processing instruction The second ICE address is processed accordingly.
  • the memory 1602 stores a second program code
  • the processor 1601 is configured to execute the second program code, including: performing the following operations: the first webpage web application passes through the browser of the first terminal
  • the ICE address negotiates with the second web application through the first ICE address of the browser of the second terminal, and establishes a webpage real-time communication WebRTC session, where the first web application is a web application loaded on the browser of the first terminal, The web application is a web application loaded on the browser of the second terminal;
  • the first web application determines, according to the service ID and the processing indication table of the current service, all the seconds received by the browser of the first terminal during the webRTC session a unified processing indication of the ICE address;
  • the first web application sends a state modification request to the browser of the first terminal, and the state modification request includes the browser pair of the first terminal in the WebRTC session a unified processing indication of all the second ICE addresses received during the period, so that the browser of the first terminal modifies the state of the ICE proxy state
  • the communication interface 1603 is configured to communicate with an external device, such as a browser. Messages that interact between the device processing the ICE address and the browser (as shown in Figures 3-4 and 6-7 of the method embodiment) are both transmitted and received via communication interface 1603.
  • the processor 1601 processes the message received by the communication interface 1603 according to the program code in the memory 1602, and interacts with the external device through the communication interface 1603.
  • the processor 1601 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like.
  • the device for processing the ICE address in this embodiment may include a bus 1604.
  • the processor 1601, the memory 1602, and the communication interface 1603 can be connected and communicated via the bus 1604.
  • the memory 1602 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function.
  • the call context in the embodiment of the present invention can be cached in the RAM.
  • the WebRTC service server in the embodiment of the present invention can be implemented based on a computer system, and the methods shown in FIG. 2-7 can be implemented in an apparatus for processing an address based on an ICE of a computer system.
  • Figure 17 illustrates an embodiment of a WebRTC service server implemented based on a computer system.
  • the WebRTC service server in this embodiment may include: a processor 1701, a memory 1702, and a communication interface 1703.
  • the memory 1702 is for storing program code.
  • the processor 1701 is configured to execute program code stored in the memory 1702.
  • the memory 1702 stores a first program code
  • the processor 1701 is configured to execute the first program code, and the following operations are performed: setting corresponding processing instructions for all services supported by the WebRTC service server, And storing the service ID of the service and the corresponding processing instruction of the service in the correspondence table between the service and the processing indication, where the processing indication table is specifically a correspondence table between the service and the processing indication, or the WebRTC service is used. All the services supported by the server are classified separately, and corresponding processing instructions are set for each type, and the service ID of the service and the type ID corresponding to the service are stored in the service and type correspondence table, and the type ID corresponding to the service is set.
  • the processing indication corresponding to the type ID is stored in the type and processing indication correspondence table.
  • the processing indication table includes a service and type correspondence relationship table and a type and processing indication correspondence table; after the WebRTC session is established, loading to the first terminal
  • the first web application on the browser sends a table save request containing a processing indication table, and receives a first web application send table save response.
  • the communication interface 1703 is configured to communicate with an external device, such as a browser. Messages that interact between the device processing the ICE address and the browser (as shown in Figure 2-7 of the method embodiment) are both transmitted and received via communication interface 1703.
  • the processor 1701 processes the message received by the communication interface 1703 according to the program code in the memory 1702, and interacts with the external device through the communication interface 1703.
  • the processor 1701 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or the like.
  • the device for processing the ICE address in this embodiment may include a bus 1704.
  • the processor 1701, the memory 1702, and the communication interface 1703 can be connected and communicated via the bus 1704.
  • the memory 1702 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function.
  • RAM random access memory
  • ROM read-only memory
  • the call context in embodiments of the present invention can be cached in RAM.
  • the video encoding and decoding method implemented in the above embodiments can be implemented by hardware related to program instructions, and the program can be stored in a readable storage medium, and the program executes the above when executed.
  • the corresponding step in the method may be, for example, a ROM/RAM, a magnetic disk, an optical disk, or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种处理交互式连接建立(ICE)地址的方法和装置,应用于网页实时通信(WebRTC)会话过程中。WebRTC会话是由第一万维网(Web)应用通过第一终端的浏览器的ICE地址与第二Web应用通过第二终端的浏览器的第一ICE地址协商建立的。第一Web应用为加载在第一终端的浏览器上的Web应用,第二Web应用为加载在第二终端的浏览器上的Web应用。所述方法包括:第一终端的浏览器接收第一Web应用发送的地址增加候选消息,地址增加候选消息包含第二终端的浏览器的第二ICE地址和第一终端的浏览器对第二ICE地址的处理指示(201);第一终端的浏览器识别出处理指示,根据识别出的处理指示对第二ICE地址进行相应处理(202)。

Description

设置、 处理交互式连接建立 ICE地址的方法、 装置和服务器
技术领域 本发明涉及 WebRTC技术, 尤其涉及一种处理交互式连接建立 ICE地 址的方法和装置及设置 ICE地址处理指示的方法、 装置和服务器。
背景技术 网页实时通信 (Web Real-Time Communication, WebRTC)是一项在浏览 器内部进行实时视频和音频通信的技术, 该技术主要利用超文本标记语言 ( HyperTextMark-upLanguage 5 , HTML5 )十办议和 JavaScript(JS)语言, 在不 使用插件的情况下实现浏览器之间的通信。 要实现 WebRTC会话, 就需要 在会话建立过程中协商浏览器各自的媒体信息 (包括媒体发送 /接收地址、 媒体传送使用的编解码方式、协议等), 目前 WebRTC项目中使用会话描述 协议 (Session Description Protocol, SDP)作为媒体信息描述的协议。在会话建 立过程中, 利用 SDP的 OFFER/ANSWER机制进行媒体信息的协商。
在现有技术中, 用户 A通过使用 Web应用 A时, Web应用 A将加载 在终端 A的浏览器上, 用户 B准备使用 Web应用 B时, Web应用 B将加 载在终端 B的浏览器上, Web应用 A和 Web应用 B进行协商, 以建立 WebRTC会话, 协商的内容包括: 交互式连接建立( Interactive Connectivity Establishment, ICE ) 地址和 SDP参数。
然而, 在某些的场景下, 在 WebRTC会话建立成功后, 终端 B的浏览 器可能会收集到新 ICE地址。 当终端 B的浏览器收集到新 ICE地址之后, Web应用 B—定会先将携带有终端 B的浏览器的新 ICE地址的 HTTP消息 发送给 WebRTC业务服务器, 然后由 WebRTC业务服务器再将携带有终端 B的浏览器的新 ICE地址的 HTTP消息发送给 Web应用 A。 Web应用 A 可以通过候选地址增加 ( addlceCandidate ) 消息将该终端 B 的浏览器的新 ICE地址发送给终端 A的浏览器。 对于终端 A的浏览器如何使用该终端 B 的浏览器的新 ICE地址, 都是由终端 A的浏览器内部决策的, Web应用 A 是不能参与决策终端 B的浏览器的新 ICE地址的使用的。 比如终端 A的浏 览器收到终端 B的浏览器的新 ICE地址后, 如果检测到终端 B的浏览器的 新 ICE地址可用, 不管现在终端 A的浏览器正在进行什么业务或者在什么 样的网络上, 均将该终端 B的浏览器的新 ICE地址丢弃; 或者, 终端 A的 浏览器会则将 Web应用 A与 Web应用 B之间的正在进行 WebRTC会话的 终端 B的浏览器的 ICE地址替换为终端 B的浏览器的新 ICE地址。
但是, 在很多业务场景下, 业务是不希望中断或者希望中断时, 也就 是说业务不希望采用终端 B的浏览器的新 ICE地址或者希望采用终端 B的 浏览器的新 ICE地址; 但是终端 A的浏览器无法根据业务的需求来决策是 否使用终端 B的浏览器的新 ICE地址。 比如: 如果终端 B的浏览器正通过 WebRTC业务服务器进行紧急呼叫, 虽然收到了终端 B的浏览器的新 ICE 地址, 但是由于是紧急呼叫, 该业务是不能中断, 但是终端 A的浏览器并 不知道业务不能中断, 终端 A的浏览器可能会将 Web应用 A与 Web应用 B之间的正在进行 WebRTC会话的终端 B的浏览器的 ICE地址替换为终端 B的浏览器的新 ICE地址, 这就导致了业务的中断了。 或者在一些网络场 景下, 必须要采用终端 B的浏览器的新 ICE地址, 但是终端 A的浏览器无 法根据网络的需求来决策是否使用终端 B的浏览器的新 ICE地址。 比如: 为终端 B 的浏览器提供服务的老的使用中继的网络地址转换 (Network Address Translator, NAT ) 穿越( Traversal Using Relay NAT, TURN )服务 器由于超负荷或者故障等原因, 需要维护, WebRTC 业务服务器必须采用 新的 TURN服务器, 也就是说终端 B的浏览器的 ICE地址发生了改变, 并 且需要用该终端 B的浏览器的新 ICE地址来与终端 A的浏览器进行通信, 但是终端 A的浏览器并不知道需要将 Web应用 A与 Web应用 B之间的当 前正在进行 WebRTC会话的终端 B的浏览器的 ICE地址替换为终端 B的浏 览器的新 ICE地址,终端 A的浏览器可能只是保存终端 B的浏览器的新 ICE 地址或丢弃终端 B的浏览器的新 ICE地址, 这样就无法满足业务的需求, 以及对业务会产生较大的影响。
发明内容 有鉴于此, 为解决上述处理 Web应用无法控制浏览器如何使用对端新 的 ICE地址的问题。 本发本发明实施方式采用如下技术方案:
第一方面, 处理 ICE地址的方法, 应用于网页实时通信 WebRCT会话 过程中, WebRTC会话是由第一万维网 Web应用通过第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第一 ICE地址协商建立 的, 第一 Web应用为加载在第一终端的浏览器上的 Web应用, 第二 Web 应用为加载在第二终端的浏览器上的 Web应用, 方法包括: 第一终端的浏 览器接收第一 Web应用发送的地址增加候选消息, 地址增加候选消息包含 第二终端的浏览器的第二 ICE地址和第一终端的浏览器对第二 ICE地址的 处理指示; 第一终端的浏览器识别出处理指示, 根据识别出的处理指示对 第二 ICE地址进行相应处理。
在第一方面的第一种可能的实现方式中, 第一终端的浏览器识别出处 理指示, 根据识别出的处理指示对第二 ICE地址进行相应处理, 包括: 第 一终端的浏览器识别出处理指示为保存时, 检测第二 ICE地址是否可达, 并且在检测出第二 ICE地址可达时, 保存第一终端的浏览器的 ICE地址和 第二 ICE地址的地址对;在检测出第二 ICE地址不可达时,则丢弃第二 ICE 地址; 或者, 第一终端的浏览器识别出处理指示为替换时, 检测第二 ICE 地址是否可达, 并且在检测出第二 ICE地址可达时, 将第一 ICE地址替换 为第二 ICE地址;在检测出第二 ICE地址不可达时,则丢弃第二 ICE地址; 或者, 第一终端的浏览器识别出处理指示为自主决策时, 检测第二 ICE地 址是否可达, 并且在检测出第二 ICE地址可达时, 检查第二 ICE地址携带 携带的优先级; 如果第二 ICE地址携带携带的优先级高于第一 ICE地址携 带的优先级, 则将第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址 携带的优先级低于或等于第一 ICE地址携带的优先级, 则丢弃第二 ICE地 址; 在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址。
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中, 检测第二 ICE地址是否可达, 具体为: 向第二终端的浏览器发送可达检测 请求, 如果在规定时间内, 第一终端的浏览器接收到第二终端的浏览器返 回的可达检测响应, 则第二 ICE地址是可达; 如果在规定时间内, 第一终 端的浏览器没有接收到第二终端的浏览器返回的可达检测响应,则第二 ICE 地址是不可达的。
在第一方面的第三种可能的实现方式中, 第一终端的浏览器识别出处 理指示,根据识别出的处理指示对第二 ICE地址进行相应处理,具体包括: 第一终端的浏览器识别出处理指示, 根据识别出的处理指示, 修改第一终 端的浏览器中的 ICE代理状态机的状态, 使修改后的状态与处理指示相对 应; 根据 ICE代理状态机的状态, 第一终端的浏览器对第二 ICE地址进行 相应处理。
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中, 根据识别出的处理指示, 修改第一终端的浏览器中的 ICE代理状态机的状 态, 使修改后的状态与处理指示相对应; 根据 ICE代理状态机的状态, 第 一终端的浏览器对第二 ICE地址进行相应处理, 具体包括: 根据处理指示 为保存, 修改 ICE代理状态机的状态为保持状态; 第一终端的浏览器检测 第二 ICE地址是否可达, 并且在检测出第二 ICE地址可达时, 保存第一终 端的浏览器的 ICE地址和第二 ICE地址的地址对; 在检测出第二 ICE地址 不可达时, 则丢弃第二 ICE地址; 或者, 根据处理指示为替换, 修改 ICE 代理状态机的状态为检测状态; 第一终端的浏览器检测第二 ICE地址是否 可达,并且在检测出第二 ICE地址可达时,将第一 ICE地址替换为第二 ICE 地址; 在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址; 或者, 根 据处理指示为自主决策, 修改 ICE代理状态机的状态为自动状态; ICE代 理状态机的状态为自动状态时, 第一终端的浏览器检测第二 ICE地址是否 可达, 并且在检测出第二 ICE地址可达时, 检查第二 ICE地址携带的优先 级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携带的优先级, 则 将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先级 小于或等于第一 ICE地址携带的优先级, 则丢弃第二 ICE地址; 在检测出 第二 ICE地址不可达时, 则丢弃第二 ICE地址。
在第一方面的第五种可能的实现方式中, 地址增加候选消息是由第一 Web应用在接收第二 Web应用发送的地址传输消息, 以及根据当前业务的 业务 ID和处理指示表,确定第一终端的浏览器对第二 ICE地址的处理指示 之后, 向第一终端的浏览器发送的, 其中, 地址传输消息包含第二终端的 浏览器的第二 ICE地址。
结合第一方面的第五种可能的实现方式中, 在第一方面的第六种可能 的实现方式中,在 WebRTC会话建立之前, WebRTC业务服务器将 WebRTC 业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用发送包含处 理指示表的表保存请求, 其中处理指示表具体为业务与处理指示对应关系 表, 接收第一 Web应用发送包含允许更新标志的表保存响应, 根据允许更 新标志, 向第二 Web应用发送允许更新消息, 以便于允许第二 Web应用向 第一 Web应用发送第二 ICE地址; 或者, WebRTC业务服务器将 WebRTC 业务服务器所支持的所有业务分别进行分类以及为每种类型设定相应的处 理指示, 并将业务的业务 ID与业务对应的类型 ID存储在业务与类型对应 关系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示存储在类型 与处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务 器向第一 Web应用发送包含处理指示表的表保存请求, 其中处理指示表包 含业务与类型对应关系表和类型与处理指示对应关系表, 接收第一 Web应 用发送含允许更新标志的表保存响应, 根据允许更新标志, 向第二 Web应 用发送允许更新消息,以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址。
结合第一方面的第六种可能的实现方式中, 在第一方面的第七种可能 的实现方式中, 当处理指示表具体为业务与处理指示对应关系表时, 第一 Web应用获取当前业务的业务 ID,其中,业务 ID为创建当前业务时 WebRTC 业务服务器分配的; 第一 Web应用根据业务 ID和业务与处理指示对应关 系表, 获得业务 ID对应的处理指示, 确认业务 ID对应的处理指示为第一 终端的浏览器对第二 ICE地址的处理指示; 或者, 当处理指示表包含业务 与类型对应关系表和类型与处理指示对应关系表时, 第一 Web应用获取当 前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器 分配的; 第一 Web应用根据业务 ID和业务与类型对应关系表, 获得业务 ID对应的类型 ID, 并根据类型与处理指示对应关系表, 获得类型 ID对应 的处理指示, 确认类型 ID对应的处理指示为第一终端的浏览器对第二 ICE 地址的处理指示。
第二方面, 设置 ICE地址处理指示的方法, 包括: 第一万维网 Web应 用通过第一终端的浏览器的 ICE地址与第二 Web应用通过第一终端的浏览 器的第一 ICE地址进行协商, 并建立网页实时通信 WebRTC会话, 其中, 第一 Web应用为加载在第一终端的浏览器上 Web应用, 第二 Web应用为 加载在第二终端的浏览器上 Web应用; 在 WebRTC会话过程中, 第一 Web 应用接收第二 Web应用发送的地址传输消息, 地址传输消息包含了第二终 端的浏览器的第二 ICE地址; 第一 Web应用根据当前业务的业务 ID和处 理指示表, 确定第一终端的浏览器对第二 ICE地址的处理指示; 向第一终 端的浏览器发送地址增加候选消息, 地址增加候选消息包含第二 ICE地址 和第一终端的浏览器对第二 ICE地址处理指示, 以便于第一终端的浏览器 根据处理指示对第二 ICE地址进行相应处理。
在第二方面的第一种可能的实现方式中, 第一 Web应用根据当前业务 的业务 ID和处理指示表,确定第一终端的浏览器对第二 ICE地址的处理指 示, 具体为: 当处理指示表为业务 ID 与处理指示的对应关系表时, 第一 Web应用获取当前业务的业务 ID,其中,业务 ID为创建当前业务时 WebRTC 业务服务器分配的; 第一 Web应用根据业务 ID和业务 ID与处理指示的对 应关系表, 获得业务 ID对应的处理指示, 确认业务 ID对应的处理指示为 第一终端的浏览器对第二 ICE地址的处理指示; 或者, 当处理指示表为类 型表和类型与处理指示的对应关系表时, 第一 Web应用获取当前业务的业 务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 第 一 Web应用根据业务 ID和类型表, 获得业务 ID对应的类型 ID, 并根据类 型 ID与处理指示的对应关系表, 获得类型 ID对应的处理指示, 确认类型 ID对应的处理指示为第一终端的浏览器对第二 ICE地址的处理指示。
结合第二方面的第一种可能的实现方式, 在第二方面的第二种可能的 实现方式中, 在 WebRTC会话建立之前, WebRTC业务服务器将 WebRTC 业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用发送包含处 理指示表的表保存请求, 其中处理指示表具体为业务与处理指示对应关系 表, 接收第一 Web应用发送含允许更新标志的表保存响应, 根据允许更新 标志, 向第二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第 一 Web应用发送第二 ICE地址; 或者, WebRTC业务服务器将 WebRTC业 务服务器所支持的所有业务分别进行分类以及为每种类型设定相应的处理 指示, 并将业务的业务 ID与业务对应的类型 ID存储在业务与类型对应关 系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示存储在类型与 处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器 向第一 Web应用发送包含处理指示表的表保存请求, 其中处理指示表包含 业务与类型对应关系表和类型与处理指示对应关系表, 接收第一 Web应用 发送含允许更新标志的表保存响应, 根据允许更新标志, 向第二 Web应用 发送允许更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址。
在第三方面, 一种处理 ICE地址的方法, 其特征在于, 应用于网页实 时通信 WebRCT会话过程中, WebRTC会话是由第一万维网 Web应用通过 第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第 一 ICE地址协商建立的, 第一 Web应用为加载在第一终端的浏览器上的 Web应用, 第二 Web应用为加载在第二终端的浏览器上的 Web应用, 方法 包括: 第一终端的浏览器接收第一 Web应用发送的状态修改请求, 状态修 改请求包含第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 终端的浏览器的第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为 第二终端的浏览器的更新的 ICE地址;; 根据统一的处理指示, 修改第一终 端的浏览器中的 ICE代理状态机的状态, 使修改后的状态与处理指示相对 应; 在 WebRTC会话期间内, 第一终端的浏览器接收第一 Web应用发送的 包含第二 ICE 地址的地址增加候选消息, 其中地址增加候选消息由第一 Web应用在接收到第二 Web应用发送的包含第二 ICE地址的地址传输消息 之后发送的; 根据 ICE代理状态机的状态, 第一终端的浏览器对第二 ICE 地址进行相应处理。
在第三方面的第一种可能的实现方式中, 根据处理指示, 修改 ICE代 理状态机的状态, 使修改后的状态与处理指示相对应, 具体包括: 处理指 示具体为保存时, 根据处理指示为保存, 修改 ICE代理状态机的状态为保 持状态; 相应的, 根据 ICE代理状态机的状态, 第一终端的浏览器对第二 ICE地址进行相应处理, 具体包括: ICE代理状态机的状态为保持状态时, 第一终端的浏览器检测第二 ICE地址是否可达, 并且在检测出第二 ICE地 址可达时, 保存第一终端的浏览器的 ICE地址和第二 ICE地址的地址对; 在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址; 或者, 根据处理 指示, 修改 ICE代理状态机的状态, 使修改后的状态与处理指示相对应, 具体包括: 处理指示具体为替换时, 根据处理指示为替换, 修改 ICE代理 状态机的状态为检测状态; 相应的, 根据 ICE代理状态机的状态, 第一终 端的浏览器对第二 ICE地址进行相应处理, 具体包括: ICE代理状态机的 状态为检测状态时, 第一终端的浏览器检测第二 ICE地址是否可达, 并且 在检测出第二 ICE地址可达时, 将第一 ICE地址替换为第二 ICE地址; 在 检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址; 或者, 根据处理指 示, 修改 ICE代理状态机的状态, 使修改后的状态与处理指示相对应, 具 体包括: 述处理指示具体为自主决策, 根据处理指示为自主决策, 修改 ICE 代理状态机的状态为自动状态; 相应地, 根据 ICE代理状态机的状态, 第 一终端的浏览器对第二 ICE地址进行相应处理, 具体包括: ICE代理状态 机的状态为自动状态时, 第一终端的浏览器检测第二 ICE地址是否可达, 并且在检测出第二 ICE地址可达时, 检查第二 ICE地址携带的优先级; 如 果第二 ICE地址携带的优先级大于第一 ICE地址携带的优先级, 则将与第 一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先级小于或 等于第一 ICE地址携带的优先级,则丢弃第二 ICE地址;在检测出第二 ICE 地址不可达时, 则丢弃第二 ICE地址。
结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中, 检测第二 ICE地址是否可达, 具体为: 向第二终端的浏览器发送可达检测 请求, 如果在规定时间内, 第一终端的浏览器接收到第二终端的浏览器返 回的可达检测响应, 则第二 ICE地址是可达的; 如果在规定时间内, 第一 终端的浏览器没有接收到第二终端的浏览器返回的可达检测响应, 则第二 ICE地址是不可达的。
在第三方面的第三种可能的实现方式中, 状态修改请求是由第一 Web 应用根据当前业务的业务 ID 和处理指示表, 确定第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理指示之后, 向第一终端的浏览器发送的。
结合第三方面的第三种可能的实现方式, 在第四种可能的实现方式, 还包括: 在 WebRTC会话建立之前, WebRTC业务服务器将 WebRTC业务 服务器所支持的所有业务分别设定相应的处理指示,并将业务的业务 ID与 业务相应的处理指示保存在业务与处理指示对应关系表中, 在 WebRTC会 话建立之后, WebRTC业务服务器向第一 Web应用发送包含处理指示表的 表保存请求, 其中处理指示表具体为业务与处理指示对应关系表, 接收第 一 Web应用发送表保存响应,其中表保存响应不包含允许更新标志;或者, WebRTC业务服务器将 WebRTC业务服务器所支持的所有业务分别进行分 类以及为每种类型设定相应的处理指示,并将业务的业务 ID与业务对应的 类型 ID存储在业务与类型对应关系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示存储在类型与处理指示对应关系表中,在 WebRTC会话 建立之后, WebRTC业务服务器向第一 Web应用发送包含处理指示表的表 保存请求, 其中处理指示表包含业务与类型对应关系表和类型与处理指示 对应关系表, 接收第一 Web应用发送表保存响应, 其中表保存响应不包含 允许更新标志。
在第三方面的第五种可能的实现方式中, 在第一终端的浏览器接收第 一 Web应用发送的包含第二 ICE地址的地址增加候选消息之前, 还包括: 第一终端的浏览器向第一 Web应用发送含允许更新标志的状态修改响应, 以便于第一 Web应用根据允许更新标志通知 WebRTC业务服务器允许第二 Web应用向第一 Web应用发送第二 ICE地址。
第四方面,一种设置 ICE地址处理指示的方法, 包括: 第一万维网 Web 应用通过第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏 览器的第一 ICE地址进行协商,并建立网页实时通信 WebRTC会话,其中, 第一 Web应用为加载在第一终端的浏览器上 Web应用, 第二 Web应用为 加载在第二终端的浏览器上 Web应用;第一 Web应用根据当前业务的业务 ID和处理指示表,确定第一终端的浏览器对在 WebRTC会话期间内接收到 的所有第二 I CE地址的统一的处理指示; 第一 Web应用向第一终端的浏览 器发送状态修改请求, 状态修改请求包含第一终端的浏览器对在 WebRTC 会话期间内接收到的所有第二终端的浏览器的第二 ICE地址的统一的处理 指示, 其中, 第二 ICE地址为第二终端的浏览器的更新的 ICE地址; 以便 于第一终端的浏览器根据统一的处理指示,修改第一终端的浏览器中的 ICE 代理状态机的状态, 使修改后的状态与处理指示相对应。
在第四方面的第一种可能的实现方式中, 第一 Web应用根据当前业务 的业务 ID和处理指示表,确定第一终端的浏览器对在 WebRTC会话期间内 接收到的所有第二 ICE地址的统一的处理指示具体为: 当处理指示表具体 为业务与处理指示对应关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 第一 Web 应用根据业务 ID和业务与处理指示对应关系表, 获得业务 ID对应的处理 指示,确认业务 ID对应的处理指示为第一终端的浏览器对在 WebRTC会话 期间内接收到的所有第二 ICE地址的统一的处理指示; 或者, 当处理指示 表包含业务与类型对应关系表和类型与处理指示对应关系表时, 第一 Web 应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC 业务服务器分配的;第一 Web应用根据业务 ID和业务与类型对应关系表, 获得业务 ID对应的类型 ID,并根据类型 ID和类型与处理指示对应关系表, 获得类型 ID对应的处理指示, 确认类型 ID对应的处理指示为第一终端的 浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理 指示。
结合第四方面的第一种可能的实现方式, 在第四方面的第二种可能的 实现方式中, 还包括: 在 WebRTC会话建立之前, WebRTC业务服务器将 WebRTC 业务服务器所支持的所有业务分别设定相应的处理指示, 并将业 务的业务 ID与业务相应的处理指示保存在业务与处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用发送包含 处理指示表的表保存请求, 其中处理指示表具体为业务与处理指示对应关 系表, 接收第一 Web应用发送表保存响应, 其中, 表保存响应不包含允许 更新标志; 或者, WebRTC业务服务器将 WebRTC业务服务器所支持的所 有业务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业 务 ID与业务对应的类型 ID存储在业务与类型对应关系表中, 并将业务对 应的类型 ID与类型 ID相应的处理指示存储在类型与处理指示对应关系表 中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用发送 包含处理指示表的表保存请求, 其中处理指示表包含业务与类型对应关系 表和类型与处理指示对应关系表, 接收第一 Web应用发送表保存响应, 其 中, 表保存响应不包含允许更新标志。
在第四方面的第三种可能的实现方式中, 在第一 Web应用向第一终端 的浏览器发送状态修改请求之后, 还包括: 接收第一终端的浏览器发送的 包含允许更新标志的状态爹改响应, 并且根据允许更新标志, 第一 Web应 用向 WebRTC业务服务器发送地址启动消息, 以便于 WebRTC业务服务器 允许第二 Web应用向第一 Web应用发送第二 ICE地址。
在第五方面、一种处理 ICE地址的装置,用于在网页实时通信 WebRTC 会话过程中处理 ICE地址,所述 WebRTC会话是由第一万维网 Web应用与 第二 Web应用通过所述装置自身的 ICE地址和运行所述第二 Web应用的浏 览器的第一 ICE地址协商建立, 所述第一 Web应用为加载在所述装置上的 Web应用, 装置包括收发器和处理器, 其中: 收发器, 用于接收第一 Web 应用发送的地址增加候选消息, 地址增加候选消息包含运行第二 Web应用 的浏览器的第二 ICE地址和处理器对第二 ICE地址的处理指示; 收发器, 还用于向处理器发送第二 ICE地址和处理器对第二 ICE地址的处理指示; 处理器, 用于接收收发器发送的第二 ICE地址和处理器对第二 ICE地址的 处理指示, 并识别出处理指示, 根据识别出的处理指示, 对第二 ICE地址 进行相应处理。
在第五方面的第一种可能的实现方式中, 处理器具体包括检测模块和 丢弃模块, 其中: 检测模块用于检测从收发器接收到的第二 ICE地址是否 可达; 丢弃模块用于当检测模块检测到第二 ICE地址不可达时, 丢弃第二 ICE地址。
结合第五方面的第一种可能的实现方式, 在第五方面的第二种可能的 实现方式中, 处理器具体包括第一保存模块、 第一替换模块和第一自主决 策模块中的一个或多个, 其中, 第一保存模块, 用于当检测模块检测到第 二 ICE地址可达时, 以及当处理器识别出处理指示为保存时, 保存装置自 身的 ICE地址和第二 ICE地址的地址对; 第一替换模块, 用于当检测模块 检测到第二 ICE地址可达时, 以及当处理器识别出处理指示为替换时, 将 第一 ICE地址替换为第二 ICE地址; 第一自主决策模块, 用于当检测模块 检测到第二 ICE地址可达时,以及当处理器识别出处理指示为自主决策时, 检查从收发器接收到的第二 ICE地址携带的优先级; 如果第二 ICE地址携 带的优先级大于第一 ICE地址携带的优先级, 则将与第一 ICE地址替换为 第二 ICE地址; 如果第二 ICE地址携带的优先级小于或等于所第一 ICE地 址携带的优先级, 则向丢弃模块发送丢弃命令; 丢弃模块, 还用于接收第 一自主决策模块发送的丢弃命令, 丢弃第二 ICE地址。
结合第五方面的第一种可能的实现方式, 在第五方面的第三种可能的 实现方式中,处理器具体还用于识别出处理指示,根据识别出的处理指示, 修改所述运行所述第二 Web应用的浏览器中的 ICE代理状态机的状态, 使 修改后的状态与处理指示相对应; 根据 ICE代理状态机的状态, 所述装置 对第二 ICE地址进行相应处理。
结合第五方面的第三种可能的实现方式, 在第五方面的第四种可能的 实现方式中, 处理器具体包括第二保存模块、 第二替换模块和第二自主决 策模块中的一个或多个,其中,第二保存模块,用于根据处理指示为保存, 修改 ICE代理状态机的状态为保持状态; 当检测模块检测到第二 ICE地址 可达时, 保存装置自身的 ICE地址和第二 ICE地址的地址对; 第二替换模 块, 用于根据处理指示为替换, 修改 ICE代理状态机的状态为检测状态; 当检测模块检测到第二 ICE地址可达时, 将第一 ICE地址替换为第二 ICE 地址; 第二自主决策模块, 用于根据处理指示为自主决策, 修改 ICE代理 状态机的状态为自动状态; ICE 代理状态机的状态为自动状态时, 当检测 模块检测到第二 ICE地址可达时, 检查第二 ICE地址携带的优先级; 如果 第二 ICE地址携带的优先级大于第一 ICE地址携带的优先级, 则将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先级小于或等 于第一 ICE地址携带的优先级, 则向丢弃模块发送丢弃命令; 丢弃模块, 还用于接收第二自主决策模块发送的丢弃命令, 丢弃第二 ICE地址。
第六方面, 一种设置 ICE地址处理指示的装置, 包括: 会话模块, 用 于通过第一终端的浏览器的 ICE地址与万维网 Web应用通过第二终端的浏 览器的第一 ICE地址进行协商,并建立网页实时通信 WebRTC会话,其中, Web应用为加载在第二终端的浏览器上 Web应用;收发器,用于在 WebRTC 会话过程中, 接收 Web应用发送的地址传输消息, 地址传输消息包含第二 终端的浏览器的第二 ICE地址; 处理器, 用于根据当前业务的业务 ID和处 理指示表, 确定第一终端的浏览器对收发器接收到的第二 ICE地址的处理 指示, 并向收发器发送第一终端的浏览器对第二 ICE地址的处理指示; 收 发器, 还用于接收处理器发送的第一终端的浏览器对第二 ICE地址的处理 指示, 并向第一终端的浏览器发送地址增加候选消息, 地址增加候选消息 包含了第二 ICE地址和第一终端的浏览器对第二 ICE地址处理指示, 以便 于第一终端的浏览器根据处理指示对第二 ICE地址进行相应处理。
在第六方面的第一种可能的实现方式中, 处理器, 具体用于当处理指 示表具体为业务与处理指示对应关系表时,获取当前业务的业务 ID,其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 并根据业务 ID和 业务与处理指示对应关系表, 获得业务 ID对应的处理指示, 确认业务 ID 对应的处理指示为第一终端的浏览器对第二 ICE地址的处理指示; 或者, 处理器, 具体用于当处理指示表包含业务与类型对应关系表和类型与处理 指示对应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前 业务时 WebRTC业务服务器分配的;根据业务 ID和业务与类型对应关系表, 获得业务 ID对应的类型 ID, 并根据类型与处理指示对应关系表, 获得类 型 ID对应的处理指示, 确认类型 ID对应的处理指示为第一终端的浏览器 对第二 ICE地址的处理指示。 在第七方面, 一种处理交互式连接建立 ICE地址的装置, 用于在网页 实时通信 WebRTC会话过程中处理 ICE地址, 所述 WebRTC会话是由第一 万维网 Web应用与第二 Web应用通过所述装置自身的 ICE地址和运行所述 第二 Web应用的浏览器的第一 ICE地址协商建立,所述第一 Web应用为加 载在所述装置上的 Web应用, 装置包括收发器和处理器, 收发器, 用于接 收第一 Web应用发送的状态修改请求, 状态修改请求包含处理器对在整个 WebRTC会话期间内接收到的运行所述第二 Web应用的浏览器的所有第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为运行所述第二 Web应 用的浏览器的更新的 ICE 地址; 收发器还用于向处理器发送处理器在 WebRTC会话中对接收到的第二 ICE地址的处理指示; 处理器, 用于接收 收发器发送的处理指示, 并根据处理指示, 修改 ICE代理状态机的状态, 使修改后的状态与处理指示相对应; 收发器, 还用于接收第一 Web应用发 送的包含第二 ICE地址的地址增加候选消息, 并向处理器发送地址增加候 选消息; 处理器, 还用于接收收发器发送的地址增加候选消息, 根据 ICE 代理状态机的状态, 对第二 ICE地址进行相应处理。
在第七方面的第一种可能的实现方式中, 处理器具体包括检测模块和 丢弃模块, 其中: 检测模块用于检测从收发器接收到的第二 ICE地址是否 可达; 丢弃模块用于当检测模块检测到第二 ICE地址不可达时, 丢弃第二 ICE地址。
在第七方面的第二种可能的实现方式中, 处理器包括保存模块, 替换 模块和自主决策模块中的一个或多个, 其中, 保存模块, 用于当处理指示 为保存, 修改 ICE代理状态机的状态为保持状态, 并且当检测模块检测到 第二 ICE地址可达时, 以及当 ICE代理状态机的状态为保持状态, 保存装 置自身的 ICE地址和第二 ICE地址的地址对; 替换模块, 用于当处理指示 为替换, 修改 ICE代理状态机的状态为检测状态; 当检测模块检测到第二 ICE地址可达时,以及当 ICE代理状态机的状态为检测状态时,将第一 ICE 地址替换为第二 ICE地址; 自主决策模块, 用于当处理指示为自主决策, 修改 ICE代理状态机的状态为自动状态; 并当检测模块检测到第二 ICE地 址可达时, 以及当 ICE代理状态机的状态为自动状态时, 检查第二 ICE地 址携带的优先级,如果第二 ICE地址携带的优先级大于装置自身的第一 ICE 地址携带的优先级, 则将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先级小于或等于第一 ICE地址携带的优先级, 则向丢弃 模块发送丢弃命令; 丢弃模块, 还用于接收丢弃模块发送的丢弃命令, 丢 弃第二 ICE地址。
在第七方面的第三种可能的实现方式中, 收发器, 还用于当 ICE代理 机的状态修改成功后, 向第一 Web应用发送包含允许更新标志的状态修改 响应, 以便于第一 Web应用根据允许更新标志通知 WebRTC业务服务器允 许第二 Web应用向第一 Web应用发送第二 ICE地址。
第八方面, 一种设置 ICE地址的处理指示的装置, 包括: 会话模块, 用于通过第一终端的浏览器的 ICE地址与万维网 Web应用通过第二终端的 浏览器的第一 ICE地址进行协商, 并建立网页实时通信 WebRTC会话, 其 中, Web应用为加载在第二终端的浏览器上 Web应用; 处理器, 用于根据 当前业务的业务 ID 和处理指示表, 确定第一终端的浏览器对在 WebRTC 会话期间内接收到的所有第二 ICE地址的统一的处理指示; 收发器, 用于 向第一终端的浏览器发送状态修改请求, 状态修改请求包含处理器确定的 第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二终端的浏览 器的第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为第二终端的 浏览器的更新的 ICE地址;以便于第一终端的浏览器根据统一的处理指示, 修改第一终端的浏览器中的 ICE代理状态机的状态, 使修改后的状态与处 理指示相对应。
在第八方面的第一种可能的实现方式中, 处理器具体用于当处理指示 表具体为业务与处理指示对应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 根据业务 ID和业 务与处理指示对应关系表, 获得业务 ID对应的处理指示, 确认业务 ID对 应的处理指示为第一终端的浏览器对在 WebRTC会话期间内接收到的所有 第二 ICE地址的统一的处理指示; 或者, 处理器具体还用于当处理指示表 为业务与类型对应关系表和类型与处理指示对应关系表时, 获取当前业务 的业务 ID,其中,业务 ID为创建当前业务时 WebRTC业务服务器分配的; 根据业务 ID和类型表, 获得业务 ID对应的类型 ID, 并根据类型 ID与处 理指示的对应关系表, 获得类型 ID对应的处理指示, 确认类型 ID对应的 处理指示为第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理指示。
在第八方面的第二种可能的实现方式中, 收发器, 还用于接收第一终 端的浏览器发送的包含允许更新标志的状态修改响应, 并且根据允许更新 标志, 向 WebRTC业务服务器发送 ICE地址启动消息, 以便于 WebRTC业 务服务器允许第二 Web应用向第一 Web应用发送第二 ICE地址。
第九方面, 一种 WebRTC业务服务器, 包括收发器和处理器, 其中, 处理器, 用于将 WebRTC业务服务器所支持的所有业务分别设定相应的处 理指示,并将业务的业务 ID与业务相应的处理指示保存在业务与处理指示 对应关系表中, 此时处理指示表具体为业务与处理指示对应关系表, 或者 将 WebRTC业务服务器所支持的所有业务分别进行分类以及为每种类型设 定相应的处理指示, 并将业务的业务 ID与业务对应的类型 ID存储在业务 与类型对应关系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示 存储在类型与处理指示对应关系表, 此时处理指示表包含业务与类型对应 关系表和类型与处理指示对应关系表; 收发器, 用于在 WebRTC会话建立 之后, 向加载在第一终端的浏览器上的第一 Web应用发送包含处理指示表 的表保存请求, 接收第一 Web应用发送表保存响应。
在第九方面的第一种可能的实现方式中, 收发器还用于, 当表保存响 应包含允许更新标志时, 根据允许更新标志, 向加载在第二终端的浏览器 上的第二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址; 当保存响应不包含允许更新标志时, 还接收 第一 Web应用发送的包含允许更新标志的允许更新通知, 根据允许更新标 志, 向第二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址。
在本发明的实施例中,由于第一 Web应用可以根据当前业务的业务 ID 和处理指示表, 对接收到的第二 ICE地址设置相应的处理指示, 并可以让 第一终端的浏览器根据该处理指示, 对该第二 ICE地址进行相应处理, 这 样就可以第一 Web应用来控制第一终端的浏览器对第二 ICE地址的处理指 示。
附图说明 为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例 中所需要使用的附图作筒单地介绍, 显而易见地, 下面所描述的附图仅仅 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性 劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为典型的 WebRTC业务网络系统结构示意图;
图 为本发明实施例提供的一种处理 ICE地址的方法流程图;
图 3为本发明实施例提供的一种设置 ICE地址处理指示的方法流程图; 图 4为本发明实施例提供的另一种处理 ICE地址的方法流程图; 图 5为本发明实施例提供的另一种处理 ICE地址的方法流程图; 图 6为本发明实施例提供的另一种设置 ICE地址处理指示的方法流程 图;
图 7为本发明实施例提供的另一种处理 ICE地址的方法流程图; 图 8为本发明实施例提供的一种处理 ICE地址的装置的结构示意图; 图 9为本发明实施例提供的另一种处理 I C E地址的装置的结构示意图; 图 10为本发明实施例提供的一种设置 ICE地址处理指示的装置的结构 示意图;
图 11为本发明实施例提供的另一种处理 ICE地址的装置的结构示意图; 图 12为本发明实施例提供的另一种处理 ICE地址的装置的结构示意图; 图 13为本发明实施例提供的另一种设置 ICE地址处理指示的装置的结 构示意图;
图 14为本发明实施例提供的一种 WebRTC业务服务器的结构示意图; 图 15为本发明实施例提供的另一种处理 ICE地址的装置的结构示意图; 图 16为本发明实施例提供的另一种设置 ICE地址处理指示的装置的结 构示意图;
图 17为本发明实施例提供的另一种 WebRTC业务服务器的结构示意图。
具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进 行清楚、 完整地描述, 显然, 所描述的实施例是本发明的一部分实施例, 而不是全部实施例。 基于本发明中的实施例, 本领域普通技术人员在没有 做出创造性劳动的前提下所获得的所有其他实施例, 都应属于本发明保护 的范围。
下面首先介绍一下一个典型的 WebRTC业务网络系统结构, 如图 1所 示:
终端 103,106 是一个可以运行浏览器的设备, 并且浏览器上可以加载 Web应用, 浏览器是一种用于访问互联网的软件, Web应用是一种业务模 块, 它存储在 WebRTC业务服务器 101上, 在浏览器访问到 WebRTC业务 服务器 101时, Web应用从 WebRTC业务服务器 101加载到浏览器上。 例 如: 终端 103,106 可以是计算机, 智能手机, 平板电脑 (Pad ), 电子书阅 览器, 瘦客户端等。
WebRTC业务服务器 101 是用于对加载在浏览器的 Web应用进行会话 控制、 寻址以及业务逻辑处理等。
TURN服务器 104可以用于帮助浏览器获得本浏览器可以用来和其它 浏览器进行通信的 ICE地址, 并中继浏览器之间的媒体流。 NAT网关 102是一种用于为浏览器访问互联网 (Internet )服务, 或者 和公网用户通信时进行内网地址到外网地址的转换的网络设备。 因为在现 实网络中, 由于公网 IP地址不足,导致使用私网 IP地址的私网广泛部署, 为了让私网环境中的计算机和外界通信,公司会使用 NAT( Network Address Translator )设备, 进行内网地址到外网地址的转换。
上述 ICE地址是浏览器在 TURN服务器的协助下, 从浏览器所在终端 103,106的各个网络接口收集到的可以被外界访问的地址。 ICE地址包含地 址、 媒体流 id (sdpMid)和媒体行索弓 I (sdpMLinelndex)信息。
ICE地址的结构和实例如下所示:
ICE地址: 地址: ICE地址序号 IP地址序号 传输层协议 优先级 IP地址 端口号 类型
SDP媒体流 ID
SDP媒体行索引 例如: 一个具体的 ICE地址为:
a=candidate:l 1 UDP 213070643 1 10.0.188.98 3487 type host
其中上述 ICE地址中的 ICE地址序号指的是: 该 ICE地址在当前浏览 器所在的终端所获得的 ICE地址信息中的位置, 比如当前浏览器所在的终 端收集了三个 ICE地址, 那么第一个 ICE地址的序号为 1 , 第二个 ICE地 址的序号为 2。
IP地址序号指的是: 浏览器所在的终端支持多个 IP地址时, 该 IP地 址的编号, 比如该终端支持多个网络接口的, 有 3个 IP地址, 那么 IP地 址序号可以为 1、 2、 3的编号。
传输层协议指的是: 浏览器所使用的传输层协议, 传输层协议可以有 TCP, UDP或者其他的协议等类型。 优先级可以使用 ICE地址的优先级参数来进行指示, 例如: 优先级参 数为 1表示优先级为最高。
用于浏览器决定使用 ICE地址的一个参考依据, 双方浏览器可以根据 某些算法共同计算出来的该 ICE地址的一串数值, 数值大则优先级高, 数 值小则优先级低。
类型指的是: 该 ICE地址的类型, 类型包括主机类型, 中继类型和服 务器类型等。
SDP媒体流 ID指的是: 该 ICE地址对应 WebRTC会话中的某个媒体 流的 ID。
SDP媒体行索引指的是:在 SDP中会包含某个媒体流的媒体行,在 ICE 地址中也会包含对应媒体流媒体行的 SDP媒体行索引。每个 SDP媒体行索 引对应 SDP中的每个媒体流,这样浏览器通过 ICE地址中的 SDP媒体行索 引可以知道该 ICE地址是用于哪个媒体流的。
如图 2所示, 为本发明实施例的一种处理 ICE地址的方法, 应用于网 页实时通信 WebRCT会话过程中, WebRTC会话是由第一万维网 Web应用 通过第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器 的第一 ICE地址协商建立的, 第一 Web应用为加载在第一终端的浏览器上 的 Web应用, 第二 Web应用为加载在第二终端的浏览器上的 Web应用, 该方法具体包括:
201第一终端的浏览器接收第一 Web应用发送的地址增加候选消息, 地址增加候选消息包含了第二终端的浏览器的第二 ICE地址和第一终端的 浏览器对第二 ICE地址的处理指示;
202、 第一终端的浏览器识别出处理指示, 根据识别出的处理指示, 对 第二 ICE地址进行相应处理。
具体的: 识别出处理指示为保存时, 第一终端的浏览器检测第二 ICE 地址是否可达, 在检测出第二 ICE地址可达时, 保存第一终端的浏览器自 身的 ICE地址和第二 ICE地址的地址对;在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址。
识别出处理指示为替换时, 第一终端的浏览器检测第二 ICE地址是否 可达, 在检测出第二 ICE地址可达时, 将第二终端的浏览器的第一 ICE地 址替换为第二 ICE地址; 在检测出第二 ICE地址不可达时, 丢弃第二 ICE 地址。
识别出处理指示为自主决策时, 第一终端的浏览器检测第二 ICE地址 是否可达, 在检测出第二 ICE地址可达时, 则检查第二 ICE地址携带的优 先级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携带的优先级, 则将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先 级小于或等于第一 ICE地址携带的优先级, 则丢弃第二 ICE地址; 在检测 出第二 ICE地址不可达时, 则丢弃第二 ICE地址。
上述检测第二 ICE地址是否可达, 具体为:
向第二终端的浏览器发送可达检测请求, 如果在规定时间内, 第一终 端的浏览器接收到第二终端的浏览器返回的可达检测响应, 则第二 ICE地 址可达; 如果在规定时间内, 第一终端的浏览器没有接收到第二终端的浏 览器返回的可达检测响应, 则第二 ICE地址不可达。
可选的, 第一终端的浏览器识别出处理指示, 根据识别出的处理指示 对第二 ICE地址进行相应处理, 具体包括: 第一终端的浏览器识别出处理 指示, 根据识别出的处理指示, 修改第一终端的浏览器中的 ICE代理状态 机的状态, 使修改后的状态与处理指示相对应; 根据 ICE代理状态机的状 态, 第一终端的浏览器对第二 ICE地址进行相应处理。
可选的, 根据识别出的处理指示, 修改第一终端的浏览器中的 ICE代 理状态机的状态, 使修改后的状态与处理指示相对应; 根据 ICE代理状态 机的状态, 第一终端的浏览器对第二 ICE地址进行相应处理, 具体包括: 根据处理指示为保存, 修改 ICE代理状态机的状态为保持状态; 第一终端 的浏览器检测第二 ICE地址是否可达,并且在检测出第二 ICE地址可达时, 保存第一终端的浏览器的 ICE地址和第二 ICE地址的地址对; 在检测出第 二 ICE地址不可达时,则丢弃第二 ICE地址;或者,根据处理指示为替换, 修改 ICE代理状态机的状态为检测状态; 第一终端的浏览器检测第二 ICE 地址是否可达, 并且在检测出第二 ICE地址可达时, 将第一 ICE地址替换 为第二 ICE地址;在检测出第二 ICE地址不可达时,则丢弃第二 ICE地址; 或者,根据处理指示为自主决策,修改 ICE代理状态机的状态为自动状态; ICE代理状态机的状态为自动状态时, 第一终端的浏览器检测第二 ICE地 址是否可达, 并且在检测出第二 ICE地址可达时, 检查第二 ICE地址携带 的优先级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携带的优先 级, 则将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的 优先级小于或等于第一 ICE地址携带的优先级, 则丢弃第二 ICE地址; 在 检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址。
可选的,地址增加候选消息是由第一 Web应用在接收第二 Web应用发 送的地址传输消息, 以及根据当前业务的业务 ID和处理指示表, 确定第一 终端的浏览器对第二 ICE地址的处理指示之后, 向第一终端的浏览器发送 的, 其中, 地址传输消息包含第二终端的浏览器的第二 ICE地址。
可选的, 该方法还包括: 在 WebRTC会话建立之前, WebRTC业务服 务器将 WebRTC业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关 系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用 发送包含处理指示表的表保存请求, 其中处理指示表具体为业务与处理指 示对应关系表, 接收第一 Web应用发送包含允许更新标志的表保存响应, 根据允许更新标志, 向第二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址; 或者, WebRTC业务服务器 将 WebRTC业务服务器所支持的所有业务分别进行分类以及为每种类型设 定相应的处理指示, 并将业务的业务 ID与业务对应的类型 ID存储在业务 与类型对应关系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示 存储在类型与处理指示对应关系表中,在 WebRTC会话建立之后, WebRTC 业务服务器向第一 Web应用发送包含处理指示表的表保存请求, 其中处理 指示表包含业务与类型对应关系表和类型与处理指示对应关系表, 接收第 一 Web应用发送含允许更新标志的表保存响应, 根据允许更新标志, 向第 二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应 用发送第二 ICE地址。
进一步的, 该方法还包括: 当处理指示表具体为业务与处理指示对应 关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建 当前业务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID和业 务与处理指示对应关系表, 获得业务 ID对应的处理指示, 确认业务 ID对 应的处理指示为第一终端的浏览器对第二 ICE地址的处理指示; 或者, 当 处理指示表包含业务与类型对应关系表和类型与处理指示对应关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID和业务与类型对 应关系表, 获得业务 ID对应的类型 ID, 并根据类型与处理指示对应关系 表, 获得类型 ID对应的处理指示, 确认类型 ID对应的处理指示为第一终 端的浏览器对第二 I C E地址的处理指示。
如图 3所示, 为本发明实施例的一种设置 ICE地址处理指示的方法, 该方法具体包括:
301、 第一 Web应用通过第一终端的浏览器的 ICE地址与第二 Web应 用通过第一终端的浏览器的第一 ICE地址进行协商,并建立 WebRTC会话, 其中, 第一 Web应用为加载在第一终端的浏览器上 Web应用, 第二 Web 应用为加载在第二终端的浏览器上 Web应用;
302、 在 WebRTC会话过程中, 第一 Web应用接收第二 Web应用发送 的地址传输消息, 地址传输消息包含第二终端的浏览器的第二 ICE地址;
303、 第一 Web应用根据当前业务的业务 ID和处理指示表, 确定第一 终端的浏览器对第二 ICE地址的处理指示;
304、 向第一终端的浏览器发送地址增加候选消息, 地址增加候选消息 包含了第二 ICE地址和第一终端的浏览器对第二 ICE地址处理指示, 以便 于第一终端的浏览器根据处理指示对第二 ICE地址进行相应处理。
具体的, 处理指示具体为: 保存、 替换或者自主决策。
可选的: 第一 Web应用根据当前业务的业务 ID和处理指示表, 确定 第一终端的浏览器对第二 ICE地址的处理指示, 具体为: 当处理指示表为 业务 ID与处理指示的对应关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID和业务 ID与处理指示的对应关系表,获得业务 ID对 应的处理指示, 确认业务 ID 对应的处理指示为第一终端的浏览器对第二 ICE 地址的处理指示; 或者, 当处理指示表为类型表和类型与处理指示的 对应关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为 创建当前业务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID 和类型表, 获得业务 ID对应的类型 ID, 并根据类型 ID与处理指示的对应 关系表, 获得类型 ID对应的处理指示, 确认类型 ID对应的处理指示为第 一终端的浏览器对第二 ICE地址的处理指示。
可选的, 该方法还包括: 在 WebRTC会话建立之前, WebRTC业务服 务器将 WebRTC业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关 系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用 发送包含处理指示表的表保存请求, 其中处理指示表具体为业务与处理指 示对应关系表, 接收第一 Web应用发送含允许更新标志的表保存响应, 根 据允许更新标志, 向第二 Web 应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址; 或者, WebRTC业务服务器 将 WebRTC业务服务器所支持的所有业务分别进行分类以及为每种类型设 定相应的处理指示, 并将业务的业务 ID与业务对应的类型 ID存储在业务 与类型对应关系表中, 并将业务对应的类型 ID与类型 ID相应的处理指示 存储在类型与处理指示对应关系表中,在 WebRTC会话建立之后, WebRTC 业务服务器向第一 Web应用发送包含处理指示表的表保存请求 , 其中处理 指示表包含业务与类型对应关系表和类型与处理指示对应关系表, 接收第 一 Web应用发送含允许更新标志的表保存响应, 根据允许更新标志, 向第 二 Web应用发送允许更新消息, 以便于允许第二 Web应用向第一 Web应 用发送第二 ICE地址。
如图 4所示, 为本发明实施例的另一种处理 ICE地址的方法, 该方法 具体包括:
401、用户 A使用 Web应用 A时, Web应用 A将加载在浏览器 A上, 浏览器 A运行在终端 103上, 用户 B使用 Web应用 B时, Web应用 B将 加载在浏览器 B上, 浏览器 B运行在终端 106上, Web应用 A和 Web应 用 B进行协商, 以建立 WebRTC会话。 协商的内容包括: ICE地址的协 商和 SDP参数协商。
这里的 Web应用 A和 Web应用 B可以为同种 Web应用, 比如: Web 应用 A和 Web应用 B都是 WebQQ, 只是 Web应用 A和 Web应用 B的账 号不同而已, Web应用 A和 Web应用 B还可以为不同种 Web应用,比如: Web应用 A是 WebQQ和 Web应用 B为微信。
为了描述的方便, 本发明的实施例可以做如下假设: 在 WebRTC会话 过程中,浏览器 B收集到的浏览器 B自身的 ICE地址为浏览器 B的第二 ICE 地址, 用于 Web应用 A与 Web应用 B之间正在进行的 WebRTC会话的浏 览器 B的 ICE地址为浏览器 B的第一 ICE地址。
在建立 WebRTC会话之前, WebRTC业务服务器将 WebRTC业务服务 器所支持的所有业务分别设定相应的处理指示,并将业务的业务 ID与业务 相应的处理指示保存在业务与处理指示对应关系表中, 在 WebRTC会话建 立之后, WebRTC业务服务器向 Web应用 A发送包含处理指示表的表保存 请求, 其中处理指示表具体为业务与处理指示对应关系表, 接收 Web应用 A发送包含允许更新标志的表保存响应, 根据允许更新标志, 向 Web应用 B发送允许更新消息,以便于允许 Web应用 B向 Web应用 A发送第二 ICE 地址; 或者, WebRTC业务服务器将 WebRTC业务服务器所支持的所有业 务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业务 ID 与业务对应的类型 ID存储在业务与类型对应关系表中,并将业务对应的类 型 ID与类型 ID相应的处理指示存储在类型与处理指示对应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向 Web应用 A发送包含处理 指示表的表保存请求, 其中处理指示表包含业务与类型对应关系表和类型 与处理指示对应关系表,接收 Web应用 A发送含允许更新标志的表保存响 应, 根据允许更新标志, 向 Web应用 B发送允许更新消息, 以便于允许 Web应用 B向 Web应用 A发送第二 ICE地址。
WebRTC 业务服务器可以根据每种业务的业务需求来确定每种业务对 应的处理指示或者每种业务对应的类型所对应的处理指示。 如果该业务的 要求是不能中断的, 例如: 紧急呼叫, 视频通话等, 该类业务被设定为保 存的处理指示, 如果该业务的要求是不需要长时间连接的, 即是可以中断 的, 例如: 微博业务, 微信业务等, 该业务被设定为替换的处理指示, 该 类业务也可以被设定为自主决策的处理指示。
402: Web应用 B在接收 WebRTC业务服务器发送的允许更新消息后, 确认当前可以将浏览器 B的新 ICE地址发送给 Web应用 A, 因此根据业务 需求或者网络需求, 确定浏览器 B需要收集浏览器 B 自身的新 ICE地址。
例如: 在以下这些场景中, Web应用 B会确定并指示浏览器 B收集新 ICE地址。 1 ), TURN服务器超负荷负载或者发生故障时, 需要更换 TURN 服务器为浏览器 B服务,即 TURN服务器的地址发生了改变,因此 WebRTC 业务服务器向 Web应用 B知会 TURN服务器的地址发生了改变, Web应用 B确定需要指示浏览器 B收集新 ICE地址。 2 ), 当用户 B通过 Web应用 B 手动选择切换到不同运营商服务器时。 由于不同的运营商各自维护自己的 TURN服务器, 如果用户 B将终端 B所在的网络从第一运营商切换到第二 运营商时,那么自然将为运行在终端 B上的浏览器 B服务的第一 TURN服 务器切换到第二 TURN服务器,第二 TURN服务器将为浏览器 B分配新 ICE 地址, 即 TURN服务器地址发生了改变, Web应用 B确定需要指示浏览器 B收集新 ICE地址。 3 ), Web应用 B根据当前不同业务的上下文, 为不同 的业务选择不同的 ICE地址。 比如运营商有十个 TURN月良务器, TURN 服务器 1,2和 3是带宽最大的服务器, 而 TURN服务器 10是带宽最差的服 务器, 一些对带宽要求强的业务, 比如视频, 需要用 TURN服务器 1,2或 3 为该业务服务; 而一些对带宽要求不强的业务, 比如传输小数据, 则可以 使用 TURN服务器 10为该业务服务, 即当前的业务发生了改变时, TURN 服务器地址发生了改变, Web应用 B确定需要指示浏览器 B收集新 ICE地 址。
假设:在 WebRTC会话过程中,浏览器 B收集到的浏览器 B 自身的 ICE 地址为浏览器 B的第二 ICE地址, 当前 Web应用 A与 Web应用 B之间正 在进行的 WebRTC会话的浏览器 B的 ICE地址为浏览器 B的第一 ICE地址。
403、 Web应用 B向浏览器 B发送地址更新 ( updatelCE ) 消息, 通知 浏览器 B收集浏览器 B 自身的第二 ICE地址, 该 updatelCE消息中携带了 新的 TURN服务器地址。
404、浏览器 B收到 Web应用 B发送的 updatelCE消息,根据 updatelCE 消息携带的新的 TURN服务器的地址, 从该新的 TURN服务器上获取到浏 览器 B 自身的第二 ICE地址。
浏览器 B根据 ICE地址类型、 中间节点有无和数量、 IP地址类型、 安 全以及网关距离主机远近等综合因素,可以确定 ICE地址的优先级,如 ICE 地址类型包括: 主机地址、 TURN 地址、 会话穿越效用网络地址转换器 ( Session Traversal Utilities for NAT, STUN )协助获取地址和对等地址等; 媒体流将途经中间节点的优先级将比媒体流不途经中间节点优先级低, 例 如: 媒体流会流经 TURN服务器, TURN服务器就是中间节点; IP地址类 型的优先级顺序是: IPv6地址类型高于 IPv6地址到 IPv4地址( IPv6toIPv4 ) 的类型, IPv6toIPv4类型高于 IPv4地址的类型; 安全的优先级顺序是: 虚 拟专用网络( Virtual Private Network , VPN ) 高于普通网络; 网关距离主机 远近优先级顺序是: 网关距离主机近的优先级高于网关距离主机远的优先 级。
本发明还有另外一个实施例, 除了 Web应用 B 因为 TURN服务器更 换时指示浏览器 B收集浏览器 B 自身的第二 ICE地址场景之外, 浏览器 B 还可以在无需接收到 Web应用 B发送 updatelCE消息情况下, 直接收集浏 览器 B的第二 ICE地址, 此时步骤 402-404就无需执行了。
例如: 浏览器 B所在终端原来在 3G网络, 但是现在由于位置移动, 新的位置又连接上了 WIFI, 则现在浏览器 B所在终端除了 3G网络可以使 用, 又有 WIFI网络可以使用, 虽然 3G网络或 WIFI网络可能还是同一个 运营商网络,其 TURN服务器是没有变的,但是新增加了 WIFI网络接口, TURN服务器上还是会给浏览器 B分配一个更适合这个新网络接口的 ICE 地址,
当终端 B的无线模块检测到终端 B已经连接到 WIFI网络时, 终端 B 的无线模块会向浏览器 B发送网络接口增加消息, 并在该网络接口增加消 息包含了此时 WIFI接口的 IP地址和端口号,浏览器 B根据该 IP地址和端 口号, 向 TURN服务器发送 STUN请求; TURN服务器根据 STUN请求, 为浏览器分配一个合适的 ICE地址, 并向浏览器 B发送 STUN响应, 该 STUN响应包含了上述 ICE地址。
405、 浏览器 B收集到了第二 ICE地址之后, 向 Web应用 B发送地址 候选 ( onlCEcandidate )消息, 该 onlCEcandidate消息中带有浏览器 B的第 二 ICE地址。 onlCEcandidate消息是用于从浏览器向 Web应用传输浏览器 自身的新 ICE地址。
406、 Web应用 B收到 onlCEcandidate消息之后,从该消息中取出浏览 器 B的第二 ICE地址。 Web应用 B可以通过和 WebRTC业务服务器之间的 信令连接,并通过 WebRTC业务服务器中转向 Web应用 A发送包含浏览器 B的第二 ICE地址的地址传输消息。
上述 Web 应用和 WebRTC 业务服务器之间的信令连接可以是基于 HTTP的信令连接,也可以是基于 Websocket的信令连接。如果是基于 HTTP 的信令连接, 需要 Web应用 A保持和 WebRTC业务服务器之间的 HTTP 长轮询连接,这样当 WebRTC业务服务器需要向给 Web应用 A的发送浏览 器 B的第二 ICE地址时, 可以通过 HTTP长轮询中的 HTTP响应将该浏览 器 B的第二 ICE地址发送给 Web应用 A, 此时, 地址传输消息具体可以是 HTTP消息。 如果是基于 Websocket的信令连接, WebRTC业务服务器均可 以保持和 Web应用 A、 Web应用 B之间的 Websocket长连接, 可以随时向 Web应用 A或 Web应用 B发送信令, 也可以随时接收来自 Web应用 A或 Web应用 B的信令,在这种情况下, Web应用 B可以将浏览器 B的第二 ICE 地址携带在 Websocket报文, 此时, 地址传输消息具体可以是 Websocket 报文, 并通过 WebRTC业务服务器将包含 Websocket报文发送到 Web应用 A。
407、 Web应用 A接收 Web应用 B发送的地址传输消息后, 从地址传 输消息中获取到浏览器 B的第二 ICE地址。 Web应用 A根据当前业务的业 务 ID和处理指示表, 确定浏览器 A对该浏览器 B的第二 ICE地址的处理 指示, 并向浏览器 A 发送地址增加候选 ( addlceCandidate ) 消息, 该 addlceCandidate中携带了浏览器 B的第二 ICE地址以及对该浏览器 B的第 二 ICE地址的处理指示。
当处理指示表具体为业务与处理指示对应关系表时, Web应用 A获取 当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务 器分配的; Web应用 A根据业务 ID和业务与处理指示对应关系表, 获得 业务 I D对应的处理指示, 确认业务 ID对应的处理指示为浏览器 A对第二 ICE 地址的处理指示; 或者, 当处理指示表包含业务与类型对应关系表和 类型与处理指示对应关系表时, Web应用 A获取当前业务的业务 ID,其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; Web应用 A根据 业务 ID和业务与类型对应关系表, 获得业务 ID对应的类型 ID, 并根据类 型与处理指示对应关系表, 获得类型 ID对应的处理指示, 确认类型 ID对 应的处理指示为浏览器 A对第二 ICE地址的处理指示。
处理指示可以多种, 比如, 替换, 保存和自主决策。 其中处理指示可 以两种表达, 可以通过处理参数来表示, 处理参数具体可以为 replace, 而 replace参数有三个值, 1), Yes, 表示的处理指示为替换, 即浏览器 A需要 优先使用浏览器 B的第二 ICE地址,也就是说,在检测浏览器 B的第二 ICE 地址可达时,将浏览器 B的址第一 ICE地址替换为浏览器 B的第二 ICE地 址, 在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃该浏览器 B 的第二 ICE地址; 2), No, 表示的处理指示为保存, 即浏览器 A优先保存 浏览器 B的第二 ICE地址, 也就是说, 在检测浏览器 B的第二 ICE地址可 达时, 浏览器 A只保存浏览器 A的 ICE地址与浏览器 B的第二 ICE地址 的地址对, 在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃该浏 览器 B的第二 ICE地址; 3 ), Auto, 表示的处理指示为自主决策, 即由浏 览器 A自身决策如何使用浏览器 B的第二 ICE地址。还可以利用不同的处 理参数来表示不同的处理指示, 例如处理参数为 replace时, 与上述 replace 的值为 yes的含义相同, 处理参数为 store时, 与上述 replace的值为 no的 含义相同, 处理参数为 auto时, 与上述 replace的值为 auto的含义相同。
408、 浏览器 A接收到 addlceCandidate消息后, 根据 addlceCandidate 消息中处理指示来处理该浏览器 B的第二 ICE地址。
浏览器 A根据处理指示来处理该浏览器 B的第二 ICE地址的详细方法 描述如下:
1 ) 当浏览器 A 收到 Web应用 A的 addlceCandidate消息后, 浏览器 A首先判断现有的 WebRTC 会话中是否有对应的连接。在 ICE地址中包含 一个 M行索引的参数, 浏览器会将这个 M行索引对比现有 SDP中所有 M 行的索引, 如果找到一个和 ICE地址的 M行索引相同的 M行, 就认为存 在一个和 ICE地址对应的连接, 否则就是不存在。
2 )如果现有的 WebRTC 会话中不存在对应连接, 那么浏览器 A会忽 略 addlceCandidate消息中的处理指示,检测浏览器 B的第二 ICE地址是否 可达, 如果浏览器 B的第二 ICE地址可达, 浏览器 A则将该浏览器 B的第 二 ICE地址和浏览器 A自身的 ICE地址配对并保存在浏览器 A的 ICE地址 对列表中。 如果浏览器 B的第二 ICE地址不可达, 浏览器 A则丢弃该浏览 器 B的第二 ICE地址。
3 ) 如果现有的 WebRTC 会话中存在对应连接, 浏览器 A 则分析 addlceCandidate消息中处理指示。 如果处理指示为替换, 浏览器 A检测该 浏览器 B的第二 ICE地址是否可达,如果浏览器 B的第二 ICE地址不可达, 则丢弃该浏览器 B的第二 ICE地址;如果该浏览器 B的第二 ICE地址可达, 浏览器 A则将与浏览器 B第一 ICE地址替换为该浏览器 B的第二 ICE地址。 如果处理指示为保存, 浏览器 A检测浏览器 B的第二 ICE地址是否可达, 如果浏览器 B的第二 ICE地址可达, 浏览器 A则将该浏览器 B的第二 ICE 地址和浏览器 A自身的 ICE地址配对并保存在浏览器 A的 ICE地址对列表 中; 如果浏览器 B的第二 ICE地址不可达, 浏览器 A则丢弃掉该浏览器 B 的第二 ICE地址。 如果处理指示为自动, 浏览器 A可以根据自主决策如何 处理该浏览器 B的第二 ICE地址, 比如: 浏览器 A检测该浏览器 B的第二 ICE地址是否可达, 如果该浏览器 B的第一 ICE可达, 则检查该浏览器 B 的第二 ICE地址携带的优先级; 如果该浏览器 B的第二 ICE地址携带的优 先级大于浏览器 B的第一 ICE地址携带的优先级, 则将与浏览器 B的第一 ICE地址替换为该浏览器 B的第二 ICE地址, 否则丢弃该浏览器 B的第二 ICE地址; 如果浏览器 B的第二 ICE地址不可达, 则丢弃该浏览器 B的第 二 ICE地址。
或者, 根据 addlceCandidate消息中处理指示来处理该浏览器 B的第二 ICE 地址, 具体为: 当处理指示为保存时, 根据所述处理指示为保存, 修 改 ICE代理状态机的状态为保持状态; 浏览器 A检测第二 ICE地址是否可 达, 并且在检测出所述第二 ICE地址可达时, 保存的浏览器 A的 ICE地址 和第二 ICE地址的地址对; 在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址; 当处理指示为替换时, 根据所述处理指示为替换, 修改 ICE代 理状态机的状态为检测状态; 浏览器 A检测第二 ICE地址是否可达, 并且 在检测出第二 ICE地址可达时, 将第一 ICE地址替换为第二 ICE地址; 在 检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址; 当处理指示为自主 决策时, 根据处理指示为所述自主决策, 修改 ICE代理状态机的状态为自 动状态; ICE代理状态机的状态为自动状态时, 浏览器 A检测第二 ICE 地址是否可达, 并且在检测出第二 ICE地址可达时, 检查第二 ICE地址携 带的优先级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携带的优 先级, 则将第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址携带的 优先级小于或等于第一 ICE地址携带的优先级,则丢弃所述第二 ICE地址; 在检测出第二 ICE地址不可达时, 则丢弃第二 ICE地址。
下面介绍一下浏览器 A检测浏览器 B的第二 ICE地址是否可达的具体 过程:
1 )、 浏览器 A向浏览器 B发送可达检测请求, 该可达检测请求具体可 以为 STUN请求, 以检测 "浏览器 A的 ICE地址: 浏览器 B的第二 ICE地 址" 地址对是否能够连通, 其中, 该 STUN请求包含了请求发送的源地址 和请求发往的目的地址, 例如: 这里的源地址为浏览器 A的 ICE地址, 目 的地址为浏览器 B的第二 ICE地址。
2 )、如果浏览器 A在规定时间内接收到浏览器 B返回的可达检测响应, 该可达检测响应具体可以为 STUN响应, 其中 STUN响应包含了响应发送 的源地址和请求发往的目的地址, 确认 "浏览器 A 的 ICE地址 : 浏览器 B的第二 ICE地址" 地址对是可以用于和浏览器 B的进行 WebRTC会话, 则该浏览器 B的第二 ICE地址可达。 例如: 这里 STUN响应的源地址为浏 览器 B的第二 ICE地址, 目的地址为浏览器 A的 ICE地址; 如果在规定时 间内,没有接收到浏览器 B返回的可达检测响应,则该浏览器 B的第二 ICE 地址不可达。
3 )、 类似的, 浏览器 B也可以向浏览器 A发送可达检测请求, 该可达 检测请求具体可以为 STUN请求, 以检测 "浏览器 B的第二 ICE地址: 浏 览器 A的 ICE地址" 地址对是否可达, 其中, 该 STUN请求包含了请求发 送的源地址和请求发往的目的地址, 例如: 这里的源地址为浏览器 B的第 二 ICE地址, 目的地址为浏览器 A的 ICE地址。
4 )、如果浏览器 B在规定时间内接收到浏览器 A返回的可达检测响应, 该可达检测响应具体可以为 STUN响应, 其中 STUN响应包含了响应发送 的源地址和请求发往的目的地址, 确认 "浏览器 B 的第二 ICE地址 : 浏 览器 A的 ICE地址" 地址对是可以用于和浏览器 A的进行 WebRTC会话, 则将该浏览器 A的 ICE地址可达。 例如: 这里的源地址为浏览器 A的 ICE 地址, 目的地址为浏览器 B的第二 ICE地址, 如果在规定时间内, 没有接 收到浏览器 A返回的可达检测响应, 则该浏览器 A的 ICE地址不可达。
在本发明的实施例中, 由于 WebRTC业务服务器根据业务需求, 预先 对 WebRTC业务服务器所能支持的所有业务都配置相应的处理方式, 这样 Web应用 A可以根据当前业务的业务 ID和处理指示表, 对接收到的浏览 器 B的第二 ICE地址设置相应的处理指示, 并可以让浏览器 A根据该处理 指示, 对该浏览器 B的第二 ICE地址进行相应处理, 这样就可以 Web应用 A实现了根据业务需求, 来控制浏览器 A对浏览器 B的第二 ICE地址的处 理指示, Web应用控制的粒度比较小, 影响小, 方便根据不同的业务灵活 调整对 ICE地址的策略。
如图 5所示, 为本发明实施例的另一种处理 ICE地址的方法, 应用于 信 WebRCT会话过程中, WebRTC会话是由第一万维网 Web应用通过第 一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第一 ICE地址协商建立的, 第一 Web应用为加载在第一终端的浏览器上的 Web 应用, 第二 Web应用为加载在第二终端的浏览器上的 Web应用, 该方法具 体包括:
501、 第一终端的浏览器接收第一万维网 Web应用发送的状态修改请 求, 状态修改请求包含第一终端的浏览器对在 WebRTC会话期间内接收到 的所有第二终端的浏览器的第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为第二终端的浏览器的更新的 ICE地址;
502、根据统一的处理指示, 修改第一终端的浏览器中的 ICE代理状态 机的状态, 使修改后的状态与处理指示相对应;
具体的: 当统一的处理指示为保存时, 修改 ICE代理状态机的状态为 保持状态; 当统一的处理指示为替换时, 修改 ICE代理状态机的状态为检 测状态; 当统一的处理指示为自主决策时, 修改 ICE代理状态机的状态为 自动状态。
可选的, 向第一 Web应用发送含允许更新标志的状态修改响应, 以便 于第一 Web应用根据允许更新标志通知 WebRTC业务服务器允许第二 Web 应用向第一 Web应用发送第二 ICE地址。
503、 在 WebRTC会话期间内, 第一终端的浏览器接收第一 Web应用 发送的包含第二 ICE地址的地址增加候选消息, 其中地址增加候选消息由 第一 Web应用在接收到第二 Web应用发送的包含第二 ICE地址的地址传输 消息之后发送的。
504、根据 ICE代理状态机的状态, 第一终端的浏览器对第二 ICE地址 进行相应处理。
具体的: 当 ICE代理状态机的状态为保持状态时, 第一终端的浏览器 检测第二 ICE地址是否可达, 如果第二 ICE地址可达, 则保存第一终端的 浏览器的 ICE地址和第二 ICE地址的地址对; 如果第二 ICE地址不可达, 则丢弃第二 ICE地址; 当 ICE代理状态机的状态为检测状态时, 第一终端 的浏览器检测第二 ICE地址是否可达, 如果第二 ICE地址可达, 则将第二 终端的浏览器的第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地址不 可达, 则丢弃第二 ICE地址; 根据 ICE代理状态机的状态为自动状态, 第 一终端的浏览器检测第二 ICE地址是否可达, 如果第二 ICE地址可达, 则 检查第二 ICE地址携带的优先级; 如果第二 ICE地址携带的优先级大于第 一 ICE地址携带的优先级, 则将与第一 ICE地址替换为第二 ICE地址; 如 果第二 ICE地址携带的优先级小于或等于第一 ICE地址携带的优先级, 则 丢弃第二 ICE地址; 如果第二 ICE地址不可达, 则丢弃第二 ICE地址。 其中检测第二 ICE地址是否可达, 具体为: 向第二终端的浏览器发送 可达检测请求, 如果在规定时间内, 第一终端的浏览器接收到第二终端的 浏览器返回的可达检测响应, 则第二 ICE地址可达; 如果在规定时间内, 第一终端的浏览器没有接收到第二终端的浏览器返回的能力检测响应, 则 第二 ICE地址是不可达。
可选的, 状态修改请求是由第一 Web应用根据当前业务的业务 ID和 处理指示表, 确定第一终端的浏览器对在 WebRTC会话期间内接收到的所 有第二 ICE地址的统一的处理指示之后, 向第一终端的浏览器发送的。
可选的, 该方法还包括: 在 WebRTC会话建立之前, WebRTC业务服 务器将 WebRTC业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关 系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用 发送包含处理指示表的表保存请求, 其中处理指示表具体为业务与处理指 示对应关系表, 接收第一 Web应用发送表保存响应, 其中表保存响应不包 含允许更新标志; 或者, WebRTC业务服务器将 WebRTC业务服务器所支 持的所有业务分别进行分类以及为每种类型设定相应的处理指示, 并将业 务的业务 ID与业务对应的类型 ID存储在业务与类型对应关系表中, 并将 业务对应的类型 ID与类型 ID相应的处理指示存储在类型与处理指示对应 关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应 用发送包含处理指示表的表保存请求, 其中处理指示表包含业务与类型对 应关系表和类型与处理指示对应关系表, 接收第一 Web应用发送表保存响 应, 其中表保存响应不包含允许更新标志。
如图 6所示, 为本发明实施例的一种设置 ICE地址处理指示的方法, 该方法具体包括:
601、 第一 Web应用通过第一终端的浏览器的 ICE地址与第二 Web应 用通过第二终端的浏览器的第一 ICE地址进行协商,并建立 WebRTC会话, 其中, 第一 Web应用为加载在第一终端的浏览器上 Web应用, 第二 Web 应用为加载在第二终端的浏览器上 Web应用。
602、 第一 Web应用根据当前业务的业务 ID和处理指示表, 确定所述 第一终端的浏览器对在所述 WebRTC 会话期间内接收到的所有所述第二 ICE地址的统一的处理指示。
603、 第一 Web应用向第一终端的浏览器发送状态修改请求, 状态修 改请求包含第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 终端的浏览器的第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为 第二终端的浏览器的更新的 ICE地址; 以便于第一终端的浏览器根据统一的 处理指示, 修改第一终端的浏览器中的 ICE代理状态机的状态, 使修改后 的状态与处理指示相对应;
可选的,在第一 Web应用向第一终端的浏览器发送状态修改请求之后, 第一 web应用还接收第一终端的浏览器发送的包含允许更新标志的状态修 改响应, 并且根据允许更新标志, 第一 Web应用向 WebRTC业务服务器发 送 ICE地址启动消息,以便于 WebRTC业务服务器允许第二 Web应用向第 一 Web应用发送第二 ICE地址。
可选的: 第一 Web应用根据当前业务的业务 ID和处理指示表, 确定 第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的 统一的处理指示具体为: 当处理指示表具体为业务与处理指示对应关系表 时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业 务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID和业务与处 理指示对应关系表, 获得业务 ID对应的处理指示, 确认业务 ID对应的处 理指示为第一终端的浏览器对在 WebRTC 会话期间内接收到的所有第二 ICE 地址的统一的处理指示; 或者, 当处理指示表包含业务与类型对应关 系表和类型与处理指示对应关系表时, 第一 Web应用获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 第一 Web应用根据业务 ID和业务与类型对应关系表, 获得业务 ID对应的类型 ID, 并根据类型 ID和类型与处理指示对应关系表, 获得类型 ID对应的处 理指示, 确认类型 ID 对应的处理指示为第一终端的浏览器对在 WebRTC 会话期间内接收到的所有第二 ICE地址的统一的处理指示。
可选的, 该方法还包括: 在 WebRTC会话建立之前, WebRTC业务服 务器将 WebRTC业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID 与业务相应的处理指示保存在业务与处理指示对应关 系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web应用 发送包含处理指示表的表保存请求, 其中处理指示表具体为业务与处理指 示对应关系表, 接收第一 Web应用发送表保存响应, 其中, 表保存响应不 包含允许更新标志; 或者, WebRTC业务服务器将 WebRTC业务服务器所 支持的所有业务分别进行分类以及为每种类型设定相应的处理指示, 并将 业务的业务 ID与业务对应的类型 ID存储在业务与类型对应关系表中, 并 将业务对应的类型 ID与类型 ID相应的处理指示存储在类型与处理指示对 应关系表中, 在 WebRTC会话建立之后, WebRTC业务服务器向第一 Web 应用发送包含处理指示表的表保存请求, 其中处理指示表包含业务与类型 对应关系表和类型与处理指示对应关系表, 接收第一 Web应用发送表保存 响应, 其中, 表保存响应不包含允许更新标志。
如图 7所示, 为本发明实施例的另一种处理 ICE地址的方法, 该方法 具体包括:
701、 除了 WebRTC业务服务器接收 Web应用 A发送的表保存响应, 以及, 根据允许更新标志, 向 Web应用 B发送允许更新消息, 以便于允许 Web应用 B向 Web应用 A发送第二 ICE地址, 与步骤 401不同外, 其它 的内容与步骤 401相同, 本实施例在此不赘述。
在本实施例中, WebRTC业务服务器接收 Web应用 A发送的表保存响 应中并不包含允许更新标志, 进一步的, 由于当前 WebRTC业务服务器还 没有接收到 Web应用 A发送的允许更新标志,因此此时没有向 Web应用 B 发送允许更新消息。 702、 Web应用 A根据当前业务的业务 ID和处理指示表, 确定浏览器 A对在所述 WebRTC会话期间内接收到的所有浏览器 B的第二 ICE地址的 统一的处理指示, 并向浏览器 A发送状态修改请求, 所述状态修改请求具 体为 updatelCE消息, 该 updatelCE消息包含浏览器 A对在所述 WebRTC 会话期间内接收到的所有浏览器 B的第二 ICE地址的统一的处理指示。
处理指示可以多种, 比如, 替换, 保存和自主决策。 其中处理指示可 以有两种表达, 可以通过处理参数来表达, 处理参数具体可以为 replace, 而 replace参数有三个值, 1), Yes, 表示的处理指示为替换, 即浏览器 A 需要优先使用浏览器 B的第二 ICE地址, 也就是说, 在检测浏览器 B的第 二 ICE地址可达时,将浏览器 B的第一 ICE地址替换为浏览器 B的第二 ICE 地址, 在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃该浏览器 B的第二 ICE地址; 2),No, 表示的处理指示为保存, 即浏览器 A优先保存 浏览器 B的第二 ICE地址, 也就是说, 在检测浏览器 B的第二 ICE地址的 可达时, 浏览器 A只保存浏览器 A的 ICE地址与浏览器 B的第二 ICE地 址的地址对, 在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃该 浏览器 B的第二 ICE地址; 3 ), Auto, 表示的处理指示为自主决策, 即由 浏览器 A自身决策如何使用浏览器 B的第二 ICE地址。还可以利用不同的 处理参数来表达不同的处理指示,例如处理参数为 replace时,与上述 replace 的值为 yes的含义相同, 处理参数为 store时, 与上述 replace的值为 no的 含义相同, 处理参数为 auto时, 与上述 replace的值为 auto的含义相同。
当处理指示表具体为业务与处理指示对应关系表时, Web应用 A获取 当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务 器分配的; Web应用 A根据业务 ID和业务与处理指示对应关系表, 获得 业务 ID对应的处理指示, 确认业务 ID对应的处理指示为浏览器 A对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理指示;或者, 当处理指示表包含业务与类型对应关系表和类型与处理指示对应关系 表时, Web应用 A获取当前业务的业务 ID, 其中, 业务 ID为创建当前业 务时 WebRTC业务服务器分配的; Web应用 A根据业务 ID和业务与类型 对应关系表, 获得业务 ID对应的类型 ID, 并根据类型 ID和类型与处理指 示对应关系表, 获得类型 ID对应的处理指示, 确认类型 ID对应的处理指 示为浏览器 A对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一 的处理指示。
703、浏览器 A接收了应用 A发送的 updatelCE消息后,根据 updatelCE 消息中统一的处理指示, 修改在浏览器 A中的 ICE代理状态机的状态。
浏览器 A根据 updatelCE消息中统一的处理指示, 修改在浏览器 A中 的 ICE代理状态机的状态。 比如当处理指示为保存的时候, 浏览器 A将在 浏览器 A中的 ICE代理状态机的状态修改为保持状态( HOLD ) , 在这种状 态下,在本次 WebRTC会话过程中,浏览器 A后续收到浏览器 B的第二 ICE 地址之后, 在检测该浏览器 B的第二 ICE地址的可达时, 浏览器 A只保存 浏览器 A的 ICE地址与浏览器 B的第二 ICE地址的地址对,在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃该浏览器 B的第二 ICE地址; 当处理指示为替换的时候,浏览器 A将浏览器 A中的 ICE代理状态机状态 修改为检测状态 (CHECKING ), 在这种状态下, 在本次 WebRTC会话过 程中, 浏览器 A在后续收到浏览器 B的第二 ICE地址之后, 在检测浏览器 B的第二 ICE地址可达时, 将浏览器 B的第一 ICE地址替换为浏览器 B的 第二 ICE地址, 在检测浏览器 B的第二 ICE地址不可达时, 浏览器 A丢弃 该浏览器 B的第二 ICE地址; 当处理指示为自主决策的时候, 浏览器 A在 ICE 代理状态机状态爹改为自动状态 (AUTO ), 在这种状态下, 在本次 WebRTC会话过程中,浏览器 A在后续收到浏览器 B的第二 ICE地址之后, 浏览器 A自身决策如何使用浏览器 B的第二 ICE地址。例如: 浏览器 A检 测该浏览器 B的第二 ICE地址是否可达,如果该浏览器 B的第一 ICE可达, 则检查该浏览器 B的第二 ICE地址携带的优先级; 如果该浏览器 B的第二 ICE地址携带的优先级大于浏览器 B的第一 ICE地址携带的优先级, 则将 与浏览器 B的第一 ICE地址替换为该浏览器 B的第二 ICE地址,否则丢弃 该浏览器 B的第二 ICE地址; 如果该浏览器 B的第一 ICE不可达, 则丢弃 该浏览器 B的第二 ICE地址。
704、 浏览器 A在修改 ICE代理状态机的状态完成后, 向 Web应用 A 发送允许更新标志的状态修改响应。
705、 Web应用 A接收允许更新标志的状态修改响应, 根据允许更新 标志, 向 WebRTC业务服务器发送地址启动消息, WebRTC业务服务器向 Web应用 B地址启动消息, 以允许 Web应用 B向 Web应用 A发送浏览器 B的第二 ICE地址, 其中, 第二 ICE地址为第二终端的浏览器的更新的 ICE 地址。
706、 Web应用 B接收 WebRTC业务服务器发送的地址启动消息, 确 认可以向 Web应用 A发送浏览器 B的第二 ICE地址, 并根据业务需求或 者网络需求, 确定浏览器 B需要收集浏览器 B 自身的新 ICE地址。
707-710、 与步骤 403-406相同, 本实施例在此不赞述。
711、 Web应用 A从 WebRTC 业务服务器接收到地址传输消息后, 从 地址传输消息中获取到浏览器 B 的第二 ICE 地址; 并向浏览器 A 发送 addlceCandidate消息,该 addlceCandidate消息中携带了浏览器 B的第二 ICE 地址。
712、 浏览器 A接收到上述 addlceCandidate消息, 获取到浏览器 B的 第二 ICE地址, 并根据步骤 703中保存的当前浏览器 A中的 ICE代理状态 机的状态, 确定对浏览器 B的第二 ICE地址的处理方式, 并根据该处理方 式对浏览器 B的第二 ICE地址相应处理。
1 ) 当浏览器 A收到 Web应用 A的 addlceCandidate消息后, 浏览器 A首先判断现有的 WebRTC 会话中是否有对应的连接。在 ICE地址中包含 一个 M行索引的参数, 浏览器会将这个 M行索引对比现有 SDP中所有 M 行的索引, 如果找到一个和 ICE地址的 M行索引相同的 M行, 就认为存 在一个和 ICE地址对应的连接, 否则就是不存在。
2 )如果现有的 WebRTC 会话中不存在对应连接, 那么浏览器 A会忽 略当前浏览器 A中的 ICE代理状态机的状态对应的处理方式, 检测浏览器 B的第二 ICE地址是否可达, 如果该浏览器 B的第二 ICE地址可达, 浏览 器 A则将该浏览器 B的第二 ICE地址和浏览器 A 自身的 ICE地址配对并 保存在浏览器 A的 ICE地址对列表中。如果该浏览器 B的第二 ICE地址不 可达, 浏览器 A则丢弃该浏览器 B的第二 ICE地址。
3 )如果现有的 WebRTC 会话中存在对应连接, 浏览器 A则分析当前 浏览器 A中的 ICE代理状态机的状态。 如果状态为检测状态, 浏览器 A检 测该浏览器 B的第二 ICE地址是否可达,如果该浏览器 B的第二 ICE地址 不可达, 则丢弃该浏览器 B的第二 ICE地址; 如果该浏览器 B的第二 ICE 地址可达,浏览器 A则将浏览器 B第一 ICE地址替换为该浏览器 B的第二 ICE地址。 如果处理方式为保持状态, 浏览器 A检测浏览器 B的第二 ICE 地址是否可达, 如果该浏览器 B的第二 ICE地址可达, 浏览器 A则将该浏 览器 B的第二 ICE地址和浏览器 A自身的 ICE地址配对并保存在浏览器 A 的 ICE地址对列表中; 如果该浏览器 B的第二 ICE地址不可达, 浏览器 A 则丢弃掉该浏览器 B的第二 ICE地址。 如果状态为自动状态, 浏览器 A检 测该浏览器 B的第二 ICE地址是否可达,如果该浏览器 B的第二 ICE地址 可达, 则检查该浏览器 B的第二 ICE地址自带的优先级; 如果该浏览器 B 的第二 ICE地址自带的优先级大于浏览器 B的第一 ICE地址自带的优先级, 则将与浏览器 B的第一 ICE地址替换为该浏览器 B的第二 ICE地址,否则 丢弃该浏览器 B的第二 ICE地址;如果该浏览器 B的第二 ICE地址不可达, 则丢弃该浏览器 B的第二 ICE地址。
浏览器 A检测浏览器 B 的第二 ICE地址是否可达的具体过程与步骤 408中的浏览器 A检测浏览器 B的第二 ICE地址是否可达的具体过程是相 同的, 这里就不赘述了。
在本发明的实施例中, 由于 Web应用 A在 WebRTC会话建立后, 确定 在本次 WebRTC会话期间内,浏览器 A对接收到的所有浏览器 B的第二 ICE 地址的统一的处理方式, 并向浏览器 A发送状态修改请求, 该状态修改请 求包含了在本次 WebRTC会话过程中浏览器 A对接收到的所有浏览器 B的 第二 ICE地址的统一的处理方式, 这样的话就实现了 Web应用 A在一个 WebRTC会话过程中, 设置统一的浏览器 B的第二 ICE地址的处理方式, 进一步的 Web应用 A无需为每一个浏览器 B发送的浏览器 B的第二 ICE 地址单独设置处理方式, 因此减少 Web应用 A对浏览器 B的第二 ICE地 址的处理判断。
图 8为本发明实施例提供的处理 ICE地址的装置的结构示意图, 用于 在网页实时通信 WebRTC会话过程中处理 ICE地址, 所述 WebRTC会话是 由第一万维网 Web应用与第二 Web应用通过所述装置自身的 ICE地址和运 行所述第二 Web应用的浏览器的第一 ICE地址协商建立, 所述第一 Web 应用为加载在所述装置上的 Web应用, 所述装置包括: 收发器 81和处理 器 82, 其中:
收发器 81 , 用于接收第一 Web应用发送的地址增加候选消息, 地址增 加候选消息包含处理器对运行第二 Web应用的浏览器的第二 ICE地址的处 理指示和第二 ICE地址;
收发器 81 , 还用于向处理器 82发送处理器对第二 ICE地址的处理指 示和第二 ICE地址;
处理器 82, 用于接收收发器 81发送的处理器对第二 ICE地址的处理 指示和第二 ICE地址, 并识别出该处理指示, 根据识别出的处理指示, 对 第二 ICE地址进行相应处理。
可选的, 图 9为本发明实施例提供的另一种处理 ICE地址的装置的结 构示意图, 处理器 82具体包括检测模块 821和丢弃模块 822, 其中: 检测 模块 821用于检测从收发器接收到的第二 ICE地址是否可达;丢弃模块 822 用于当检测模块检测到第二 ICE地址不可达时, 丢弃第二 ICE地址。
可选的, 处理器 82处理器具体包括第一保存模块 823、 第一替换模块 824和第一自主决策模块 825中的一个或多个, 该第一保存模块 823 , 用于 当检测模块检测到第二 ICE地址可达时, 以及当处理器识别出处理指示为 保存时, 保存处理 ICE地址的装置自身的 ICE地址和第二 ICE地址的地址 对;第一替换模块 824,用于当检测模块 821检测到第二 ICE地址可达时, 以及当处理器识别出处理指示为替换时, 将运行所述第二 Web应用的浏览 器的第一 ICE地址替换为第二 ICE地址; 第一自主决策模块 825 , 用于当 检测模块检测到第二 ICE地址可达时, 以及当处理器识别出处理指示为自 主决策时, 检查从收发器接收到的第二 ICE地址携带的优先级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携带的优先级, 则将与第一 ICE 地址替换为第二 ICE地址; 如果第二 ICE地址携带的优先级小于或等于第 一 ICE地址携带的优先级, 则向丢弃模块发送丢弃命令; 丢弃模块 822, 还用于接收丢弃命令, 丢弃第二 ICE地址。
可选的:处理器具体还用于识别出处理指示,根据识别出的处理指示, 修改装置自身中的 ICE代理状态机的状态, 使修改后的状态与处理指示相 对应; 根据 ICE代理状态机的状态, 装置自身对第二 ICE地址进行相应处 理。
可选的, 处理器 82具体包括第二保存模块 826、 第二替换模块 827和 第二自主决策模块 828中的一个或多个, 其中, 第二保存模块 826, 用于根 据处理指示为保存, 修改 ICE代理状态机的状态为保持状态; 当检测模块 检测到第二 ICE地址可达时, 保存装置自身的 ICE地址和第二 ICE地址的 地址对; 第二替换模块 827, 用于根据处理指示为替换, 修改 ICE代理状 态机的状态为检测状态; 当检测模块检测到第二 ICE地址可达时, 将第一 ICE地址替换为第二 ICE地址; 第二自主决策模块 828,用于根据处理指示 为自主决策, 修改 ICE代理状态机的状态为自动状态; ICE代理状态机的 状态为自动状态时,当检测模块检测到第二 ICE地址可达时,检查第二 ICE 地址携带的优先级; 如果第二 ICE地址携带的优先级大于第一 ICE地址携 带的优先级, 则将与第一 ICE地址替换为第二 ICE地址; 如果第二 ICE地 址携带的优先级小于或等于第一 ICE地址携带的优先级, 则向丢弃模块发 送丢弃命令; 丢弃模块, 还用于接收第二自主决策模块发送的丢弃命令, 丢弃第二 ICE地址。
图 10为本发明实施例提供的一种设置 ICE地址的处理指示的装置的结 构示意图, 包括: 会话模块 1001 , 用于通过第一终端的浏览器的 ICE地址 与万维网 Web应用通过第二终端的浏览器的第一 ICE地址进行协商, 并建 立网页实时通信 WebRTC会话, 其中, Web应用为加载在第二终端的浏览 器上 Web应用,该 Web应用就为图 3的方法实施例对应的第二 Web应用; 收发器 1002,用于在 WebRTC会话过程中,接收 Web应用发送的地址 传输消息, 地址传输消息包含第二终端的浏览器的第二 ICE地址;
处理器 1003 , 用于根据当前业务的业务 ID和处理指示表, 确定第一 终端的浏览器对收发器 1002接收到的第二 ICE地址的处理指示,并将收发 器 1002发送第一终端的浏览器对收发器 1002接收到的第二 ICE地址的处 理指示;
收发器 1002, 还用于接收处理器发送的第一终端的浏览器对第二 ICE 地址的处理指示, 并向第一终端的浏览器发送地址增加候选消息, 地址增 加候选消息包含了第二 ICE地址和第一终端的浏览器对第二 ICE地址处理 指示, 以便于第一终端的浏览器根据处理指示对第二 ICE地址进行相应处 理。
可选的, 处理器 1003 , 具体用于当处理指示表具体为业务与处理指示 对应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务 时 WebRTC业务服务器分配的;并根据业务 ID和业务与处理指示对应关系 表, 获得业务 ID对应的处理指示, 确认业务 ID对应的处理指示为第一终 端的浏览器对第二 ICE地址的处理指示; 或者, 处理器 1003 , 具体用于当 处理指示表包含业务与类型对应关系表和类型与处理指示对应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务 服务器分配的; 根据业务 ID和业务与类型对应关系表, 获得业务 ID对应 的类型 ID, 并根据类型与处理指示对应关系表, 获得类型 ID对应的处理 指示,确认类型 ID对应的处理指示为第一终端的浏览器对第二 I CE地址的 处理指示。
图 11为本发明实施例提供的另一种处理 ICE地址的装置的结构示意图, 用于在网页实时通信 WebRTC会话过程中处理 ICE地址, 所述 WebRTC会 话是由第一万维网 Web应用与第二 Web应用通过所述装置自身的 ICE地址 和运行所述第二 Web应用的浏览器的第一 ICE地址协商建立, 所述第一 Web应用为加载在所述装置上的 Web应用, 装置包括: 包括收发器 1101 和处理器 1102,
收发器 1101 , 用于接收第一 Web应用发送的状态修改请求, 状态修改 器请求包含处理器对在 WebRTC会话期间内接收到的所有所述第二 ICE地 址的统一的处理指示;
收发器 1101 , 还用于向处理器 1102发送处理器对在 WebRTC会话期 间内接收到运行所述第二 Web应用的所有第二 ICE地址的统一的处理指示 , 其中, 所述第二 ICE地址为运行第二 Web应用的浏览器的更新的 ICE地址; 处理器 1102, 用于接收收发器 1101发送的统一的处理指示, 并根据统 一的处理指示, 修改 ICE代理状态机的状态, 使修改后的状态与处理指示 相对应。
收发器 1101 , 还用于当 ICE 代理状态机的状态修改成功后, 向第一 Web应用发送包含允许更新标志的状态修改响应, 以便于所述第一 Web应 用根据所述允许更新标志通知 WebRTC业务服务器允许所述第二 Web应用 向所述第一 Web应用发送所述第二 ICE地址。
收发器 1101 ,还用于接收第一 Web应用发送的包含第二 ICE地址的地 址增加候选消息, 并向处理器 1102发送地址增加候选消息;
处理器 1102, 用于接收收发器 1101发送的地址增加候选消息, 并获取 到 ICE代理状态机的状态, 根据状态, 对第二 ICE地址进行相应处理。
可选的,图 12为本发明实施例提供的另一种处理 ICE地址的装置的结 构示意图,处理器 1103具体包括检测模块 11021和丢弃模块 11022,其中: 检测模块 11021用于检测从收发器 1101接收到的第二 ICE地址是否可达; 丢弃模块 11022用于当检测模块 11021检测到第二 ICE地址不可达时, 丢 弃第二 ICE地址。
可选的, 处理器 1102, 具体用于当处理指示为保存时, 修改 ICE代理 状态机的状态为保持状态; 当处理指示为替换, 修改 ICE代理状态机的状 态为检测状态; 当处理指示为自主决策, 修改 ICE代理状态机的状态为自 动^ 态;
可选的, 处理器 1102 具体还包括保存模块 11023 , 用于当检测模块 11021检测到第二 ICE地址可达时, 以及当 ICE代理状态机的状态为保持 状态时, 保存处理 ICE地址的装置自身的 ICE地址和第二 ICE地址的地址 对。
可选的, 处理器 1102 具体还包括替换模块 11024, 用于当检测模块 11021检测到第二 ICE地址可达时当 ICE代理状态机的状态为检测状态时, 将运行第二 Web应用的浏览器的第一 ICE地址替换为第二 ICE地址。
可选的, 处理器 1102具体还包括自主决策模块 11025 , 用于当检测模 块 11021检测到第二 ICE地址可达时, 以及当 ICE代理状态机的状态为自 动状态时, 检查第二 ICE地址携带的优先级, 如果第二 ICE地址携带的优 先级大于第一 ICE地址携带的优先级,则将与第一 ICE地址替换为第二 ICE 地址; 如果第二 ICE地址携带的优先级小于或等于第一 ICE地址携带的优 先级, 则向丢弃模块 11022发送丢弃命令;
丢弃模块 11022, 还用于接收丢弃命令, 丢弃第二 ICE地址。
图 13为本发明实施例提供的另一种设置 ICE地址的处理指示的装置的 结构示意图,具体包括:会话模块 1301 ,用于通过第一终端的浏览器的 ICE 地址与万维网 Web应用通过第二终端的浏览器的第一 ICE地址进行协商, 并建立 WebRTC会话, 其中, Web应用为加载在第二终端的浏览器上 Web 应用, 这里的 Web应用对应于图 6实施例的第二 Web应用;
处理器 1302, 用于根据当前业务的业务 ID和处理指示表, 确定第一 终端的浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一 的处理指示。
收发器 1303 , 用于向第一终端的浏览器发送状态修改请求, 状态修改 请求包含了处理器 1302确定的第一终端的浏览器对在 WebRTC会话期间内 接收到的所有第二终端的浏览器的第二 ICE地址的统一的处理指示, 其中, 第二 ICE地址为第二终端的浏览器的更新的 ICE地址; 以便于第一终端的浏 览器根据统一的处理指示, 修改第一终端的浏览器中的 ICE代理状态机的 状态, 使修改后的状态与处理指示相对应。
收发器 1303 , 还用于接收第一终端的浏览器发送的包含允许更新标志 的状态修改响应, 并且根据允许更新标志, 向 WebRTC业务服务器发送地 址启动消息, 以便于 WebRTC业务服务器允许第二 Web应用向第一 Web 应用发送第二 ICE地址。
可选的,处理器 1302具体用于当处理指示表具体为业务与处理指示对 应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的; 根据业务 ID和业务与处理指示对应关系表, 获得业务 ID对应的处理指示, 确认业务 ID对应的处理指示为第一终端的 浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理 指示; 或者, 处理器 1302具体还用于当处理指示表为业务与类型对应关系 表和类型与处理指示对应关系表时, 获取当前业务的业务 ID, 其中, 业务 ID为创建当前业务时 WebRTC业务服务器分配的;根据业务 ID和类型表, 获得业务 ID对应的类型 ID, 并根据类型 ID与处理指示的对应关系表, 获 得类型 ID对应的处理指示, 确认类型 ID对应的处理指示为第一终端的浏 览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的统一的处理指 示。
如图 14所示, 介绍了一种 WebRTC业务服务器, 包括收发器和处理 器, 其中, 处理器 1401 , 用于将 WebRTC业务服务器所支持的所有业务分 别设定相应的处理指示,并将业务的业务 ID与业务相应的处理指示保存在 业务与处理指示对应关系表中, 此时处理指示表具体为业务与处理指示对 应关系表, 或者将 WebRTC业务服务器所支持的所有业务分别进行分类以 及为每种类型设定相应的处理指示,并将业务的业务 ID与业务对应的类型 ID存储在业务与类型对应关系表中, 并将业务对应的类型 ID与类型 ID相 应的处理指示存储在类型与处理指示对应关系表, 此时处理指示表包含业 务与类型对应关系表和类型与处理指示对应关系表; 收发器 1402, 用于在 WebRTC会话建立之后, 向加载在第一终端的浏览器上的第一 Web应用发 送包含处理指示表的表保存请求, 接收第一 Web应用发送表保存响应。
可选的, 收发器 1402还用于, 当表保存响应包含允许更新标志时, 根 据允许更新标志, 向加载在第二终端的浏览器上的第二 Web应用发送允许 更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址; 当保存响应不包含允许更新标志时, 还接收第一 Web应用发送的包含允许 更新标志的允许更新通知, 根据允许更新标志, 向第二 Web应用发送允许 更新消息, 以便于允许第二 Web应用向第一 Web应用发送第二 ICE地址。
本发明实施例中的处理 ICE地址的装置可以基于计算机系统来实现, 图 2、图 4-5和图 7所示的方法均可在基于计算机系统的处理 ICE地址的装 置中实现。图 15示出了基于计算机系统来实现的处理 ICE地址的装置的实 施例。本实施例中处理 ICE地址的装置可以包括:处理器 1501、存储器 1502 和通信接口 1503。 存储器 1502用于存储程序代码。 处理器 1501用于执行 存储器 1502中存储的程序代码。 本发明一个实施例中, 存储器 1502存储 有第一程序代码, 处理器 1501用于执行该第一程序代码, 包括执行如下操 作: 在 WebRCT会话过程中, WebRTC会话是由第一 Web应用通过第一终 端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第一 ICE 地址协商建立的,第一 Web应用为加载在第一终端的浏览器上的 Web应用, 第二 Web应用为加载在第二终端的浏览器上的 Web应用,以及第一终端的 浏览器接收第一 Web应用发送的地址增加候选消息, 地址增加候选消息包 含第二终端的浏览器的第二 ICE地址和第一终端的浏览器对第二 ICE地址 的处理指示; 第一终端的浏览器识别出处理指示, 根据识别出的处理指示 对第二 ICE地址进行相应处理。 本发明的另外一个实施例中, 存储器 1502 存储有第二程序代码, 处理器 1501用于执行该第二程序代码, 包括执行如 下操作: 在 WebRCT会话过程中, WebRTC会话是由第一 Web应用通过第 一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第一 ICE地址协商建立的, 第一 Web应用为加载在第一终端的浏览器上的 Web 应用, 第二 Web应用为加载在第二终端的浏览器上的 Web应用, 以及第一 终端的浏览器接收第一 Web应用发送的状态修改请求, 状态修改请求包含 第一终端的浏览器对在 WebRTC会话期间内接收到的所有第二 ICE地址的 统一的处理指示; 根据统一的处理指示, 修改第一终端的浏览器中的 ICE 代理状态机的状态, 使修改后的状态与处理指示相对应; 第一终端的浏览 器向第一 Web应用发送含允许更新标志的状态修改响应, 以便于第一 Web 应用根据允许更新标志通知 WebRTC业务服务器允许第二 Web应用向第一 Web应用发送第二 ICE地址; 在 WebRTC会话期间内, 第一终端的浏览器 接收第一 Web应用发送的包含第二 ICE地址的地址增加候选消息, 其中地 址增加候选消息由第一 Web应用在接收到第二 Web应用发送的包含第二 ICE地址的地址传输消息之后发送的; 根据 ICE代理状态机的状态, 第一 终端的浏览器对第二 ICE地址进行相应处理。 通信接口 1403 , 用于与外部 设备通信,如与 Web应用通信。处理 ICE地址的装置与 Web应用之间交互 的消息 (如方法实施例图 2、 图 4-5和图 7所示) 均通过通信接口 1503发 送和接收。 其中, 处理器 1501根据存储器 1502中的程序代码对通信接口 1503接收到的消息进行处理, 并通过通信接口 1503与外部设备交互。处理 器 1501可以是中央处理器 (central processing unit, CPU ), 专用集成电路 ( application- specific integrated circuit, ASIC ) 等。 其中, 本实施例中的处 理 ICE地址的装置可以包括总线 1504。 处理器 1501、 存储器 1502以及通 信接口 1503之间可通过总线 1504连接并通信。 其中, 存储器 1502可以包 括: 随机存取存者器( random access memory, RAM ),只读存者器( read-only memory, ROM ), 磁盘等具有存储功能的实体。 本发明实施例中的呼叫上下 文可緩存在 RAM中。
本发明实施例中的设置 ICE地址的处理指示的装置可以基于计算机系 统来实现, 图 3-4和图 6-7所示的方法均可在基于计算机系统的 ICE处理 地址的装置中实现。图 16示出了基于计算机系统来实现的处理 ICE地址的 装置的实施例。 本实施例中处理 ICE地址的装置可以包括: 处理器 1601、 存储器 1602和通信接口 1603。存储器 1602用于存储程序代码。处理器 1601 用于执行存储器 1602 中存储的程序代码。 本发明一个实施例中, 存储器 1602存储有第一程序代码,处理器 1601用于执行该第一程序代码, 包括执 行如下操作: 第一 Web应用通过第一终端的浏览器的 ICE地址与第二 Web 应用通过第一终端的浏览器的第一 ICE地址进行协商, 并建立网页实时通 信 WebRTC会话, 其中, 第一 Web应用为加载在第一终端的浏览器上 Web 应用, 第二 Web应用为加载在第二终端的浏览器上 Web应用; 在 WebRTC 会话过程中, 第一 Web应用接收第二 Web应用发送的地址传输消息, 地址 传输消息包含了第二终端的浏览器的第二 ICE地址; 第一 Web应用根据当 前业务的业务 ID和处理指示表 , 确定第一终端的浏览器对第二 ICE地址 的处理指示; 向第一终端的浏览器发送地址增加候选消息, 地址增加候选 消息包含第二 ICE地址和第一终端的浏览器对第二 ICE地址处理指示, 以 便于第一终端的浏览器根据处理指示对第二 ICE地址进行相应处理。 本发 明的另外一个实施例中, 存储器 1602存储有第二程序代码, 处理器 1601 用于执行该第二程序代码, 包括执行如下操作: 第一万维网 Web应用通过 第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏览器的第 一 ICE地址进行协商, 并建立网页实时通信 WebRTC会话, 其中, 第一 Web应用为加载在第一终端的浏览器上 Web应用,第二 Web应用为加载在 第二终端的浏览器上 Web应用; 第一 Web应用根据当前业务的业务 ID和 处理指示表, 确定第一终端的浏览器对在 WebRTC会话期间内接收到的所 有第二 ICE地址的统一的处理指示; 第一 Web应用向第一终端的浏览器发 送状态修改请求, 状态修改请求包含第一终端的浏览器对在 WebRTC会话 期间内接收到的所有第二 ICE地址的统一的处理指示, 以便于第一终端的 浏览器根据统一的处理指示, 修改第一终端的浏览器中的 ICE代理状态机 的状态, 使修改后的状态与处理指示相对应; 接收第一终端的浏览器发送 的包含允许更新标志的状态修改响应, 并且根据允许更新标志, 第一 Web 应用向 WebRTC业务服务器发送地址启动消息, 以便于 WebRTC业务服务 器允许第二 Web应用向第一 Web应用发送第二 ICE地址。通信接口 1603 , 用于与外部设备通信, 如与浏览器通信。 处理 ICE地址的装置与浏览器之 间交互的消息 (如方法实施例图 3-4和图 6-7所示) 均通过通信接口 1603 发送和接收。 其中, 处理器 1601根据存储器 1602中的程序代码对通信接 口 1603接收到的消息进行处理, 并通过通信接口 1603与外部设备交互。 处理器 1601可以是中央处理器( central processing unit, CPU )、 专用集成电 路 ( application- specific integrated circuit, ASIC ) 等。 其中, 本实施例中的 处理 ICE地址的装置可以包括总线 1604。 处理器 1601、 存储器 1602以及 通信接口 1603之间可通过总线 1604连接并通信。 其中, 存储器 1602可以 包括: 随机存取存 器 ( random access memory, RAM ) , 只读存 器 ( read-only memory, ROM ), 磁盘等具有存储功能的实体。 本发明实施例中 的呼叫上下文可緩存在 RAM中。
本发明实施例中的 WebRTC业务服务器可以基于计算机系统来实现, 图 2-7所示的方法均可在基于计算机系统的 ICE处理地址的装置中实现。 图 17示出了基于计算机系统来实现的 WebRTC业务服务器的实施例。本实 施例中 WebRTC业务服务器可以包括: 处理器 1701、 存储器 1702和通信 接口 1703。 存储器 1702用于存储程序代码。 处理器 1701用于执行存储器 1702中存储的程序代码。本发明一个实施例中,存储器 1702存储有第一程 序代码, 处理器 1701 用于执行该第一程序代码, 包括执行如下操作: 将 WebRTC 业务服务器所支持的所有业务分别设定相应的处理指示, 并将业 务的业务 ID与业务相应的处理指示保存在业务与处理指示对应关系表中, 此时处理指示表具体为业务与处理指示对应关系表, 或者将 WebRTC业务 服务器所支持的所有业务分别进行分类以及为每种类型设定相应的处理指 示, 并将业务的业务 ID与业务对应的类型 ID存储在业务与类型对应关系 表中, 并将业务对应的类型 ID与类型 ID相应的处理指示存储在类型与处 理指示对应关系表, 此时处理指示表包含业务与类型对应关系表和类型与 处理指示对应关系表; 在 WebRTC会话建立之后, 向加载在第一终端的浏 览器上的第一 Web应用发送包含处理指示表的表保存请求, 接收第一 Web 应用发送表保存响应。 通信接口 1703 , 用于与外部设备通信, 如与浏览器 通信。处理 ICE地址的装置与浏览器之间交互的消息(如方法实施例图 2-7 所示) 均通过通信接口 1703发送和接收。 其中, 处理器 1701根据存储器 1702中的程序代码对通信接口 1703接收到的消息进行处理,并通过通信接 口 1703与外部设备交互。处理器 1701可以是中央处理器(central processing unit, CPU )、专用集成电路( application- specific integrated circuit, ASIC )等。
其中,本实施例中的处理 ICE地址的装置可以包括总线 1704。处理器 1701、 存储器 1702以及通信接口 1703之间可通过总线 1704连接并通信。 其中, 存储器 1702可以包括: 随机存取存储器 ( random access memory, RAM ), 只读存储器(read-only memory, ROM ), 磁盘等具有存储功能的实体。 本发 明实施例中的呼叫上下文可緩存在 RAM中。
本领域普通技术人员可以理解, 实现上述实施例所示视频编码和解码 方法可以通过程序指令相关的硬件来完成, 所述的程序可以存储于可读取 存储介质中, 该程序在执行时执行上述方法中的对应步骤。 所述的存储介 质可以如: ROM/RAM、 磁碟、 光盘等。
以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的 普通技术人员来说, 在不脱离本发明原理的前提下, 还可以做出若干改进 和润饰, 这些改进和润饰也应视为本发明的保护范围。
+

Claims

权 利 要 求
1、 一种处理交互式连接建立 ICE地址的方法, 其特征在于, 应用于网 页实时通信 WebRCT会话过程中, 所述 WebRTC会话是由第一万维网 Web 应用通过第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端的浏 览器的第一 ICE地址协商建立的, 所述第一 Web应用为加载在所述第一终 端的浏览器上的 Web应用,所述第二 Web应用为加载在所述第二终端的浏 览器上的 Web应用, 所述方法包括:
所述第一终端的浏览器接收第一 Web应用发送的地址增加候选消息, 所述地址增加候选消息包含所述第二终端的浏览器的第二 ICE地址和所述 第一终端的浏览器对所述第二 ICE地址的处理指示;
所述第一终端的浏览器识别出所述处理指示, 根据识别出的处理指示 对所述第二 ICE地址进行相应处理。
2、如权利要求 1所述的方法,其特征在于,所述处理指示具体为保存、 替换或自主决策;
所述第一终端的浏览器识别出所述处理指示, 根据所述识别出的处理 指示对所述第二 ICE地址进行相应处理, 包括:
所述第一终端的浏览器识别出所述处理指示为保存时, 检测所述第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址可达时, 保存所述第 一终端的浏览器的 ICE地址和所述第二 ICE地址的地址对; 在检测出所述 第二 ICE地址不可达时, 则丢弃所述第二 ICE地址; 或者
所述第一终端的浏览器识别出所述处理指示为替换时, 检测所述第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址可达时, 将所述第一 ICE地址替换为所述第二 ICE地址;在检测出所述第二 ICE地址不可达时, 则丢弃所述第二 ICE地址; 或者,
所述第一终端的浏览器识别出所述处理指示为自主决策时, 检测所述 第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址可达时, 检查所 述第二 ICE地址携带携带的优先级; 如果所述第二 ICE地址携带携带的优 先级高于所述第一 ICE地址携带的优先级, 则将所述第一 ICE地址替换为 所述第二 ICE地址; 如果所述第二 ICE地址携带的优先级低于或等于所述 第一 ICE地址携带的优先级, 则丢弃所述第二 ICE地址; 在检测出所述第 二 ICE地址不可达时, 则丢弃所述第二 ICE地址。
3、 如权利要求 2所述的方法, 其特征在于, 所述检测所述第二 ICE地 址是否可达, 具体为:
向所述第二终端的浏览器发送可达检测请求, 如果在规定时间内, 所 述第一终端的浏览器接收到所述第二终端的浏览器返回的可达检测响应, 则所述第二 ICE地址是可达; 如果在规定时间内, 所述第一终端的浏览器 没有接收到所述第二终端的浏览器返回的可达检测响应, 则所述第二 ICE 地址是不可达的。
4、 如权利要求 1所述的方法, 其特征在于, 所述第一终端的浏览器识 别出所述处理指示, 根据所述识别出的处理指示对所述第二 ICE地址进行 相应处理, 具体包括:
所述第一终端的浏览器识别出所述处理指示, 根据所述识别出的处理 指示, 修改所述第一终端的浏览器中的 ICE代理状态机的状态, 使修改后 的状态与所述处理指示相对应; 根据所述 ICE代理状态机的状态, 所述第 一终端的浏览器对所述第二 ICE地址进行相应处理。
5、如权利要求 4所述的方法,其特征在于,所述处理指示具体为保存、 替换或自主决策;
所述根据所述识别出的处理指示,修改所述第一终端的浏览器中的 ICE 代理状态机的状态,使修改后的状态与所述处理指示相对应;根据所述 ICE 代理状态机的状态, 所述第一终端的浏览器对所述第二 ICE地址进行相应 处理, 具体包括:
根据所述处理指示为保存, 修改所述 ICE代理状态机的状态为保持状 态; 所述第一终端的浏览器检测所述第二 ICE地址是否可达, 并且在检测 出所述第二 ICE地址可达时, 保存所述第一终端的浏览器的 ICE地址和所 述第二 ICE地址的地址对; 在检测出所述第二 ICE地址不可达时, 则丢弃 所述第二 ICE地址; 或者,
根据所述处理指示为替换, 修改所述 ICE代理状态机的状态为检测状 态; 所述第一终端的浏览器检测所述第二 ICE地址是否可达, 并且在检测 出所述第二 ICE地址可达时, 将所述第一 ICE地址替换为所述第二 ICE地 址; 在检测出所述第二 ICE地址不可达时, 则丢弃所述第二 ICE地址; 或 者,
根据所述处理指示为所述自主决策, 修改所述 ICE代理状态机的状态 为自动状态; 所述 ICE代理状态机的状态为自动状态时, 所述第一终端的 浏览器检测所述第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址 可达时, 检查所述第二 ICE地址携带的优先级; 如果所述第二 ICE地址携 带的优先级大于所述第一 ICE地址携带的优先级, 则将所述第一 ICE地址 替换为所述第二 ICE地址; 如果所述第二 ICE地址携带的优先级小于或等 于所述第一 ICE地址携带的优先级, 则丢弃所述第二 ICE地址; 在检测出 所述第二 ICE地址不可达时, 则丢弃所述第二 ICE地址。
6、 如权利要求 1所述的方法, 其特征在于, 所述地址增加候选消息是 由所述第一 Web应用在接收所述第二 Web应用发送的地址传输消息,以及 根据当前业务的业务 ID和处理指示表,确定所述第一终端的浏览器对所述 第二 ICE地址的处理指示之后, 向所述第一终端的浏览器发送的, 其中, 所述地址传输消息包含所述第二终端的浏览器的第二 ICE地址。
7、 如权利要求 6所述的方法, 其特征在于, 还包括: 在所述 WebRTC 会话建立之前, WebRTC业务服务器将所述 WebRTC业务服务器所支持的 所有业务分别设定相应的处理指示,并将业务的业务 ID与所述业务相应的 所述处理指示保存在所述业务与处理指示对应关系表中, 在所述 WebRTC 会话建立之后, 所述 WebRTC业务服务器向所述第一 Web应用发送包含处 理指示表的表保存请求, 其中所述处理指示表具体为业务与处理指示对应 关系表, 接收所述第一 Web应用发送包含允许更新标志的表保存响应, 根 据所述允许更新标志, 向所述第二 Web应用发送允许更新消息, 以便于允 许所述第二 Web应用向所述第一 Web应用发送所述第二 ICE地址; 或者, 所述 WebRTC业务服务器将所述 WebRTC业务服务器所支持的所有业 务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业务 ID 与所述业务对应的类型 ID存储在业务与类型对应关系表中,并将所述业务 对应的类型 ID与所述类型 ID相应的处理指示存储在所述类型与处理指示 对应关系表中, 在所述 WebRTC会话建立之后, 所述 WebRTC业务服务器 向所述第一 Web应用发送包含所述处理指示表的表保存请求, 其中所述处 理指示表包含业务与类型对应关系表和类型与处理指示对应关系表, 接收 所述第一 Web应用发送含允许更新标志的表保存响应, 根据所述允许更新 标志, 向所述第二 Web应用发送允许更新消息, 以便于允许所述第二 Web 应用向所述第一 Web应用发送所述第二 ICE地址。
8、 如权利要求 7所述的方法, 其特征在于, 还包括: 当所述处理指示 表具体为业务与处理指示对应关系表时, 所述第一 Web应用获取当前业务 的所述业务 ID, 其中, 所述业务 ID为创建所述当前业务时所述 WebRTC 业务服务器分配的; 所述第一 Web应用根据所述业务 ID和所述业务与处 理指示对应关系表, 获得所述业务 ID对应的处理指示, 确认所述业务 ID 对应的处理指示为所述第一终端的浏览器对所述第二 ICE地址的处理指示; 或者,
当所述处理指示表包含所述业务与类型对应关系表和所述类型与处理 指示对应关系表时,所述第一 Web应用获取当前业务的所述业务 ID,其中, 所述业务 ID为创建所述当前业务时所述 WebRTC业务 务器分配的;所述 第一 Web应用根据所述业务 ID和所述业务与类型对应关系表, 获得所述 业务 ID对应的类型 ID, 并根据所述类型与处理指示对应关系表, 获得所 述类型 ID对应的处理指示, 确认所述类型 ID对应的处理指示为第一终端 的浏览器对所述第二 ICE地址的处理指示。
9、 一种设置交互式连接建立 ICE地址处理指示的方法, 其特征在于, 包括:
第一万维网 Web应用通过第一终端的浏览器的 ICE地址与第二 Web 应用通过第一终端的浏览器的第一 ICE地址进行协商, 并建立网页实时通 信 WebRTC会话, 其中, 所述第一 Web应用为加载在所述第一终端的浏览 器上 Web应用,所述第二 Web应用为加载在所述第二终端的浏览器上 Web 应用;
在所述 WebRTC会话过程中, 所述第一 Web应用接收所述第二 Web 应用发送的地址传输消息, 所述地址传输消息包含了所述第二终端的浏览 器的第二 ICE地址;
所述第一 Web应用根据当前业务的业务 ID和处理指示表, 确定所述 第一终端的浏览器对所述第二 ICE地址的处理指示;
向所述第一终端的浏览器发送地址增加候选消息, 所述地址增加候选 消息包含所述第二 ICE地址和所述第一终端的浏览器对所述第二 ICE地址 处理指示,以便于所述第一终端的浏览器根据所述处理指示对所述第二 ICE 地址进行相应处理。
10、 如权利要求 9所述的方法, 其特征在于, 所述第一 Web应用根据 当前业务的业务 ID和处理指示表,确定所述第一终端的浏览器对所述第二 ICE地址的处理指示, 具体为:
当所述处理指示表为业务 ID 与处理指示的对应关系表时, 所述第一 Web应用获取当前业务的所述业务 ID, 其中, 所述业务 ID为创建所述当 前业务时所述 WebRTC业务服务器分配的; 所述第一 Web应用根据所述业 务 ID和业务 ID与处理指示的对应关系表,获得所述业务 ID对应的处理指 示,确认所述业务 ID对应的处理指示为所述第一终端的浏览器对所述第二 ICE地址的处理指示; 或者,
当所述处理指示表为类型表和类型与处理指示的对应关系表时, 所述 第一 Web应用获取当前业务的所述业务 ID, 其中, 所述业务 ID为创建所 述当前业务时所述 WebRTC业务服务器分配的; 所述第一 Web应用根据所 述业务 ID和所述类型表, 获得所述业务 ID对应的类型 ID, 并根据所述类 型 ID与处理指示的对应关系表, 获得所述类型 ID对应的处理指示, 确认 所述类型 ID对应的处理指示为第一终端的浏览器对所述第二 ICE地址的处 理指示。
11、如权利要求 10所述的方法,其特征在于,还包括:在所述 WebRTC 会话建立之前, WebRTC业务服务器将所述 WebRTC业务服务器所支持的 所有业务分别设定相应的处理指示,并将业务的业务 ID与所述业务相应的 处理指示保存在业务与处理指示对应关系表中, 在所述 WebRTC会话建立 之后, 所述 WebRTC业务服务器向所述第一 Web应用发送包含所述处理指 示表的表保存请求, 其中所述处理指示表具体为业务与处理指示对应关系 表, 接收所述第一 Web应用发送含允许更新标志的表保存响应, 根据所述 允许更新标志, 向所述第二 Web应用发送允许更新消息, 以便于允许所述 第二 Web应用向所述第一 Web应用发送所述第二 ICE地址; 或者,
所述 WebRTC业务服务器将所述 WebRTC业务服务器所支持的所有业 务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业务 ID 与所述业务对应的类型 ID存储在业务与类型对应关系表中,并将所述业务 对应的类型 ID与所述类型 ID相应的处理指示存储在所述类型与处理指示 对应关系表中, 在所述 WebRTC会话建立之后, 所述 WebRTC业务服务器 向所述第一 Web应用发送包含所述处理指示表的表保存请求, 其中所述处 理指示表包含所述业务与类型对应关系表和所述类型与处理指示对应关系 表, 接收所述第一 Web应用发送含允许更新标志的表保存响应, 根据所述 允许更新标志, 向所述第二 Web应用发送允许更新消息, 以便于允许所述 第二 Web应用向所述第一 Web应用发送所述第二 ICE地址。
12、 一种处理交互式连接建立 ICE地址的方法, 其特征在于, 应用于 网页实时通信 WebRCT会话过程中, 所述 WebRTC会话是由第一万维网 Web应用通过第一终端的浏览器的 ICE地址与第二 Web应用通过第二终端 的浏览器的第一 ICE地址协商建立的, 所述第一 Web应用为加载在所述第 一终端的浏览器上的 Web应用,所述第二 Web应用为加载在所述第二终端 的浏览器上的 Web应用, 所述方法包括:
所述第一终端的浏览器接收所述第一 Web应用发送的状态修改请求, 所述状态修改请求包含所述第一终端的浏览器对在所述 WebRTC会话期间 内接收到的所有第二终端的浏览器的第二 ICE地址的统一的处理指示, 其 中, 所述第二 ICE地址为第二终端的浏览器的更新的 ICE地址;
根据所述统一的处理指示, 修改所述第一终端的浏览器中的 ICE代理 状态机的状态, 使修改后的状态与所述处理指示相对应;
在所述 WebRTC 会话期间内, 所述第一终端的浏览器接收所述第一 Web应用发送的包含所述第二 ICE地址的地址增加候选消息, 其中所述地 址增加候选消息由所述第一 Web应用在接收到所述第二 Web应用发送的包 含所述第二 ICE地址的地址传输消息之后发送的;
根据所述 ICE代理状态机的状态, 所述第一终端的浏览器对所述第二 ICE地址进行相应处理。
13、如权利要求 12所述的方法,其特征在于,所述根据所述处理指示, 修改所述 ICE代理状态机的状态,使修改后的状态与所述处理指示相对应, 具体包括: 所述处理指示具体为保存时, 根据所述处理指示为保存, 修改 所述 ICE代理状态机的状态为保持状态; 相应的, 所述根据所述 ICE代理 状态机的状态,所述第一终端的浏览器对所述第二 ICE地址进行相应处理, 具体包括: 所述 ICE代理状态机的状态为保持状态时, 所述第一终端的浏 览器检测所述第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址可 达时, 保存所述第一终端的浏览器的 ICE地址和所述第二 ICE地址的地址 对; 在检测出所述第二 ICE地址不可达时, 则丢弃所述第二 ICE地址; 或 者,
所述根据所述处理指示, 修改所述 ICE代理状态机的状态, 使修改后 的状态与所述处理指示相对应, 具体包括: 所述处理指示具体为替换时, 根据所述处理指示为替换, 修改所述 ICE代理状态机的状态为检测状态; 相应的, 所述根据所述 ICE代理状态机的状态, 所述第一终端的浏览器对 所述第二 ICE地址进行相应处理, 具体包括: 所述 ICE代理状态机的状态 为检测状态时, 所述第一终端的浏览器检测所述第二 ICE地址是否可达, 并且在检测出所述第二 ICE地址可达时, 将所述第一 ICE地址替换为所述 第二 ICE地址;在检测出所述第二 ICE地址不可达时,则丢弃所述第二 ICE 地址; 或者,
所述根据所述处理指示, 修改所述 ICE代理状态机的状态, 使修改后 的状态与所述处理指示相对应, 具体包括: 述处理指示具体为自主决策, 根据所述处理指示为所述自主决策, 修改所述 ICE代理状态机的状态为自 动状态; 相应地, 所述根据所述 ICE代理状态机的状态, 所述第一终端的 浏览器对所述第二 ICE地址进行相应处理, 具体包括: 所述 ICE代理状态 机的状态为自动状态时, 所述第一终端的浏览器检测所述第二 ICE地址是 否可达, 并且在检测出所述第二 ICE地址可达时, 检查所述第二 ICE地址 携带的优先级; 如果所述第二 ICE地址携带的优先级大于所述第一 ICE地 址携带的优先级, 则将所述第一 ICE地址替换为所述第二 ICE地址; 如果 所述第二 ICE地址携带的优先级小于或等于所述第一 ICE地址携带的优先 级, 则丢弃所述第二 ICE地址; 在检测出所述第二 ICE地址不可达时, 则 丢弃所述第二 ICE地址。
14、 如权利要求 13所述的方法, 其特征在于, 所述检测所述第二 ICE 地址是否可达, 具体为:
向所述第二终端的浏览器发送可达检测请求, 如果在规定时间内, 所 述第一终端的浏览器接收到所述第二终端的浏览器返回的可达检测响应, 则所述第二 ICE地址是可达的; 如果在规定时间内, 所述第一终端的浏览 器没有接收到所述第二终端的浏览器返回的可达检测响应,则所述第二 ICE 地址是不可达的。
15、 如权利要求 13所述的方法, 其特征在于, 所述状态修改请求是由 所述第一 Web应用根据当前业务的业务 ID和处理指示表, 确定所述第一 终端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二 ICE地 址的统一的处理指示之后, 向所述第一终端的浏览器发送的。
16、 如权利要求 15所述的方法, 其特征在于, 还包括:
在所述 WebRTC会话建立之前, WebRTC业务服务器将所述 WebRTC 业务服务器所支持的所有业务分别设定相应的处理指示, 并将业务的业务 ID与所述业务相应的处理指示保存在业务与处理指示对应关系表中, 在所 述 WebRTC会话建立之后,所述 WebRTC业务服务器向所述第一 Web应用 发送包含所述处理指示表的表保存请求, 其中所述处理指示表具体为业务 与处理指示对应关系表, 接收所述第一 Web应用发送表保存响应, 其中所 述表保存响应不包含允许更新标志; 或者,
所述 WebRTC业务服务器将所述 WebRTC业务服务器所支持的所有业 务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业务 ID 与所述业务对应的类型 ID存储在业务与类型对应关系表中,并将所述业务 对应的类型 ID与所述类型 ID相应的处理指示存储在所述类型与处理指示 对应关系表中, 在所述 WebRTC会话建立之后, 所述 WebRTC业务服务器 向所述第一 Web应用发送包含所述处理指示表的表保存请求, 其中所述处 理指示表包含业务与类型对应关系表和类型与处理指示对应关系表, 接收 所述第一 Web应用发送表保存响应, 其中所述表保存响应不包含允许更新 标志。
17、 如权利要求 13所述的方法, 其特征在于, 在所述第一终端的浏览 器接收所述第一 Web应用发送的包含所述第二 ICE地址的地址增加候选消 息之前, 还包括: 所述第一终端的浏览器向所述第一 Web应用发送含允许 更新标志的状态修改响应, 以便于所述第一 Web应用根据所述允许更新标 志通知 WebRTC业务服务器允许所述第二 Web应用向所述第一 Web应用 发送所述第二 ICE地址。
18、一种设置交互式连接建立 ICE地址处理指示的方法,其特征在于, 包括:
第一万维网 Web应用通过第一终端的浏览器的 ICE地址与第二 Web 应用通过第二终端的浏览器的第一 ICE地址进行协商, 并建立网页实时通 信 WebRTC会话, 其中, 所述第一 Web应用为加载在所述第一终端的浏览 器上 Web应用,所述第二 Web应用为加载在所述第二终端的浏览器上 Web 应用;
所述第一 Web应用根据当前业务的业务 ID和处理指示表, 确定所述 第一终端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二终 端的浏览器的第二 ICE地址的统一的处理指示, 其中, 所述第二 ICE地址 为第二终端的浏览器的更新的 ICE地址;
所述第一 Web应用向所述第一终端的浏览器发送状态修改请求, 所述 状态修改请求包含所述第一终端的浏览器对在所述 WebRTC会话期间内接 收到的所有所述第二 ICE地址的统一的处理指示, 以便于所述第一终端的 浏览器根据所述统一的处理指示, 修改所述第一终端的浏览器中的 ICE代 理状态机的状态, 使修改后的状态与所述处理指示相对应。
19、 如权利要求 18所述的方法, 其特征在于, 所述第一 Web应用根 据当前业务的业务 ID和处理指示表,确定所述第一终端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二 ICE地址的统一的处理指示具 体为:
当所述处理指示表具体为业务与处理指示对应关系表时, 所述第一 Web应用获取当前业务的所述业务 ID, 其中, 所述业务 ID为创建所述当 前业务时所述 WebRTC业务服务器分配的; 所述第一 Web应用根据所述业 务 ID和业务与处理指示对应关系表, 获得所述业务 ID对应的处理指示, 确认所述业务 ID 对应的处理指示为所述第一终端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二 ICE地址的统一的处理指示; 或者,
当所述处理指示表包含所述业务与类型对应关系表和所述类型与处理 指示对应关系表时,所述第一 Web应用获取当前业务的所述业务 ID,其中, 所述业务 ID为创建所述当前业务时所述 WebRTC业务 务器分配的;所述 第一 Web应用根据所述业务 ID和所述业务与类型对应关系表, 获得所述 业务 ID对应的类型 ID, 并根据所述类型 ID和所述类型与处理指示对应关 系表, 获得所述类型 ID对应的处理指示, 确认所述类型 ID对应的处理指 示为所述第一终端的浏览器对在所述 WebRTC会话期间内接收到的所有所 述第二 ICE地址的统一的处理指示。
20、如权利要求 19所述的方法,其特征在于,还包括:在所述 WebRTC 会话建立之前, WebRTC业务服务器将所述 WebRTC业务服务器所支持的 所有业务分别设定相应的处理指示,并将业务的业务 ID与所述业务相应的 处理指示保存在业务与处理指示对应关系表中, 在所述 WebRTC会话建立 之后, 所述 WebRTC业务服务器向所述第一 Web应用发送包含所述处理指 示表的表保存请求, 其中所述处理指示表具体为业务与处理指示对应关系 表, 接收所述第一 Web应用发送表保存响应, 其中, 所述表保存响应不包 含允许更新标志; 或者,
所述 WebRTC业务服务器将所述 WebRTC业务服务器所支持的所有业 务分别进行分类以及为每种类型设定相应的处理指示, 并将业务的业务 ID 与所述业务对应的类型 ID存储在业务与类型对应关系表中,并将所述业务 对应的类型 ID与所述类型 ID相应的处理指示存储在所述类型与处理指示 对应关系表中, 在所述 WebRTC会话建立之后, 所述 WebRTC业务服务器 向所述第一 Web应用发送包含所述处理指示表的表保存请求, 其中所述处 理指示表包含业务与类型对应关系表和类型与处理指示对应关系表, 接收 所述第一 Web应用发送表保存响应, 其中, 所述表保存响应不包含允许更 新标志。
21、 如权利要求 19所述的方法, 其特征在于, 在所述第一 Web应用 向所述第一终端的浏览器发送状态修改请求之后, 还包括: 接收所述第一 终端的浏览器发送的包含允许更新标志的状态修改响应, 并且根据所述允 许更新标志,所述第一 Web应用向 WebRTC业务服务器发送地址启动消息, 以便于所述 WebRTC业务服务器允许所述第二 Web应用向所述第一 Web 应用发送所述第二 ICE地址。
22、 一种处理交互式连接建立 ICE地址的装置, 其特征在于, 用于在网 页实时通信 WebRTC会话过程中处理 ICE地址, 所述 WebRTC会话是由第一 万维网 Web应用与第二 Web应用通过所述装置自身的 ICE地址和运行所述第 二 Web应用的浏览器的第一 ICE地址协商建立, 所述第一 Web应用为加载在 所述装置上的 Web应用, 所述装置包括收发器和处理器, 其中:
所述收发器, 用于接收第一 Web应用发送的地址增加候选消息, 所述 地址增加候选消息包含运行所述第二 Web应用的浏览器的第二 ICE地址和 所述处理器对所述第二 ICE地址的处理指示;
所述收发器, 还用于向所述处理器发送所述第二 ICE地址和所述处理 器对所述第二 ICE地址的处理指示;
所述处理器,用于接收所述收发器发送的所述第二 ICE地址和所述处理 器对所述第二 ICE地址的处理指示, 并识别出所述处理指示, 根据识别出的 处理指示, 对所述第二 ICE地址进行相应处理。
23、 如权利要求 22所述的装置, 其特征在于, 所述处理器具体包括检 测模块和丢弃模块, 其中:
检测模块用于检测从所述收发器接收到的所述第二 ICE地址是否可达; 丢弃模块用于当所述检测模块检测到所述第二 ICE地址不可达时,丢弃 所述第二 ICE地址。
24、 如权利要求 23所述的装置, 其特征在于, 所述处理器具体包括第 一保存模块、 第一替换模块和第一自主决策模块中的一个或多个, 其中, 所述第一保存模块,用于当所述检测模块检测到所述第二 ICE地址可达 时, 以及当所述处理器识别出处理指示为保存时, 保存所述装置自身的 ICE 地址和所述第二 ICE地址的地址对;
所述第一替换模块, 用于当所述检测模块检测到所述第二 ICE地址可 达时, 以及当所述处理器识别出处理指示为替换时, 将所述第一 ICE地址 替换为所述第二 ICE地址;
所述第一自主决策模块, 用于当所述检测模块检测到所述第二 ICE地 址可达时, 以及当所述处理器识别出处理指示为自主决策时, 检查从所述 收发器接收到的所述第二 ICE地址携带的优先级; 如果所述第二 ICE地址 携带的优先级大于所述第一 ICE地址携带的优先级, 则将所述第一 ICE地 址替换为所述第二 ICE地址; 如果所述第二 ICE地址携带的优先级小于或 等于所第一 ICE地址携带的优先级, 则向所述丢弃模块发送丢弃命令; 所述丢弃模块, 还用于接收所述第一自主决策模块发送的所述丢弃命 令, 丢弃所述第二 ICE地址。
25、 如权利要求 23所述的装置, 其特征在于, 所述处理器具体还用于 识别出所述处理指示, 根据所述识别出的处理指示, 修改所述装置自身的 ICE 代理状态机的状态, 使修改后的状态与所述处理指示相对应; 根据所 述 ICE代理状态机的状态, 所述装置自身对所述第二 ICE地址进行相应处 理。
26、 如权利要求 25所述的装置, 其特征在于, 所述处理器具体包括第 二保存模块、 第二替换模块和第二自主决策模块中的一个或多个, 其中, 所述第二保存模块, 用于根据所述处理指示为保存, 修改所述 ICE代 理状态机的状态为保持状态; 当所述检测模块检测到所述第二 ICE地址可 达时, 保存所述装置自身的 ICE地址和所述第二 ICE地址的地址对;
所述第二替换模块, 用于根据所述处理指示为替换, 修改所述 ICE代 理状态机的状态为检测状态; 当所述检测模块检测到所述第二 ICE地址可 达时, 将所述第一 ICE地址替换为所述第二 ICE地址;
所述第二自主决策模块, 用于根据所述处理指示为所述自主决策, 修 改所述 ICE代理状态机的状态为自动状态; 所述 ICE代理状态机的状态为 自动状态时, 当所述检测模块检测到所述第二 ICE地址可达时, 检查所述 第二 ICE地址携带的优先级; 如果所述第二 ICE地址携带的优先级大于所 述第一 ICE地址携带的优先级,则将所述第一 ICE地址替换为所述第二 ICE 地址; 如果所述第二 ICE地址携带的优先级小于或等于所述第一 ICE地址 携带的优先级, 则向所述丢弃模块发送丢弃命令;
所述丢弃模块, 还用于接收所述第二自主决策模块发送的所述丢弃命 令, 丢弃所述第二 ICE地址。
27、一种设置交互式连接建立 ICE地址处理指示的装置,其特征在于, 包括:
会话模块, 用于通过第一终端的浏览器的 ICE地址与万维网 Web应用 通过第二终端的浏览器的第一 ICE 地址进行协商, 并建立网页实时通信 WebRTC 会话, 其中, 所述 Web 应用为加载在所述第二终端的浏览器上 Web应用;
收发器, 用于在所述 WebRTC会话过程中, 接收所述 Web应用发送的 地址传输消息, 所述地址传输消息包含所述第二终端的浏览器的第二 ICE 地址;
处理器, 用于根据当前业务的业务 ID和处理指示表, 确定所述第一终 端的浏览器对收发器接收到的所述第二 ICE地址的处理指示, 并向所述收 发器发送所述第一终端的浏览器对所述第二 ICE地址的处理指示;
收发器, 还用于接收所述处理器发送的所述第一终端的浏览器对所述 第二 ICE地址的处理指示, 并向所述第一终端的浏览器发送地址增加候选 消息, 所述地址增加候选消息包含了所述第二 ICE地址和所述第一终端的 浏览器对所述第二 ICE地址处理指示, 以便于所述第一终端的浏览器根据 所述处理指示对所述第二 ICE地址进行相应处理。
28、 如权利要求 27所述的装置, 其特征在于, 所述处理器, 具体用于 当所述处理指示表具体为业务与处理指示对应关系表时, 获取当前业务的 所述业务 ID, 其中, 所述业务 ID为创建所述当前业务时所述 WebRTC业 务服务器分配的; 并根据所述业务 ID和业务与处理指示对应关系表, 获得 所述业务 ID对应的处理指示, 确认所述业务 ID对应的处理指示为所述第 一终端的浏览器对所述第二 ICE地址的处理指示; 或者,
所述处理器, 具体用于当所述处理指示表包含业务与类型对应关系表 和类型与处理指示对应关系表时, 获取当前业务的所述业务 ID, 其中, 所 述业务 ID为创建所述当前业务时所述 WebRTC业务服务器分配的;根据所 述业务 ID和所述业务与类型对应关系表,获得所述业务 ID对应的类型 ID, 并根据所述类型与处理指示对应关系表,获得所述类型 ID对应的处理指示, 确认所述类型 ID对应的处理指示为第一终端的浏览器对所述第二 ICE地址 的处理指示。
29、 一种处理交互式连接建立 ICE地址的装置, 其特征在于, 用于在 网页实时通信 WebRTC会话过程中处理 ICE地址, 所述 WebRTC会话是由 第一万维网 Web应用与第二 Web应用通过所述装置自身的 ICE地址和运行 所述第二 Web应用的浏览器的第一 ICE地址协商建立,所述第一 Web应用 为加载在所述装置上的 Web应用, 所述装置包括收发器和处理器,
所述收发器, 用于接收所述第一 Web应用发送的状态修改请求, 所述 状态修改请求包含所述处理器对在整个所述 WebRTC会话期间内接收到的 所述运行所述第二 Web应用的浏览器的所有第二 ICE地址的统一的处理指 示, 其中, 所述第二 ICE地址为所述浏览器的更新的 ICE地址;
所述收发器还用于向所述处理器发送所述处理器在所述 WebRTC会话 中对接收到的所述第二 ICE地址的处理指示;
所述处理器, 用于接收所述收发器发送的统一的所述处理指示, 并根 据所述处理指示, 修改 ICE代理状态机的状态, 使修改后的状态与所述处 理指示相对应;
所述收发器, 还用于接收所述第一 Web应用发送的包含所述第二 ICE 地址的地址增加候选消息, 并向所述处理器发送所述地址增加候选消息; 所述处理器, 还用于接收所述收发器发送的所述地址增加候选消息, 根据所述 ICE代理状态机的状态, 对所述第二 ICE地址进行相应处理。
30、 如权利要求 28所述的装置, 其特征在于, 所述处理器具体包括检 测模块和丢弃模块, 其中:
检测模块用于检测从所述收发器接收到的所述第二 ICE地址是否可达; 丢弃模块用于当所述检测模块检测到所述第二 ICE地址不可达时, 丢 弃所述第二 ICE地址。
31、 如权利要求 29所述的装置, 其特征在于, 所述处理器包括保存模 块, 替换模块和自主决策模块中的一个或多个, 其中,
所述保存模块, 用于当所述处理指示为保存, 修改所述 ICE代理状态 机的状态为保持状态, 并且当所述检测模块检测到所述第二 ICE地址可达 时, 以及当所述 ICE代理状态机的状态为保持状态, 保存所述装置自身的 ICE地址和所述第二 ICE地址的地址对;
所述替换模块, 用于当所述处理指示为替换, 修改所述 ICE代理状态 机的状态为检测状态; 当所述检测模块检测到所述第二 ICE地址可达时, 换为所述第二 ICE地址;
所述自主决策模块, 用于当所述处理指示为自主决策, 修改所述 ICE 代理状态机的状态为自动状态; 并当所述检测模块检测到所述第二 ICE地 址可达时, 以及当所述 ICE代理状态机的状态为自动状态时, 检查所述第 二 ICE地址携带的优先级, 如果所述第二 ICE地址携带的优先级大于所述 浏览器的第一 ICE地址携带的优先级, 则将所述第一 ICE地址替换为所述 第二 ICE地址; 如果所述第二 ICE地址携带的优先级小于或等于所述第一 ICE地址携带的优先级, 则向所述丢弃模块发送丢弃命令;
所述丢弃模块, 还用于接收所述丢弃模块发送的所述丢弃命令, 丢弃 所述第二 ICE地址。
32、 如权利要求 29所述的装置, 其特征在于, 所述收发器, 还用于当 ICE代理机的状态修改成功后, 向所述第一 Web应用发送包含允许更新标 志的状态修改响应, 以便于所述第一 Web应用根据所述允许更新标志通知 WebRTC业务服务器允许所述第二 Web应用向所述第一 Web应用发送所述 第二 ICE地址。
33、 一种设置交互式连接建立 ICE地址的处理指示的装置, 其特征在 于, 包括:
会话模块, 用于通过第一终端的浏览器的 ICE地址与万维网 Web应用 通过第二终端的浏览器的第一 ICE 地址进行协商, 并建立网页实时通信 WebRTC 会话, 其中, 所述 Web 应用为加载在所述第二终端的浏览器上 Web应用;
处理器, 用于根据当前业务的业务 ID和处理指示表, 确定所述第一终 端的浏览器对在所述 WebRTC会话期间内接收到的所有第二终端的浏览器 的第二 ICE地址的统一的处理指示, 其中, 所述第二 ICE地址为第二终端 的浏览器的更新的 ICE地址;
所述收发器, 用于向所述第一终端的浏览器发送状态修改请求, 所述 状态修改请求包含所述处理器确定的所述第一终端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二 ICE地址的统一的处理指示, 以便于所述第一终端的浏览器根据所述统一的处理指示, 修改所述第一终 端的浏览器中的 ICE代理状态机的状态, 使修改后的状态与所述处理指示 相对应。
34、 如权利要求 33所述的装置, 其特征在于, 所述处理器具体用于当 所述处理指示表具体为业务与处理指示对应关系表时, 获取当前业务的所 述业务 ID, 其中, 所述业务 ID为创建所述当前业务时所述 WebRTC业务 服务器分配的; 根据所述业务 ID和业务与处理指示对应关系表, 获得所述 业务 ID对应的处理指示, 确认所述业务 ID对应的处理指示为所述第一终 端的浏览器对在所述 WebRTC会话期间内接收到的所有所述第二 ICE地址 的统一的处理指示; 或者,
所述处理器具体还用于当所述处理指示表为业务与类型对应关系表和 类型与处理指示对应关系表时, 获取当前业务的所述业务 ID, 其中, 所述 业务 ID为创建所述当前业务时所述 WebRTC业务服务器分配的;根据所述 业务 ID和所述类型表, 获得所述业务 ID对应的类型 ID, 并根据所述类型 ID与处理指示的对应关系表, 获得所述类型 ID对应的处理指示, 确认所 述类型 ID对应的处理指示为所述第一终端的浏览器对在所述 WebRTC会话 期间内接收到的所有所述第二 ICE地址的统一的处理指示。
35、 如权利要求 33所述的装置, 其特征在于, 所述收发器, 还用于接 收所述第一终端的浏览器发送的包含允许更新标志的状态修改响应, 并且 根据所述允许更新标志, 向 WebRTC业务服务器发送 ICE地址启动消息, 以便于所述 WebRTC业务服务器允许所述第二 Web应用向所述第一 Web 应用发送所述第二 ICE地址
36、 一种网页实时通信 WebRTC业务服务器, 其特征在于, 包括收发 器和处理器, 其中,
所述处理器, 用于将所述 WebRTC业务服务器所支持的所有业务分别 设定相应的处理指示,并将业务的业务 ID与所述业务相应的处理指示保存 在业务与处理指示对应关系表中, 此时处理指示表具体为业务与处理指示 对应关系表, 或者将所述 WebRTC业务服务器所支持的所有业务分别进行 分类以及为每种类型设定相应的处理指示,并将业务的业务 ID与所述业务 对应的类型 ID存储在业务与类型对应关系表中,并将所述业务对应的类型 ID与所述类型 ID相应的处理指示存储在类型与处理指示对应关系表, 此 时处理指示表包含业务与类型对应关系表和类型与处理指示对应关系表; 所述收发器, 用于在所述 WebRTC会话建立之后, 向加载在第一终端 的浏览器上的第一 Web应用发送包含所述处理指示表的表保存请求, 接收 所述第一 Web应用发送表保存响应。
37、 如权利要求 36所述的 WebRTC业务服务器, 其特征在于, 所述收 发器还用于, 当所述表保存响应包含允许更新标志时, 根据所述允许更新 标志, 向加载在第二终端的浏览器上的第二 Web应用发送允许更新消息, 以便于允许所述第二 Web应用向所述第一 Web应用发送所述第二 ICE地址; ^炅新标志时, 还接收所述第一 Web应用发 送的包含允许更新标志的允许更新通知, 根据所述允许更新标志, 向所述 第二 Web应用发送允许更新消息,以便于允许所述第二 Web应用向所述第 一 Web应用发送所述第二 ICE地址。
PCT/CN2012/087968 2012-12-31 2012-12-31 设置、处理交互式连接建立ice地址的方法、装置和服务器 WO2014101159A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280002626.5A CN104255014A (zh) 2012-12-31 2012-12-31 设置、处理交互式连接建立ice地址的方法、装置和服务器
PCT/CN2012/087968 WO2014101159A1 (zh) 2012-12-31 2012-12-31 设置、处理交互式连接建立ice地址的方法、装置和服务器

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/087968 WO2014101159A1 (zh) 2012-12-31 2012-12-31 设置、处理交互式连接建立ice地址的方法、装置和服务器

Publications (1)

Publication Number Publication Date
WO2014101159A1 true WO2014101159A1 (zh) 2014-07-03

Family

ID=51019769

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087968 WO2014101159A1 (zh) 2012-12-31 2012-12-31 设置、处理交互式连接建立ice地址的方法、装置和服务器

Country Status (2)

Country Link
CN (1) CN104255014A (zh)
WO (1) WO2014101159A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114554543A (zh) * 2022-04-27 2022-05-27 希诺麦田技术(深圳)有限公司 Mesh设备数据传输系统、方法及Mesh设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014544B (zh) * 2021-01-25 2023-02-10 阳光凯讯(北京)科技有限公司 基于webRtc无中心媒体链路建立方法及装置
CN113630424B (zh) * 2021-09-15 2023-04-28 上海哔哩哔哩科技有限公司 WebRTC通信方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101843079A (zh) * 2007-10-30 2010-09-22 思科技术公司 传输对潜在配置的选择
CN102447749A (zh) * 2010-10-15 2012-05-09 中兴通讯股份有限公司 支持nat穿越的集中式p2p系统、nat穿越的方法
CN102567125A (zh) * 2011-12-28 2012-07-11 中标软件有限公司 一种浏览器页面间通信的方法
CN102594886A (zh) * 2012-02-15 2012-07-18 华为技术有限公司 浏览器与浏览器直通的方法、装置和通信系统
CN102652426A (zh) * 2009-12-15 2012-08-29 高通股份有限公司 对等式通信的设备和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101843079A (zh) * 2007-10-30 2010-09-22 思科技术公司 传输对潜在配置的选择
CN102652426A (zh) * 2009-12-15 2012-08-29 高通股份有限公司 对等式通信的设备和方法
CN102447749A (zh) * 2010-10-15 2012-05-09 中兴通讯股份有限公司 支持nat穿越的集中式p2p系统、nat穿越的方法
CN102567125A (zh) * 2011-12-28 2012-07-11 中标软件有限公司 一种浏览器页面间通信的方法
CN102594886A (zh) * 2012-02-15 2012-07-18 华为技术有限公司 浏览器与浏览器直通的方法、装置和通信系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114554543A (zh) * 2022-04-27 2022-05-27 希诺麦田技术(深圳)有限公司 Mesh设备数据传输系统、方法及Mesh设备

Also Published As

Publication number Publication date
CN104255014A (zh) 2014-12-31

Similar Documents

Publication Publication Date Title
US9338279B2 (en) Mechanism for connecting a mobile device to a network
WO2012083736A1 (zh) 业务的分流处理方法、通信设备及网络系统
WO2014187214A1 (zh) 一种网页实时通信方法、系统及终端
JP6147338B2 (ja) 接続可能性障害後のホームネットワークのための再ルーティングを可能とする方法及びシステム
US20120077483A1 (en) Enabling interface aggregation of mobile broadband network interfaces
EP2868054B1 (en) Resilient video encoding control via explicit network indication
JP5420756B2 (ja) サービス品質(QoS)制御のためのノード及び方法
WO2017157144A1 (zh) 基于SIP over TCP/TLS的通信方法及相关装置
WO2011038637A1 (zh) 端到端呼叫的实现方法、端到端呼叫终端及系统
JP2017118545A (ja) Httpを利用する通信システム
US20130065588A1 (en) Transmitting data over multiple networks
US20170078456A1 (en) Remote SIP Stack and Architecture and Methods for Video Calls Between Mobile Devices
EP2987295B1 (en) Local control of additional media session for a packet based call
CN105978780B (zh) 一种端口切换方法及装置
EP4017089A2 (en) Network policy application based on session state
WO2014101159A1 (zh) 设置、处理交互式连接建立ice地址的方法、装置和服务器
CN108270689B (zh) 一种实现业务连接的方法及装置
JP5311460B2 (ja) 接続制御装置
CN113014855A (zh) 一种视频会议加速方法、系统及视频会议加速平台
US20130067083A1 (en) Transmitting Data Over Multiple Networks
CN113542395B (zh) 报文处理方法和报文处理系统
JP5025449B2 (ja) 中継通信システム
EP2424169B1 (en) Method of providing MMoIP communication device
KR101410510B1 (ko) Sctp를 이용한 데이터 전송 방법 및 장치
WO2015100978A1 (zh) 软件自定义网络中自动发现控制器的方法、控制器及系统

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: 12890635

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: 12890635

Country of ref document: EP

Kind code of ref document: A1