WO2025124129A1 - 通信方法、系统、设备及可读介质 - Google Patents
通信方法、系统、设备及可读介质 Download PDFInfo
- Publication number
- WO2025124129A1 WO2025124129A1 PCT/CN2024/134510 CN2024134510W WO2025124129A1 WO 2025124129 A1 WO2025124129 A1 WO 2025124129A1 CN 2024134510 W CN2024134510 W CN 2024134510W WO 2025124129 A1 WO2025124129 A1 WO 2025124129A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- sip
- server
- target
- message
- target terminal
- 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
Classifications
-
- 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/1083—In-session procedures
- H04L65/1095—Inter-network session transfer or sharing
-
- 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
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
-
- 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/22—Parsing or analysis of headers
Definitions
- the present disclosure relates to the field of communication technology, and in particular to a communication method, system, device and readable medium.
- Session Initiation Protocol (SIP) access technology refers to the technology that terminal devices use to establish, modify and terminate multimedia sessions by adopting the SIP protocol.
- SIP is an application layer signaling control protocol.
- the sessions it represents can be Internet multimedia conferences, Internet Protocol (IP) telephones and multimedia distribution.
- IP Internet Protocol
- MGCP H248
- the advantages of using SIP protocol access include: (1) It is scalable and can be easily embedded in various embedded terminal devices; (2) It can ensure interoperability and can use different devices for communication; (3) It has strong flexibility and can be integrated with other software systems to build a unified and complete communication solution, which can be applied to various multimedia access scenarios, including but not limited to video conferencing, video surveillance, etc.
- Embodiments of the present disclosure provide a communication method, system, device, and readable medium.
- An embodiment of the present disclosure provides a communication method, which is applied to a first intermediary server.
- the method includes: receiving a first SIP message from a target terminal, parsing the first SIP message to determine a target SIP server, and forwarding the first SIP message to the target SIP server; receiving a second SIP message from the target SIP server, parsing the second SIP message to determine the target terminal, and forwarding the second SIP message to the target terminal.
- the embodiment of the present disclosure also provides a communication method, which is applied to a SIP server, and the method includes: receiving a first SIP message from a target terminal forwarded by a first intermediary server; sending a second SIP message for the target terminal to the first intermediary server, so as to forward the second SIP message to the target terminal through the first intermediary server.
- the embodiment of the present disclosure also provides a communication system, including: a target terminal, used to send a first SIP message to a first intermediary server; a target SIP server, used to send a second SIP message to the first intermediary server; the first intermediary server, used to receive the first SIP message from the target terminal, parse the first SIP message to determine the target SIP server, forward the first SIP message to the target SIP server, receive the second SIP message from the target SIP server, parse the second SIP message to determine the target terminal, and forward the second SIP message to the target terminal; and a second intermediary server, used to serve as a backup server for the first intermediary server.
- An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory on which at least one program is stored.
- the at least one processor executes the at least one program.
- the embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the communication method according to the embodiment of the present disclosure is implemented.
- FIG1 is a schematic diagram of the architecture of a communication system according to an embodiment of the present disclosure.
- FIG2 is a flow chart of a communication method performed by a first intermediary server according to an embodiment of the present disclosure
- FIG3 is a schematic diagram of a normal process of SIP communication according to an embodiment of the present disclosure.
- FIG4 is a schematic diagram of a process flow when a SIP server fails according to an embodiment of the present disclosure
- FIG5 is a schematic diagram of a process flow when an intermediary server fails according to an embodiment of the present disclosure
- FIG. 6 is a flow chart of a communication method performed by a SIP server according to an embodiment of the present disclosure
- FIG. 7 is a schematic diagram of the structure of a communication device applied to a first intermediary server according to an embodiment of the present disclosure
- the application scenarios of the communication system and the communication method provided by the embodiments of the present disclosure include, but are not limited to, SIP terminal access scenarios for video conferencing, video surveillance, and call centers, and support various SIP types of terminals to access via audio or video.
- FIG1 is a schematic diagram of the architecture of the communication system for SIP communication provided by the embodiment of the present disclosure, the system comprising: a target terminal 10, used to send a first SIP message to a first intermediary server 12; a target SIP server 11, used to send a second SIP message to the first intermediary server 12; the first intermediary server 12, used to receive the first SIP message from the target terminal 10, parse the first SIP message to determine the target SIP server 11, forward the first SIP message to the target SIP server 11, receive the second SIP message from the target SIP server 11, parse the second SIP message to determine the target terminal 10, and forward the second SIP message to the target terminal 10; the second intermediary server 13, used to serve as a backup server for the first intermediary server 12.
- the first intermediary server 12 and the second intermediary server 13 form a dual-machine hot standby (Hot Standby) mechanism.
- Dual-machine hot standby is a solution applied to servers. Under normal circumstances, the host is in working state and the slave is in monitoring state. Once the slave finds that the host is abnormal, the slave will replace the host in a short time and fully realize the functions of the host.
- the first intermediary server 12 mainly performs (but is not limited to) the following processing:
- active-standby the forwarding of SIP messages is not affected after active-standby switching occurs.
- stand-alone mode the forwarding of SIP messages is not affected after a restart.
- the target SIP server 11 is any server in the SIP server set on the network side to which the first intermediary server 12 is connected.
- the target SIP server mainly performs (but is not limited to) the following processing:
- SIP message server As a SIP message server, it has a complete SIP protocol stack and can parse SIP request messages;
- the disclosed embodiment adopts a 1+1 (HA) + N networking mode, with two intermediary servers acting as the master and backup for each other, and uses N (N is an integer greater than 1) SIP servers to process SIP signaling, supports user access through the SIP protocol, and provides users with stable and reliable video conferencing access services.
- N is an integer greater than 1
- SIP servers to process SIP signaling, supports user access through the SIP protocol, and provides users with stable and reliable video conferencing access services.
- SIP servers fails or a SIP intermediary server fails, the SIP access system can still continue to work normally, and can establish stable real-time communication between different terminal devices, including voice, video, messages, etc., and can be used for call control and call management.
- the embodiment of the present disclosure provides a communication method, which is applied to the first intermediary server 11 in the above system architecture.
- a virtual IP address is pre-configured in the first intermediary server 11, and the virtual IP address is set in the target terminal 10 and the target SIP server 11 respectively, so as to send the SIP message to the first intermediary server 11 corresponding to the virtual IP address for transfer.
- the virtual IP (VIP) address is not the IP address of a specific computer or a network interface card (NIC) in the computer, and all data packets sent to the VIP address need to pass through the real network interface.
- FIG. 2 is a flow chart showing a communication method executed by a first intermediary server, which includes the following steps 201 to 202 .
- a first SIP message is received from a target terminal, the first SIP message is parsed to determine a target SIP server, and the first SIP message is forwarded to the target SIP server.
- parsing the first SIP message to determine the target SIP server includes: parsing the first SIP message to determine the type of the first SIP message, and allocating the target SIP server to the target terminal according to the type of the first SIP message.
- allocating a target SIP server to a target terminal according to the type of a first SIP message includes: when the type of the first SIP message is a registration message and is a new SIP registration request message, allocating a target SIP server to the target terminal; when the type of the first SIP message is a registration message and is not a new SIP registration request message, parsing and obtaining content of a first target field of the first SIP message, and determining a target SIP server based on the content of the first target field; when the type of the first SIP message is a SIP call message initiated by the target terminal and is a new SIP call access request message, allocating a target SIP server to the target terminal; when the type of the first SIP message is a SIP call message initiated by the target terminal and is not a new SIP call access request message, obtaining content of a second target field of the first SIP message, and determining a target SIP server based on the content of the second target field; when the type of
- the SIP communication process may include: a registration phase, a SIP upcall phase initiated by the terminal to the server, and a SIP downcall phase initiated by the server to the terminal.
- the SIP message in the registration phase is called a registration message
- the SIP message in the SIP upcall phase is called a SIP call message initiated by the terminal
- the SIP message in the SIP downcall phase is called a call message for the calling terminal.
- parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message belongs to a registration message and is a new SIP registration request message, allocating the target SIP server to the target terminal.
- allocating a target SIP server to a target terminal includes: parsing and obtaining a unique identifier of the target terminal included in the first SIP message, and selecting a target SIP server from a set of SIP servers based on the unique identifier of the target terminal through a load balancing algorithm.
- the first intermediary server 11 parses the first SIP message and determines it as an initial registration request, that is, a registration message and a new SIP registration request message, uses the calling number in the first SIP message as the unique identifier of the target terminal, uses the calling number as the input parameter of the load balancing algorithm, obtains the address of the target SIP server output by the load balancing algorithm, and sends the first SIP message to the target SIP server according to the address of the target SIP server.
- the points on the hash ring are evenly divided by the SIP servers in normal operation, so that the results of different SIP messages after load balancing can be evenly directed to each SIP server in normal operation.
- the output obtained for the same input parameter is always the same.
- the target SIP server selected is always the same SIP server. While ensuring load balancing, it can also ensure that the registration-type SIP messages of the same terminal can be assigned to the same SIP server for processing, so as to ensure the consistency of the SIP session.
- the unique identifier of the target terminal may also be other parameters besides the calling number. As long as the parameter can uniquely identify the target terminal, it can be used as an input parameter of the load balancing algorithm.
- parsing the first SIP message to determine the target SIP server includes: parsing the first SIP message and determining that the first SIP message belongs to a registration message and is not a new SIP registration request message, obtaining content of a first target field of the first SIP message, and determining the target SIP server based on the content of the first target field.
- the first target field is a Nonce field of an Authorization header field of the first SIP message.
- parsing the first SIP message to determine the target SIP server includes: parsing the first SIP message and allocating the target SIP server to the target terminal when determining that the first SIP message belongs to a SIP call class message initiated by the target terminal and is a new SIP call access request message.
- allocating a target SIP server to a target terminal includes: parsing and obtaining a unique identifier of the target terminal included in the first SIP message, and selecting a target SIP server from a set of SIP servers based on the unique identifier of the target terminal through a load balancing algorithm.
- the first intermediary server 11 parses the first SIP message and determines it to be a new SIP call access request message, that is, it belongs to a SIP call class message and is a new SIP call access request message, uses the calling number in the first SIP message as the unique identifier of the target terminal, uses the calling number as the input parameter of the load balancing algorithm, obtains the address of the target SIP server output by the load balancing algorithm, and sends the first SIP message to the target SIP server according to the address of the target SIP server.
- the points on the hash ring are evenly divided by the SIP servers in normal operation, so that the results of different SIP messages after load balancing can be evenly directed to each SIP server in normal operation.
- the output obtained for the same input parameter is always the same.
- the target SIP server selected is always the same SIP server. While ensuring load balancing, it can also ensure that the call access request type SIP messages of the same terminal can be allocated to the same SIP server for processing, so as to ensure the consistency of the SIP session.
- the unique identifier of the target terminal may also be other parameters besides the calling number. As long as the parameter can uniquely identify the target terminal, it can be used as an input parameter of the load balancing algorithm.
- parsing the first SIP message to determine the target SIP server includes: parsing the first SIP message and determining that the first SIP message belongs to a SIP call class message initiated by a target terminal and is not a new SIP call access request message, obtaining content of a second target field of the first SIP message, and determining the target SIP server based on the content of the second target field.
- the second target field is a local tag field of the To header field of the first SIP message.
- the Local tag is a random string generated by the SIP server, which may include the nonce of the Register authentication message, the From tag of the requester message, and the To tag of the responder message.
- the first intermediary server when the target terminal initiates a SIP call to the server, the first intermediary server receives a new INVITE message from the target terminal on the user side, and distributes the message to the target SIP server on the network side according to the calling number in the message; the target SIP server embeds its own address information in the To tag as a Local tag and carries it in the response.
- the first intermediary server obtains the Local tag field from the To header field and the From header field respectively, and distributes the response or request message to the corresponding target SIP server for processing.
- parsing the first SIP message to determine the target SIP server includes: when parsing the first SIP message and determining that the first SIP message belongs to a call type message for calling a target terminal, obtaining content of a second target field of the first SIP message, and determining the target SIP server based on the content of the second target field.
- the second target field is a local tag field in the From header field of the first SIP message.
- the SIP server when the server initiates a call to the target terminal, the SIP server embeds the address information of the target terminal into the private field XNEXTHOP, and embeds its own address information into the Local tag field of the From header field.
- the first intermediary server distributes the message to the corresponding target terminal according to the address information in XNEXTHOP.
- the target terminal makes a subsequent response or request in the same session, the first intermediary server obtains the address of the target SIP server from the Local tag field obtained from the From header field and the To header field, respectively, and distributes the response or request message to the corresponding target SIP server for processing.
- each SIP server in the SIP server set used in the load balancing algorithm should be in a normal working state to ensure that the SIP messages assigned to the SIP server can be processed normally.
- the method also includes: when any SIP server that establishes a communication connection is detected to be faulty, the SIP server is removed from the SIP server set; when any faulty SIP server is detected to be unfaulted, the SIP server is added to the SIP server set.
- a second SIP message is received from a target SIP server, the second SIP message is parsed to determine a target terminal, and the second SIP message is forwarded to the target terminal.
- the content of the third target field of the second SIP message is obtained, and the target terminal is determined based on the content of the third target field.
- parsing the second SIP message to determine the target terminal includes: parsing the second SIP message and determining that the second SIP message belongs to a registration type message, obtaining content of a third target field of the second SIP message, and determining the target terminal based on the content of the third target field.
- the third target field is an XNEXTHOP field in a private field of the header field.
- the target SIP server embeds the address information of the target terminal into the private field XNEXTHOP, and the target SIP server carries the WWW-Authenticate header field in the response, and embeds the address information of the SIP server into the Nonce field of the header field.
- parsing the second SIP message to determine the target terminal includes: parsing the second SIP message and determining that the second SIP message belongs to a call type message initiated by the target terminal, obtaining the content of the third target field of the second SIP message, and determining the target terminal based on the content of the third target field.
- the third target field is an XNEXTHOP field in a private field of the header field.
- the third target field is an XNEXTHOP field in a private field of the header field.
- the process of the target SIP server sending the second SIP message in each stage of the SIP communication process can be referred to the normal flow diagram of SIP communication shown in FIG. 3 , which will not be described in detail here.
- the communication method further includes: in the event that a target SIP server fails, re-determining a new target SIP server, and sending a third SIP message of the SIP session of the target terminal newly acquired to the new target SIP server; querying the cached history information of the SIP session of the target terminal through the new target SIP server, and returning a response to the third SIP message based on the history information.
- the failed SIP servers when some SIP servers fail, the failed SIP servers no longer send keep-alive messages to the first intermediary server.
- the first intermediary server After the first intermediary server identifies the failure of the corresponding SIP server node, it adjusts the load balancing algorithm. SIP messages thereafter will no longer be sent to the failed SIP servers, but will be distributed to other SIP servers in normal status for processing.
- the first intermediary server forwards the SIP message to other SIP servers through a load balancing algorithm. Since the SIP message carries the Local tag, the SIP message at this time is a new unfamiliar session request for the newly assigned SIP server. Therefore, the newly assigned SIP server generates a corresponding response message based on the session history information queried in the Redis cache database.
- the previous session information can be restored from the Redis cache database, and the SIP server continues to send keep-alive messages to the first intermediary server.
- the first intermediary server recognizes that the corresponding SIP server node has returned to normal, adjusts the load balancing algorithm, and continues to distribute messages to the restored SIP server. After receiving the message, the SIP server continues to process it according to the normal process steps.
- the communication method according to the embodiment of the present disclosure also includes: in the event of a failure in the first intermediary server, triggering a master-slave switching mechanism, passing the virtual network address of the first intermediary server to the second intermediary server through the master-slave switching mechanism, so as to switch the second intermediary server to the master server and the first intermediary server to the backup server; in the event of recovery of the first intermediary server, triggering the master-slave switching mechanism, obtaining the virtual network address of the second intermediary server through the master-slave switching mechanism for configuration, so as to switch the first intermediary server to the master server and the second intermediary server to the backup server.
- FIG5 is a schematic diagram of a processing flow when an intermediary server fails.
- the master-slave switching mechanism of the dual-machine hot standby component is automatically triggered.
- the dual-machine hot standby component sets the virtual IP address to the standby second intermediary server, and the second intermediary server becomes the master server, and the failed first intermediary server becomes the standby server. After the failed first intermediary server is repaired, it continues to remain in the standby state and waits for the second switch, and the distribution of SIP messages is not affected.
- the embodiment of the present disclosure also provides a communication method, which is applied to a SIP server.
- FIG6 is a flow chart showing a communication method executed by a SIP server, including the following steps 601 to 602 .
- step 601 a first SIP message from a target terminal forwarded by a first mediation server is received.
- the SIP server sends a keep-alive message to the first intermediary server to maintain a communication connection with the first intermediary server.
- step 602 a second SIP message for the target terminal is sent to the first intermediary server, so that the second SIP message is forwarded to the target terminal through the first intermediary server.
- the communication method before sending the second SIP message for the target terminal to the first intermediary server, further includes at least one of the following steps: writing the address of the SIP server in the first target field of the second SIP message; writing the address of the SIP server in the second target field of the second SIP message; writing the address of the target terminal in the third target field of the second SIP message.
- the communication method according to the embodiment of the present disclosure further includes: querying and obtaining historical information of the SIP session of the target terminal from a cache database; and responding to the first SIP message according to the historical information.
- a first intermediary server is provided, and a first SIP message from a target terminal is received through the first intermediary server, the first SIP message is parsed to determine a target SIP server, and the first SIP message is forwarded to the target SIP server, and a second SIP message from the target SIP server is received, the second SIP message is parsed to determine a target terminal, and the second SIP message is forwarded to the target terminal, so that a corresponding SIP server can be allocated to the terminal through the first intermediary server, providing a basis for load balancing of multiple connected SIP servers, and providing a possibility for improving the stability and reliability of SIP access services.
- NGINX proxy servers to distribute SIP messages, which requires an additional status recording mechanism to record the status of SIP messages to ensure the consistency of SIP transactions.
- NGINX proxy servers need to cooperate with the status recording mechanism to distribute SIP messages, so there is still a single point risk, which is not truly highly reliable.
- SIP messages in non-initial request states cannot be forwarded to the correct SIP server, that is, the consistency of SIP transactions cannot be guaranteed.
- Single-point SIP access solutions or solutions that rely on NGINX require manual recovery once their single-point SIP server or NGINX fails.
- NGNIX proxy server uses a 4-layer proxy mode, that is, based on the TCP/UDP protocol, but NGINIX does not know the specific content of the request and cannot implement stateless forwarding. It needs to cooperate with the state caching mechanism, which makes it impossible to implement a highly reliable mechanism such as active-standby switching.
- the first intermediary server and the second intermediary server belong to stateless forwarding, and do not need to rely on a state recording mechanism to record the state of the SIP session. They can implement stateless load balancing and forward directly by parsing the SIP message.
- a more stable and reliable video conferencing access experience is provided for users of SIP access, which can improve the robustness and service carrying capacity of the video conferencing system and improve the SIP access performance.
- a rapid response is achieved when the SIP server fails, avoiding the situation where users cannot join the meeting or can only join the meeting after multiple failed attempts due to a single point failure.
- the situation of slow response and non-response to the terminal caused by overloading of the single-point SIP server during high concurrency can be effectively alleviated.
- a hot standby deployment method that does not rely on a cache can be implemented to achieve high reliability, and only by ensuring that the intermediary server that distributes SIP messages adopts a stateless design, a legal load balancing algorithm and hot standby method can be selected according to different business scenarios and security requirements to achieve highly reliable SIP access.
- step division of the various methods above is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this disclosure; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this disclosure.
- the embodiment of the present disclosure also provides a communication device.
- the specific implementation of the device can refer to the relevant description of the first intermediary server in the communication method according to the embodiment of the present disclosure, which will not be repeated here.
- FIG. 7 is a schematic diagram of the structure of the communication device applied to the first intermediary server according to the embodiment of the present disclosure.
- the communication device according to the embodiment of the present disclosure includes a first processing module 701 and a second processing module 702.
- the first processing module 701 is used to receive a first SIP message from a target terminal, parse the first SIP message to determine a target SIP server, and forward the first SIP message to the target SIP server.
- the second processing module 702 is used to receive a second SIP message from a target SIP server, parse the second SIP message to determine a target terminal, and forward the second SIP message to the target terminal.
- the embodiment of the present disclosure also provides a communication device.
- the specific implementation of the device can refer to the relevant description of the SIP server in the communication method according to the embodiment of the present disclosure, which will not be repeated here.
- FIG8 is a schematic diagram of the structure of the communication device applied to the SIP server according to the embodiment of the present disclosure.
- the communication device according to the embodiment of the present disclosure includes a receiving module 801 and a sending module 802.
- the receiving module 801 is used to receive a first SIP message from a target terminal forwarded by a first intermediary server.
- the sending module 802 is used to send a second SIP message for the target terminal to the first intermediary server, so that the second SIP message is forwarded to the target terminal through the first intermediary server.
- the functions or modules included in the communication device provided in the embodiments of the present disclosure can be used to execute the communication method according to the embodiments of the present disclosure.
- the specific implementation and technical effects thereof can be referred to the description of the above method embodiments, and will not be repeated here for the sake of brevity.
- modules involved in this embodiment are logic modules.
- a logic unit may be a physical unit, or a part of a physical unit, or may be implemented as a combination of multiple physical units.
- this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present disclosure, but this does not mean that there are no other units in this embodiment.
- an embodiment of the present disclosure further provides an electronic device, comprising: at least one processor 901; and a memory 902 on which at least one program is stored.
- the at least one processor 901 executes the at least one program.
- the electronic device may further include at least one I/O interface 903 connected between the processor 901 and the memory 902 and configured to implement information interaction between the processor 901 and the memory 902 .
- the processor 901 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 902 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I/O interface (read-write interface) 903 is connected between the processor 901 and the memory 902, and can realize information exchange between the processor 901 and the memory 902, including but not limited to a data bus (Bus), etc.
- RAM random access memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- FLASH flash memory
- the I/O interface (read-write interface) 903 is connected between the processor 901 and the memory 902, and can realize information exchange between the processor 901 and the memory 902, including but not limited to a data bus (Bus), etc.
- the processor 901 , the memory 902 , and the I/O interface 903 are connected to each other through a bus, and further connected to other components of the computing device.
- This embodiment also provides a computer-readable medium on which a computer program is stored.
- the program is executed by a processor, the communication method according to each embodiment of the present disclosure is implemented. To avoid repeated description, the specific steps of the method are not repeated here.
- Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium).
- a computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data).
- Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
- communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- Telephonic Communication Services (AREA)
Abstract
本公开提供了一种通信方法、系统、设备及可读介质。应用于第一中介服务器的通信方法包括:接收来自于目标终端的第一SIP消息,解析所述第一SIP消息以确定目标SIP服务器,将所述第一SIP消息转发给所述目标SIP服务器;接收来自于所述目标SIP服务器的第二SIP消息,解析所述第二SIP消息以确定所述目标终端,将所述第二SIP消息转发给所述目标终端。
Description
相关申请的交叉引用
本申请要求于2023年12月13日提交的名称为“通信方法、系统、设备及可读介质”的中国专利申请CN 202311710599.3的优先权,其全部内容通过引用并入本文中。
本公开涉及通信技术领域,尤其涉及一种通信方法、系统、设备及可读介质。
会话初始协议(Session Initiation Protocol,SIP)接入技术是指终端设备通过采用SIP协议的方式来建立、修改和终止多媒体会话的技术。SIP是一个应用层的信令控制协议,其所表示的会话可以是因特网(Internet)多媒体会议、网际协议(IP)电话和多媒体分发等。相较于H323协议、H248(MGCP)协议等,采用SIP协议接入的优点包括:(1)具有可扩展性,能够简单易行的嵌入在各种嵌入式终端设备中;(2)能够确保互操作能力,可以使用不同的设备进行通信;(3)具有较强的灵活性,与其他软件系统融合可以构建统一完整的通信解决方案,可以应用于各种多媒体接入的场景,包括不限于视频会议、视频监控等。
鉴于SIP接入的巨大优势,涌现了一大批对应的SIP服务端软件,但目前这些方案(软件产品)无法提供稳定且可靠的SIP接入服务。
本公开实施例提供一种通信方法、系统、设备及可读介质。
本公开实施例提供了一种通信方法,应用于第一中介服务器,所述方法包括:接收来自于目标终端的第一SIP消息,解析所述第一SIP消息以确定目标SIP服务器,将所述第一SIP消息转发给所述目标SIP服务器;接收来自于所述目标SIP服务器的第二SIP消息,解析所述第二SIP消息以确定所述目标终端,将所述第二SIP消息转发给所述目标终端。
本公开实施例还提供一种通信方法,应用于SIP服务器,所述方法包括:接收通过第一中介服务器转发的来自于目标终端的第一SIP消息;向所述第一中介服务器发送针对所述目标终端的第二SIP消息,以通过所述第一中介服务器将所述第二SIP消息转发至所述目标终端。
本公开实施例还提供一种通信系统,包括:目标终端,用于向第一中介服务器发送第一SIP消息;目标SIP服务器,用于向所述第一中介服务器发送第二SIP消息;第一中介服务器,用于接收来自于所述目标终端的所述第一SIP消息,解析所述第一SIP消息以确定所述目标SIP服务器,将所述第一SIP消息转发给所述目标SIP服务器,接收来自于所述目标SIP服务器的所述第二SIP消息,解析所述第二SIP消息以确定所述目标终端,将所述第二SIP消息转发给所述目标终端;以及第二中介服务器,用于作为所述第一中介服务器的备用服务器。
本公开实施例还提供一种电子设备,包括:至少一个处理器;存储器,其上存储有至少一个程序,当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现根据本公开实施例的通信方法。
本公开实施例还提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现根据本公开实施例的通信方法。
图1为根据本公开实施例的通信系统的架构示意图;
图2为根据本公开实施例的第一中介服务器执行的通信方法的流程示意图;
图3为根据本公开实施例的SIP通信的正常流程示意图;
图4为根据本公开实施例的SIP服务器故障时的处理流程示意图;
图5为根据本公开实施例的中介服务器故障时的处理流程示意图;
图6为根据本公开实施例的SIP服务器执行的通信方法的流程示意图;
图7为根据本公开实施例的应用于第一中介服务器的通信装置的结构示意图;
图8为根据本公开实施例的应用于SIP服务器的通信装置的结构示意图;
图9为根据本公开实施例的电子设备的结构示意图。
以下结合附图对本公开的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本公开,并不用于限制本公开。
如本公开所使用的,术语“和/或”包括一个或多个相关列举条目的任何和全部组合。
本公开所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本公开所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。
当本公开中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。
除非另外限定,否则本公开所用的全部术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本公开明确如此限定。
本公开实施例提供的通信系统和通信方法的应用场景,包括但不限于视频会议、视频监控和呼叫中心的SIP终端接入场景,支持各种SIP类型的终端通过音频或者视频接入。
本公开实施例提供的通信系统可以应用于SIP通信业务。图1所示为本公开实施例提供的用于SIP通信的通信系统的架构示意图,该系统包括:目标终端10,用于向第一中介服务器12发送第一SIP消息;目标SIP服务器11,用于向第一中介服务器12发送第二SIP消息;第一中介服务器12,用于接收来自于目标终端10的第一SIP消息,解析第一SIP消息以确定目标SIP服务器11,将第一SIP消息转发给目标SIP服务器11,接收来自于目标SIP服务器11的第二SIP消息,解析第二SIP消息以确定目标终端10,将第二SIP消息转发给目标终端10;第二中介服务器13,用于作为第一中介服务器12的备用服务器。
第一中介服务器12和第二中介服务器13形成双机热备(Hot Standby)机制,双机热备是应用于服务器的一种解决方案,正常情况下主机处于工作状态,从机处于监视状态,一旦从机发现主机异常,从机将会在短时间之内代替主机,完全实现主机的功能。
第一中介服务器12主要执行(但不限于)以下处理:
(1)作为SIP消息入口,对SIP消息透传,其他负责处理SIP消息的网元对第一中介服务器12无感知;
(2)拥有轻量级的SIP协议栈,并能够根据负载均衡算法完成对SIP消息的分发和负载均衡;
(3)无状态区分,具有主备和单机两种模式,主备模式下,发生主备切换后也不影响对SIP消息的转发,在单机模式下,重启后也不影响对SIP消息的转发。
目标SIP服务器11是第一中介服务器12对接的网络侧的SIP服务器集合中的任意一个服务器。
目标SIP服务器主要执行(但不限于)以下处理:
(1)作为SIP消息服务器,拥有完整的SIP协议栈,可以解析SIP请求消息;
(2)可以处理终端发起的注册、注销、注册保活、注册鉴权和注册抢占等注册类消息;
(3)可以处理终端发起的呼叫、号码规整、特服号呼叫、路由寻址等呼叫类消息。
本公开实施例采用1+1(HA)+N的组网方式,由两台中介服务器互为主备,利用N(N为大于1的整数)台SIP服务器处理SIP信令,支持用户通过SIP协议的接入,为用户提供稳定可靠视频会议的接入服务。当部分SIP服务器故障或者某台SIP中介服务器故障,SIP接入系统仍可继续正常工作,能够在不同终端设备之间建立稳定的实时通信,包括语音、视频、消息等,并且可以用于呼叫控制和呼叫管理。
本公开实施例提供了一种通信方法,应用于以上系统架构中的第一中介服务器11。在第一中介服务器11中预先配置有虚拟IP地址,在目标终端10、目标SIP服务器11中分别设置该虚拟IP地址,以将SIP消息发送到该虚拟IP地址对应的第一中介服务器11进行中转。虚拟IP(Virtual IP,VIP)地址不是特定计算机或计算机中的网络接口卡(NIC)的IP地址,发送到VIP地址的所有的数据包都需要经过真实的网络接口。
图2所示为第一中介服务器执行的通信方法的流程示意图,包括以下步骤201至202。
在步骤201,接收来自于目标终端的第一SIP消息,解析第一SIP消息以确定目标SIP服务器,将第一SIP消息转发给目标SIP服务器。
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息以确定第一SIP消息的类型,根据第一SIP消息的类型为目标终端分配目标SIP服务器。
在一些实施例中,根据第一SIP消息的类型为目标终端分配目标SIP服务器,包括:在第一SIP消息的类型为注册类消息、且为新的SIP注册请求消息的情况下,为目标终端分配目标SIP服务器;在第一SIP消息的类型为注册类消息、且不为新的SIP注册请求消息的情况下,解析并获得第一SIP消息的第一目标字段的内容,基于第一目标字段的内容确定目标SIP服务器;在第一SIP消息的类型为目标终端发起的SIP呼叫类消息、且为新的SIP呼叫接入请求消息的情况下,为目标终端分配目标SIP服务器;在第一SIP消息的类型为目标终端发起的SIP呼叫类消息、且不为新的SIP呼叫接入请求消息的情况下,获得第一SIP消息的第二目标字段的内容,基于第二目标字段的内容确定目标SIP服务器;在第一SIP消息的类型为呼叫目标终端的呼叫类消息的情况下,获得第一SIP消息的第二目标字段的内容,基于第二目标字段的内容确定目标SIP服务器。
需要说明的是,对应SIP通信过程中的各阶段,解析第一SIP消息确定目标SIP服务器的方式也有所不同,以下分别对各阶段的处理过程进行说明。
SIP通信过程可以包括:注册阶段、终端向服务器发起的SIP上呼阶段、服务器向终端发起的SIP下呼阶段。
注册阶段的SIP消息称为注册类消息,SIP上呼阶段的SIP消息称为终端发起的SIP呼叫类消息,SIP下呼阶段的SIP消息称为呼叫终端的呼叫类消息。
注册阶段
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息并且确定第一SIP消息属于注册类消息、且为新的SIP注册请求消息的情况下,为目标终端分配目标SIP服务器。
在一些实施例中,为目标终端分配目标SIP服务器,包括:解析并获得第一SIP消息中包括的目标终端的唯一标识,通过负载均衡算法基于目标终端的唯一标识从SIP服务器集合中选择目标SIP服务器。
在示例性实施例中,第一中介服务器11接收到来自于目标终端10的第一SIP消息之后,解析第一SIP消息并确定为初始注册请求,即,属于注册类消息且是新的SIP注册请求消息,采用第一SIP消息中的主叫号码作为目标终端的唯一标识,将主叫号码作为负载均衡算法的输入参数,获得负载均衡算法输出的目标SIP服务器的地址,按照目标SIP服务器的地址将第一SIP消息发送给目标SIP服务器。
根据负载均衡算法,哈希(Hash)环上的点由处于正常运行状态的SIP服务器均分,从而使得不同SIP消息通过负载均衡后的结果可以均匀地指向各个正常运行状态的SIP服务器。
根据负载均衡算法的特征,对于同一个输入参数得到的输出始终相同,这就使得通过将目标终端的唯一标识(例如,主叫号码)作为负载均衡算法的输入参数,选择得到的目标SIP服务器始终为同一个SIP服务器,在保证负载均衡的同时还能保证可以将同一个终端的注册类SIP消息分配到同一个SIP服务器进行处理,以保证SIP会话的一致性。
需要说明的是,目标终端的唯一标识也可以是除主叫号码之外的其他参数,只需要该参数能够唯一地标识目标终端即可用作负载均衡算法的输入参数。
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息并且确定第一SIP消息属于注册类消息、且不为新的SIP注册请求消息的情况下,获得第一SIP消息的第一目标字段的内容,基于第一目标字段的内容确定目标SIP服务器。
在示例性实施例中,第一目标字段为第一SIP消息的Authorization头部字段的Nonce字段。
在示例性实施例中,参见图3所示的SIP通信的正常流程示意图,目标终端向服务端注册时,第一中介服务器收到用户侧的目标终端发来的新的初始注册请求(REGISTER)消息,并根据该消息中的主叫号码将该消息分发至网络侧的目标SIP服务器;目标SIP服务器将目标终端的地址信息嵌入私有字段XNEXTHOP中,同时目标SIP服务器在响应中携带WWW-Authenticate头部字段,并将SIP服务器的地址信息嵌入到该头部字段的Nonce字段中。
终端在进行后续的REGISTER消息时,第一中介服务器直接根据终端注册类消息中Authorization头部字段的Nonce字段将该消息分发至相应的目标SIP服务器进行处理。
SIP上呼阶段
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息并且确定第一SIP消息属于目标终端发起的SIP呼叫类消息、且为新的SIP呼叫接入请求消息的情况下,为目标终端分配目标SIP服务器。
在一些实施例中,为目标终端分配目标SIP服务器,包括:解析并获得第一SIP消息中包括的目标终端的唯一标识,通过负载均衡算法基于目标终端的唯一标识从SIP服务器集合中选择目标SIP服务器。
在示例性实施例中,第一中介服务器11接收到来自于目标终端10的第一SIP消息之后,解析第一SIP消息并确定为新的SIP呼叫接入请求消息,即,属于SIP呼叫类消息且是新的SIP呼叫接入请求消息,采用第一SIP消息中的主叫号码作为目标终端的唯一标识,将主叫号码作为负载均衡算法的输入参数,获得负载均衡算法输出的目标SIP服务器的地址,按照目标SIP服务器的地址将第一SIP消息发送给目标SIP服务器。
根据负载均衡算法,哈希(Hash)环上的点由处于正常运行状态的SIP服务器均分,从而使得不同SIP消息通过负载均衡后的结果可以均匀地指向各个正常运行状态的SIP服务器。
根据负载均衡算法的特征,对于同一个输入参数得到的输出始终相同,这就使得通过将目标终端的唯一标识(例如,主叫号码)作为负载均衡算法的输入参数,选择得到的目标SIP服务器始终为同一个SIP服务器,在保证负载均衡的同时还能保证可以将同一个终端的呼叫接入请求类SIP消息分配到同一个SIP服务器进行处理,以保证SIP会话的一致性。
需要说明的是,目标终端的唯一标识也可以是除主叫号码之外的其他参数,只需要该参数能够唯一地标识目标终端即可用作负载均衡算法的输入参数。
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息并且确定第一SIP消息属于目标终端发起的SIP呼叫类消息、且不为新的SIP呼叫接入请求消息的情况下,获得第一SIP消息的第二目标字段的内容,基于第二目标字段的内容确定目标SIP服务器。
在示例性实施例中,第二目标字段为第一SIP消息的To头域的本地标签(Local tag)字段。Local tag是由SIP服务器生成的随机串,可以包括Register鉴权消息的nonce、请求方消息的From tag、响应方消息的To tag。
在示例性实施例中,参见图3所示的SIP通信的正常流程示意图,目标终端向服务端发起SIP呼叫时,第一中介服务器收到用户侧的目标终端发来的新的INVITE消息,并根据该消息中的主叫号码将该消息分发至网络侧的目标SIP服务器;目标SIP服务器将自身的地址信息嵌入To tag作为Local tag携带在响应中。目标终端在进行同一会话中后续的请求或响应时,第一中介服务器分别从To头域和From头域中获取Local tag字段,并将响应或请求消息分发至相应的目标SIP服务器处理。
SIP下呼阶段
在一些实施例中,解析第一SIP消息以确定目标SIP服务器,包括:解析第一SIP消息并且确定第一SIP消息属于呼叫目标终端的呼叫类消息的情况下,获得第一SIP消息的第二目标字段的内容,基于第二目标字段的内容确定目标SIP服务器。
在示例性实施例中,第二目标字段为第一SIP消息的From头域中的本地标签(Local tag)字段。
在示例性实施例中,参见图3所示的SIP通信的正常流程示意图,服务器端向目标终端发起呼叫时,SIP服务器将目标终端的地址信息嵌入私有字段XNEXTHOP中,同时将自己的地址信息嵌入From头域的Local tag字段中,第一中介服务器根据XNEXTHOP中的地址信息,将消息分发至相应的目标终端。目标终端在进行同一会话中后续的响应或请求时,第一中介服务器分别从From头域和To头域中获取的Local tag字段中获取目标SIP服务器的地址,并将响应或请求消息分发至相应的目标SIP服务器处理。
在一些实施例中,对于在注册阶段和SIP上呼阶段过程中使用的负载均衡算法,在负载均衡算法中使用的SIP服务器集合中各个SIP服务器都应当处于正常工作状态,以保障分配到给SIP服务器的SIP消息能够正常被处理。基于此,方法还包括:在监测到建立通信连接的任一SIP服务器故障的情况下,将该SIP服务器从SIP服务器集合中去除;在监测到任一故障SIP服务器的故障解除的情况下,将该SIP服务器增加至SIP服务器集合。
在步骤202,接收来自于目标SIP服务器的第二SIP消息,解析第二SIP消息以确定目标终端,将第二SIP消息转发给目标终端。
在一些实施例中,解析第二SIP消息并确定第二SIP消息属于指定类型消息的情况下,获得第二SIP消息的第三目标字段的内容,基于第三目标字段的内容确定目标终端。
指定类型消息包括以下之一:注册类消息;目标终端发起的呼叫类消息;呼叫目标终端的呼叫类消息。
需要说明的是,对应于SIP通信过程中的各阶段,解析第二SIP消息以确定目标终端的方式有所不同,以下分别对各阶段的处理过程进行说明。
注册阶段
在一些实施例中,解析第二SIP消息以确定目标终端,包括:解析第二SIP消息并确定第二SIP消息属于注册类消息的情况下,获得第二SIP消息的第三目标字段的内容,基于第三目标字段的内容确定目标终端。
在示例性实施例中,第三目标字段为头域私有字段中的XNEXTHOP字段。
在示例性实施例中,参见图3所示的SIP通信的正常流程示意图,目标SIP服务器将目标终端的地址信息嵌入私有字段XNEXTHOP中,同时目标SIP服务器在响应中携带WWW-Authenticate头部字段,并将SIP服务器的地址信息嵌入到该头部字段的Nonce字段中。
SIP上呼阶段
在一些实施例中,解析第二SIP消息以确定目标终端,包括:解析第二SIP消息并确定第二SIP消息属于目标终端发起的呼叫类消息的情况下,获得第二SIP消息的第三目标字段的内容,基于第三目标字段的内容确定目标终端。
在示例性实施例中,第三目标字段为头域私有字段中的XNEXTHOP字段。
SIP下呼阶段
在一些实施例中,解析第二SIP消息以确定目标终端,包括:解析第二SIP消息并确定第二SIP消息属于呼叫目标终端的呼叫类消息的情况下,获得第二SIP消息的第三目标字段的内容,基于第三目标字段的内容确定目标终端。
在示例性实施例中,第三目标字段为头域私有字段中的XNEXTHOP字段。
在SIP通信过程中的各阶段中的目标SIP服务器发送第二SIP消息的过程可参见图3所示的SIP通信的正常流程示意图,此处不再赘述。
在一些实施例中,根据本公开实施例的通信方法还包括:在目标SIP服务器发生故障的情况下,重新确定新的目标SIP服务器,将新获取到目标终端的SIP会话的第三SIP消息发送给新的目标SIP服务器;通过新的目标SIP服务器查询缓存的目标终端的SIP会话的历史信息,并根据历史信息返回对第三SIP消息的响应。
在示例性实施例中,当部分SIP服务器出现故障时,故障的SIP服务器不再向第一中介服务器发送保活消息,第一中介服务器识别到对应的SIP服务器节点故障后,调整负载均衡算法,此后的SIP消息将不再发往故障的SIP服务器,转为分发到其他的正常状态的SIP服务器处理。
在一些实施例中,根据本公开实施例的通信方法还包括:在目标SIP服务器恢复的情况下,将新获取到的目标终端的SIP会话的第四SIP消息发送给目标SIP服务器;通过目标SIP服务器查询缓存的目标终端的SIP会话的历史信息,并根据历史信息返回对第四SIP消息的响应。
在示例性实施例中,参见图4所示的SIP服务器故障时的处理流程示意图,当Local tag对应的SIP服务器宕机时,第一中介服务器通过负载均衡算法将SIP消息转发给其他的SIP服务器。由于SIP消息携带了Local tag,此时的SIP消息对新分配的SIP服务器而言是一个新的陌生会话内请求,因此,由新分配的SIP服务器根据Redis缓存数据库中查询到会话历史信息,来生成对应的响应消息。
当发生故障的SIP服务器恢复后,可从Redis缓存数据库中恢复此前的会话信息,SIP服务器继续向第一中介服务器发送保活消息。第一中介服务器识别到对应的SIP服务器节点恢复正常,调整负载均衡算法,继续向此恢复正常的SIP服务器分发消息。SIP服务器收到消息后,继续按正常流程步骤进行处理。
在一些实施例中,根据本公开实施例的通信方法还包括:在第一中介服务器发生故障的情况下,触发主备切换机制,通过主备切换机制将第一中介服务器的虚拟网络地址传递给第二中介服务器,以将第二中介服务器切换为主服务器、将第一中介服务器切换为备用服务器;在第一中介服务器恢复的情况下,触发主备切换机制,通过主备切换机制获取第二中介服务器的虚拟网络地址进行配置,以将第一中介服务器切换为主服务器、将第二中介服务器切换为备用服务器。
在示例性实施例中,图5所示为中介服务器故障时的处理流程示意图,当第一中介服务器出现故障时,会自动触发双机热备组件的主备切换机制,双机热备组件将虚拟IP地址设置到备用的第二中介服务器上,第二中介服务器变为主服务器,故障的第一中介服务器变成备用服务器。待故障的第一中介服务器修复后,继续保持备用状态,等待第二次切换,SIP消息的分发不受影响。
本公开实施例还提供了一种通信方法,应用于SIP服务器。
图6所示为SIP服务器执行的通信方法的流程示意图,包括以下步骤601至602。
在步骤601,接收通过第一中介服务器转发的来自于目标终端的第一SIP消息。
在一些实施例中,SIP服务器向第一中介服务器发送保活消息,以维持与第一中介服务器的通信连接。
在步骤602,向第一中介服务器发送针对目标终端的第二SIP消息,以通过第一中介服务器将第二SIP消息转发至目标终端。
在一些实施例中,在向第一中介服务器发送针对目标终端的第二SIP消息之前,根据本公开实施例的通信方法还包括以下步骤中的至少之一:在第二SIP消息的第一目标字段中写入SIP服务器的地址;在第二SIP消息的第二目标字段写入SIP服务器的地址;在第二SIP消息的第三目标字段写入目标终端的地址。
在一些实施例中,根据本公开实施例的通信方法还包括:从缓存数据库中查询获得目标终端的SIP会话的历史信息;根据历史信息响应第一SIP消息。
本公开实施例中,设置第一中介服务器,并通过第一中介服务器接收来自于目标终端的第一SIP消息,解析第一SIP消息以确定目标SIP服务器,将第一SIP消息转发给目标SIP服务器,以及接收来自于目标SIP服务器的第二SIP消息,解析第二SIP消息以确定目标终端,将第二SIP消息转发给目标终端,从而使得能够通过第一中介服务器为终端分配对应的SIP服务器,为连接的多个SIP服务器的负载均衡提供基础,为提高SIP接入服务的稳定性和可靠性提供可能性。
相关技术中,在一些SIP接入方案中采用NGINX代理服务器来分发SIP消息,这需要增加额外的状态记录机制来记录SIP消息的状态,以此来保证SIP事务的一致性。NGNIX代理服务器需要配合状态记录机制来分发SIP消息,因此仍存在单点风险,不是真正意义上的高可靠。当NGINX服务器故障时,重启NGINX后,无法将非初始请求状态的SIP消息转发至正确的SIP服务器,即,无法保证SIP事务的一致性。单点的SIP接入方案或者依赖NGINX的方案,一旦其单点SIP服务器或NGINX出现故障,需要人为手动恢复,不但不能继续给用户提供完整视频会议接入服务,还要大量的系统建设和人力运维资源,缺乏容灾处理能力。单点的SIP接入方案缺乏负载均衡能力,无法在大话务量情况下,保证系统平稳的运行。当系统过载时,导致可能无法及时响应终端的请求。NGNIX代理服务器采用4层代理模式,即,基于TCP/UDP协议,但NGINIX不知道请求的具体内容,无法实现无状态的转发,需要配合状态缓存机制,这导致其自身无法实现主备切换这种高可靠的机制。
根据本公开实施例的第一中介服务器和第二中介服务器属于无状态转发,不需要依赖于状态记录机制记录SIP会话的状态,能够实现无状态的负载均衡,直接通过解析SIP消息进行转发。
根据本公开实施例,对于视频会议中的SIP类型终端的接入,依托5G通信技术发展和网络传输的高带宽,为SIP接入的用户提供更加稳定可靠的视频会议接入体验,能够提升视频会议系统的鲁棒性和业务承载能力,提升SIP接入性能。根据本公开实施例,实现了SIP服务器故障时的快速响应,避免因单点故障造成用户无法入会或多次入会失败后才能入会的情况。同时,根据本公开实施例,通过SIP消息的负载均衡,可以有效缓解高并发时造成对单点SIP服务器过载而导致的对终端响应慢和不响应的情况。
根据本公开实施例,能够实现不依赖于缓存的热备份部署方式,实现高可靠性,并且只需要保证分发SIP消息的中介服务器是采用的无状态的设计,就可以根据不同业务场景和安全需求选择合法的负载均衡算法和热备方法,实现高可靠的SIP接入。
本领域技术人员应当认识到,上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本公开的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在本公开的保护范围内。
本公开实施例还提供了一种通信装置,该装置的具体实施可参见根据本公开实施例的通信方法中的第一中介服务器的相关描述,此处不再重述。图7所示为根据本公开实施例的应用于第一中介服务器的通信装置的结构示意图,根据本公开实施例的通信装置包括第一处理模块701和第二处理模块702。
第一处理模块701用于接收来自于目标终端的第一SIP消息,解析第一SIP消息以确定目标SIP服务器,将第一SIP消息转发给目标SIP服务器。
第二处理模块702用于接收来自于目标SIP服务器的第二SIP消息,解析第二SIP消息以确定目标终端,将第二SIP消息转发给目标终端。
本公开实施例还提供了一种通信装置,该装置的具体实施可参见根据本公开实施例的通信方法中的SIP服务器的相关描述,此处不再重述。图8所示为根据本公开实施例的应用于SIP服务器的通信装置的结构示意图,根据本公开实施例的通信装置包括接收模块801和发送模块802。
接收模块801用于接收通过第一中介服务器转发的来自于目标终端的第一SIP消息。
发送模块802用于向第一中介服务器发送针对目标终端的第二SIP消息,以通过第一中介服务器将第二SIP消息转发至目标终端。
本公开实施例提供的通信装置具有的功能或包含的模块可以用于执行根据本公开实施例的通信方法,其具体实现和技术效果可参照上文方法实施例的描述,为了简洁,这里不再赘述。
需要说明的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本公开的创新部分,本实施方式中并没有将与解决本公开所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。
参照图9,本公开实施例还提供一种电子设备,包括:至少一个处理器901;存储器902,其上存储有至少一个程序,当该至少一个程序被该至少一个处理器901执行,使得该至少一个处理器901实现根据本公开各实施例的通信方法。
如图9所示,根据本公开实施例的电子设备还可以包括至少一个I/O接口903,连接在处理器901与存储器902之间,配置为实现处理器901与存储器902的信息交互。
处理器901为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器902为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)903连接在处理器901与存储器902间,能实现处理器901与存储器902的信息交互,其包括但不限于数据总线(Bus)等。
在一些实施例中,处理器901、存储器902和I/O接口903通过总线相互连接,进而与计算设备的其它组件连接。
本实施例还提供一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现根据本公开各实施例的通信方法,为避免重复描述,在此不再赘述该方法的具体步骤。
本领域普通技术人员可以理解,上文中所申请方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其它存储器技术、CD-ROM、数字多功能盘(DVD)或其它光盘存储、磁盒、磁带、磁盘存储或其它磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本实施例的范围之内并且形成不同的实施例。
可以理解的是,以上实施方式仅仅是为了说明本公开的原理而采用的示例性实施方式,然而本公开并不局限于此。对于本领域内的普通技术人员而言,在不脱离本公开的精神和实质的情况下,可以做出各种变型和改进,这些变型和改进也视为本公开的保护范围。
Claims (15)
- 一种通信方法,应用于第一中介服务器,所述方法包括:接收来自于目标终端的第一初始会话协议SIP消息,解析所述第一SIP消息以确定目标SIP服务器,将所述第一SIP消息转发给所述目标SIP服务器;接收来自于所述目标SIP服务器的第二SIP消息,解析所述第二SIP消息以确定所述目标终端,将所述第二SIP消息转发给所述目标终端。
- 根据权利要求1所述的方法,其中,解析所述第一SIP消息以确定目标SIP服务器,包括:解析所述第一SIP消息以确定所述第一SIP消息的类型,根据所述第一SIP消息的类型为所述目标终端分配所述目标SIP服务器。
- 根据权利要求2所述的方法,其中,根据所述第一SIP消息的类型为所述目标终端分配所述目标SIP服务器,包括:在所述第一SIP消息的类型为注册类消息、且为新的SIP注册请求消息的情况下,为所述目标终端分配所述目标SIP服务器;在所述第一SIP消息的类型为注册类消息、且不为新的SIP注册请求消息的情况下,获得所述第一SIP消息的第一目标字段的内容,基于所述第一目标字段的内容确定所述目标SIP服务器;在所述第一SIP消息的类型为所述目标终端发起的SIP呼叫类消息、且为新的SIP呼叫接入请求消息的情况下,为所述目标终端分配所述目标SIP服务器;在所述第一SIP消息的类型为所述目标终端发起的SIP呼叫类消息、且不为新的SIP呼叫接入请求消息的情况下,获得所述第一SIP消息的第二目标字段的内容,基于所述第二目标字段的内容确定所述目标SIP服务器;在所述第一SIP消息的类型为呼叫所述目标终端的呼叫类消息的情况下,获得所述第一SIP消息的第二目标字段的内容,基于所述第二目标字段的内容确定所述目标SIP服务器。
- 根据权利要求1所述的方法,其中,解析所述第二SIP消息以确定所述目标终端,包括:解析所述第二SIP消息并确定所述第二SIP消息属于指定类型消息的情况下,获得所述第二SIP消息的第三目标字段的内容,基于所述第三目标字段的内容确定所述目标终端,其中,所述指定类型消息包括以下之一:注册类消息;所述目标终端发起的呼叫类消息;呼叫所述目标终端的呼叫类消息。
- 根据权利要求3所述的方法,其中,为所述目标终端分配所述目标SIP服务器,包括:解析并获得所述第一SIP消息中包括的目标终端的唯一标识,通过负载均衡算法基于所述目标终端的唯一标识从SIP服务器集合中选择所述目标SIP服务器。
- 根据权利要求5所述的方法,还包括:在监测到建立通信连接的任一SIP服务器故障的情况下,将故障SIP服务器从所述SIP服务器集合中去除;在监测到任一故障SIP服务器的故障解除的情况下,将所述SIP服务器增加至所述SIP服务器集合。
- 根据权利要求1所述的方法,还包括:在所述目标SIP服务器发生故障的情况下,重新确定新的目标SIP服务器,将新获取到所述目标终端的SIP会话的第三SIP消息发送给所述新的目标SIP服务器;通过所述新的目标SIP服务器查询缓存的所述目标终端的SIP会话的历史信息,并根据所述历史信息返回对所述第三SIP消息的响应。
- 根据权利要求7所述的方法,还包括:在所述目标SIP服务器恢复的情况下,将新获取到的所述目标终端的SIP会话的第四SIP消息发送给所述目标SIP服务器;通过所述目标SIP服务器查询缓存的所述目标终端的SIP会话的历史信息,并根据所述历史信息返回对所述第四SIP消息的响应。
- 根据权利要求1所述的方法,还包括:在所述第一中介服务器发生故障的情况下,触发主备切换机制,通过所述主备切换机制将所述第一中介服务器的虚拟网络地址传递给第二中介服务器,以将所述第二中介服务器切换为主服务器、将所述第一中介服务器切换为备用服务器;在所述第一中介服务器恢复的情况下,触发所述主备切换机制,通过所述主备切换机制获取所述第二中介服务器的虚拟网络地址进行配置,以将所述第一中介服务器切换为主服务器、将所述第二中介服务器切换为备用服务器。
- 一种通信方法,应用于SIP服务器,所述方法包括:接收通过第一中介服务器转发的来自于目标终端的第一SIP消息;向所述第一中介服务器发送针对所述目标终端的第二SIP消息,以通过所述第一中介服务器将所述第二SIP消息转发至所述目标终端。
- 根据权利要求10所述的方法,其中,在向所述第一中介服务器发送针对所述目标终端的第二SIP消息之前,所述方法还包括以下步骤中的至少之一:在所述第二SIP消息的第一目标字段中写入所述SIP服务器的地址;在所述第二SIP消息的第二目标字段写入所述SIP服务器的地址;在所述第二SIP消息的第三目标字段写入所述目标终端的地址。
- 根据权利要求10所述的方法,还包括:从缓存数据库中查询获得所述目标终端的SIP会话的历史信息;根据所述历史信息响应所述第一SIP消息。
- 一种通信系统,包括:目标终端,用于向第一中介服务器发送第一SIP消息;目标SIP服务器,用于向所述第一中介服务器发送第二SIP消息;所述第一中介服务器,用于:接收来自于所述目标终端的所述第一SIP消息,解析所述第一SIP消息以确定所述目标SIP服务器,将所述第一SIP消息转发给所述目标SIP服务器;以及接收来自于所述目标SIP服务器的所述第二SIP消息,解析所述第二SIP消息以确定所述目标终端,将所述第二SIP消息转发给所述目标终端;第二中介服务器,用于作为所述第一中介服务器的备用服务器。
- 一种电子设备,包括:至少一个处理器;存储器,其上存储有至少一个程序,当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现根据权利要求1-12中任意一项所述的通信方法。
- 一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现根据权利要求1-12中任意一项所述的通信方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311710599.3A CN120151330A (zh) | 2023-12-13 | 2023-12-13 | 通信方法、系统、设备及可读介质 |
| CN202311710599.3 | 2023-12-13 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025124129A1 true WO2025124129A1 (zh) | 2025-06-19 |
Family
ID=95951482
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/134510 Pending WO2025124129A1 (zh) | 2023-12-13 | 2024-11-26 | 通信方法、系统、设备及可读介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120151330A (zh) |
| WO (1) | WO2025124129A1 (zh) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090013078A1 (en) * | 2007-07-03 | 2009-01-08 | 4Dk Technologies, Inc. | Optimized Signaling Protocol, Including Session Initiation Protocol (SIP), in a Communications Environment |
| US20130151586A1 (en) * | 2011-12-12 | 2013-06-13 | Fujitsu Limited | Message distribution server, sip server, and message distribution method |
| US20220030060A1 (en) * | 2020-07-24 | 2022-01-27 | Vmware, Inc. | Policy-based forwarding to a load balancer of a load balancing cluster |
-
2023
- 2023-12-13 CN CN202311710599.3A patent/CN120151330A/zh active Pending
-
2024
- 2024-11-26 WO PCT/CN2024/134510 patent/WO2025124129A1/zh active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090013078A1 (en) * | 2007-07-03 | 2009-01-08 | 4Dk Technologies, Inc. | Optimized Signaling Protocol, Including Session Initiation Protocol (SIP), in a Communications Environment |
| US20130151586A1 (en) * | 2011-12-12 | 2013-06-13 | Fujitsu Limited | Message distribution server, sip server, and message distribution method |
| US20220030060A1 (en) * | 2020-07-24 | 2022-01-27 | Vmware, Inc. | Policy-based forwarding to a load balancer of a load balancing cluster |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120151330A (zh) | 2025-06-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8775628B2 (en) | Load balancing for SIP services | |
| US8374079B2 (en) | Proxy server, communication system, communication method and program | |
| CN101834877B (zh) | 基于分布式sip构架的动态负载均衡的方法及系统 | |
| US9319431B2 (en) | Methods, systems, and computer readable media for providing sedation service in a telecommunications network | |
| US9723048B2 (en) | System and method for providing timer affinity through notifications within a session-based server deployment | |
| US20230007456A1 (en) | Methods, systems, and computer readable media for resource cleanup in communications networks | |
| WO2018076972A1 (zh) | 一种故障切换方法、装置及系统 | |
| EP2795849B1 (en) | Method and apparatus for messaging in the cloud | |
| US7882226B2 (en) | System and method for scalable and redundant COPS message routing in an IP multimedia subsystem | |
| US20150006741A1 (en) | Reconstruction of states on controller failover | |
| CN118660023B (zh) | 设备调度接入方法、系统、可读存储介质和程序产品 | |
| WO2021213243A1 (zh) | 关联业务注册方法及相关设备、以及计算机可读存储介质 | |
| US20070115806A1 (en) | Methods, systems, and computer program products for session initiation protocol (SIP) fast switchover | |
| US8189764B2 (en) | Server for transferring a communication message | |
| CN112671554A (zh) | 一种节点故障处理方法及相关装置 | |
| CN109120556B (zh) | 一种云主机访问对象存储服务器的方法及系统 | |
| EP2887620B1 (en) | Session Initiation Protocol Messaging | |
| CN110233886A (zh) | 一种面向海量微服务的高可用服务治理系统及实现方法 | |
| WO2025124129A1 (zh) | 通信方法、系统、设备及可读介质 | |
| US10972514B2 (en) | Reestablishment of session initiation protocol (SIP) dialogs | |
| CN102821118B (zh) | 一种具备异构节点的网络中业务备份的方法和系统 | |
| WO2012109953A1 (zh) | 一种sip会话保护的方法和系统 | |
| CN119520588B (zh) | 信令处理方法、装置、系统、计算机设备和可读存储介质 | |
| CN114448931B (zh) | 一种基于mlag组网环境的域名解析方法、设备及介质 | |
| US20150180910A1 (en) | Communication network with low latency call signaling functionality |
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: 24902551 Country of ref document: EP Kind code of ref document: A1 |