CN110943910A - WebSocket-based interphone implementation method - Google Patents
WebSocket-based interphone implementation method Download PDFInfo
- Publication number
- CN110943910A CN110943910A CN201911255867.0A CN201911255867A CN110943910A CN 110943910 A CN110943910 A CN 110943910A CN 201911255867 A CN201911255867 A CN 201911255867A CN 110943910 A CN110943910 A CN 110943910A
- Authority
- CN
- China
- Prior art keywords
- terminal
- voice server
- voice
- websocket
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/52—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/10—Architectures or entities
- H04L65/1016—IP multimedia subsystem [IMS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/1066—Session management
- H04L65/1101—Session protocols
- H04L65/1104—Session initiation protocol [SIP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/164—Adaptation or special uses of UDP protocol
Abstract
The invention discloses an interphone realization method based on WebSocket. The method comprises a voice server and a terminal, and specifically comprises the following steps: (1) the existing terminal is connected to the voice server through WebSocket, is added into a room and then sends voice data to the voice server through WebSocket; (2) the newly added terminal is connected to the voice server through the WebSocket, the newly added terminal is added into the same room, then the voice data are sent to the voice server through the WebSocket, the voice server can associate the newly added terminal with the existing terminal, therefore, the voice data of the existing terminal can be sent to the newly added terminal, the existing terminal can also receive the data of the newly added terminal, and meanwhile, the voice server can inform the existing terminal that the new terminal is added. The invention has the beneficial effects that: and transmitting audio data through a firewall by using a WebSocket technology to realize the function of the interphone.
Description
Technical Field
The invention relates to the technical field related to audio and video instant messaging, in particular to a WebSocket-based interphone implementation method.
Background
The currently common voice intercom technology is mainly based on WebRTC (WebRTC refers to Web Real-time communication, an API supporting a Web browser to perform Real-time voice conversation or video conversation) or self-developed protocol, however, its internal data transmission is mainly UDP (Internet Protocol suite supports a connectionless transmission Protocol called User Datagram Protocol (UDP), which provides a method for sending encapsulated IP datagrams without establishing a connection for an application) or a modified Protocol based on UDP, however, in some application scenarios, the network management and control are strict, and the firewall only allows HTTP (Transmission control protocol (TCP) to be a connection-oriented, reliable transport layer communication protocol based on byte stream, which is defined by RFC793[1] of IETF), and the data of UDP and TCP are intercepted.
Disclosure of Invention
The invention provides a WebSocket-based interphone realizing method for realizing the interphone function through a firewall to overcome the defects in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
an interphone implementation method based on WebSocket comprises a voice server and a terminal, and specifically comprises the following steps:
(1) the existing terminal is connected to the voice server through WebSocket, is added into a room and then sends voice data to the voice server through WebSocket;
(2) the newly added terminal is connected to the voice server through the WebSocket, the newly added terminal is added into the same room, then the voice data are sent to the voice server through the WebSocket, the voice server can associate the newly added terminal with the existing terminal, therefore, the voice data of the existing terminal can be sent to the newly added terminal, the existing terminal can also receive the data of the newly added terminal, and meanwhile, the voice server can inform the existing terminal that the new terminal is added.
WebSocket is a protocol for full duplex communication over a single TCP connection. The WebSocket communication protocol was specified by the IETF as standard RFC 6455 in 2011 and is supplemented by RFC 7936. The WebSocket API is also standardized by W3C. In some application scenes, network management and control are strict, a firewall can only allow HTTP data to pass through, and data of UDP and TCP can be intercepted.
Preferably, the voice server refers to a server for managing sessions and forwarding voice data, the terminal refers to a device for supporting WebSocket and simultaneously supporting audio recording and playing, the voice server includes a session Tunnel module, a Router module and a RelaySvr node, and the Tunnel module converts data stream borne by the WebSocket into UDP or TCP data; the Router module is a scheduler of a native voice system and used for allocating access and transmission nodes; the RelaySvr node is used for forwarding audio data.
Preferably, in the step (1) and the step (2), the specific operation method for the terminal to join the room is as follows: the terminal is connected to a Tunnel module of the voice server through WebSocket, and sends a request command for joining a room to the Tunnel module of the voice server, the Tunnel module of the voice server executes the command for joining the room according to the request content and sends the command to a Router module of the voice server through HTTP, the Router module of the voice server receives the command for joining the room forwarded by the Tunnel module of the voice server, distributes a proper RelaySvr node of the voice server for the command, and then informs the information to the RelaySvr node of the voice server through HTTP.
Preferably, in step (1) and step (2), the specific operation method for transmitting the voice data to the voice server is as follows: the terminal starts to send voice data to the Tunnel module of the voice server after taking the corresponding RelaySvr node of the voice server, the Tunnel module of the voice server forwards the voice data to the RelaySvr node of the voice server through UDP, the RelaySvr node of the voice server sends the voice data to the terminal existing in the room through UDP, and the terminal existing in the room complete intercommunication through UDP data flow.
The invention has the beneficial effects that: according to the method, the WebSocket is adopted to replace a UDP protocol to solve the problem that only the HTTP protocol can be used under a part of scenes, and the WebSocket technology is used for transmitting audio data to penetrate through a firewall to realize the function of the interphone.
Drawings
FIG. 1 is a schematic structural view of the present invention;
fig. 2 is an internal flow diagram of a voice server.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
In the embodiment shown in fig. 1 and 2, an intercom implementation method based on WebSocket includes a voice server and a terminal, where the voice server refers to a server that manages sessions and forwards voice data, the terminal refers to a device that supports WebSocket and simultaneously supports audio recording and playing, such as a browser and a mobile phone, the voice server includes a session Tunnel module, a Router module and a RelaySvr node, and the Tunnel module converts a data stream carried by the WebSocket into UDP or TCP data; the Router module is a scheduler of a native voice system and used for allocating access and transmission nodes; the RelaySvr node is used for forwarding audio data, and specifically comprises the following steps:
(1) the existing terminal is connected to the voice server through WebSocket, is added into a room and then sends voice data to the voice server through WebSocket;
(2) the newly added terminal is connected to the voice server through the WebSocket, the newly added terminal is added into the same room, then the voice data are sent to the voice server through the WebSocket, the voice server can associate the newly added terminal with the existing terminal, therefore, the voice data of the existing terminal can be sent to the newly added terminal, the existing terminal can also receive the data of the newly added terminal, and meanwhile, the voice server can inform the existing terminal that the new terminal is added.
As shown in fig. 2, a terminal a outside the firewall wants to talk to terminals B and C inside the firewall in voice. Data stream 1 is a WebSocket protocol, data streams 2, 3.1, 3.2 are HTTP protocols, and data streams 4.1, 4.2, 5 are UDP protocols.
The specific operation method for adding the terminal into the room is as follows: the terminal A is connected to a Tunnel module of the voice server through WebSocket (because of the existence of a firewall, the terminal A cannot simply initiate a command to initiate voice docking to a Router module of the voice server like the terminal B and the terminal C), a request command for joining a room is sent to the Tunnel module of the voice server, the Tunnel module of the voice server executes 2 the command for joining the room according to the request content and sends the command to the Router module of the voice server through HTTP, 2 the command is a signaling operation and mainly a room joining or leaving operation, the Router module of the voice server receives the command for joining the room forwarded by the Tunnel module of the voice server, a suitable RelaySvr node of the voice server is distributed to the command, and then the information is notified to the RelaySvr node of the voice server through HTTP (3.1/3.2).
The specific operation method for sending the voice data to the voice server is as follows: after the terminal A takes the corresponding RelaySvr node of the voice server, the terminal A starts to send voice data to the Tunnel module of the voice server, the Tunnel module of the voice server forwards the voice data to the RelaySvr node of the voice server through UDP (5), 5 is used for forwarding UDP data, namely the voice data, the RelaySvr node of the voice server sends the voice data to the existing terminal in the room through UDP (4.1/4.2), and the terminal A completes intercommunication with the existing terminal B and terminal C in the room through UDP data flow.
Wherein: figure 2 block represents a voice server. WebSocket is a protocol for full duplex communication over a single TCP connection. The WebSocket communication protocol was specified by the IETF as standard RFC 6455 in 2011 and is supplemented by RFC 7936. The WebSocket API is also standardized by W3C. In some application scenes, network management and control are strict, a firewall can only allow HTTP data to pass through, and data of UDP and TCP can be intercepted.
Claims (4)
1. A realization method of an interphone based on WebSocket is characterized by comprising a voice server and a terminal, and specifically comprises the following steps:
(1) the existing terminal is connected to the voice server through WebSocket, is added into a room and then sends voice data to the voice server through WebSocket;
(2) the newly added terminal is connected to the voice server through the WebSocket, the newly added terminal is added into the same room, then the voice data are sent to the voice server through the WebSocket, the voice server can associate the newly added terminal with the existing terminal, therefore, the voice data of the existing terminal can be sent to the newly added terminal, the existing terminal can also receive the data of the newly added terminal, and meanwhile, the voice server can inform the existing terminal that the new terminal is added.
2. The method for implementing the interphone based on the WebSocket according to claim 1, wherein the voice server refers to a server for managing sessions and forwarding voice data, the terminal refers to a device supporting the WebSocket and simultaneously supporting audio recording and playing, the voice server comprises a session Tunnel module, a Router module and a RelaySvr node, and the Tunnel module converts a data stream borne by the WebSocket into UDP or TCP data; the Router module is a scheduler of a native voice system and used for allocating access and transmission nodes; the RelaySvr node is used for forwarding audio data.
3. The method for implementing the interphone based on the WebSocket as claimed in claim 2, wherein in the step (1) and the step (2), the specific operation method for adding the terminal into the room is as follows: the terminal is connected to a Tunnel module of the voice server through WebSocket, and sends a request command for joining a room to the Tunnel module of the voice server, the Tunnel module of the voice server executes the command for joining the room according to the request content and sends the command to a Router module of the voice server through HTTP, the Router module of the voice server receives the command for joining the room forwarded by the Tunnel module of the voice server, distributes a proper RelaySvr node of the voice server for the command, and then informs the information to the RelaySvr node of the voice server through HTTP.
4. The method for implementing the interphone based on the WebSocket as claimed in claim 3, wherein in the step (1) and the step (2), the specific operation method for sending the voice data to the voice server is as follows: the terminal starts to send voice data to the Tunnel module of the voice server after taking the corresponding RelaySvr node of the voice server, the Tunnel module of the voice server forwards the voice data to the RelaySvr node of the voice server through UDP, the RelaySvr node of the voice server sends the voice data to the terminal existing in the room through UDP, and the terminal existing in the room complete intercommunication through UDP data flow.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911255867.0A CN110943910A (en) | 2019-12-10 | 2019-12-10 | WebSocket-based interphone implementation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911255867.0A CN110943910A (en) | 2019-12-10 | 2019-12-10 | WebSocket-based interphone implementation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110943910A true CN110943910A (en) | 2020-03-31 |
Family
ID=69910022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911255867.0A Pending CN110943910A (en) | 2019-12-10 | 2019-12-10 | WebSocket-based interphone implementation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110943910A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111816190A (en) * | 2020-07-08 | 2020-10-23 | 苏州思必驰信息科技有限公司 | Voice interaction method and device for upper computer and lower computer |
CN112637703A (en) * | 2020-12-30 | 2021-04-09 | 上海数果科技有限公司 | WEB terminal real-time talkback system and talkback method |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243281A (en) * | 2014-08-20 | 2014-12-24 | 北京比邻在线信息技术有限公司 | Voice communication method based on mobile Internet |
CN106936698A (en) * | 2017-04-13 | 2017-07-07 | 合肥市群智科技有限公司 | A kind of pc ends instant messaging application process based on websocket |
CN107632988A (en) * | 2016-07-18 | 2018-01-26 | 杭州海康威视数字技术股份有限公司 | Browser voice method of sending and receiving, device and voice inter-speaking system |
US20180063252A1 (en) * | 2016-08-31 | 2018-03-01 | Sap Se | Accessing resources hosted on different domains |
CN108055188A (en) * | 2017-10-19 | 2018-05-18 | 福建中金在线信息科技有限公司 | H5 live broadcast in both illustration and text method and apparatus based on wechat |
CN109327670A (en) * | 2018-10-22 | 2019-02-12 | 杭州叙简科技股份有限公司 | A kind of visual-speaking system and intercommunication method based on B/S mode |
CN109428803A (en) * | 2017-08-22 | 2019-03-05 | 深圳艾派网络科技股份有限公司 | A kind of method for sending voice message and system |
CN109739971A (en) * | 2019-01-03 | 2019-05-10 | 浙江百应科技有限公司 | A method of full duplex Intelligent voice dialog is realized based on wechat small routine |
-
2019
- 2019-12-10 CN CN201911255867.0A patent/CN110943910A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243281A (en) * | 2014-08-20 | 2014-12-24 | 北京比邻在线信息技术有限公司 | Voice communication method based on mobile Internet |
CN107632988A (en) * | 2016-07-18 | 2018-01-26 | 杭州海康威视数字技术股份有限公司 | Browser voice method of sending and receiving, device and voice inter-speaking system |
US20180063252A1 (en) * | 2016-08-31 | 2018-03-01 | Sap Se | Accessing resources hosted on different domains |
CN106936698A (en) * | 2017-04-13 | 2017-07-07 | 合肥市群智科技有限公司 | A kind of pc ends instant messaging application process based on websocket |
CN109428803A (en) * | 2017-08-22 | 2019-03-05 | 深圳艾派网络科技股份有限公司 | A kind of method for sending voice message and system |
CN108055188A (en) * | 2017-10-19 | 2018-05-18 | 福建中金在线信息科技有限公司 | H5 live broadcast in both illustration and text method and apparatus based on wechat |
CN109327670A (en) * | 2018-10-22 | 2019-02-12 | 杭州叙简科技股份有限公司 | A kind of visual-speaking system and intercommunication method based on B/S mode |
CN109739971A (en) * | 2019-01-03 | 2019-05-10 | 浙江百应科技有限公司 | A method of full duplex Intelligent voice dialog is realized based on wechat small routine |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111816190A (en) * | 2020-07-08 | 2020-10-23 | 苏州思必驰信息科技有限公司 | Voice interaction method and device for upper computer and lower computer |
CN112637703A (en) * | 2020-12-30 | 2021-04-09 | 上海数果科技有限公司 | WEB terminal real-time talkback system and talkback method |
CN112637703B (en) * | 2020-12-30 | 2023-04-28 | 上海数果科技有限公司 | Real-time intercom system and method for WEB terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100713359B1 (en) | Visual TelePhony Method of Capable to Providing Video in Another Display | |
CN111479121B (en) | Live broadcasting method and system based on streaming media server | |
TWI551112B (en) | Non-transitory tangible machine-readable medium and client device for transitioning between a circuit switched audio call and a video call | |
US9602553B2 (en) | Method, apparatus, and system for implementing VOIP call in cloud computing environment | |
US7978216B2 (en) | Versatile conference adapter and method employing same | |
US7480500B1 (en) | Divitas protocol proxy and methods therefor | |
CN102480575B (en) | VOIP recording control method and system thereof | |
WO2015127793A1 (en) | Recording method, voice exchanging device, recording server, and recording system | |
WO2011088656A1 (en) | Method and system for implementing three-party call of videophone by mobile terminals | |
US20120274726A1 (en) | Session processing method and system | |
CN103348657B (en) | Flow media playing method, equipment and system | |
WO2010003385A1 (en) | A method and apparatus for controlling the multimedia conference by the application server | |
WO2015062454A1 (en) | Audio and video call method, device and system | |
CN112953925A (en) | Real-time audio and video communication system and method based on SIP (Session initiation protocol) and RTC (real time communication) network | |
CN110943910A (en) | WebSocket-based interphone implementation method | |
EP3515032B1 (en) | Port multiplexing method and server in video conference system and computer storage medium | |
JP2007142786A (en) | Handover server, and mobile communication terminal communcable thereof | |
WO2018006678A1 (en) | Voice call method and apparatus | |
CN103684970A (en) | Transmission method and thin terminals for media data streams | |
CN104105222B (en) | Establish communication | |
WO2023078458A1 (en) | Call exception processing method and apparatus, and electronic device | |
WO2015058648A1 (en) | Message service processing method and apparatus based on ip telephone | |
CN102282886B (en) | Method, mobile terminal, device and system for implementing voice services | |
CN109067659B (en) | Session establishing method, router and session system | |
CN107046673B (en) | Method and system for wireless calling |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200331 |