Method and device for realizing network switching of SIP terminal, IP-PBX and communication system
By encrypting Call-ID in the SIP terminal and verifying the new IP address through IP-PBX, the call interruption problem during network switching of SIP terminals is solved, and more efficient network switching is achieved, and call quality and security are improved.
Patent Information
- Application Number
- CN202410976870.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-22
AI Technical Summary
Existing SIP terminals renegotiate media information through re-INVITE during network switching, resulting in a brief interruption of calls, affecting call quality and user experience.
When a network switch occurs in the SIP terminal, the Call-ID of the current call is encrypted and filled into the RTP packet, and the legality of the new IP address is verified through IP-PBX, the old IP address is replaced, and the original RTP packet transmission is restored. The RTP-verified version is verified. Negotiation method to avoid re-establishing connections.
It reduces the delay and pause time caused by network handover, improves call quality, ensures the continuity and stability of calls, and improves security.
Smart Images

Figure CN119011546A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a method, equipment, IP-PBX and communication system for implementing network switching of a SIP terminal. Background Art
[0002] SIP (Session Initiation Protocol) is a protocol for initiating sessions. A SIP session is a session between two user terminals, or possibly more users, based on an IP network, i.e. a VoIP session. The media of the session is generally in the form of voice, video, etc.
[0003] In the era of mobile Internet, mobile phones are standard equipment for everyone, and people often need to switch between WiFi and 4G. For example, they use the company's WiFi at work, switch to 4G or 5G on the road, and connect to the home WiFi again when they get home. Therefore, people need to switch networks frequently in their daily lives, and each network switch will cause the IP address to change.
[0004] In the field of VOIP, switching networks is also a problem that needs to be solved. At present, the general process for handling network changes is as follows: Figure 1 As shown. Figure 1 The existing SIP network switching is restored by re-INVITE to renegotiate media information (SDP, Session Description Protocol). It is necessary to send a SIP packet (re-INVITE) to renegotiate the media and negotiate and interact with the server. This method will cause a brief interruption in the call after the network switching, affecting the call quality and user experience. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, IP-PBX and communication system for implementing network switching of a SIP terminal, so as to reduce the delay and pause time caused by network switching during a call by modifying the negotiation mode, thereby improving the call quality.
[0006] In order to achieve the above object, on the one hand, a method for a SIP terminal to implement network switching is provided, comprising:
[0007] When a network switch occurs during a call at a SIP terminal, the SIP terminal encrypts the first Call-ID corresponding to the current call, fills the encrypted first Call-ID into the RTP packet as filling information, generates a new RTP packet containing the filling information, and sends the new RTP packet to the IP-PBX according to the original packet sending address;
[0008] When the IP-PBX determines that the source of the received RTP packet is a new IP address and the received RTP packet is a new RTP packet containing padding information, the IP-PBX extracts the padding information from the new RTP packet, decrypts the padding information, and obtains the decrypted second Call-ID;
[0009] The IP-PBX determines whether the second Call-ID is consistent with the first Call-ID negotiated previously; if so, the IP-PBX marks the new IP address as a legal address and replaces the old IP address of the SIP terminal before the network switch with the new IP address, so that the other end of the call can send the RTP packet to the SIP terminal according to the new IP address through the IP-PBX;
[0010] After the SIP terminal receives the RTP packet sent by the opposite end, the SIP terminal resumes sending the original RTP packet that does not contain the filling information.
[0011] Preferably, the method, when the second Call-ID is consistent with the first Call-ID negotiated previously, further includes:
[0012] The IP-PBX removes the padding information from the received RTP packet to obtain an original RTP packet without the padding information.
[0013] Preferably, the method further comprises:
[0014] The IP-PBX sends the original RTP packet to the peer end, and receives the original RTP packet sent by the peer end.
[0015] On the other hand, a SIP terminal device for implementing any of the above methods for implementing SIP terminal network switching is also provided.
[0016] In yet another aspect, there is provided an IP-PBX for implementing any of the methods for implementing SIP terminal network switching as described above.
[0017] On the other hand, a communication system is provided, including: a SIP terminal and an IP-PBX, using any of the above methods for implementing SIP terminal network switching to solve the problem of call interruption caused by SIP terminal network switching.
[0018] The above technical solution has the following technical effects:
[0019] The technical solution of the embodiment of the present invention is to encrypt the Call-ID corresponding to the current call through the SIP terminal and fill it into the RTP packet as filling information to generate a new RTP packet, and send it to the IP-PBX along the original path; when the IP-PBX recognizes that the packet source is a new IP address and the received RTP packet is a new RTP packet containing filling information, the filling information in the new RTP packet is extracted and decrypted to obtain the Call-ID, and it is verified whether it is consistent with the negotiated Call-ID. If it is consistent, the new IP address is marked as legal and replaces the old address. The other end sends the RTP packet to the SIP terminal according to the new IP address through the IP-PBX. When the SIP terminal receives the RTP packet, it resumes the original RTP packet sending to realize the network switching of the SIP terminal. When the SIP terminal encounters network switching during the call, the RTP direct verification method is adopted to ensure that the transmission of the RTP packet is not interrupted, reduce the delay and pause time caused by the network switching during the call, and improve the call quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of a method for a SIP terminal to implement network switching in the prior art;
[0021] Figure 2 It is a schematic diagram of the principle of a method for a SIP terminal to implement network switching according to an embodiment of the present invention;
[0022] Figure 3 It is a flow chart of a method for implementing network switching by a SIP terminal according to an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of the structure of a new RTP packet including a padding portion in one embodiment of the present invention;
[0024] Figure 5 The figure is a flow chart of a method for implementing network switching by a SIP terminal according to another embodiment of the present invention. DETAILED DESCRIPTION
[0025] To further illustrate the various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, a person of ordinary skill in the art should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0026] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0027] Figure 2 FIG. 1 is a schematic diagram showing the principle of a method for implementing network switching in a SIP terminal according to an embodiment of the present invention. Figure 2 The principle of implementing network switching by the method of the embodiment of the present invention is:
[0028] Modify the negotiation method, abandon the traditional re-INVITE negotiation method, and use the more efficient RTP negotiation method with authentication;
[0029] After the network is switched, the SIP terminal, i.e. the SIP client, continues to send RTP to the server address, but the RTP packet at this time is a new RTP packet with verification information, i.e. filling information;
[0030] After the IP-PBX passes the verification, it will update the packet destination and send the original RTP packet without padding information to the SIP client. If the SIP terminal, i.e. the SIP client, receives the original RTP packet sent by the IP-PBX, it means that the verification is successful and the subsequent RTP packets return to normal.
[0031] Embodiment 1:
[0032] Figure 3 FIG. 1 is a flow chart of a method for implementing network switching by a SIP terminal according to an embodiment of the present invention. Figure 3 The method for implementing network switching of the SIP terminal in this example includes the following steps:
[0033] When a network switch occurs during a call, the SIP terminal encrypts the first Call-ID corresponding to the current call, fills the encrypted first Call-ID into the RTP packet as padding information, generates a new RTP packet containing the padding information, and sends the new RTP packet to the IP-PBX according to the original packet sending address;
[0034] When the IP-PBX determines that the source of the received RTP packet is the new IP address and the received RTP packet is a new RTP packet containing padding information, the IP-PBX extracts the padding information from the new RTP packet, decrypts the padding information, and obtains the decrypted second Call-ID;
[0035] The IP-PBX determines whether the second Call-ID is consistent with the originally negotiated first Call-ID; if so, the IP-PBX marks the new IP address as a valid address and replaces the old IP address of the SIP terminal before the network switch with the new IP address, so that the other end of the call can send the RTP packet to the SIP terminal according to the new IP address through the IP-PBX;
[0036] After the SIP terminal receives the RTP packet sent by the opposite end, the SIP terminal resumes sending the original RTP packet that does not contain the padding information.
[0037] In a specific implementation, when the second Call-ID is consistent with the originally negotiated first Call-ID, the method further includes:
[0038] The IP-PBX removes the padding information in the received RTP packet to obtain the original RTP packet without the padding information.
[0039] In a specific implementation, the method further includes:
[0040] The IP-PBX sends the original RTP packets to the peer end and receives the original RTP packets sent by the peer end.
[0041] Embodiment 2:
[0042] Figure 4 FIG. 1 is a schematic diagram of the structure of a new RTP packet including a filling part in one embodiment of the present invention. Figure 4 The RTP packet consists of an RTP header, namely, an RTP Header, and an RTP payload, namely, an RTP Payload. The new RTP packet is generated by the SIP terminal encrypting the Call-ID and filling it into the RTP packet as filling information.
[0043] Combination Figure 5 The method for implementing network switching by the SIP terminal of this embodiment includes the following steps:
[0044] Step 1: When the network of the SIP terminal switches during a call, the traditional re-INVITE negotiation method is not triggered. The SIP terminal encrypts the first Call-ID corresponding to the current call, and fills the encrypted first Call-ID into the RTP packet as filling information to generate a new RTP packet; in the specific implementation, encryption and filling are implemented by implementing corresponding functional software modules, such as encryption through an encryption module, and construction of a new RTP packet is implemented through an RTP filling module;
[0045] Step 2: The new RTP packet inherits the original packet sending address, and the SIP terminal sends the new RTP packet to the original RTP port of the IP-PBX;
[0046] Step 3: When the IP-PBX receives the RTP packet, it first determines whether the source address of the received RTP packet has been authenticated;
[0047] If not, that is, if the source address of the received RTP packet is a new address, continue to determine whether the received RTP packet contains a padding part; if so, take out the padding part of the received RTP packet and decrypt it to obtain the second Call-ID, and go to step 4; otherwise, discard the RTP packet;
[0048] If yes, it is determined whether the received RTP packet contains a padding part. If the received RTP packet does not contain a padding part, it proceeds to step 6 to determine whether the encoding methods between the SIP terminals are consistent. If the received RTP packet contains a padding part, the padding part in the RTP packet is removed to restore the original RTP packet, and then it proceeds to step 6 to determine whether the encoding methods between the SIP terminals are consistent.
[0049] Step 4: The IP-PBX compares the second Call-ID obtained by decryption with the originally negotiated first Call-ID to see if they are consistent; if they are consistent, the IP-PBX marks the source address of the received RTP packet as a legal address and replaces the original old IP of the SIP terminal with the new IP; if they are inconsistent, the RTP packet is discarded;
[0050] In a specific implementation, the old IP address refers to the IP address of the SIP terminal before the network switch, and the new IP address refers to the IP address of the SIP terminal after the network switch.
[0051] Step 5: The IP-PBX removes the padding part of the received RTP packet to obtain the original RTP packet without padding information;
[0052] Step 6: The IP-PBX determines whether the encoding methods of the SIP terminals are consistent. If they are consistent, the original RP packet is sent to the other end. If they are inconsistent, the original RTP packet is first transcoded and then sent to the other end;
[0053] Step 7: Send the RTP packet sent by the peer end to the IP-PBX through the IP-PBX to the new IP address of the SIP terminal. When the SIP terminal receives the RTP packet sent by the peer end, it resumes sending the original RTP packet without padding information.
[0054] In a specific implementation, because the interval between SIP sending RTP packets is very short and the network environment is uncertain, the number of RTP packets converted into new RTP packets can be any natural number. When the first new RTP packet passes the verification process of the IP-PBX and changes the old IP and port to the new IP and port, the subsequent converted new RTP packets containing padding information will directly proceed to steps five and six.
[0055] By utilizing the technical solution of the embodiment of the present invention, the traditional re-INVITE negotiation method is cancelled, and the RTP with verification method is adopted. There is no need to re-establish the connection when the network is switched, which reduces the delay and pause time, ensures the continuity and stability of the call, improves the call quality, and thus increases the competitive advantage of the product; at the same time, the verification information is generated in the negotiation stage of each call, and the scope of action is only during this call, and the verification information is encrypted, so the security is higher than the traditional method; and this technical solution only transforms a few RTP packets on the basis of saving the overhead of the re-INVITE stage, saving resources and costs.
[0056] Embodiment three:
[0057] The present invention also provides a SIP terminal device for implementing the method for implementing network switching of a SIP terminal as described above.
[0058] Embodiment 4:
[0059] The present invention also provides an IP-PBX, which uses the method embodiment described above to implement network switching of SIP terminals.
[0060] Embodiment five:
[0061] The embodiment of the present invention further provides a communication system, including: a SIP terminal and an IP-PBX, which uses the method embodiment described above to solve the problem of call interruption caused by SIP terminal network switching.
[0062] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A method for implementing network switching by a SIP terminal, characterized in that: include: When a network switch occurs during a call at a SIP terminal, the SIP terminal encrypts the first Call-ID corresponding to the current call, fills the encrypted first Call-ID into the RTP packet as filling information, generates a new RTP packet containing the filling information, and sends the new RTP packet to the IP-PBX according to the original packet sending address; When the IP-PBX determines that the source of the received RTP packet is a new IP address and the received RTP packet is a new RTP packet containing padding information, the IP-PBX extracts the padding information from the new RTP packet, decrypts the padding information, and obtains the decrypted second Call-ID; The IP-PBX determines whether the second Call-ID is consistent with the first Call-ID negotiated previously; If yes, the IP-PBX marks the new IP address as a legal address and replaces the old IP address of the SIP terminal before the network switch with the new IP address, so that the other end of the call can send the RTP packet to the SIP terminal according to the new IP address through the IP-PBX; After the SIP terminal receives the RTP packet sent by the opposite end, the SIP terminal resumes sending the original RTP packet that does not contain the filling information.
2. The method according to claim 1, characterized in that When the second Call-ID is consistent with the first Call-ID negotiated originally, the method further includes: The IP-PBX removes the padding information from the received RTP packet to obtain an original RTP packet without the padding information.
3. The method according to claim 2, characterized in that Also includes: The IP-PBX sends the original RTP packet to the peer end, and receives the original RTP packet sent by the peer end.
4. A SIP terminal device that implements network switching using the method described in any one of claims 1 to 3.
5. An IP-PBX that uses the method according to any one of claims 1 to 3 to implement SIP terminal network switching.
6. A communication system comprising: The SIP terminal and the IP-PBX are characterized in that the SIP terminal and the IP-PBX use the method for implementing network switching by the SIP terminal as described in any one of claims 1 to 3 to implement network switching.
