A signaling message processing method, apparatus, device, and medium
By detecting and calculating the address identifier in the SIP signaling message, the signaling message is forwarded to the target server, which solves the complexity and high cost problems caused by relying on databases and distributed caches in the prior art, and realizes high-reliability signaling message processing.
Patent Information
- Application Number
- CN202211109215.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-09-13
AI Technical Summary
When maintaining the long connection state of users, the existing technology needs to rely on middleware such as databases and distributed caches, resulting in complex design, frequent interactions, high latency, high cost, high development difficulty, and low system reliability.
By obtaining the SIP signaling message sent by the client, it detects whether the address identification of the target server is carried. If not, the address identification is calculated and a reply message is sent to the client, so that the client adds the address identification to the signaling message, and finally forwards the signaling message to the target server for processing based on the address identification.
Without relying on middleware such as database and distributed cache, all signaling messages sent by the client are forwarded to the same server for processing, reducing costs and improving system reliability.
Smart Images

Figure CN115484237B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instant voice communication, and particularly relates to a signaling message processing method, device, equipment and medium. Background Art
[0002] With the popularization of mobile terminals, there are more and more mobile Internet users. In order to adapt to the usage scenarios of network switching during call establishment and in - call, it is necessary to correctly process all signaling messages of the same call. VoIP (Voice over Internet Protocol, that is, voice transmission based on IP) is a voice call technology via the Internet. VoIP network phones process voice signals through digital processing, compression encoding, encryption and packaging, transmission through the network, then decryption and decoding, and restore the digital signals into sound so that the other party of the call can hear. SIP (Session Initialization Protocol, that is, Session Initial Protocol) is one of the core protocols of VoIP and is widely used in controlling multimedia communication sessions, such as voice and video calls on the IP network. SIP is used to create, modify, and terminate sessions composed of one or more media streams, and can be used for two - party or multi - party sessions. In the signaling transmission stage, the TLS protocol (Transport Layer Security, that is, Secure Transport Protocol) is used for protection, that is, the SIP protocol works on the long - connection channel established by the TLS protocol.
[0003] When maintaining the long - connection state of users in the prior art, one approach is state sharing: persist to the database, and members access the shared database. However, the design is relatively complex, the number of interactions is large, the latency is high, the cost is high in the actual implementation process, the development difficulty is great, and the reliability of the system is not high; another approach is to use a long - connection server with a fixed IP or domain name to ensure that the long - connection of the user is connected to the same server each time. Therefore, more IP or domain name resources are required, and the client also needs to be modified, which is relatively complex.
[0004] In summary, how to forward all signaling messages sent by the client to the same server for processing without relying on middleware such as databases and distributed caches to reduce costs and improve the reliability of the system is a problem to be solved at present. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a signaling message processing method, device, equipment and medium, which can forward all signaling messages sent by the client to the same server for processing without relying on middleware such as databases and distributed caches, so as to reduce costs and improve the reliability of the system. The specific solutions are as follows:
[0006] In a first aspect, the present application discloses a signaling message processing method, including:
[0007] Obtain a SIP signaling message sent by a client, and detect whether an address identifier for characterizing a target server is carried in the SIP signaling message;
[0008] If not, calculate the address identifier based on the SIP signaling message, and send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message;
[0009] Obtain the SIP signaling message carrying the address identifier, extract the address identifier from the SIP signaling message, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0010] Optionally, after detecting whether an address identifier for characterizing a target server is carried in the SIP signaling message, it further includes:
[0011] If so, forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0012] Optionally, the obtaining a SIP signaling message sent by a client and detecting whether an address identifier for characterizing a target server is carried in the SIP signaling message includes:
[0013] Obtain a calling SIP signaling message sent by a calling client and a called SIP signaling message sent by a called client;
[0014] Detect whether an address identifier for characterizing a target server is carried in the calling SIP signaling message and the called SIP signaling message;
[0015] Correspondingly, if not, calculating the address identifier based on the SIP signaling message includes:
[0016] If neither the calling SIP signaling message nor the called SIP signaling message carries the address identifier of the target server, calculate the address identifier based on the SIP signaling message.
[0017] Optionally, the calculating the address identifier based on the SIP signaling message includes:
[0018] Obtain the calling client identifier and the called client identifier in the SIP signaling message, and calculate the address identifier based on the calling user identifier and the called user identifier by using a hash algorithm.
[0019] Optionally, sending the response message including the address identifier to the client includes:
[0020] Obtain the To header in the calling SIP signaling message, add the address identifier to the tag parameter of the To header to obtain a first response message, and then send the first response message to the calling client;
[0021] Obtain the From header in the called SIP signaling message, add the address identifier to the tag parameter of the From header to obtain a second response message, and then send the second response message to the called client.
[0022] Optionally, extracting the address identifier from the SIP signaling message includes:
[0023] Detect the tag parameter in the SIP signaling message, and extract the address identifier from the tag parameter.
[0024] Optionally, after calculating the address identifier based on the SIP signaling message, it further includes:
[0025] Detect whether the target server corresponding to the address identifier is in a down state or an overloaded state;
[0026] If so, screen out the servers in the server cluster that are not in the down state and the overloaded state as the new target server.
[0027] In a second aspect, the present application discloses a signaling message processing device, including:
[0028] An identifier detection module, configured to obtain a SIP signaling message sent by a client, and detect whether the SIP signaling message carries an address identifier for characterizing a target server;
[0029] An identifier calculation module, configured to, if not, calculate the address identifier based on the SIP signaling message, and send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message;
[0030] A message forwarding module, configured to obtain the SIP signaling message carrying the address identifier, extract the address identifier from the SIP signaling message, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0031] In a third aspect, the present application discloses an electronic device, including:
[0032] A memory for storing a computer program;
[0033] A processor for executing the computer program to implement the steps of the signaling message processing method disclosed above.
[0034] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the signaling message processing method disclosed above are implemented.
[0035] It can be seen that the present application obtains the SIP signaling message sent by the client and detects whether the SIP signaling message carries an address identifier for characterizing the target server; if not, the address identifier is calculated based on the SIP signaling message, and an acknowledgment message including the address identifier is sent to the client so that the client adds the address identifier to the SIP signaling message; the SIP signaling message carrying the address identifier is obtained, the address identifier is extracted from the SIP signaling message, and then the SIP signaling message is forwarded to the target server according to the address identifier so that the target server processes the SIP signaling message. Thus, it can be seen that when the present application obtains the SIP signaling message sent by the client, it detects whether the SIP signaling message carries an address identifier for characterizing the target server. If not, the corresponding address identifier is calculated and added to the SIP signaling message so that when the SIP signaling message is obtained subsequently, the address identifier carried in the SIP signaling message is extracted, and the SIP signaling message is forwarded to the target server based on this address identifier. In this way, all signaling messages sent by the client can be forwarded to the same server for processing without relying on middleware such as databases and distributed caches, thereby reducing costs and improving the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0037] Figure 1 It is a schematic diagram of the system framework applicable to the signaling message processing method disclosed in the present application;
[0038] Figure 2 It is a flowchart of a signaling message processing method disclosed in the present application;
[0039] Figure 3A flowchart of a specific signaling message processing method disclosed in this application;
[0040] Figure 4 A flowchart of a specific signaling message processing method disclosed in this application;
[0041] Figure 5 A schematic diagram of replying an answer message to the calling client disclosed in this application;
[0042] Figure 6 A schematic diagram of the structure of a signaling message processing device disclosed in this application;
[0043] Figure 7 A structural diagram of an electronic device disclosed in this application. Detailed implementation manners
[0044] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0045] When maintaining the long connection state of users in the prior art, one approach is state sharing: persisting to a database and members accessing the shared database. However, the design is relatively complex, with a large number of interactions and high latency. In the actual implementation process, the cost is relatively high, the development difficulty is large, and the reliability of the system is not high. Another approach is to use a long connection server with a fixed IP or domain name to ensure that the long connection of the user is connected to the same server each time. Therefore, a large number of IP or domain name resources need to be used, and the client also needs to be modified, which is relatively complex. For this reason, the embodiments of the present application disclose a signaling message processing method, device, equipment, and medium, which can forward all signaling messages sent by the client to the same server for processing without relying on middleware such as databases and distributed caches, so as to reduce costs and improve the reliability of the system.
[0046] The system framework adopted in this application can be specifically referred to Figure 1As shown in the figure, it may specifically include: a VoIP client 01, an external network access firewall 02, an LVS load balancer 03, and a VoIP server 04. Among them, the VoIP client 01 includes a calling client and a called client. The LVS load balancer 03 can support VoIP. The VoIP server 04 is used to execute the steps of obtaining the SIP signaling message sent by the client, and detecting whether the address identifier for representing the target server is carried in the SIP signaling message; if not, calculating the address identifier based on the SIP signaling message, and sending a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message; obtaining the SIP signaling message carrying the address identifier, extracting the address identifier from the SIP signaling message, and then forwarding the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0047] See Figure 2 As shown in the figure, an embodiment of the present application discloses a signaling message processing method, and the method includes:
[0048] Step S11: Obtain the SIP signaling message sent by the client, and detect whether the address identifier for representing the target server is carried in the SIP signaling message.
[0049] In this embodiment, the current VoIP server in the server cluster obtains the SIP signaling message sent by the client, and detects whether the address identifier for representing the target server is carried in the SIP signaling message. The above client is specifically a VoIP user client.
[0050] Step S12: If not, calculate the address identifier based on the SIP signaling message, and send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message;
[0051] In this embodiment, if the address identifier for representing the target server is not carried in the SIP signaling message, calculate the address identifier of the target server based on the SIP signaling message, and reply or send a response message including the address identifier to the client, so that the client receives the response message and adds the address identifier to the subsequent SIP signaling message.
[0052] In another specific embodiment, after detecting whether the address identifier for characterizing the target server is carried in the SIP signaling message, the following steps are further included: If so, forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message. That is, if the address identifier for characterizing the target server is carried in the SIP signaling message, directly forward the SIP signaling message to the target server, so that the target server processes the SIP signaling message.
[0053] It should be noted that after calculating the address identifier based on the SIP signaling message, the following steps are further included: Detect whether the target server corresponding to the address identifier is in a down state or an overloaded state; If so, screen out the servers in the server cluster that are not in the down state and the overloaded state as the new target server. It can be understood that after calculating the address identifier, it is necessary to detect whether the target server corresponding to the address identifier is in a down state or an overloaded state, that is, it is necessary to ensure that the target server can work and run normally. If the target server is in a down state or an overloaded state, it means that the target server cannot work and run normally. Then, it is necessary to screen out the servers in the server cluster that are not in the down state and the overloaded state as the new target server. When selecting a new target server, it can be randomly selected or screened according to certain rules. For example, it can be screened in sequence according to the server numbers, etc.
[0054] Step S13: Obtain the SIP signaling message carrying the address identifier, extract the address identifier from the SIP signaling message, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0055] In this embodiment, when the address identifier is carried in the SIP signaling message, the address identifier is extracted, and the SIP signaling message is forwarded to the target server corresponding to the address identifier, so that the target server processes the SIP signaling message. It can be understood that in a specific embodiment, if the current VoIP server is the target server corresponding to the address identifier, then there is no need to forward it anymore.
[0056] It can be seen that this application obtains the SIP signaling message sent by the client and detects whether the address identifier for characterizing the target server is carried in the SIP signaling message; if not, the address identifier is calculated based on the SIP signaling message, and an acknowledgment message including the address identifier is sent to the client so that the client adds the address identifier to the SIP signaling message; the SIP signaling message carrying the address identifier is obtained, the address identifier is extracted from the SIP signaling message, and then the SIP signaling message is forwarded to the target server according to the address identifier so that the target server processes the SIP signaling message. Thus, it can be seen that after this application obtains the SIP signaling message sent by the client, it detects whether the address identifier for characterizing the target server is carried in the SIP signaling message. If not, the corresponding address identifier is calculated and added to the SIP signaling message so that when the SIP signaling message is obtained later, the address identifier carried in the SIP signaling message is extracted, and the SIP signaling message is forwarded to the target server based on this address identifier. In this way, without relying on middleware such as databases and distributed caches, all signaling messages sent by the client can be forwarded to the same server for processing, reducing costs and improving the reliability of the system.
[0057] See Figure 3 and Figure 4 As shown, an embodiment of this application discloses a specific signaling message processing method. Compared with the previous embodiment, this embodiment further describes and optimizes the technical solution. Specifically, it includes:
[0058] Step S21: Obtain the calling SIP signaling message sent by the calling client and the called SIP signaling message sent by the called client.
[0059] In this embodiment, it is necessary to obtain the calling SIP signaling message sent by the calling client and the called SIP signaling message sent by the called client. It should be noted that the user client initiating the VoIP call is the calling client, and the user client receiving the VoIP call is the called client, that is, the one making the call is the calling party, and the one answering the call is the called party.
[0060] Step S22: Detect whether the address identifier for characterizing the target server is carried in the calling SIP signaling message and the called SIP signaling message.
[0061] In this embodiment, it is respectively detected whether the address identifier for characterizing the target server is carried in the calling SIP signaling message and the called SIP signaling message. Specifically, it is to detect whether the address identifier of the target server is included in the To-tag parameter of the calling SIP signaling message and whether the address identifier of the target server is included in the From-tag parameter of the called SIP signaling message.
[0062] Step S23: If the address identifier of the target server is not carried in both the calling SIP signaling message and the called SIP signaling message, calculate the address identifier based on the SIP signaling message.
[0063] In this embodiment, if the address identifier of the target server is not carried in both the calling SIP signaling message and the called SIP signaling message, calculate the address identifier based on the SIP signaling message. Correspondingly, if the address identifier of the target server is carried in either the calling SIP signaling message or the called SIP signaling message, forward the SIP signaling message to the target server according to the address identifier.
[0064] The calculating the address identifier based on the SIP signaling message includes: obtaining the calling client identifier and the called client identifier in the SIP signaling message, and calculating the address identifier based on the calling user identifier and the called user identifier by using the hash algorithm. It can be understood that in this embodiment, the address identifier is calculated by using the hash algorithm. Specifically, obtain the calling client identifier and the called client identifier in the SIP signaling message. This identifier can specifically be the user ID. Then select the smaller ID value among the user IDs corresponding to the calling client and the called client, and perform processing by using the hash algorithm to obtain the index value. Use the server corresponding to the index value as the target server, and obtain the address identifier of this target server, which can specifically be the IP address.
[0065] Step S24: Send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message.
[0066] In this embodiment, the sending a response message including the address identifier to the client specifically may include: obtaining the To header in the calling SIP signaling message, and adding the address identifier to the tag parameter of the To header to obtain the first response information, and then sending the first response information to the calling client; obtaining the From header in the called SIP signaling message, and adding the address identifier to the tag parameter of the From header to obtain the second response information, and then sending the second response information to the called client. It can be understood that it is necessary to encode the address identifier into the tag parameter of the To header in the calling SIP signaling message and the tag parameter of the From header in the called SIP signaling message. And the SIP protocol stipulates that the client must carry the tag parameter in the message. Therefore, the server checks the tag parameter in the message header and can forward the message to the target server. Figure 5 It is a schematic diagram of a response message replied to the calling client disclosed in this application.Figure 5 The italic part is to add the address identifier of the target server to the tag parameter in the To header of the calling SIP signaling message.
[0067] Step S25: Obtain the SIP signaling message carrying the address identifier, detect the tag parameter in the SIP signaling message, extract the address identifier from the tag parameter, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0068] In this embodiment, since the SIP signaling message carries a tag parameter and the address identifier has been added to the tag parameter, by detecting the tag parameter in the SIP signaling message and extracting the address identifier from the tag parameter, the SIP signaling message can be forwarded to the target server according to the address identifier.
[0069] It can be seen that the embodiment of the present application can encode the address of the target server into the corresponding tag parameter in the SIP signaling message on the premise of meeting the standards and ensuring compatibility. Then when processing subsequent SIP signaling messages, by extracting the corresponding address identifier from the tag parameter of the SIP signaling message, the SIP signaling message can be forwarded to the target server. In this way, all signaling messages sent by the client can be forwarded to the same server for processing without relying on middleware such as databases and distributed caches, reducing costs, improving the reliability of the system, having low latency, and good performance.
[0070] See Figure 6 As shown, the embodiment of the present application discloses a signaling message processing device, which includes:
[0071] An identifier detection module 11, configured to obtain a SIP signaling message sent by a client and detect whether the SIP signaling message carries an address identifier for characterizing a target server;
[0072] An identifier calculation module 12, configured to, if not, calculate the address identifier based on the SIP signaling message and send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message;
[0073] A message forwarding module 13, configured to obtain the SIP signaling message carrying the address identifier, extract the address identifier from the SIP signaling message, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
[0074] It can be seen that this application obtains the SIP signaling message sent by the client and detects whether the address identifier for characterizing the target server is carried in the SIP signaling message; if not, the address identifier is calculated based on the SIP signaling message, and an acknowledgment message including the address identifier is sent to the client so that the client adds the address identifier to the SIP signaling message; the SIP signaling message carrying the address identifier is obtained, the address identifier is extracted from the SIP signaling message, and then the SIP signaling message is forwarded to the target server according to the address identifier so that the target server processes the SIP signaling message. Thus, it can be seen that after this application obtains the SIP signaling message sent by the client, it detects whether the address identifier for characterizing the target server is carried in the SIP signaling message. If not, the corresponding address identifier is calculated and added to the SIP signaling message so that when the SIP signaling message is obtained subsequently, the address identifier carried in the SIP signaling message is extracted, and the SIP signaling message is forwarded to the target server based on the address identifier. In this way, without relying on middleware such as databases and distributed caches, all signaling messages sent by the client can be forwarded to the same server for processing, thereby reducing costs and improving the reliability of the system.
[0075] Figure 7 FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the signaling message processing method executed by the electronic device disclosed in any of the foregoing embodiments.
[0076] In this embodiment, the power supply 23 is used to provide operating voltages for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and specific limitations are not imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to specific application requirements, and no specific limitations are made here.
[0077] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0078] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage method may be temporary storage or permanent storage.
[0079] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It may be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the signaling message processing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.
[0080] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the method steps executed in the signaling message processing process disclosed in any of the foregoing embodiments are implemented.
[0081] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.
[0082] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this document can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0083] The steps of the methods or algorithms described in combination with the embodiments disclosed in this document can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium well-known in the technical field.
[0084] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the said element.
[0085] The above has introduced in detail a signaling message processing method, apparatus, device, and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present invention.
Claims
1. A signaling message processing method, characterized in that, applied to a VoIP server, includes: obtaining a SIP signaling message sent by a client, and detecting whether an address identifier for characterizing a target server is carried in the SIP signaling message; if not, calculating the address identifier based on the SIP signaling message, and sending a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message; obtaining the SIP signaling message carrying the address identifier, extracting the address identifier from the SIP signaling message, and then forwarding the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message; wherein, the obtaining a SIP signaling message sent by a client, and detecting whether an address identifier for characterizing a target server is carried in the SIP signaling message includes: obtaining a calling SIP signaling message sent by a calling client and a called SIP signaling message sent by a called client; detecting whether an address identifier for characterizing a target server is carried in the calling SIP signaling message and the called SIP signaling message; correspondingly, if not, calculating the address identifier based on the SIP signaling message includes: if the address identifier of the target server is not carried in both the calling SIP signaling message and the called SIP signaling message, calculating the address identifier based on the SIP signaling message; the calculating the address identifier based on the SIP signaling message includes: obtaining a calling client identifier and a called client identifier in the SIP signaling message, and selecting a smaller identifier value from the calling client identifier and the called client identifier; performing processing using a hash algorithm to obtain an index value, using the server corresponding to the index value as the target server, and obtaining the address identifier of the target server.
2. The signaling message processing method according to claim 1, characterized in that, after detecting whether an address identifier for characterizing a target server is carried in the SIP signaling message, further includes: if so, forwarding the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message.
3. The signaling message processing method according to claim 1, characterized in that, the sending a response message including the address identifier to the client includes: obtaining a To header in the calling SIP signaling message, adding the address identifier to a tag parameter of the To header to obtain a first response message, and then sending the first response message to the calling client; obtaining a From header in the called SIP signaling message, adding the address identifier to a tag parameter of the From header to obtain a second response message, and then sending the second response message to the called client.
4. The signaling message processing method according to claim 1, characterized in that, Extracting the address identifier from the SIP signaling message includes: Detecting the tag parameter in the SIP signaling message and extracting the address identifier from the tag parameter.
5. The signaling message processing method according to any one of claims 1 to 4, characterized in that after calculating the address identifier based on the SIP signaling message, it further includes: Detecting whether the target server corresponding to the address identifier is in a down state or an overloaded state; If so, screening out the servers in the server cluster that are not in the down state and the overloaded state as the new target server.
6. A signaling message processing device, characterized in that applied to a VoIP server, including: An identifier detection module, configured to obtain a SIP signaling message sent by a client and detect whether the SIP signaling message carries an address identifier for characterizing a target server; An identifier calculation module, configured to, if not, calculate the address identifier based on the SIP signaling message and send a response message including the address identifier to the client, so that the client adds the address identifier to the SIP signaling message; A message forwarding module, configured to obtain the SIP signaling message carrying the address identifier, extract the address identifier from the SIP signaling message, and then forward the SIP signaling message to the target server according to the address identifier, so that the target server processes the SIP signaling message; wherein, the identifier detection module is specifically configured to obtain a calling SIP signaling message sent by a calling client and a called SIP signaling message sent by a called client; detect whether the calling SIP signaling message and the called SIP signaling message carry an address identifier for characterizing a target server; Correspondingly, the identifier calculation module is specifically configured to calculate the address identifier based on the SIP signaling message if neither the calling SIP signaling message nor the called SIP signaling message carries the address identifier of the target server; The identifier calculation module is specifically configured to obtain the calling client identifier and the called client identifier in the SIP signaling message, and select the smaller identifier value of the calling client identifier and the called client identifier; perform processing using a hash algorithm to obtain an index value, use the server corresponding to the index value as the target server, and obtain the address identifier of the target server.
7. An electronic device, characterized in that including: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the signaling message processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that used to store a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the signaling message processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
SIP service clustering system and implementation method
CN110913010A