[go: up one dir, main page]

CN113992500B - Main and standby server switching method and device suitable for VoIP terminal - Google Patents

Main and standby server switching method and device suitable for VoIP terminal Download PDF

Info

Publication number
CN113992500B
CN113992500B CN202111302628.3A CN202111302628A CN113992500B CN 113992500 B CN113992500 B CN 113992500B CN 202111302628 A CN202111302628 A CN 202111302628A CN 113992500 B CN113992500 B CN 113992500B
Authority
CN
China
Prior art keywords
voip service
server
voip
message
signaling data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111302628.3A
Other languages
Chinese (zh)
Other versions
CN113992500A (en
Inventor
翁海明
蔡墩雄
赖志豪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yealink Network Technology Co Ltd
Original Assignee
Xiamen Yealink Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yealink Network Technology Co Ltd filed Critical Xiamen Yealink Network Technology Co Ltd
Priority to CN202111302628.3A priority Critical patent/CN113992500B/en
Publication of CN113992500A publication Critical patent/CN113992500A/en
Application granted granted Critical
Publication of CN113992500B publication Critical patent/CN113992500B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M7/00Arrangements for interconnection between switching centres
    • H04M7/006Networks other than PSTN/ISDN providing telephone service, e.g. Voice over Internet Protocol (VoIP), including next generation networks with a packet-switched transport layer

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method and a device for switching a master server and a slave server suitable for a VoIP terminal. The method comprises the following steps: sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server; if the first TCP connection response message is not the ICMP message or the RST message, establishing TCP connection with the main server; if the first TCP connection response message is an ICMP message or an RST message, the retransmission of the first SYN data packet is stopped, and a second TCP connection establishment request and the second SYN data packet are sent to the standby server after a first preset time, so that TCP connection is established with the standby server. The invention can make the VoIP terminal switch the active server and the standby server when the VoIP terminal receives ICMP message or RST message in TCP connection, thereby guaranteeing the communication stability of the VoIP terminal.

Description

Main and standby server switching method and device suitable for VoIP terminal
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a method and an apparatus for switching between active and standby servers applicable to VoIP terminals.
Background
Voice over IP (Voice over Internet Protocol, abbreviated as VoIP) is a voice call technology that enables voice calls and multimedia conferences via Internet Protocol (IP), i.e., communications via the internet. The VoIP technology can be used for various internet access devices including VoIP phones, smartphones, personal computers, and the VoIP terminals interact data with servers of various VoIP service providers through cellular networks and WiFi to register, subscribe, talk, send short messages and other various VoIP services.
In order to realize reliable data transmission, a VoIP terminal usually establishes a TCP connection with a server and then executes various VoIP services, but there is no active/standby server switching mechanism for the case that the VoIP terminal receives ICMP/RST messages in and after the TCP connection. When the VoIP terminal receives ICMP/RST information in and after TCP connection, the VoIP service cannot be normally executed, and at the moment, the VoIP terminal cannot switch the active server and the standby server, so that the communication stability of the VoIP terminal is difficult to guarantee.
Disclosure of Invention
The invention provides a method and a device for switching a main server and a standby server, which are suitable for a VoIP terminal, and can ensure the communication stability of the VoIP terminal by switching the main server and the standby server when the VoIP terminal receives ICMP information or RST information in TCP connection.
In order to solve the above technical problem, in a first aspect, an embodiment of the present invention provides a method for switching a primary server and a backup server, which is applicable to a VoIP terminal, including:
Sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server;
if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server;
If the first TCP connection response message is an ICMP message or an RST message, retransmitting the first SYN data packet is stopped, and a second TCP connection establishment request and a second SYN data packet are sent to a standby server after a first preset time so as to establish TCP connection with the standby server.
Further, after the TCP connection is established with the primary server, the method further includes:
sending VoIP service signaling data to the main server, and receiving a VoIP service response message returned by the main server;
If the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data;
If the VoIP service response message is an ICMP message or an RST message, sending the VoIP service signaling data to the standby server after a second preset time to execute the VoIP service; or alternatively
If the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or a preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met;
And if the VoIP service response message is a RST message, sending the VoIP service signaling data to the standby server after the second preset time so as to execute the VoIP service.
Further, the preset switching condition is that the retransmission times reach the maximum retransmission times or the total retransmission time reaches the maximum transaction processing time.
Further, after the TCP connection is established with the primary server, the method further includes:
And when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, performing registration renewal detection on the main server after a third preset time, and when the registration renewal detection fails, sending the second TCP connection establishment request and the second SYN data packet to the standby server so as to switch to the standby server for registration.
Further, before the first TCP connection establishment request and the first SYN packet are sent to the primary server, and the first TCP connection response message returned by the primary server is received, the method further includes:
and resolving a plurality of servers according to the domain name, selecting one of all the servers as the main server, and taking the rest servers as the standby servers.
In a second aspect, an embodiment of the present invention provides a primary server and backup server switching device applicable to a VoIP terminal, including a processor;
The processor is configured to:
Sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server;
if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server;
If the first TCP connection response message is an ICMP message or an RST message, retransmitting the first SYN data packet is stopped, and a second TCP connection establishment request and a second SYN data packet are sent to a standby server after a first preset time so as to establish TCP connection with the standby server.
Further, after the TCP connection is established with the primary server, the method further includes:
sending VoIP service signaling data to the main server, and receiving a VoIP service response message returned by the main server;
If the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data;
If the VoIP service response message is an ICMP message or an RST message, sending the VoIP service signaling data to the standby server after a second preset time to execute the VoIP service; or alternatively
If the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or a preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met;
And if the VoIP service response message is a RST message, sending the VoIP service signaling data to the standby server after the second preset time so as to execute the VoIP service.
Further, the preset switching condition is that the retransmission times reach the maximum retransmission times or the total retransmission time reaches the maximum transaction processing time.
Further, after the TCP connection is established with the primary server, the method further includes:
And when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, performing registration renewal detection on the main server after a third preset time, and when the registration renewal detection fails, sending the second TCP connection establishment request and the second SYN data packet to the standby server so as to switch to the standby server for registration.
Further, before the first TCP connection establishment request and the first SYN packet are sent to the primary server, and the first TCP connection response message returned by the primary server is received, the method further includes:
and resolving a plurality of servers according to the domain name, selecting one of all the servers as the main server, and taking the rest servers as the standby servers.
The embodiment of the invention has the following beneficial effects:
And sending a first TCP connection establishment request and a first SYN data packet to the main server, receiving a first TCP connection response message returned by the main server, if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server, if the first TCP connection response message is the ICMP message or the RST message, stopping retransmitting the first SYN data packet, and sending a second TCP connection establishment request and a second SYN data packet to the standby server after a first preset time so as to establish TCP connection with the standby server, thereby realizing the switching of the main server and the standby server. Compared with the prior art, in the embodiment of the invention, whether the main server returns the ICMP message or the RST message is judged in the process of establishing the TCP connection with the main server, and the standby server is switched to establish the TCP connection when the main server returns the ICMP message or the RST message is judged, wherein the main-standby switching mode can be selected according to the error type of the ICMP message or the RST message, namely, the first preset time is set, the main-standby switching is carried out according to the selected main-standby switching mode, and the main-standby server switching can be carried out when the VoIP terminal receives the ICMP message or the RST message in the TCP connection, so that the communication stability of the VoIP terminal is ensured.
Further, in the embodiment of the invention, whether the main server returns ICMP information or RST information is judged in the process of carrying out VoIP service signaling data interaction after the TCP connection is successfully established with the main server, and the main server is switched to the standby server to initiate VoIP service again when the main server is judged to return the ICMP information or RST information, wherein the main-standby switching mode can be selected according to the error type of the ICMP information or RST information, namely, the VoIP service signaling data is directly retransmitted or the VoIP service signaling data is sent only when the preset switching condition is met, and the main-standby server is switched according to the selected main-standby switching mode, so that the VoIP terminal can carry out the main-standby server switching when the ICMP information or RST information is received after the TCP connection, thereby ensuring the communication stability of the VoIP terminal.
Further, in the embodiment of the invention, whether the main server returns the RST message is judged in the process of successfully establishing the TCP connection with the main server but not carrying out VoIP service signaling data interaction, and when the main server is judged to return the RST message, the main server is switched to the standby server to establish the TCP connection, so that the VoIP terminal can switch the main server and the standby server when receiving the ICMP message or the RST message after the TCP connection, thereby ensuring the communication stability of the VoIP terminal.
Drawings
Fig. 1 is a flow chart of a method for switching between active and standby servers for a VoIP terminal according to a first embodiment of the present invention;
fig. 2 is a data flow diagram illustrating a primary-standby server switching method suitable for a VoIP terminal according to a first embodiment of the present invention;
Fig. 3 is a data flow diagram of a method for switching active and standby servers for a VoIP terminal according to a preferred embodiment of the present invention;
Fig. 4 is a data flow diagram of a primary-standby server switching method suitable for a VoIP terminal according to another preferred embodiment of the first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a primary-standby server switching device suitable for a VoIP terminal according to a second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made more apparent and fully hereinafter with reference to the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, the step numbers herein are only for convenience of explanation of the specific embodiments, and are not used as limiting the order of execution of the steps. The method provided in this embodiment may be performed by a relevant terminal device, and the following description will take a VoIP terminal as an execution body.
As shown in fig. 1, a first embodiment provides a method for switching between active and standby servers, which is applicable to a VoIP terminal, and includes steps S1 to S3:
s1, a first TCP connection establishment request and a first SYN data packet are sent to a main server, and a first TCP connection response message returned by the main server is received;
S2, if the first TCP connection response message is not the ICMP message or the RST message, establishing TCP connection with the main server;
And S3, if the first TCP connection response message is an ICMP message or an RST message, stopping retransmitting the first SYN data packet, and sending a second TCP connection establishment request and the second SYN data packet to the standby server after the first preset time so as to establish TCP connection with the standby server.
It should be noted that, the transmission type of the data in the primary and standby server switching method is limited to TCP or TLS.
As shown in fig. 2, for example, to ensure reliable transmission of data, a VoIP terminal establishes a TCP connection with a server before initiating registration, subscription, conversation, or other VoIP service. The VoIP terminal analyzes a plurality of servers of IP1, IP2 and IP3 from the registered domain names through the domain name server, selects the server IP1 which is analyzed first from the servers as a main server according to the analysis sequence IP 1- & gt IP 2- & gt IP3 of the servers, and takes the rest servers IP2 and IP3 as standby servers. The VoIP terminal sends a first TCP connection establishment request and a first SYN data packet to the main server IP1, and receives a first TCP connection response message returned by the main server IP 1.
If the first TCP connection response message returned by the main server IP1 is not the ICMP message or the RST message, the network connection condition is considered to be normal, and the VoIP terminal establishes TCP connection with the main server IP 1.
If the first TCP connection response message returned by the main server IP1 is an ICMP message or an RST message, and the network connection condition is considered to be abnormal, for example, the main server IP1 is down, a status code (ICMP message or RST message) is reported in the VoIP terminal, the retransmission of the first SYN data packet to the main server IP1 is stopped, and after a first preset time, a second TCP connection establishment request and a second SYN data packet are sent to the standby server IP2 which is analyzed first, so as to establish a TCP connection with the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is not the ICMP message or the RST message, the network connection condition is considered to be normal, and the VoIP terminal establishes TCP connection with the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is an ICMP message or an RST message, it is considered that the network connection condition is abnormal, for example, a fault such as downtime of the standby server IP2 occurs, the VoIP terminal internally reports a status code (ICMP message or RST message), stops retransmitting the second SYN packet to the standby server IP2, and sends a third TCP connection establishment request and a third SYN packet to the remaining standby server IP3 which is analyzed first after the first preset time, so as to establish TCP connection with the standby server IP 3.
Wherein the first preset time is a different time value set according to different error types of the ICMP message or the RST message. When the message is set to 0s, the VoIP terminal immediately switches to the standby server IP2 to establish a TCP connection when receiving an ICMP message or RST message returned by the main server IP1 in the TCP connection.
It can be understood that the error types of the ICMP message include 7 types, that is, the icmp-net-unreachable、icmp-host-unreachable、icmp-port-unreachable rst、icmp-proto-unreachable、icmp-net-prohibited、icmp-host-prohibited、icmp-admin-prohibited.VoIP terminal can select to immediately perform the active-standby switching or wait for the TCP connection to timeout to perform the active-standby switching according to the different error types of the ICMP message in the process of establishing the TCP connection with the active server.
In the embodiment, whether the main server returns the ICMP message or the RST message is judged in the process of establishing the TCP connection with the main server, and when the main server is judged to return the ICMP message or the RST message, the main server is switched to the standby server to establish the TCP connection, wherein a main-standby switching mode can be selected according to the error type of the ICMP message or the RST message, namely, a first preset time is set, the main-standby switching is carried out according to the selected main-standby switching mode, and the VoIP terminal can be enabled to switch the main-standby server when the ICMP message or the RST message is received in the TCP connection, so that the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the first preset time is set to configure various active-standby server switching modes, so that the VoIP terminal can perform active-standby switching in various forms, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, after said establishing a TCP connection with the primary server, further comprising: sending VoIP service signaling data to a main server, and receiving a VoIP service response message returned by the main server; if the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data; if the VoIP service response message is an ICMP message or an RST message, sending VoIP service signaling data to the standby server after a second preset time to execute VoIP service; or if the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or the preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met; if the VoIP service response message is RST message, sending VoIP service signaling data to the standby server after the second preset time to execute VoIP service.
In a preferred implementation of this embodiment, the preset switching condition is that the number of retransmissions reaches a maximum number of retransmissions or that the total time consumed for retransmissions reaches a maximum transaction time.
As shown in fig. 3, illustratively, after the VoIP terminal successfully establishes a TCP connection with the primary server IP1, the VoIP terminal may send VoIP traffic signaling data to the primary server IP1 to initiate registration, subscription, talk or other VoIP traffic, such as sending a registration request to the primary server IP1 to successfully register on the primary server IP 1. The VoIP terminal sends VoIP service signaling data to the main server IP1, and receives a VoIP service response message returned by the main server IP 1.
If the VoIP service response message returned by the main server IP1 is not an ICMP message or an RST message, the network connection condition is considered to be normal, and the main server IP1 can normally respond to the VoIP service signaling data, then executing the VoIP service corresponding to the VoIP service signaling data.
If the VoIP service response message returned by the main server IP1 is an ICMP message or an RST message, it is considered that the network connection status is abnormal, for example, the main server IP1 is down, and the main server IP1 cannot normally respond to the VoIP service signaling data, the state code (ICMP message or RST message) is reported in the VoIP terminal, and after a second preset time, the VoIP service signaling data is sent to the standby server IP2 that is analyzed first, so as to execute the VoIP service.
If the VoIP service response message returned by the standby server IP2 is not ICMP message or RST message, the network connection condition is considered to be normal, the standby server IP2 can normally respond to the VoIP service signaling data, and then the VoIP service is executed.
If the VoIP service response message returned by the standby server IP2 is an ICMP message or an RST message, the network connection condition is considered to be abnormal, for example, the standby server IP2 is down, the state code (ICMP message or RST message) is reported in the VoIP terminal, and after the second preset time, voIP service signaling data is sent to the remaining standby server IP3 which is analyzed first, so as to execute VoIP service.
Wherein the second preset time is a different time value set according to a different error type of the ICMP message or the RST message. When set to 0s, the VoIP terminal immediately switches to the standby server IP2 to perform VoIP service upon receiving ICMP message or RST message returned from the main server IP1 after TCP connection.
Or if the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits the VoIP service signaling data until the VoIP service is executed or the preset switching condition is met, and when the preset switching condition is met, the VoIP service signaling data is sent to the standby server IP2 which is analyzed first so as to execute the VoIP service; if the VoIP service response message is RST message, the VoIP terminal sends VoIP service signaling data to the standby server IP2 which is analyzed first after the second preset time to execute VoIP service.
It can be understood that the error types of the ICMP message include 7 types, and the icmp-net-unreachable、icmp-host-unreachable、icmp-port-unreachable rst、icmp-proto-unreachable、icmp-net-prohibited、icmp-host-prohibited、icmp-admin-prohibited.VoIP terminal can select to immediately perform the active-standby switching or wait for the number of times of retransmission of the VoIP service signaling data to meet the preset switching condition according to the different error types of the ICMP message in the process of performing VoIP service signaling data interaction after the TCP connection is successfully established with the active server.
For example, the preset switching condition is set such that the number of retransmissions reaches the maximum number of retransmissions, which is 2. When the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits VoIP service signaling data for the first time; if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is the ICMP message, executing the second retransmission of the VoIP service signaling data by the VoIP terminal; if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the second time is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the second time is still the ICMP message, the VoIP terminal sends the VoIP service signaling data to the standby server IP2 which is analyzed first, so as to execute the VoIP service.
For example, the preset switching condition is set to the maximum transaction time for which the total retransmission time is up to 32s, and the retransmission interval time is set, for example, the second retransmission waiting time is set to 0.5s, the third retransmission waiting time is set to 1s, and the subsequent waiting retransmission time is fixed to 2s. When the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits VoIP service signaling data for the first time; if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is the ICMP message, executing the second retransmission of the VoIP service signaling data after the VoIP terminal waits for 0.5 s; if the VoIP service response message returned by the main server IP1 after the second retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server IP1 after the second retransmission of the VoIP service signaling data is the ICMP message, executing the third retransmission of the VoIP service signaling data after the VoIP terminal waits for 1 s; if the VoIP service response message returned by the main server IP1 after the third retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the third retransmission of the VoIP service signaling data is the ICMP message, executing the fourth retransmission of the VoIP service signaling data after the VoIP terminal waits for 2 seconds; if the VoIP service response message returned by the main server IP1 after the fourth retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the fourth retransmission of the VoIP service signaling data is the ICMP message, executing the fifth retransmission of the VoIP service signaling data after the VoIP terminal waits for 2 seconds; and pushing the above steps until the total time for retransmission reaches the maximum transaction processing time, the VoIP terminal sends VoIP service signaling data to the standby server IP2 which is analyzed first so as to execute VoIP service.
In the embodiment, in the process of carrying out VoIP service signaling data interaction after the TCP connection is successfully established with the main server, whether the main server returns ICMP information or RST information is judged, and when the main server returns ICMP information or RST information is judged, the main server is switched to the standby server to initiate VoIP service again, wherein a main-standby switching mode can be selected according to the error type of the ICMP information or RST information, namely VoIP service signaling data can be directly retransmitted or sent only when preset switching conditions are met, the main server is switched according to the selected main-standby switching mode, and the VoIP terminal can be switched to the main server and the standby server when the ICMP information or RST information is received after the TCP connection, so that the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the multiple active-standby server switching modes are configured by setting the second preset time and the preset switching conditions, so that the VoIP terminal can perform active-standby switching in multiple modes, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, after said establishing a TCP connection with the primary server, further comprising: when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, the registration renewal detection is performed on the main server after a third preset time, and when the registration renewal detection fails, a second TCP connection establishment request and a second SYN data packet are sent to the standby server so as to be switched to the standby server for registration.
As shown in fig. 4, illustratively, after the VoIP terminal successfully establishes a TCP connection with the primary server IP1, when the VoIP terminal receives a RST message returned from the primary server IP1 without VoIP service signaling data interaction with the primary server IP1, the network connection state is considered to be abnormal, and if the TCP connection is wrong, the VoIP terminal performs registration renewal detection on the primary server IP1 after a third preset time, and when the registration renewal detection fails, sends a second TCP connection establishment request and a second SYN packet to the standby server IP2 that is analyzed first, so as to switch to registration on the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is not an ICMP message or an RST message, and the network connection condition is considered to be normal, the VoIP terminal establishes a TCP connection with the standby server IP2, and the VoIP terminal can initiate a registration service to the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is an ICMP message or an RST message, and the network connection condition is considered to be abnormal, for example, a fault such as downtime of the standby server IP2 occurs, the VoIP terminal stops retransmitting the second SYN data packet to the standby server IP2, and sends a third TCP connection establishment request and the third SYN data packet to the remaining standby server IP3 which is analyzed first, so as to establish TCP connection with the standby server IP3, so that the VoIP terminal can initiate a registration service to the standby server IP 3.
Wherein the third preset time may be set to different time values according to different error types of the RST message. When the set value is 0s, the VoIP terminal immediately performs registration renewal detection on the main server IP1 when receiving the RST message returned by the main server IP1 under the condition of no VoIP service signaling data interaction with the main server IP 1.
In the embodiment, whether the main server returns the RST message is judged in the process of successfully establishing the TCP connection with the main server but not carrying out VoIP service signaling data interaction, and when the main server returns the RST message, the main server is switched to the standby server to establish the TCP connection, so that the VoIP terminal can switch the main server and the standby server when receiving the ICMP message or the RST message after the TCP connection, and the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the third preset time is set to configure various active-standby server switching modes, so that the VoIP terminal can perform active-standby switching in various forms, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, before the sending the first TCP connection establishment request and the first SYN packet to the primary server and receiving the first TCP connection response message returned by the primary server, the method further includes: and resolving a plurality of servers according to the domain name, selecting one from all servers as a main server, and taking the rest servers as standby servers.
As an example, the VoIP terminal parses a plurality of servers IP1, IP2, IP3 from the registered domain name through the domain name server, and selects the server IP1 parsed first from these servers as the main server and the remaining servers IP2, IP3 as the standby servers according to the parsing order IP1→ip2→ip3 of these servers.
As shown in fig. 5, a second embodiment provides a primary-backup server switching device applicable to a VoIP terminal, including a processor; a processor for: sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server; if the first TCP connection response message is not the ICMP message or the RST message, establishing TCP connection with the main server; if the first TCP connection response message is an ICMP message or an RST message, the retransmission of the first SYN data packet is stopped, and a second TCP connection establishment request and the second SYN data packet are sent to the standby server after a first preset time, so that TCP connection is established with the standby server.
Illustratively, to ensure reliable transmission of data, the VoIP terminal establishes a TCP connection with the server prior to initiating registration, subscription, conversation or other VoIP service. A processor is configured in a VoIP terminal, a plurality of servers of IP1, IP2 and IP3 are resolved from registered domain names by the VoIP terminal through a domain name server, the first resolved server IP1 is selected from the servers as a main server according to resolving sequences of the servers of IP1, IP2 and IP3, and the rest servers of IP2 and IP3 are all used as standby servers. The VoIP terminal sends a first TCP connection establishment request and a first SYN data packet to the main server IP1, and receives a first TCP connection response message returned by the main server IP 1.
If the first TCP connection response message returned by the main server IP1 is not the ICMP message or the RST message, the network connection condition is considered to be normal, and the VoIP terminal establishes TCP connection with the main server IP 1.
If the first TCP connection response message returned by the main server IP1 is an ICMP message or an RST message, and the network connection condition is considered to be abnormal, for example, the main server IP1 is down, a status code (ICMP message or RST message) is reported in the VoIP terminal, the retransmission of the first SYN data packet to the main server IP1 is stopped, and after a first preset time, a second TCP connection establishment request and a second SYN data packet are sent to the standby server IP2 which is analyzed first, so as to establish a TCP connection with the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is not the ICMP message or the RST message, the network connection condition is considered to be normal, and the VoIP terminal establishes TCP connection with the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is an ICMP message or an RST message, it is considered that the network connection condition is abnormal, for example, a fault such as downtime of the standby server IP2 occurs, the VoIP terminal internally reports a status code (ICMP message or RST message), stops retransmitting the second SYN packet to the standby server IP2, and sends a third TCP connection establishment request and a third SYN packet to the remaining standby server IP3 which is analyzed first after the first preset time, so as to establish TCP connection with the standby server IP 3.
Wherein the first preset time is a different time value set according to different error types of the ICMP message or the RST message. When the message is set to 0s, the VoIP terminal immediately switches to the standby server IP2 to establish a TCP connection when receiving an ICMP message or RST message returned by the main server IP1 in the TCP connection.
It can be understood that the error types of the ICMP message include 7 types, that is, the icmp-net-unreachable、icmp-host-unreachable、icmp-port-unreachable rst、icmp-proto-unreachable、icmp-net-prohibited、icmp-host-prohibited、icmp-admin-prohibited.VoIP terminal can select to immediately perform the active-standby switching or wait for the TCP connection to timeout to perform the active-standby switching according to the different error types of the ICMP message in the process of establishing the TCP connection with the active server.
In the embodiment, whether the main server returns the ICMP message or the RST message is judged in the process of establishing the TCP connection with the main server, and when the main server is judged to return the ICMP message or the RST message, the main server is switched to the standby server to establish the TCP connection, wherein a main-standby switching mode can be selected according to the error type of the ICMP message or the RST message, namely, a first preset time is set, the main-standby switching is carried out according to the selected main-standby switching mode, and the VoIP terminal can be enabled to switch the main-standby server when the ICMP message or the RST message is received in the TCP connection, so that the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the first preset time is set to configure various active-standby server switching modes, so that the VoIP terminal can perform active-standby switching in various forms, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, after said establishing a TCP connection with the primary server, further comprising: sending VoIP service signaling data to a main server, and receiving a VoIP service response message returned by the main server; if the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data; if the VoIP service response message is an ICMP message or an RST message, sending VoIP service signaling data to the standby server after a second preset time to execute VoIP service; or if the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or the preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met; if the VoIP service response message is RST message, sending VoIP service signaling data to the standby server after the second preset time to execute VoIP service.
In a preferred implementation of this embodiment, the preset switching condition is that the number of retransmissions reaches a maximum number of retransmissions or that the total time consumed for retransmissions reaches a maximum transaction time.
Illustratively, after the VoIP terminal successfully establishes a TCP connection with the primary server IP1, the VoIP terminal may send VoIP traffic signaling data to the primary server IP1 to initiate registration, subscription, talk or other VoIP traffic, such as sending a registration request to the primary server IP1 to successfully register on the primary server IP 1. The VoIP terminal sends VoIP service signaling data to the main server IP1, and receives a VoIP service response message returned by the main server IP 1.
If the VoIP service response message returned by the main server IP1 is not an ICMP message or an RST message, the network connection condition is considered to be normal, and the main server IP1 can normally respond to the VoIP service signaling data, then executing the VoIP service corresponding to the VoIP service signaling data.
If the VoIP service response message returned by the main server IP1 is an ICMP message or an RST message, it is considered that the network connection status is abnormal, for example, the main server IP1 is down, and the main server IP1 cannot normally respond to the VoIP service signaling data, the state code (ICMP message or RST message) is reported in the VoIP terminal, and after a second preset time, the VoIP service signaling data is sent to the standby server IP2 that is analyzed first, so as to execute the VoIP service.
If the VoIP service response message returned by the standby server IP2 is not ICMP message or RST message, the network connection condition is considered to be normal, the standby server IP2 can normally respond to the VoIP service signaling data, and then the VoIP service is executed.
If the VoIP service response message returned by the standby server IP2 is an ICMP message or an RST message, the network connection condition is considered to be abnormal, for example, the standby server IP2 is down, the state code (ICMP message or RST message) is reported in the VoIP terminal, and after the second preset time, voIP service signaling data is sent to the remaining standby server IP3 which is analyzed first, so as to execute VoIP service.
Wherein the second preset time is a different time value set according to a different error type of the ICMP message or the RST message. When set to 0s, the VoIP terminal immediately switches to the standby server IP2 to perform VoIP service upon receiving ICMP message or RST message returned from the main server IP1 after TCP connection.
Or if the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits the VoIP service signaling data until the VoIP service is executed or the preset switching condition is met, and when the preset switching condition is met, the VoIP service signaling data is sent to the standby server IP2 which is analyzed first so as to execute the VoIP service; if the VoIP service response message is RST message, the VoIP terminal sends VoIP service signaling data to the standby server IP2 which is analyzed first after the second preset time to execute VoIP service.
It can be understood that the error types of the ICMP message include 7 types, and the icmp-net-unreachable、icmp-host-unreachable、icmp-port-unreachable rst、icmp-proto-unreachable、icmp-net-prohibited、icmp-host-prohibited、icmp-admin-prohibited.VoIP terminal can select to immediately perform the active-standby switching or wait for the number of times of retransmission of the VoIP service signaling data to meet the preset switching condition according to the different error types of the ICMP message in the process of performing VoIP service signaling data interaction after the TCP connection is successfully established with the active server.
For example, the preset switching condition is set such that the number of retransmissions reaches the maximum number of retransmissions, which is 2. When the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits VoIP service signaling data for the first time; if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is the ICMP message, executing the second retransmission of the VoIP service signaling data by the VoIP terminal; if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the second time is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the second time is still the ICMP message, the VoIP terminal sends the VoIP service signaling data to the standby server IP2 which is analyzed first, so as to execute the VoIP service.
For example, the preset switching condition is set to the maximum transaction time for which the total retransmission time is up to 32s, and the retransmission interval time is set, for example, the second retransmission waiting time is set to 0.5s, the third retransmission waiting time is set to 1s, and the subsequent waiting retransmission time is fixed to 2s. When the VoIP service response message returned by the main server IP1 is an ICMP message, the VoIP terminal retransmits VoIP service signaling data for the first time; if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the first retransmission of the VoIP service signaling data is the ICMP message, executing the second retransmission of the VoIP service signaling data after the VoIP terminal waits for 0.5 s; if the VoIP service response message returned by the main server IP1 after the second retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server IP1 after the second retransmission of the VoIP service signaling data is the ICMP message, executing the third retransmission of the VoIP service signaling data after the VoIP terminal waits for 1 s; if the VoIP service response message returned by the main server IP1 after the third retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the third retransmission of the VoIP service signaling data is the ICMP message, executing the fourth retransmission of the VoIP service signaling data after the VoIP terminal waits for 2 seconds; if the VoIP service response message returned by the main server IP1 after the fourth retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server IP1 after the fourth retransmission of the VoIP service signaling data is the ICMP message, executing the fifth retransmission of the VoIP service signaling data after the VoIP terminal waits for 2 seconds; and pushing the above steps until the total time for retransmission reaches the maximum transaction processing time, the VoIP terminal sends VoIP service signaling data to the standby server IP2 which is analyzed first so as to execute VoIP service.
In the embodiment, in the process of carrying out VoIP service signaling data interaction after the TCP connection is successfully established with the main server, whether the main server returns ICMP information or RST information is judged, and when the main server returns ICMP information or RST information is judged, the main server is switched to the standby server to initiate VoIP service again, wherein a main-standby switching mode can be selected according to the error type of the ICMP information or RST information, namely VoIP service signaling data can be directly retransmitted or sent only when preset switching conditions are met, the main server is switched according to the selected main-standby switching mode, and the VoIP terminal can be switched to the main server and the standby server when the ICMP information or RST information is received after the TCP connection, so that the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the multiple active-standby server switching modes are configured by setting the second preset time and the preset switching conditions, so that the VoIP terminal can perform active-standby switching in multiple modes, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, after said establishing a TCP connection with the primary server, further comprising: when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, the registration renewal detection is performed on the main server after a third preset time, and when the registration renewal detection fails, a second TCP connection establishment request and a second SYN data packet are sent to the standby server so as to be switched to the standby server for registration.
As an example, after the VoIP terminal successfully establishes a TCP connection with the main server IP1, when the VoIP terminal receives a RST message returned by the main server IP1 without VoIP service signaling data interaction with the main server IP1, the network connection state is considered to be abnormal, and the TCP connection is wrong, the VoIP terminal performs registration continuation detection on the main server IP1 after a third preset time, and when the registration continuation detection fails, sends a second TCP connection establishment request and a second SYN packet to the standby server IP2 which is analyzed first, so as to switch to the standby server IP2 for registration.
If the second TCP connection response message returned by the standby server IP2 is not an ICMP message or an RST message, and the network connection condition is considered to be normal, the VoIP terminal establishes a TCP connection with the standby server IP2, and the VoIP terminal can initiate a registration service to the standby server IP 2.
If the second TCP connection response message returned by the standby server IP2 is an ICMP message or an RST message, and the network connection condition is considered to be abnormal, for example, a fault such as downtime of the standby server IP2 occurs, the VoIP terminal stops retransmitting the second SYN data packet to the standby server IP2, and sends a third TCP connection establishment request and the third SYN data packet to the remaining standby server IP3 which is analyzed first, so as to establish TCP connection with the standby server IP3, so that the VoIP terminal can initiate a registration service to the standby server IP 3.
Wherein the third preset time may be set to different time values according to different error types of the RST message. When the set value is 0s, the VoIP terminal immediately performs registration renewal detection on the main server IP1 when receiving the RST message returned by the main server IP1 under the condition of no VoIP service signaling data interaction with the main server IP 1.
In the embodiment, whether the main server returns the RST message is judged in the process of successfully establishing the TCP connection with the main server but not carrying out VoIP service signaling data interaction, and when the main server returns the RST message, the main server is switched to the standby server to establish the TCP connection, so that the VoIP terminal can switch the main server and the standby server when receiving the ICMP message or the RST message after the TCP connection, and the communication stability of the VoIP terminal is ensured.
According to the method, the device and the system, the third preset time is set to configure various active-standby server switching modes, so that the VoIP terminal can perform active-standby switching in various forms, and the communication stability of the VoIP terminal is further guaranteed.
In a preferred embodiment, before the sending the first TCP connection establishment request and the first SYN packet to the primary server and receiving the first TCP connection response message returned by the primary server, the method further includes: and resolving a plurality of servers according to the domain name, selecting one from all servers as a main server, and taking the rest servers as standby servers.
As an example, the VoIP terminal parses a plurality of servers IP1, IP2, IP3 from the registered domain name through the domain name server, and selects the server IP1 parsed first from these servers as the main server and the remaining servers IP2, IP3 as the standby servers according to the parsing order IP1→ip2→ip3 of these servers.
In summary, the embodiment of the invention has the following beneficial effects:
and sending a first TCP connection establishment request and a first SYN data packet to the main server, receiving a first TCP connection response message returned by the main server, if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server, if the first TCP connection response message is the ICMP message or the RST message, stopping retransmitting the first SYN data packet, and sending a second TCP connection establishment request and a second SYN data packet to the standby server after a first preset time so as to establish TCP connection with the standby server, thereby realizing the switching of the main server and the standby server. In the embodiment of the invention, whether the main server returns ICMP information or RST information is judged in the process of establishing TCP connection with the main server, and when the main server is judged to return the ICMP information or RST information, the main server is switched to the standby server to establish TCP connection, so that the VoIP terminal can switch the main server and the standby server when the ICMP information or RST information is received in the TCP connection, and the communication stability of the VoIP terminal is ensured.
Further, in the embodiment of the invention, whether the main server returns ICMP information or RST information is judged in the process of carrying out VoIP service signaling data interaction after the TCP connection is successfully established with the main server, and when the main server is judged to return the ICMP information or RST information, the main server is switched to the standby server to reinitiate the VoIP service, so that the VoIP terminal can carry out the switching of the main server and the standby server when the ICMP information or RST information is received after the TCP connection, thereby guaranteeing the communication stability of the VoIP terminal.
Further, in the embodiment of the invention, whether the main server returns the RST message is judged in the process of successfully establishing the TCP connection with the main server but not carrying out VoIP service signaling data interaction, and when the main server is judged to return the RST message, the main server is switched to the standby server to establish the TCP connection, so that the VoIP terminal can switch the main server and the standby server when receiving the ICMP message or the RST message after the TCP connection, thereby ensuring the communication stability of the VoIP terminal.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiments may be accomplished by way of computer programs, which may be stored on a computer readable storage medium, which when executed may comprise the steps of the above-described embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.

Claims (10)

1. A method for switching a master server and a slave server suitable for a VoIP terminal is characterized by comprising the following steps:
Sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server;
if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server;
If the first TCP connection response message is an ICMP message or an RST message, stopping retransmitting the first SYN data packet, and sending a second TCP connection establishment request and a second SYN data packet to a standby server after a first preset time so as to establish TCP connection with the standby server;
wherein after the TCP connection is established with the primary server, the method comprises:
When the VoIP service response message returned by the main server is an ICMP message, retransmitting VoIP service signaling data for the first time;
If the VoIP service response message returned by the main server after retransmitting the VoIP service signaling data for the first time is not the ICMP message, executing VoIP service, if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the first time is the ICMP message, retransmitting the VoIP service signaling data for the second time after waiting for 0.5 s;
If the VoIP service response message returned by the main server after the second retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server after the second retransmission of the VoIP service signaling data is the ICMP message, executing the third retransmission of the VoIP service signaling data after the VoIP terminal waits for 1 s;
If the VoIP service response message returned by the main server after the third retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server after the third retransmission of the VoIP service signaling data is the ICMP message, waiting for 2 seconds and then retransmitting the VoIP service signaling data for the fourth time;
If the VoIP service response message returned by the main server after the fourth retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server after the fourth retransmission of the VoIP service signaling data is the ICMP message, waiting for 2 seconds, and then repeating the VoIP service signaling data for the fifth retransmission; and pushing the above steps until the total time consumption of retransmission reaches the maximum transaction processing time, and the VoIP terminal sends VoIP service signaling data to the standby server which is analyzed first so as to execute VoIP service.
2. The active-standby server switching method for VoIP terminals as set forth in claim 1, further comprising, after said establishing a TCP connection with said active server:
sending VoIP service signaling data to the main server, and receiving a VoIP service response message returned by the main server;
If the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data;
If the VoIP service response message is an ICMP message or an RST message, sending the VoIP service signaling data to the standby server after a second preset time to execute the VoIP service; or alternatively
If the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or a preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met;
And if the VoIP service response message is a RST message, sending the VoIP service signaling data to the standby server after the second preset time so as to execute the VoIP service.
3. The method for switching between active and standby servers for VoIP terminals as claimed in claim 2, wherein the preset switching condition is that the number of retransmissions reaches a maximum number of retransmissions or the total time consumed for retransmissions reaches a maximum transaction time.
4. A primary-backup server switching method suitable for a VoIP terminal according to claim 1 or 2, further comprising, after said establishing a TCP connection with said primary server:
And when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, performing registration renewal detection on the main server after a third preset time, and when the registration renewal detection fails, sending the second TCP connection establishment request and the second SYN data packet to the standby server so as to switch to the standby server for registration.
5. The method for switching between active and standby servers for VoIP terminals as claimed in claim 1, further comprising, before said sending a first TCP connection establishment request and a first SYN packet to the active server and receiving a first TCP connection reply message returned by the active server:
and resolving a plurality of servers according to the domain name, selecting one of all the servers as the main server, and taking the rest servers as the standby servers.
6. A master-slave server switching device suitable for VoIP terminal is characterized by comprising a processor;
The processor is configured to:
Sending a first TCP connection establishment request and a first SYN data packet to a main server, and receiving a first TCP connection response message returned by the main server;
if the first TCP connection response message is not an ICMP message or a RST message, establishing TCP connection with the main server;
If the first TCP connection response message is an ICMP message or an RST message, stopping retransmitting the first SYN data packet, and sending a second TCP connection establishment request and a second SYN data packet to a standby server after a first preset time so as to establish TCP connection with the standby server;
wherein after the TCP connection is established with the primary server, the method comprises:
When the VoIP service response message returned by the main server is an ICMP message, retransmitting VoIP service signaling data for the first time;
If the VoIP service response message returned by the main server after retransmitting the VoIP service signaling data for the first time is not the ICMP message, executing VoIP service, if the VoIP service response message returned by the main server IP1 after retransmitting the VoIP service signaling data for the first time is the ICMP message, retransmitting the VoIP service signaling data for the second time after waiting for 0.5 s;
If the VoIP service response message returned by the main server after the second retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, and if the VoIP service response message returned by the main server after the second retransmission of the VoIP service signaling data is the ICMP message, executing the third retransmission of the VoIP service signaling data after the VoIP terminal waits for 1 s;
If the VoIP service response message returned by the main server after the third retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server after the third retransmission of the VoIP service signaling data is the ICMP message, waiting for 2 seconds and then retransmitting the VoIP service signaling data for the fourth time;
If the VoIP service response message returned by the main server after the fourth retransmission of the VoIP service signaling data is not the ICMP message, executing the VoIP service, if the VoIP service response message returned by the main server after the fourth retransmission of the VoIP service signaling data is the ICMP message, waiting for 2 seconds, and then repeating the VoIP service signaling data for the fifth retransmission; and pushing the above steps until the total time consumption of retransmission reaches the maximum transaction processing time, and the VoIP terminal sends VoIP service signaling data to the standby server which is analyzed first so as to execute VoIP service.
7. The active-standby server switching apparatus for VoIP terminals as set forth in claim 6, further comprising, after said establishing a TCP connection with said primary server:
sending VoIP service signaling data to the main server, and receiving a VoIP service response message returned by the main server;
If the VoIP service response message is not the ICMP message or the RST message, executing the VoIP service corresponding to the VoIP service signaling data;
If the VoIP service response message is an ICMP message or an RST message, sending the VoIP service signaling data to the standby server after a second preset time to execute the VoIP service; or alternatively
If the service response message is an ICMP message, retransmitting the VoIP service signaling data until the VoIP service is executed or a preset switching condition is met, and sending the VoIP service signaling data to the standby server to execute the VoIP service when the preset switching condition is met;
And if the VoIP service response message is a RST message, sending the VoIP service signaling data to the standby server after the second preset time so as to execute the VoIP service.
8. The active-standby server switching apparatus for VoIP terminals as set forth in claim 7, wherein the preset switching condition is that the number of retransmissions reaches a maximum number of retransmissions or that the total time taken for retransmissions reaches a maximum transaction time.
9. A primary-backup server switching apparatus adapted for VoIP terminals as claimed in claim 6 or 7, further comprising, after said establishing a TCP connection with said primary server:
And when the VoIP service signaling data interaction is not performed with the main server, if the RST message returned by the main server is received, performing registration renewal detection on the main server after a third preset time, and when the registration renewal detection fails, sending the second TCP connection establishment request and the second SYN data packet to the standby server so as to switch to the standby server for registration.
10. The active-standby server switching apparatus for VoIP terminals of claim 6, further comprising, prior to said sending a first TCP connection establishment request and a first SYN packet to a primary server and receiving a first TCP connection reply message returned by the primary server:
and resolving a plurality of servers according to the domain name, selecting one of all the servers as the main server, and taking the rest servers as the standby servers.
CN202111302628.3A 2021-11-04 2021-11-04 Main and standby server switching method and device suitable for VoIP terminal Active CN113992500B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111302628.3A CN113992500B (en) 2021-11-04 2021-11-04 Main and standby server switching method and device suitable for VoIP terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111302628.3A CN113992500B (en) 2021-11-04 2021-11-04 Main and standby server switching method and device suitable for VoIP terminal

Publications (2)

Publication Number Publication Date
CN113992500A CN113992500A (en) 2022-01-28
CN113992500B true CN113992500B (en) 2024-07-23

Family

ID=79746539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111302628.3A Active CN113992500B (en) 2021-11-04 2021-11-04 Main and standby server switching method and device suitable for VoIP terminal

Country Status (1)

Country Link
CN (1) CN113992500B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532452A (en) * 2020-11-30 2021-03-19 厦门亿联网络技术股份有限公司 Switching method, device and equipment of communication terminal main and standby servers and storage medium
CN112866338A (en) * 2020-12-31 2021-05-28 杭州迪普科技股份有限公司 Server state detection method and device
CN113595765A (en) * 2021-07-02 2021-11-02 厦门亿联网络技术股份有限公司 Method and device for fault transfer of VoIP terminal registration service

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100596049C (en) * 2006-03-30 2010-03-24 阿里巴巴集团控股有限公司 Message repeating method and system
JP2007312227A (en) * 2006-05-19 2007-11-29 Canon Inc Information processing system and its control method, and program executing the control method
JP2009164948A (en) * 2008-01-08 2009-07-23 Nec Corp Communication system, server, terminal, packet transfer method, and program
EP2493139A1 (en) * 2011-02-22 2012-08-29 Voipfuture GmbH VoIP quality measurement enhancements using the internet control message protocol
US8806043B1 (en) * 2011-06-24 2014-08-12 Juniper Networks, Inc. Server selection during retransmit of a request
CN103220161B (en) * 2012-01-18 2016-02-24 深圳市腾讯计算机系统有限公司 A kind of detection method of server state and device
CN111200505B (en) * 2018-11-19 2022-05-13 中移(苏州)软件技术有限公司 Message processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112532452A (en) * 2020-11-30 2021-03-19 厦门亿联网络技术股份有限公司 Switching method, device and equipment of communication terminal main and standby servers and storage medium
CN112866338A (en) * 2020-12-31 2021-05-28 杭州迪普科技股份有限公司 Server state detection method and device
CN113595765A (en) * 2021-07-02 2021-11-02 厦门亿联网络技术股份有限公司 Method and device for fault transfer of VoIP terminal registration service

Also Published As

Publication number Publication date
CN113992500A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US8706892B2 (en) Communication system and server
US8374079B2 (en) Proxy server, communication system, communication method and program
US8364827B2 (en) Communication system
US20080013447A1 (en) Method and Apparatus for Survivable Failover in Communication System
JP2008104112A (en) Transmission path setting device, transmission path setting method, and transmission path setting program
CN101997850B (en) Call management method and device for IP (Internet Protocol) multimedia subsystem
CN1290350C (en) Method of registering mobile IP (MIP) for mobile node (MN), system and group data service node
CN101137104B (en) Method and system for implementing resource release
CN103891255B (en) Method for sip agent failover
CN101459533B (en) System and method for improved application server disaster tolerance in next generation network
CN103618747B (en) A kind of method and system realizing SIP information service
CN106549901B (en) Service triggering method and device
CN113595765A (en) Method and device for fault transfer of VoIP terminal registration service
CN110943987A (en) Communication method, access gateway and system based on session initiation protocol SIP
US8792344B2 (en) Method and system for managing signalling in a telecommunication network
CN113992500B (en) Main and standby server switching method and device suitable for VoIP terminal
WO2009010747A1 (en) Call processing system and method
CN113746865B (en) Fault transfer method and device for VoIP terminal communication service
CN110602339B (en) Fault detection method, system and storage medium based on voice gateway
CN110784943B (en) Processing method and device for VoWiFi voice service disconnection and reconnection
CN102487341B (en) Talk detection method, device and session initial protocol server
US7907514B2 (en) MGCP fallback mechanism enhancement
US8117311B2 (en) Communication method, server and medium on notification of session status
CN114244813B (en) Call abnormity processing method and device and electronic equipment
JP2008005076A (en) Network system, network terminal, and network equipment switching method used therefor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant