CN106936784A - SIP registration method, terminal and system - Google Patents
SIP registration method, terminal and system Download PDFInfo
- Publication number
- CN106936784A CN106936784A CN201511022259.7A CN201511022259A CN106936784A CN 106936784 A CN106936784 A CN 106936784A CN 201511022259 A CN201511022259 A CN 201511022259A CN 106936784 A CN106936784 A CN 106936784A
- Authority
- CN
- China
- Prior art keywords
- terminal
- sip server
- state
- communication state
- time length
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 claims abstract description 135
- 238000001514 detection method Methods 0.000 claims description 44
- 230000004044 response Effects 0.000 claims description 30
- 230000002159 abnormal effect Effects 0.000 claims description 23
- 239000000523 sample Substances 0.000 claims description 9
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 12
- 230000003993 interaction Effects 0.000 description 7
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/1066—Session management
- H04L65/1073—Registration or de-registration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/1066—Session management
- H04L65/1101—Session protocols
- H04L65/1104—Session initiation protocol [SIP]
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
Abstract
The embodiment of the present invention provides a kind of SIP registration method, terminal and system.The method includes:Terminal obtains the communications status between terminal and sip server;Whether terminal judges communications status are normal condition;Terminal generates random duration when it is determined that communications status are normal condition;Terminal sends login request message after random duration is experienced to sip server.It is used to realize during SIP registration, it is to avoid sip server failure.
Description
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method, a terminal and a system for SIP registration.
Background
A Session Initiation Protocol (SIP) system includes a SIP server and a terminal, where the terminal is, for example, a Voice over Internet Protocol (VoIP) terminal, and the terminal can implement normal services only after registering in the SIP server.
In the actual use process, when a network fault (such as a shutdown of the SIP server, a power failure, and the like) occurs in the SIP system, all the terminals registered in the SIP server are all offline, and after the terminals are offline, the terminals automatically and continuously send registration requests to the SIP server within a preset time period until the registration is successful or the registration requests are stopped being sent overtime. After the network is recovered to normal, the SIP server may receive the registration requests sent by tens of thousands or even hundreds of thousands of terminals at the same time, and the application layer of the SIP server processes the large number of registration requests, and as the processing capability of the application layer of the SIP service is limited, the SIP server may fail.
However, after the terminal is added to the blacklist, the terminal cannot perform normal services, and unless an administrator performs manual intervention, the terminal added to the blacklist cannot recover normal services in a short time, so that user experience is poor.
Disclosure of Invention
The embodiment of the invention provides an SIP registration method, a terminal and a system, which can avoid the SIP server failure in the SIP registration process.
In a first aspect, an embodiment of the present invention provides a SIP registration method, where the method includes:
the terminal acquires a communication state between the terminal and the SIP server;
the terminal judges whether the communication state is a normal state or not;
the terminal generates a random time length when determining that the communication state is a normal state;
and after the terminal experiences the random time length, sending a registration request message to the SIP server.
In a second aspect, an embodiment of the present invention provides a terminal, including:
an obtaining module, configured to obtain a communication state between the terminal and the SIP server;
the judging module is used for judging whether the communication state is a normal state or not;
the generating module is used for generating random time length when the terminal determines that the communication state is a normal state;
and the sending module is used for sending a registration request message to the SIP server after the random time length is passed.
In a third aspect, an embodiment of the present invention provides an SIP registration system, where the SIP system includes a primary SIP server, a standby SIP server, and the terminal in the second aspect;
the main SIP server is used for receiving a first registration request message sent by the terminal when the communication state between the terminal and the main SIP server is a normal state;
and the standby SIP server is used for receiving a second registration request message sent by the terminal when the communication state between the terminal and the main SIP server is an abnormal state and the communication state between the terminal and the standby SIP server is a normal state.
The SIP registration method, the terminal and the system provided by the embodiment of the invention have the advantages that the terminal acquires the communication state between the terminal and the SIP server and judges whether the communication state is normal or not, the terminal sends a registration request message to the SIP server when determining that the communication state is normal, the SIP server returns a registration success response message to the terminal when receiving the registration request because the communication state between the terminal and the SIP server is normal, so that the terminal can successfully register after sending the registration request message to the SIP server once, further, the terminal generates a random time length according to a preset maximum time length when sending the registration request message to the SIP server, the random time length is any time length smaller than the preset maximum time length, the terminal sends the registration request message to the SIP server after experiencing the random time length, and the random time lengths generated by different terminals are generally different, therefore, the method and the device avoid that a plurality of terminals send the registration request message to the SIP server at the same time, thereby avoiding that the SIP server receives a large amount of registration request messages at the same time, and further avoiding the SIP server from being in fault in the SIP registration process.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of an SIP registration method provided in the present invention;
fig. 2 is a first flowchart of an SIP registration method provided in the present invention;
fig. 3 is a schematic diagram of a registration process of a terminal in a SIP server according to the present invention;
fig. 4A is a first schematic structural diagram of a terminal according to the present invention;
fig. 4B is a schematic structural diagram of a terminal according to the present invention;
fig. 5 is a schematic structural diagram of an SIP system provided in the present invention;
fig. 6 is a flowchart illustrating a second SIP registration method according to the present invention;
fig. 7 is a schematic interaction flow diagram of a SIP registration method provided in the present invention;
fig. 8 is a schematic diagram of an interaction flow of the SIP registration method provided by the present invention;
fig. 9 is a third schematic view of an interaction flow of the SIP registration method provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of an SIP registration method provided by the present invention, please refer to fig. 1, which includes a plurality of terminals 101A to 101N and an SIP server 102 corresponding to each terminal, where the terminals are terminals having a Voice function, such as Voice over Internet Protocol (VoIP) terminals, Optical Network Unit (ONU) terminals, and the like, and the terminals 101A to 101N need to register in the SIP server 102 to implement a normal service, and the terminals 101A to 101N are connected to the SIP server 102 through a wireless Network respectively to implement a normal service; the following describes a SIP registration method, device, and system in detail through specific embodiments.
Fig. 2 is a first flowchart of an SIP registration method provided by the present invention, which is applied to an SIP system including an SIP server and a terminal, where an execution subject of the method is the terminal, and referring to fig. 2, the method may include:
s201, a terminal acquires a communication state between the terminal and an SIP server;
s202, the terminal judges whether the communication state is a normal state;
s203, when the terminal determines that the communication state is a normal state, generating a random time length;
s204, after the terminal experiences the random time length, the terminal sends a registration request message to the SIP server.
In the embodiment of the invention, the communication state between the terminal and the SIP server comprises the communication link state between the terminal and the SIP server and the state of the SIP server, and the communication state between the terminal and the SIP server is divided into a normal state and an abnormal state; if the communication state between the terminal and the SIP server is a normal state, the communication link state between the terminal and the SIP server is a normal state, and the SIP server is also a normal state; if the communication state between the terminal and the SIP server is abnormal, the communication link state between the terminal and the SIP server is abnormal, or the SIP server is abnormal.
In the practical application process, the terminal starts to execute the embodiment shown in fig. 2 under a specific scenario, where the specific scenario may include the following possible scenarios:
one possible scenario is: the terminal determines that the state between the terminal and the SIP server is switched from a connection state to a disconnection state:
in this possible scenario, the terminal may determine that the state between the terminal and the SIP server is switched from the connected state to the disconnected state through the following two possible implementations: one possible implementation is: under the condition that the terminal and the SIP server are in a connected state, the terminal receives a disconnection request sent by the SIP server; another possible implementation: under the condition that the terminal and the SIP server are in a connected state, the terminal periodically detects the state between the terminal and the SIP server, and the terminal detects that the state between the terminal and the SIP server is changed into a disconnected state.
Another possible scenario is: and the terminal receives a registration failure response message sent by the SIP server.
Yet another possible scenario is: the terminal receives a registration overtime message sent by the SIP server, wherein the registration overtime message is used for indicating that a registration request message sent by the terminal to the SIP server is overtime.
It should be noted that the above is only an example of the scene where the terminal is located, and is not limited to the scene where the terminal is located, and in an actual application process, the scene where the terminal is located may also include other types of scenes, which is not specifically limited by the present invention.
The following describes in detail a procedure of registering a terminal in the SIP server.
When the terminal needs to register in the SIP server, the terminal acquires the communication state between the terminal and the SIP server and judges whether the communication state is a normal state, if the communication state is not the normal state, the communication link between the terminal and the SIP server is failed or the SIP server is failed, the terminal continues to acquire the communication state between the terminal and the SIP server and judges the acquired communication state until the acquired communication state is the normal state.
When the terminal determines that the communication state between the terminal and the SIP server is a normal state, a random time period is generated, and for example, the random time period may be 3 seconds, 15 seconds, or the like. After the terminal generates the random time length and experiences the random time length, the terminal sends a registration request message to the SIP server; for example, assuming that the terminal generates a random time length of 10 seconds at 10 o 'clock in 1 month, 1 day and 2015 year, the terminal sends a registration request message to the SIP server after 10 seconds, that is, 10 o' clock in 1 month, 1 day and 2015 year for 10 seconds; and when the terminal receives the registration success response message sent by the SIP server, the terminal successfully registers in the SIP server.
The following describes in detail the SIP registration method shown in the embodiment of fig. 2 by using a specific example with reference to fig. 3.
Fig. 3 is a schematic diagram of a registration process of a terminal in an SIP server according to the present invention, and please refer to fig. 3, where it is assumed that a terminal successfully registered in the SIP server includes a terminal 1-a terminal N, and if the SIP server is powered off, the terminal 1-the terminal N is simultaneously off-line from the SIP server.
After the terminals 1-N are off-line from the SIP server at the same time, the terminals 1-N respectively and periodically detect the communication state with the SIP server, after the SIP server is powered on, the terminals 1-N all determine that the communication state with the SIP server is a normal state, then the terminals-N stop detecting the communication state with the SIP server, and the terminals 1-N respectively generate random time length according to the preset maximum time length, for example, the random time length generated by the terminal 1 is 2 seconds, the random time length generated by the terminal 2 is 6 seconds, the random time length generated by the terminal 3 is 4 seconds, and the random time length generated by the terminal N is 5 seconds; and each terminal sends a registration request message to the SIP server after the generated random time length.
In the SIP registration method provided by the embodiment of the invention, a terminal acquires the communication state between the terminal and an SIP server and judges whether the communication state is normal or not, the terminal sends a registration request message to the SIP server when determining that the communication state is normal, and the SIP server returns a registration success response message to the terminal when receiving the registration request because the communication state between the terminal and the SIP server is normal, so that the terminal can successfully register by sending the registration request message to the SIP server once, further, when sending the registration request message to the SIP server, the terminal generates a random time length according to a preset maximum time length, the random time length is any time length smaller than the preset maximum time length, the terminal sends the registration request message to the SIP server after experiencing the random time length, and the random time lengths generated by different terminals are generally different, therefore, the method and the device avoid that a plurality of terminals send the registration request message to the SIP server at the same time, thereby avoiding that the SIP server receives a large amount of registration request messages at the same time, and further avoiding the SIP server from being in fault in the SIP registration process.
In the embodiment shown in fig. 1, optionally, when determining that the communication state is the normal state, the terminal may generate a random time length according to a preset maximum time length, where the random time length is any time length smaller than the preset maximum time length; the preset maximum duration is a duration preset in the terminal by the user, optionally, the preset maximum duration may be 20 seconds, and the random duration generated according to the preset maximum duration is any duration less than 20 seconds, such as 3 seconds, 15 seconds, and the like. In practical application, the preset maximum duration can be set according to actual needs.
In the embodiment shown in fig. 1, optionally, the terminal may obtain the communication state between the terminal and the SIP server through the following feasible implementation manners:
the terminal sends a detection message to the SIP server, wherein the detection message is used for acquiring the communication state between the terminal and the SIP server; judging whether a feedback message corresponding to a detection message sent by an SIP server is received within a preset time length, if so, determining that the communication state between the terminal and the SIP server is a normal state; and if not, determining that the communication state between the terminal and the SIP server is an abnormal state.
In this feasible implementation manner, the terminal may periodically send the probe message to the SIP server, optionally, the period may be 100 milliseconds, and the length of the period may be set according to actual needs; if the communication state between the terminal and the SIP server is a normal state (a communication link between the terminal and the SIP server is normal, and the SIP server is normal), when a transport layer of the SIP server receives a probe Message, the SIP server sends a feedback Message corresponding to the probe Message to the terminal, therefore, after the terminal sends the probe Message to the SIP server, if the feedback Message corresponding to the probe Message sent by the SIP server is received within a preset time period, it is determined that the communication state between the terminal and the SIP server is a normal state, and if the feedback Message corresponding to the probe Message sent by the SIP server is not received within the preset time period, it is determined that the communication state between the terminal and the SIP server is an abnormal state, optionally, the probe Message may be a Control Message Protocol (ICMP) Message.
The terminal sends the detection message to the SIP server, and when the detection message reaches the transmission layer of the SIP server, the SIP server may generate a corresponding feedback message according to the detection message, and send the feedback message to the terminal, and the detection message does not need to be transmitted to the application layer of the SIP server, and further does not need to be processed by the application layer of the SIP server.
Fig. 4A is a schematic structural diagram of a terminal according to the first embodiment of the present invention, referring to fig. 4A, the terminal may include:
an obtaining module 401, configured to obtain a communication state between a terminal and an SIP server;
a judging module 402, configured to judge whether a communication state is a normal state;
a generating module 403, configured to generate a random time length when the terminal determines that the communication state is a normal state;
a sending module 404, configured to send a registration request message to the SIP server after a random duration elapses;
optionally, the obtaining module 401 may specifically be configured to:
sending a detection message to the SIP server, wherein the detection message is used for acquiring the communication state between the terminal and the SIP server;
judging whether a feedback message corresponding to a detection message sent by an SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the SIP server is a normal state;
and if not, determining that the communication state between the terminal and the SIP server is an abnormal state.
Optionally, the generating module 403 may be specifically configured to generate a random time length according to a preset maximum time length when it is determined that the communication state is the normal state, where the random time length is any time length smaller than the preset maximum time length.
Optionally, the probe message may be an ICMP message.
Fig. 4B is a second schematic structural diagram of a terminal according to the present invention, and referring to fig. 4B, based on the embodiment shown in fig. 4A, the terminal may further include a receiving module 405, wherein,
the receiving module 405 is configured to receive a registration success response message sent by the SIP server after the sending module 404 sends the registration request message to the SIP server, so as to implement registration of the terminal in the SIP server.
The receiving module 405 may be further configured to determine that the state between the terminal and the SIP server is switched from the connection state to the disconnection state before the obtaining module 401 obtains the communication state between the terminal and the SIP server corresponding to the terminal; or receiving a registration failure response message sent by the SIP server; or receiving a registration timeout message sent by the SIP server, where the registration timeout message is used to indicate that a registration request message sent by the terminal to the SIP service times out.
The terminal provided by the embodiment of the present invention may execute the technical solutions described in the above embodiments, and the implementation principles and beneficial effects are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of an SIP system provided by the present invention, referring to fig. 5, the SIP system may include an active SIP server 501, a standby SIP server 502, and a plurality of terminals 503A-503N, each of the terminals 503A-503N may be connected to and communicate with the SIP server 501 and the standby SIP server 502 through a wireless network, wherein,
the active SIP server 501 is configured to receive a first registration request message sent by the terminal when a communication state between the terminal and the active SIP server is a normal state;
optionally, after the active SIP server 501 receives the first registration request message sent by the terminal, a first registration success response message corresponding to the first registration request message may be sent to the terminal.
The standby SIP server 502 is configured to receive a second registration request message sent by the terminal when a communication state between the terminal and the active SIP server is an abnormal state and a communication state between the terminal and the standby SIP server is a normal state.
Optionally, after the standby SIP server 502 receives the first registration request message sent by the terminal, a second registration success response message corresponding to the second registration request message may be sent to the terminal.
Further, the standby SIP server 502 may be further configured to receive a second registration request message sent by the terminal when the communication state between the terminal and the active SIP server is a normal state, and the communication state between the terminal and the standby SIP server is a normal state, and the terminal fails to register with the active SIP.
In the SIP system shown in fig. 5, the SIP registration process of each terminal is the same, and the method described in the embodiment of fig. 2 will be described in detail below with reference to fig. 6, taking the SIP registration process of one terminal in the SIP system shown in fig. 5 as an example.
Fig. 6 is a second flowchart illustrating a SIP registration method provided by the present invention, and referring to fig. 6, on the basis of the embodiment shown in fig. 6, the method may include:
s601, the terminal respectively acquires a first communication state between the terminal and the main SIP server and a second communication state between the terminal and the standby SIP server;
s602, the terminal respectively judges whether the first communication state and the second communication state are normal states;
executing S603-S604 when the terminal determines that the first communication state is a normal state and the second communication state is an abnormal state;
executing S604-S608 when the terminal determines that the first communication state is a normal state and the second communication state is a normal state;
executing S609-S610 when the terminal determines that the first communication state is an abnormal state and the second communication state is a normal state;
s603, the terminal generates a random time length according to a preset maximum time length and sends a registration request message to the main SIP server after the random time length;
s604, the terminal judges whether a registration success response message sent by the main SIP server is received within a preset response time;
if yes, executing S611;
if the judgment result is negative, returning to the S601;
s605, the terminal generates a random time length according to a preset maximum time length and sends a registration request message to the main SIP server after the random time length;
s606, the terminal judges whether a registration success response message sent by the main SIP server is received within a preset response duration;
if yes, executing S611;
if the determination result is negative, executing S607;
s607, the terminal sends a registration request message to the standby SIP server;
s608, the terminal judges whether a response message of successful registration sent by the standby SIP server is received within a preset response time;
if yes, executing S611;
if the judgment result is negative, returning to the S601;
s609, the terminal generates a random time length according to the preset maximum time length and sends a registration request message to the standby SIP server after the random time length;
s610, the terminal judges whether a response message of successful registration sent by the standby SIP server is received within a preset response time;
if yes, executing S611;
if the judgment result is negative, returning to the S601;
s611, registering successfully.
In the embodiment shown in fig. 6, when the terminal needs to perform SIP registration, the terminal detects the communication state between the terminal and the primary SIP server and the communication state between the terminal and the standby SIP server at the same time, and when one of the communication states is a normal state, the terminal stops state detection and performs SIP registration according to the detection result; according to the difference of the detection results, the SIP registration process of the terminal is also different, and specifically, the detection results may include the following three possible situations, and the following describes in detail the interaction process between the terminal and the active SIP server and the standby SIP server in the three possible situations, respectively, with reference to fig. 7 to fig. 10:
one possible scenario is:
the communication state between the terminal and the main SIP server is a normal state, and the communication state between the terminal and the standby SIP server is an abnormal state.
Fig. 7 is a schematic interaction flow diagram of a SIP registration method provided in the present invention, referring to fig. 7, the method may include:
s701, the terminal sends a first detection message to a main SIP server;
s702, the main SIP server sends a first feedback message corresponding to the first detection message to the terminal according to the first detection message;
s703, the terminal judges whether the communication state between the terminal and the main SIP server is a normal state according to the first feedback message;
specifically, the terminal judges whether a first feedback message corresponding to a detection message sent by a main SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the main SIP server is a normal state;
if not, determining that the communication state between the terminal and the main SIP server is an abnormal state.
S704, the terminal sends a second detection message to the standby SIP server;
s705, the standby SIP server sends a second feedback message corresponding to the second detection message to the terminal according to the second detection message;
s706, the terminal judges whether the communication state between the terminal and the standby SIP server is a normal state according to the second feedback message;
specifically, the terminal judges whether a second feedback message corresponding to the detection message sent by the standby SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the standby SIP server is a normal state;
if not, determining that the communication state between the terminal and the standby SIP server is an abnormal state.
Repeating the steps S701-S706 until the terminal determines that the communication state between the terminal and the main SIP server is a normal state and the communication state between the terminal and the standby SIP server is an abnormal state, and executing S707;
s707, the terminal generates a random time length according to a preset maximum time length;
s708, after the random duration, the terminal sends a first registration request message to the main SIP server;
s709, the main SIP server sends a first registration success response message to the terminal within a preset response duration;
and S710, successfully registering.
It should be noted that, if the active SIP server does not send a registration success response message to the terminal within the preset response duration, the terminal continues to detect the communication state between the terminal and the active SIP server and the communication state between the terminal and the standby SIP server.
Another possible scenario is:
the communication state between the terminal and the main SIP server is a normal state, and the communication state between the terminal and the standby SIP server is a normal state.
Fig. 8 is a schematic diagram illustrating an interaction flow of an SIP registration method provided by the present invention, referring to fig. 8, the method may include:
s801, a terminal sends a first detection message to a main SIP server;
s802, the main SIP server sends a first feedback message corresponding to the first detection message to the terminal according to the first detection message;
s803, the terminal judges whether the communication state between the terminal and the main SIP server is a normal state according to the first feedback message;
specifically, the terminal judges whether a first feedback message corresponding to a detection message sent by a main SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the main SIP server is a normal state;
if not, determining that the communication state between the terminal and the main SIP server is an abnormal state.
S804, the terminal sends a second detection message to the standby SIP server;
s805, the standby SIP server sends a second feedback message corresponding to the second detection message to the terminal according to the second detection message;
s806, the terminal judges whether the communication state between the terminal and the standby SIP server is a normal state according to the second feedback message;
specifically, the terminal judges whether a second feedback message corresponding to the detection message sent by the standby SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the standby SIP server is a normal state;
if not, determining that the communication state between the terminal and the standby SIP server is an abnormal state.
Repeating the steps S801-S806 until the terminal determines that the communication state between the terminal and the main SIP server is a normal state and the communication state between the terminal and the standby SIP server is a normal state, and executing S807;
s807, the terminal generates a random time length according to a preset maximum time length;
s808, after the random time length, the terminal sends a first registration request message to the main SIP server;
after S809, the main SIP server does not send a first registration success response message to the terminal within a preset response duration, and S809 is executed;
s809, the terminal sends a second registration request message to the standby SIP server;
s810, the standby SIP server sends a second registration success response message to the terminal within a preset response time;
s811, registration is successful.
It should be noted that, if the standby SIP server does not send the second registration success response message to the terminal within the preset response duration, the terminal continues to detect the communication state between the terminal and the active SIP server and the communication state between the terminal and the standby SIP server.
Yet another possible scenario is: the communication state between the terminal and the main SIP server is a normal state, and the communication state between the terminal and the standby SIP server is a normal state.
Fig. 9 is a third schematic view illustrating an interaction flow of an SIP registration method provided by the present invention, referring to fig. 9, the method may include:
s901, the terminal sends a first detection message to a main SIP server;
s902, the main SIP server sends a first feedback message corresponding to the first detection message to the terminal according to the first detection message;
s903, the terminal judges whether the communication state between the terminal and the main SIP server is a normal state according to the first feedback message;
specifically, the terminal judges whether a first feedback message corresponding to a detection message sent by a main SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the main SIP server is a normal state;
if not, determining that the communication state between the terminal and the main SIP server is an abnormal state.
S904, the terminal sends a second detection message to the standby SIP server;
s905, the standby SIP server sends a second feedback message corresponding to the second detection message to the terminal according to the second detection message;
s906, the terminal judges whether the communication state between the terminal and the standby SIP server is a normal state or not according to the second feedback message;
specifically, the terminal judges whether a second feedback message corresponding to the detection message sent by the standby SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the standby SIP server is a normal state;
if not, determining that the communication state between the terminal and the standby SIP server is an abnormal state.
Repeating the steps of S901-S906 until the terminal determines that the communication state between the terminal and the main SIP server is an abnormal state and the communication state between the terminal and the standby SIP server is a normal state, and executing S907;
s907, the terminal generates a random time length according to a preset maximum time length;
s908, after the random time length, the terminal sends a second registration request message to the standby SIP server;
s909, the standby SIP server sends a second registration success response message to the terminal within a preset response time;
s910, registration is successful.
In the above SIP registration process, the terminal sends a registration request message to the SIP server when determining that the communication state is normal, because the communication state between the terminal and the SIP server is normal, the SIP server will return a registration success response message to the terminal when receiving the registration request, so that the terminal can successfully register by sending the registration request message to the SIP server once, further, when sending the registration request message to the SIP server, the terminal generates a random time length specifically according to the preset maximum time length, the random time length is any time length less than the preset maximum time length, the terminal sends the registration request message to the SIP server after experiencing the random time length, because the random time lengths generated by different terminals are generally different, the multiple terminals are prevented from sending the registration request message to the SIP server at the same time, thereby preventing the SIP server from receiving a large number of registration request messages at the same time, and further, the SIP server is prevented from being failed in the SIP registration process.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A SIP registration method, the method comprising:
the terminal acquires a communication state between the terminal and the SIP server;
the terminal judges whether the communication state is a normal state or not;
the terminal generates a random time length when determining that the communication state is a normal state;
and after the terminal experiences the random time length, sending a registration request message to the SIP server.
2. The method of claim 1, wherein the obtaining, by the terminal, the communication status between the terminal and the SIP server comprises:
the terminal sends a detection message to the SIP server, wherein the detection message is used for acquiring the communication state between the terminal and the SIP server;
the terminal judges whether a feedback message corresponding to the detection message sent by the SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the SIP server is a normal state;
and if not, determining that the communication state between the terminal and the SIP server is an abnormal state.
3. The method according to claim 1, wherein the terminal generates a random time length when determining that the communication status is a normal status, and includes:
and when the communication state is determined to be a normal state, the terminal generates a random time length according to a preset maximum time length, wherein the random time length is any time length smaller than the preset maximum time length.
4. A method according to any of claims 1-3, wherein the probe message is a control message protocol ICMP message.
5. The method according to any one of claims 1 to 3, wherein before the terminal acquires the communication state between the terminal and the SIP server corresponding to the terminal, the method further comprises:
the terminal determines that the state between the terminal and the SIP server is switched from a connection state to a disconnection state;
or,
the terminal receives a registration failure response message sent by the SIP server;
or,
and the terminal receives a registration timeout message sent by the SIP server, wherein the registration timeout message is used for indicating that a registration request message sent by the terminal to the SIP service is overtime.
6. A terminal, comprising:
an obtaining module, configured to obtain a communication state between the terminal and the SIP server;
the judging module is used for judging whether the communication state is a normal state or not;
the generating module is used for generating random time length when the terminal determines that the communication state is a normal state;
and the sending module is used for sending a registration request message to the SIP server after the random time length is passed.
7. The terminal of claim 6, wherein the obtaining module is specifically configured to:
sending a detection message to the SIP server, wherein the detection message is used for acquiring the communication state between the terminal and the SIP server;
judging whether a feedback message corresponding to the detection message sent by the SIP server is received within a preset time length;
if so, determining that the communication state between the terminal and the SIP server is a normal state;
and if not, determining that the communication state between the terminal and the SIP server is an abnormal state.
8. The terminal according to claim 6, wherein the generating module is specifically configured to generate a random duration according to a preset maximum duration when it is determined that the communication state is a normal state, where the random duration is any duration smaller than the preset maximum duration.
9. An SIP registration system, characterized in that the SIP system comprises a primary SIP server, a standby SIP server and a terminal according to any of claims 6-8;
the main SIP server is used for receiving a first registration request message sent by the terminal when the communication state between the terminal and the main SIP server is a normal state;
and the standby SIP server is used for receiving a second registration request message sent by the terminal when the communication state between the terminal and the main SIP server is an abnormal state and the communication state between the terminal and the standby SIP server is a normal state.
10. The system of claim 9 wherein the standby SIP server is further configured to,
and when the communication state between the terminal and the main SIP server is a normal state and the communication state between the terminal and the standby SIP server is a normal state, receiving the second registration request message sent by the terminal when the terminal fails to register to the main SIP.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511022259.7A CN106936784B (en) | 2015-12-30 | 2015-12-30 | SIP (Session initiation protocol) registration method, terminal and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511022259.7A CN106936784B (en) | 2015-12-30 | 2015-12-30 | SIP (Session initiation protocol) registration method, terminal and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106936784A true CN106936784A (en) | 2017-07-07 |
CN106936784B CN106936784B (en) | 2020-12-29 |
Family
ID=59441706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511022259.7A Active CN106936784B (en) | 2015-12-30 | 2015-12-30 | SIP (Session initiation protocol) registration method, terminal and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106936784B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109905550A (en) * | 2019-03-01 | 2019-06-18 | 上海市共进通信技术有限公司 | The method for realizing the adaptive handoff functionality of VOIP server |
CN113746865A (en) * | 2021-09-30 | 2021-12-03 | 厦门亿联网络技术股份有限公司 | Method and device for fault transfer of VoIP terminal communication service |
CN115604234A (en) * | 2022-11-15 | 2023-01-13 | 深圳市华曦达科技股份有限公司(Cn) | VoIP server self-adaptive switching method, system and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030021264A1 (en) * | 1998-09-24 | 2003-01-30 | Zhakov Vyacheslav I. | Call transfer using session initiation protocol (SIP) |
CN101052206B (en) * | 2006-04-04 | 2010-09-29 | 华为技术有限公司 | Mobile terminal network attaching method |
CN101888705A (en) * | 2010-07-28 | 2010-11-17 | 中兴通讯股份有限公司 | Business establishment control method and system in long-term evolution network and terminal device |
CN101964806B (en) * | 2010-11-02 | 2013-05-22 | 深圳市共进电子股份有限公司 | Method for switching servers of SIP (Session Initiation Protocol) communication terminal |
CN103516536A (en) * | 2012-06-26 | 2014-01-15 | 重庆新媒农信科技有限公司 | Server service request parallel processing method based on thread number limit and system thereof |
CN103685166A (en) * | 2012-09-06 | 2014-03-26 | 中兴通讯股份有限公司 | Method and device for switching between main server and standby server for session initiation protocol terminal |
CN102594628B (en) * | 2012-03-14 | 2014-11-05 | 深圳市共进电子股份有限公司 | Method, terminal and system for detecting availability of communication link and service |
-
2015
- 2015-12-30 CN CN201511022259.7A patent/CN106936784B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030021264A1 (en) * | 1998-09-24 | 2003-01-30 | Zhakov Vyacheslav I. | Call transfer using session initiation protocol (SIP) |
CN101052206B (en) * | 2006-04-04 | 2010-09-29 | 华为技术有限公司 | Mobile terminal network attaching method |
CN101888705A (en) * | 2010-07-28 | 2010-11-17 | 中兴通讯股份有限公司 | Business establishment control method and system in long-term evolution network and terminal device |
CN101964806B (en) * | 2010-11-02 | 2013-05-22 | 深圳市共进电子股份有限公司 | Method for switching servers of SIP (Session Initiation Protocol) communication terminal |
CN102594628B (en) * | 2012-03-14 | 2014-11-05 | 深圳市共进电子股份有限公司 | Method, terminal and system for detecting availability of communication link and service |
CN103516536A (en) * | 2012-06-26 | 2014-01-15 | 重庆新媒农信科技有限公司 | Server service request parallel processing method based on thread number limit and system thereof |
CN103685166A (en) * | 2012-09-06 | 2014-03-26 | 中兴通讯股份有限公司 | Method and device for switching between main server and standby server for session initiation protocol terminal |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109905550A (en) * | 2019-03-01 | 2019-06-18 | 上海市共进通信技术有限公司 | The method for realizing the adaptive handoff functionality of VOIP server |
CN113746865A (en) * | 2021-09-30 | 2021-12-03 | 厦门亿联网络技术股份有限公司 | Method and device for fault transfer of VoIP terminal communication service |
CN115604234A (en) * | 2022-11-15 | 2023-01-13 | 深圳市华曦达科技股份有限公司(Cn) | VoIP server self-adaptive switching method, system and storage medium |
CN115604234B (en) * | 2022-11-15 | 2023-03-10 | 深圳市华曦达科技股份有限公司 | VoIP server self-adaptive switching method, system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106936784B (en) | 2020-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2775755B1 (en) | Acquiring an online state of a terminal | |
CN101217407B (en) | A processing method on functional failure on calling conversation control agent | |
US20140359340A1 (en) | Subscriptions that indicate the presence of application servers | |
CN106936784B (en) | SIP (Session initiation protocol) registration method, terminal and system | |
CN101674313A (en) | SIP registration method for server to actively inform user switching, system and device thereof | |
US20130198353A1 (en) | Overload handling through diameter protocol | |
JP2009296138A (en) | Communication system | |
CN109150659B (en) | Processor and BFD message transmission method | |
US20170272339A1 (en) | Method and apparatus for detecting connectivity | |
CN103825777A (en) | DMZ server switching method and device | |
CN104580537A (en) | Rapid reconnecting method based on XMPP (extensible messaging and presence protocol) client side, terminal and server | |
CN110971459B (en) | Session fault detection method and device, terminal equipment and readable storage medium | |
CN105307217A (en) | Method and device for flexibly processing link between network elements | |
US20150319267A1 (en) | Methods, systems, and computer readable media for controlling deep parsing of diameter messages | |
CN108259213A (en) | NETCONF session status detection method and device | |
US20110286365A1 (en) | Method for Connection Preservation | |
CN107819599B (en) | Message processing method and device | |
CN102487341B (en) | Talk detection method, device and session initial protocol server | |
CN104378230A (en) | System and method for improving stability of Telnet server | |
CN115412974B (en) | Shunting communication method, device, equipment and readable storage medium | |
CN103607324B (en) | Data processing method for Java message service, Java message client and server | |
CN104094575B (en) | The method and apparatus of improvement processing for IMS node to pipe off | |
CN106230878B (en) | Equipment service calling method and device based on AllJoyn framework | |
WO2016062021A1 (en) | Method and device for service capacity detection | |
WO2015158058A1 (en) | Method and system for implementing call saving and recovery |
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 |