A SIP message playback method, electronic device, readable medium, program product

By extracting and grouping the five-tuple relationships of SIP packets in network forwarding devices, simulating the network environment and performing packet modification, the problem of SIP packet and media stream playback was solved, enabling accurate reproduction of on-site communication and rapid problem localization.

CN119583519BActive Publication Date: 2025-10-24BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411715742.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-10-24
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve complete playback of SIP packets and media streams in network forwarding devices, especially in complex environments modified by network forwarding devices, making it difficult to accurately reproduce the on-site communication situation.

Method used

By extracting the SIP packet 5-tuple relationship between the inside and outside of the network forwarding device, grouping and establishing corresponding relationships, simulating the network environment to perform packet replay, and performing packet modification processing during the replay process to ensure accurate reproduction of the media stream.

Benefits of technology

It enables complete playback of SIP messages and media streams on network forwarding devices, accurately reproducing the on-site communication process, reducing the complexity of on-site environment setup, and improving the efficiency of problem location and troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583519B_ABST
    Figure CN119583519B_ABST
Patent Text Reader

Abstract

The present disclosure provides a SIP message playback method, comprising: according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, extracting the inside and outside message sets, grouping them respectively according to the sending and receiving directions, and establishing the correspondence relationship of the inside and outside message groups; by analyzing the original INVITE message and the corresponding original 200OK message in the inside and outside message sets, respectively determining the five-tuple relationship of the inside and outside original media streams, and accordingly extracting the original media stream messages inside and outside before playback; according to the correspondence relationship of the inside and outside message groups, alternately playing back the inside and outside message groups; by analyzing the INVITE message and the corresponding 200OK message in the inside and outside message groups after playback, respectively determining the five-tuple relationship of the inside and outside media streams after playback; according to the five-tuple relationship of the inside and outside media streams after playback, repackaging the original media stream messages inside and outside before playback, and sequentially playing back the repackaged media stream messages.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of network communication, in particular to a SIP message playback method, an electronic device, a computer readable medium, and a computer program product. BACKGROUND

[0002] SIP (Session Initiation Protocol) is an application layer control protocol, which is widely used to establish, modify and terminate multimedia sessions or conferences, such as Internet telephony. Due to its flexibility in audio and video data processing, SIP protocol is widely used in video conferencing, security and other fields.

[0003] Network forwarding device is a network security device, which is usually deployed between the internal and external networks, and filters data through the configured security policy. It can block data that does not meet the security policy, and ensure that only the filtered data is transmitted to the opposite end of the network gateway, thereby realizing the physical isolation of the internal network. In this way, the network forwarding device can effectively prevent external attackers from directly invading, attacking or damaging the internal network, and protect the security of the internal network.

[0004] When troubleshooting network problems, it is usually necessary to use network packet capture tools to capture and analyze messages on site. Especially for complex and variable network forwarding device environment, combined with the high flexibility of SIP protocol, it is particularly important to restore the on-site situation through packet capture means. However, it is usually very tedious to build an environment consistent with the on-site situation, therefore, in order to reduce the difficulty of building the on-site environment, message playback tools are usually used for simulation.

[0005] The message playback of TCP / IP protocol (four layers and below) is relatively simple, but the message playback of SIP protocol at the seventh layer, especially the message containing media stream modified by the network forwarding device, is of great difficulty. SUMMARY

[0006] The present disclosure provides a SIP message playback method, an electronic device, a computer readable medium, and a computer program product.

[0007] In a first aspect, the embodiments of the present disclosure provide a SIP message playback method, comprising: extracting an inside message set and an outside message set according to a five-tuple relationship of SIP messages to be played back inside and outside a network forwarding device, grouping the inside message set and the outside message set according to sending and receiving directions respectively, and establishing a correspondence relationship between the inside message group and the outside message group; determining a five-tuple relationship of an original media stream inside and outside the network forwarding device respectively by analyzing an original INVITE message and a corresponding original 200 OK message in the inside message set and the outside message set, and extracting original media stream messages inside and outside the network forwarding device before playback according to the five-tuple relationship; alternately playing back the inside message group and the outside message group according to the correspondence relationship between the inside message group and the outside message group in a simulated network forwarding device environment; determining a five-tuple relationship of a media stream inside and outside the network forwarding device after playback respectively by analyzing an INVITE message and a corresponding 200 OK message in the inside message group and the outside message group after playback; and repackaging the original media stream messages inside and outside the network forwarding device before playback according to the five-tuple relationship of the media stream inside and outside the network forwarding device after playback, and playing back the repackaged media stream messages in turn.

[0008] In some embodiments, extracting an inside message set and an outside message set according to a five-tuple relationship of SIP messages to be played back inside and outside a network forwarding device, grouping the inside message set and the outside message set according to sending and receiving directions respectively, and establishing a correspondence relationship between the inside message group and the outside message group comprises: extracting the inside message set and the outside message set from inside and outside SIP messages to be played back respectively according to a five-tuple relationship of SIP messages to be played back inside and outside a network forwarding device; grouping messages in the inside message set and the outside message set in turn according to continuously same sending or receiving directions until grouping of all messages is completed; and establishing a one-to-one correspondence relationship between the message groups on both sides of the network forwarding device in order.

[0009] In some embodiments, grouping messages in the inside message set and the outside message set in turn according to continuously same sending or receiving directions until grouping of all messages is completed comprises: in the inside message set or the outside message set, starting from a first message, grouping messages of continuously same direction as the direction of the first message into a first message group; grouping continuously next messages of different directions into a second message group; and grouping alternately in this way until grouping of all messages is completed.

[0010] In some embodiments, establishing a one-to-one correspondence relationship between the message groups on both sides of the network forwarding device in order comprises: establishing a correspondence relationship between a first message group of the inside message set and a first message group of the outside message set; establishing a correspondence relationship between a second message group of the inside message set and a second message group of the outside message set; and corresponding each message group in the inside message set and the outside message set in turn in this order until a one-to-one correspondence relationship of all message groups is established.

[0011] In some embodiments, the five-tuple relationship of the original media stream of the inner side and the outer side is determined respectively by analyzing the original INVITE message and the corresponding original 200 OK message in the inner side and the outer side message set, and the original media stream message of the inner side and the outer side before playback is extracted according to the five-tuple relationship, including: analyzing the original INVITE message of the inner side and the outer side, and extracting the media information of the request direction of each side respectively; analyzing the original 200 OK message corresponding to the original INVITE message of the inner side and the outer side, and extracting the media information of the response direction of each side respectively; determining the five-tuple relationship of the original media stream of the inner side and the outer side respectively based on the media information of the request and response direction of each side; and extracting the original media stream message of the inner side and the outer side before playback according to the five-tuple relationship of the original media stream of the inner side and the outer side.

[0012] In some embodiments, under the simulated network forwarding device environment, the inner side and the outer side message sets are played back alternately according to the corresponding relationship of the inner side and the outer side message sets, including: simulating the same network forwarding device environment to match the actual running environment and establish a simulated communication environment according to the configuration and network topology of the network forwarding device site; arranging the inner side and the outer side message sets alternately according to the sending and receiving order according to the corresponding relationship of the inner side and the outer side message sets, so as to realize the interactive order of request and response; and starting the playback of each message set in turn according to the arrangement order, so as to realize the playback of the SIP message; wherein, in the playback process of each message set, the network forwarding device performs packet modification processing on the received message set, and forwards the packet modified message set as the corresponding mapping message set.

[0013] In some embodiments, the five-tuple relationship of the media stream of the inner side and the outer side after playback is determined respectively by analyzing the INVITE message and the corresponding 200 OK message in the inner side and the outer side message set after playback, including: extracting the media information from the outer side INVITE message after playback, and combining the media information extracted from the outer side original 200 OK message to generate the five-tuple relationship of the media stream of the outer side after playback; extracting the media information from the inner side 200 OK message after playback, and combining the media information extracted from the inner side original INVITE message to generate the five-tuple relationship of the media stream of the inner side after playback.

[0014] In some embodiments, the original media stream message of the inner side and the outer side before playback is packet modified according to the five-tuple relationship of the media stream of the inner side and the outer side after playback, and the packet modified media stream message is played back in turn, including: packet modifying the original media stream message of the inner side before playback according to the five-tuple relationship of the media stream of the inner side after playback; packet modifying the original media stream message of the outer side before playback according to the five-tuple relationship of the media stream of the outer side after playback; and playing back the packet modified inner side and outer side media stream messages in turn according to the time order of the original media stream.

[0015] In some embodiments, before extracting the inboard and outboard message sets according to the five-tuple relationship of the inboard and outboard SIP messages to be played back inside and outside the network forwarding device, grouping them according to the sending and receiving directions respectively, and establishing the correspondence of the inboard and outboard message groups, further comprising: using a packet capture tool to obtain the inboard and outboard SIP messages to be played back inside and outside the network forwarding device.

[0016] In a second aspect, the embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a memory having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the SIP message playback method in the first aspect of the embodiments of the present disclosure.

[0017] In a third aspect, the embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, when the computer program is executed by a processor, the SIP message playback method in the first aspect of the embodiments of the present disclosure is implemented.

[0018] In a fourth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program or instructions, when the computer program or instructions are executed by a processor, the SIP message playback method in the first aspect of the embodiments of the present disclosure is implemented.

[0019] The method of the present disclosure realizes complete playback of SIP messages and media streams by simulating network forwarding device configurations consistent with actual running environments. In the playback process, the inboard and outboard SIP messages are played back in turn according to the alternating order of requests and responses, and the network forwarding device repackages and forwards the messages according to the mapping relationship. This method accurately reproduces the communication interaction process in the network environment, enabling quick positioning and troubleshooting of problems in actual operation in the experimental environment, and effectively reducing the complexity of on-site environment construction. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 Fig. 1 shows the overall deployment structure diagram of the SIP message playback tool of the embodiments of the present disclosure;

[0021] Figure 2 Fig. 2 is a flowchart of a SIP message playback method according to an embodiment of the present disclosure;

[0022] Figure 3 Fig. 3 shows a schematic diagram of message grouping and correspondence of the network forwarding device according to an embodiment of the present disclosure;

[0023] Figure 4 Fig. 4 shows a relationship diagram of SIP messages before and after playback of the network forwarding device according to an embodiment of the present disclosure;

[0024] Figure 5is a schematic diagram of an electronic device according to an embodiment of the present disclosure;

[0025] Figure 6 is a block diagram of a SIP message playback system according to an embodiment of the present disclosure;

[0026] Figure 7 shows a network topology of a SIP message playback tool according to an embodiment of the present disclosure;

[0027] Figure 8 is an example of an INVITE message inside a network forwarding device according to an embodiment of the present disclosure;

[0028] Figure 9 is an example of a 200 OK message corresponding to the INVITE message inside a network forwarding device according to an embodiment of the present disclosure;

[0029] Figure 10 is an example of an INVITE message outside a network forwarding device according to an embodiment of the present disclosure;

[0030] Figure 11 is an example of a 200 OK message corresponding to the INVITE message outside a network forwarding device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to make the skilled in the art better understand the technical solutions of the present disclosure, the technical solutions of the present disclosure are described in detail below with reference to the drawings.

[0032] In the following, example embodiments will be described more fully with reference to the accompanying drawings, in which example embodiments can be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0033] In the case of no conflict, each embodiment of the present disclosure and each feature in the embodiments can be combined with each other.

[0034] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0035] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0036] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure and will not be interpreted in an overly literal or overly formal sense unless expressly so defined herein.

[0037] In the present disclosure, the following technical terms should be understood as follows, unless otherwise specified:

[0038] SIP is an application layer control protocol used to create, modify, and terminate multimedia sessions (such as audio, video calls, and conferences) in IP networks. SIP is mainly responsible for the messaging and control of sessions.

[0039] SIP signaling refers to the message exchange process in the SIP protocol used to control and manage sessions, including the establishment, modification, and termination of sessions. SIP signaling includes various requests (such as INVITE, ACK) and response messages (such as 200 OK) used to convey connection status and session parameters.

[0040] A packet is the basic data unit transmitted in a network. A packet can be a specific control message defined by a protocol (such as a SIP INVITE or 200 OK packet) used to carry communication information or data payload.

[0041] Media stream refers to the actual audio and video data stream transmitted in a communication session, separate from the packet. Media stream is usually transmitted over UDP using RTP (Real-time Transport Protocol).

[0042] SDP (Session Description Protocol) is commonly used in SIP signaling to define the parameters of a multimedia session. SDP contains information such as IP address, port, encoding format of media stream, helping both parties to negotiate connection methods.

[0043] The five-tuple relationship is used to uniquely identify five key parameters of a network communication stream, including source IP address, destination IP address, source port, destination port, and transmission protocol (such as TCP or UDP).

[0044] Network forwarding device is a device deployed between the internal network and the external network, used to filter, forward and process data packets according to security policies. Network forwarding devices are usually used to control traffic and protect the security of the internal network, avoiding external connection intrusion that does not comply with the policy.

[0045] Packet capture is used to capture data packets transmitted in the network and save them as files for analyzing network communication. Packet capture is used to diagnose network problems and help troubleshoot SIP message and media stream transmission.

[0046] Replay refers to re-sending previously captured network packets in a test environment to simulate real communication scenarios. Replay can be used for SIP message and media stream testing to reproduce network problems or verify device behavior.

[0047] Media information is a configuration set that describes the parameters of media streams in a SIP session, including IP address, port, transmission protocol, etc. Media information is usually transmitted by SDP in SIP messages to define the connection attributes of media streams.

[0048] The present scheme aims to solve the problem of SIP message replay in the network forwarding device scenario, so as to more clearly and accurately reproduce the on-site situation and help locate and analyze network problems.

[0049] The present disclosure aims to solve the following technical problems: first, by quickly replaying the on-site packet capture data of the network forwarding device, the accurate reproduction of the interaction process of the SIP message through the network forwarding device is realized; second, the quick replay of the corresponding media stream is realized to ensure that the media stream of the SIP message after passing through the network forwarding device can be accurately reproduced.

[0050] The present disclosure provides a complete SIP protocol message replay method based on a network forwarding device. This method can quickly replay the interaction process of the SIP message on the network forwarding device and reproduce the corresponding media stream, including: message capture, capturing message data on both sides of the network forwarding device in the on-site environment; environment building, building the same local network forwarding device environment according to the configuration of the on-site network forwarding device in the experimental environment, and configuring the five-tuple filtering conditions for replay.

[0051] Through this method, the actual interaction process of the SIP protocol through the network forwarding device in the on-site environment can be accurately replayed, helping to more clearly reproduce the on-site situation and troubleshoot problems.

[0052] The following takes the overall deployment of the SIP message replay tool of Figure 1 as an example to explain the SIP message replay method provided by the embodiments of the present disclosure.

[0053] Figure 1 The overall deployment structure diagram of the SIP message replay tool of the embodiments of the present disclosure is shown.

[0054] Figure 1The basic network structure and tool configuration are shown, which are used to simulate the inside and outside environment of network forwarding equipment to test and verify the forwarding behavior of message and media stream of network forwarding equipment.

[0055] As shown in Figure 1 , the network forwarding equipment 101 is divided into inside and outside, connected to internal network and external network respectively, as the device under test. The main function of the device is to forward SIP messages and media streams from the inside to the outside, or from the outside to the inside, to verify the accuracy of its processing and forwarding.

[0056] The playback tool 102 is configured to simulate multiple inside and outside devices to realize the playback of SIP messages and media streams. The playback tool is responsible for retransmitting the captured SIP message and media stream data to the inside or outside interface of the network forwarding equipment to test the forwarding behavior and message processing capability of the device.

[0057] The playback tool 102 is used to simulate multiple inside and outside devices to realize the playback of SIP messages and media streams. The tool contains multiple simulation devices (e.g., simulated inside device 1, simulated inside device 2, simulated outside device 1, simulated outside device 2, etc.) to initiate and receive SIP messages and media streams on the inside and outside to simulate real communication scenarios. Through the multi-device configuration, the playback tool can simulate multiple sessions and concurrent connections to test the performance of the network forwarding equipment in complex environments.

[0058] Figure 1 The dashed line in indicates the separation line between the inside and outside, showing how the playback tool allocates simulated devices on the inside and outside to different interfaces of the network forwarding equipment to realize the alternate sending and receiving of messages. This structure enables the playback tool to perform SIP message playback and corresponding media stream testing between inside and outside devices.

[0059] Through the configuration of multiple simulation devices, the playback tool can perform message playback on the inside and outside of the network forwarding equipment to verify whether the processing and forwarding functions of the device meet the expectations. This deployment ensures the comprehensiveness and diversity of testing, thus more effectively evaluating the performance and stability of the network forwarding equipment.

[0060] Figure 2 is a flowchart of a SIP message playback method according to an embodiment of the present disclosure.

[0061] In a first aspect, referring to Figure 2 , the present disclosure provides a SIP message playback method, comprising:

[0062] S11, extracting the inside and outside message sets according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, and grouping them according to the sending and receiving directions respectively, and establishing the corresponding relationship of the inside and outside message groups;

[0063] S12, determining the five-tuple relationship of the inside and outside original media streams respectively by analyzing the original INVITE message and the corresponding original 200OK message in the inside and outside message sets, and extracting the inside and outside original media stream messages before playing back according to the five-tuple relationship;

[0064] S13, alternately playing back the inside and outside message groups according to the corresponding relationship of the inside and outside message groups in the simulated network forwarding device environment;

[0065] S14, determining the five-tuple relationship of the inside and outside media streams after playing back respectively by analyzing the INVITE message and the corresponding 200OK message in the inside and outside message groups after playing back;

[0066] S15, repackaging the inside and outside original media stream messages before playing back according to the five-tuple relationship of the inside and outside media streams after playing back, and playing back the repackaged media stream messages in turn.

[0067] In some embodiments, according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, the inside and outside message sets are extracted, and they are grouped according to the sending and receiving directions respectively, and the corresponding relationship of the inside and outside message groups is established, including:

[0068] According to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, the inside and outside message sets are extracted from the inside and outside SIP messages to be played back respectively;

[0069] According to the same sending or receiving direction in succession, the messages in the inside and outside message sets are grouped in turn until the grouping of all messages is completed;

[0070] The one-to-one corresponding relationship is established in order for the message groups on both sides of the network forwarding device which have been grouped.

[0071] In some embodiments, according to the same sending or receiving direction in succession, the messages in the inside and outside message sets are grouped in turn until the grouping of all messages is completed, including:

[0072] In the inside or outside message set, starting from the first message, the messages with the same direction in succession are grouped into the first message group according to their direction;

[0073] The next continuous message with different direction is grouped into the second message group;

[0074] Alternately grouping in this way until all message packets are completed.

[0075] In some embodiments, a one-to-one correspondence is established between the message groups on both sides of the network forwarding device in order, including:

[0076] The first message group of the inner message set is established in correspondence with the first message group of the outer message set;

[0077] The second message group of the inner message set is established in correspondence with the second message group of the outer message set;

[0078] According to this order, each message group in the inner and outer message sets is sequentially corresponded, until all message groups have established a one-to-one correspondence.

[0079] In the embodiments of the present disclosure, based on the five-tuple relationship of the SIP messages on both sides of the network forwarding device, message sets are extracted from the packet capture files on both sides of the network forwarding device, for example, referred to as inner message set A and outer message set B.

[0080] In the embodiments of the present disclosure, the inner message set A and the outer message set B are grouped according to the sending and receiving directions, specifically,

[0081] In the inner message set A, the first message is in the sending direction, starting from the first message, all messages in the sending direction are sequentially searched and grouped into A1 message group, until the first message in the receiving direction is encountered; the consecutive messages in the receiving direction are grouped into A2 message group. Alternately, the grouping sequence of A1, A2, A3…… is formed, ensuring that the directions of the messages in each group are consistent, and the sending and receiving directions are alternated between the message groups;

[0082] In the outer message set B, the same method is used for grouping, starting from the first message, the consecutive messages in the same direction are grouped into B1 message group, and the consecutive messages in different directions are grouped into B2 message group, sequentially forming the grouping sequence of B1, B2, B3……, and the sending and receiving directions are alternated between the message groups;

[0083] Through such grouping, the inner and outer message sets are alternately arranged according to the sending and receiving directions, forming a simple structure and clear directionality grouping.

[0084] In the embodiments of the present disclosure, according to the transmission logic of the network forwarding device, the correspondence between the inner message group A and the outer message group B is established, for example, the A1 message group on the inner side corresponds to the B1 message group on the outer side after passing through the network forwarding device; the B2 message group on the outer side is mapped to the A2 message group on the inner side as the response of A1 after passing through the network forwarding device. According to this correspondence rule, A1 group and B1 group, A2 group and B2 group are alternately corresponded.

[0085] This packet direction-based grouping and one-to-one mapping of the two sides of the message group solves the complexity of processing individual messages one by one, and is compatible with special or abnormal message order; through message set extraction, direction grouping and the establishment of the corresponding relationship, the message playback process is automated and structured, avoiding the tedious operation of manually extracting and arranging messages.

[0086] Figure 3 The schematic diagram of the message grouping and the corresponding relationship of the network forwarding device of the embodiment of the present disclosure is shown. In the figure, the network forwarding device is taken as the boundary, the left side is the inside message (client A perspective), and the right side is the outside message (client B perspective), reflecting the message interaction of the inside and outside.

[0087] On the inside, the message groups are arranged in the order of "send-receive-send-receive" and numbered as A1, A2, A3,..., for example, A1 group represents a plurality of continuous sending messages, and A2 group represents a plurality of continuous receiving messages. The direction of the outside message corresponds to the inside message group, arranged in the order of "receive-send-receive-send" and numbered as B1, B2, B3,..., for example, B1 group is the receiving message group corresponding to A1, and B2 group is the sending message group corresponding to A2.

[0088] This grouping method forms a one-to-one correspondence between the inside and outside messages through the network forwarding device. For example, A1 (sending message group) corresponds to B1 (receiving message group), indicating that the sending message of A1 becomes the receiving message of B1 after passing through the network forwarding device; A2 (receiving message group) corresponds to B2 (sending message group), indicating that the message received by A2 corresponds to the message sent by B2. This correspondence ensures that the message flow on both sides of the network forwarding device is consistent, simulating the interaction logic between the inside and outside devices in actual communication.

[0089] Through this message grouping and mapping, Figure 3 The alternation and correspondence of the inside and outside messages of the network forwarding device are shown, effectively handling complex protocol interaction situations, making the message playback process smoother, and being compatible with abnormal or special message situations.

[0090] In some embodiments, by analyzing the original INVITE message and the corresponding original 200 OK message in the inside and outside message sets, the five-tuple relationship of the inside and outside original media streams is determined respectively, and the original media stream messages of the inside and outside before playback are extracted accordingly, including:

[0091] The original INVITE messages on the inside and outside are analyzed, and the media information of the request direction on each side is extracted;

[0092] The original 200 OK messages corresponding to the original INVITE messages on the inside and outside are analyzed, and the media information of the response direction on each side is extracted;

[0093] determine the five-tuple relationship of the media stream of the inner side and the outer side respectively based on the media information of the request and the response direction of each side;

[0094] extract the inner and outer side original media stream messages before playback according to the five-tuple relationship of the inner side and the outer side original media stream.

[0095] In the embodiments of the present disclosure, by analyzing the INVITE and the corresponding 200OK messages in the SIP messages in the packet capture files of the inner side and the outer side of the network forwarding device respectively, the media stream information of each corresponding call is extracted, the identifier (CALL_ID) of each call and the five-tuple information of the corresponding negotiated media stream are recorded, and the specific steps are as follows:

[0096] i. Analyze the original INVITE signaling of the inner side and the outer side, and extract the media information of the request direction of the media stream of each corresponding call on each side, including IP address, media port and transmission protocol;

[0097] ii. Analyze the original 200OK message corresponding to the original INVITE signaling of the inner side and the outer side, and extract the media information of the response direction of each side, including IP address, media port and transmission protocol;

[0098] iii. Based on the media information of the request and the response direction of the inner side and the outer side, the five-tuple relationship of the media stream of the inner side and the outer side is determined, including source address, source port, protocol type, destination address and destination port;

[0099] iv. According to the five-tuple relationship of the media stream of the inner side and the outer side, the original media stream information of the inner and outer side before playback is extracted.

[0100] By analyzing the SIP signaling of the inner side and the outer side, the five-tuple relationship of the call media stream of each side is extracted, which prepares for the playback of the media stream described by the signaling.

[0101] In some embodiments, in the simulated network forwarding device environment, the inner side and the outer side message groups are alternately played back according to the corresponding relationship of the inner side and the outer side message groups, including:

[0102] According to the configuration and network topology of the network forwarding device on site, the same network forwarding device environment is simulated to match the actual running environment and establish a simulated communication environment;

[0103] According to the corresponding relationship of the inner side and the outer side message groups, the inner side and the outer side message groups are alternately arranged in the order of sending and receiving to realize the interactive order of request and response;

[0104] Start the playback of each message group in turn according to the arrangement order to realize the playback of the SIP message.

[0105] In the playback process of each message group, the network forwarding device performs packet modification processing on the received message group and forwards the modified message group as a corresponding mapping message group.

[0106] In an embodiment of the present disclosure, by alternately playing back the message groups on the inside and outside in the simulated network forwarding device environment according to the correspondence between the inside and outside message groups, the specific steps are as follows:

[0107] According to the configuration and network topology of the network forwarding device on site, a simulated communication environment matching the actual operating environment is established to ensure that the messages can flow along the same path on the simulated network forwarding device in the playback process, simulating the real network data flow direction; without a real audio and video system, the on-site environment simulation can be completed; for example, the IP addresses of the client A, the proxy server and the client B are configured to simulate the client A, the proxy server and the client B.

[0108] According to the correspondence between the inside and outside message groups extracted previously, the message groups are alternately arranged in the order of sending and receiving; for example, the message group A1 is a sending message, and then B1 is the mapping message group after A1 is forwarded by the network forwarding device; according to the arrangement, B2 is the reply message group corresponding to B1; A2 is the reply message group after B2 replies to B1 and is forwarded by the network forwarding device, and so on; this order ensures that the correspondence between each message group on both sides of the network forwarding device can be maintained, and the sending and receiving alternation logic is realized.

[0109] According to the arrangement order, the playback of each message group is started in turn; when a message group is played back, the network forwarding device receives and processes the message group, performs packet modification processing (such as port modification) on it, and forwards the modified message group as a corresponding mapping message group; for example, by playing back the message group A1 to the network forwarding device, the network forwarding device receives the message group and forwards it to the corresponding mapping message group B1' (which is a message after playback, possibly modified by the network forwarding device, and B1' after playback may be different from the original captured B1), receives and analyzes the B1' message; the message group B2 is played back to the network forwarding device, and the network forwarding device forwards the B2 message group to A2' (which is a message after playback, possibly modified by the network forwarding device, and not exactly the same as the original captured A2), receives and analyzes the A2' message group; according to the above logic, all message groups are played back in turn to complete the SIP message playback process; the entire playback process generates a message sequence, such as A1, B1', B2, A2', A3, B3', B4, A4', etc.; each message after playback (such as B1', A2', etc.) may be different from the original message due to modification by the network forwarding device.

[0110] Through the above steps, the alternate playback of the SIP message in the simulation environment is realized, ensuring that the request and response order of both sides of the device is maintained, and the repackaging behavior of the network forwarding device to the message is compatible, so that the playback process is closer to the communication situation in the actual network.

[0111] In some embodiments, by analyzing the INVITE message and the corresponding 200 OK message in the playbacked inner side and outer side message groups, the five tuple relationship of the media stream of the playbacked inner side and outer side is determined, including:

[0112] The media information is extracted from the playbacked outer side INVITE message, and combined with the media information extracted from the outer side original 200 OK message, to generate the five tuple relationship of the media stream of the playbacked outer side;

[0113] The media information is extracted from the playbacked inner side 200 OK message, and combined with the media information extracted from the inner side original INVITE message, to generate the five tuple relationship of the media stream of the playbacked inner side.

[0114] In the embodiments of the present disclosure, according to the SIP message played back through the network forwarding device, the five tuple relationship of the media stream after playback is determined, and the specific steps are as follows:

[0115] i. Analyze the playbacked outer side INVITE (B1') message, extract the media information in the SDP information of the message, including the IP address of the media stream, the port of the media stream and the transmission protocol of the media stream; combine the media information of the playbacked INVITE (B1') message (i.e. the INVITE (B1') message sent by the client A and forwarded to the outer side through the network forwarding device) and the media information in the outer side original 200 OK (B2) message corresponding thereto, to generate the five tuple information M1 of the outer side media stream after playback;

[0116] For example, the playbacked outer side five tuple M1 includes the media IP, port, transmission protocol in the INVITE (B1') message, and the media IP, port, transmission protocol in the outer side 200 OK (B2) message. Compared with the original outer side five tuple, the information in the INVITE (B1') is used to replace the information in the original INVITE (B1) in the playbacked five tuple.

[0117] ii. Analyze the SDP information of the playbacked 200 OK (A2') message corresponding to the INVITE, extract the media information of the corresponding call, including the IP address of the media stream, the port of the media stream and the transmission protocol of the media stream; combine the media information in the original INVITE (A1) message and the media information in the playbacked 200 OK (A2') message, to generate the five tuple information M2 of the inner side media stream after playback;

[0118] For example, the playbacked inner quintuple M2 includes the media IP, port, and transmission protocol in the INVITE (A1) and the media IP, port, and transmission protocol in the 200 OK (A2').

[0119] In some embodiments, according to the quintuple relationship of the playbacked inner and outer media streams, the original media stream packets before playback are repackaged, and the repackaged media stream packets are played back in sequence, comprising:

[0120] According to the quintuple relationship of the playbacked inner media stream, the original inner media stream packets before playback are repackaged;

[0121] According to the quintuple relationship of the playbacked outer media stream, the original outer media stream packets before playback are repackaged;

[0122] According to the time sequence of the original media stream, the repackaged inner and outer media stream packets are played back in sequence.

[0123] In embodiments of the present disclosure, according to the quintuple relationship of the playbacked inner and outer media streams, the original media stream packets before playback are repackaged and played back to reproduce the complete session process. The specific steps are as follows:

[0124] On the inner side of the network forwarding device, according to the call ID, the inner original stream (i.e., the original stream without playback) associated with the call is found, and is repackaged and sent according to the quintuple information M2 after playback on the inner side, completing the playback of the inner media stream;

[0125] On the outer side of the network forwarding device, according to the call ID, the outer original stream (i.e., the original stream without playback) associated with the call is found, and is repackaged and sent according to the quintuple information M1 after playback on the outer side, completing the playback of the outer media stream.

[0126] In embodiments of the present disclosure, through the respective playback of the inner and outer media streams, the repackaging process is completed based on the quintuple relationship of M1 and M2, and the complete session of SIP packets and media streams is reproduced. The playback of SIP packets provides the reproduction of the signaling flow, and the playback of media streams ensures the reproduction of the actual session data stream.

[0127] In some embodiments, before extracting the inner and outer message sets according to the quintuple relationship of the SIP packets to be played back on the inner and outer sides of the network forwarding device, grouping them in the sending and receiving directions respectively, and establishing the correspondence between the inner and outer message groups, further comprising:

[0128] Using a packet capture tool, the inner and outer SIP packets to be played back on the inner and outer sides of the network forwarding device are obtained.

[0129] In the embodiments of the present disclosure, the SIP messages that need to be played back on the inside and outside of the network forwarding device are captured respectively, and are saved as an inside packet capture file and an outside packet capture file respectively.

[0130] Figure 4 A relationship diagram of the SIP messages on both sides of the network forwarding device before and after playback is shown.

[0131] As shown in Figure 4 , the inside 401 before playback represents the SIP messages on the inside of the network forwarding device in the original communication, that is, the "inside before playback" state;

[0132] For example, INVITE (A1) is a call request sent by the client A; 200 OK (A2) is a confirmation reply to the request by the client B.

[0133] The outside 402 before playback represents the SIP messages on the outside of the network forwarding device in the original communication, that is, the "outside before playback" state;

[0134] For example, INVITE (B1) is a mapping request generated after the network forwarding device forwards the INVITE (A1) to the outside; 200 OK (B2) is a confirmation reply to the INVITE (B1) by the external network.

[0135] The inside 403 after playback represents the SIP messages generated on the inside during the playback, that is, the "inside after playback" state;

[0136] For example, 200 OK (A2') is a mapping reply message generated after the network forwarding device forwards the 200 OK (B2) back to the inside during the playback.

[0137] The outside 404 after playback represents the SIP messages generated on the outside during the playback, that is, the "outside after playback" state;

[0138] For example, INVITE (B1') is a request message generated after the network forwarding device forwards the INVITE (A1) to the outside during the playback.

[0139] Figure 4 The mapping relationship between the original state and the state after playback of the SIP messages in the presence of the network forwarding device is described. During the playback, the network forwarding device can perform secondary processing on the messages to generate mapping messages (for example, A2' and B1') with forwarding characteristics, thereby completing the complete call process simulation and playback.

[0140] Figure 5 is a composition diagram of an electronic device according to an embodiment of the present disclosure.

[0141] In a second aspect, referring to Figure 5 The electronic device provided by the embodiments of the present disclosure includes:

[0142] one or more processors 501;

[0143] a memory 502, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the SIP message playback method in the first aspect of the embodiments of the present disclosure;

[0144] one or more I / O interfaces 503 connected between the processor and the memory, configured to realize the information interaction of the processor and the memory.

[0145] The processor 501 is a device with data processing capability, including but not limited to a central processing unit (CPU) and the like; the memory 502 is a device with data storage capability, including but not limited to a random access memory (RAM, more specifically SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), and a flash memory (FLASH); the I / O interface (read-write interface) 503 is connected between the processor 501 and the memory 502, and can realize the information interaction of the processor 501 and the memory 502, including but not limited to a data bus (Bus) and the like.

[0146] In some embodiments, the processor 501, the memory 502, and the I / O interface 503 are connected to each other through a bus 504, and further connected to other components of the computing device.

[0147] In a third aspect, the embodiments of the present disclosure provide a computer readable medium, on which a computer program is stored, and the program is executed by a processor to implement the SIP message playback method in the first aspect of the embodiments of the present disclosure.

[0148] In a fourth aspect, the embodiments of the present disclosure provide a computer program product, including a computer program or instructions, which are executed by a processor to implement the SIP message playback method in the first aspect of the embodiments of the present disclosure.

[0149] Figure 6 is a block diagram of a SIP message playback system according to the embodiments of the present disclosure.

[0150] In a fifth aspect, referring to Figure 6 The SIP message playback system provided by the embodiments of the present disclosure includes:

[0151] The message grouping module 601 is configured to extract the inside and outside message sets according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, group the inside and outside message sets according to the sending and receiving directions respectively, and establish the correspondence between the inside and outside message groups.

[0152] The original media stream extraction module 602 is configured to determine the five-tuple relationship of the inside and outside original media streams respectively by analyzing the original INVITE message and the corresponding original 200 OK message in the inside and outside message sets, and extract the original media stream messages inside and outside before playback according to the five-tuple relationship.

[0153] The message playback module 603 is configured to alternately play back the inside and outside message groups according to the correspondence between the inside and outside message groups in the simulated network forwarding device environment.

[0154] The five-tuple relationship determination module 604 is configured to determine the five-tuple relationship of the inside and outside media streams after playback by analyzing the INVITE message and the corresponding 200 OK message in the inside and outside message groups after playback.

[0155] The media stream playback module 605 is configured to repack the original media stream messages inside and outside before playback according to the five-tuple relationship of the inside and outside media streams after playback, and sequentially play back the repacked media stream messages.

[0156] In some embodiments, the message grouping module 601 comprises:

[0157] The message set extraction module is configured to extract the inside and outside message sets from the inside and outside SIP messages to be played back respectively according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device.

[0158] The grouping module is configured to group the messages in the inside and outside message sets according to the same sending or receiving direction in sequence until the grouping of all messages is completed.

[0159] The correspondence establishment module is configured to establish a one-to-one correspondence between the message groups on both sides of the network forwarding device in sequence.

[0160] In some embodiments, the original media stream extraction module 602 comprises:

[0161] The request direction media information extraction module is configured to analyze the original INVITE message inside and outside, and extract the media information of the request direction of each side respectively.

[0162] The response direction media information extraction module is configured to analyze original 200 OK messages corresponding to the original INVITE messages on the inner side and the outer side, and extract media information of the response direction on each side respectively;

[0163] The playback five tuple relationship determination module is configured to determine five tuple relationships of the original media streams on the inner side and the outer side respectively based on the media information of the request and response directions on each side.

[0164] The playback media stream message extraction module is configured to extract the original media stream messages on the inner side and the outer side before playback respectively according to the five tuple relationships of the original media streams on the inner side and the outer side.

[0165] In some embodiments, the message playback module 603 comprises:

[0166] The simulation environment configuration module is configured to simulate the same network forwarding device environment to match the actual running environment and establish a simulation communication environment according to the configuration and network topology of the network forwarding device on site.

[0167] The arrangement module is configured to arrange the message groups on the inner side and the outer side alternately according to the sending and receiving order to realize the interaction order of the request and the response.

[0168] The message group playback module is configured to start the playback of each message group in turn according to the arrangement order to realize the playback of the SIP messages.

[0169] In the playback process of each message group, the network forwarding device performs repackaging processing on the received message group, and forwards the repackaged message group as the corresponding mapping message group.

[0170] In some embodiments, the playback five tuple relationship determination module 604 comprises:

[0171] The outer side five tuple relationship generation module is configured to extract media information from the outer side INVITE message after playback, and generate the five tuple relationship of the media stream on the outer side after playback in combination with the media information extracted from the outer side original 200 OK message.

[0172] The inner side five tuple relationship generation module is configured to extract media information from the inner side 200 OK message after playback, and generate the five tuple relationship of the media stream on the inner side after playback in combination with the media information extracted from the inner side original INVITE message.

[0173] In some embodiments, the media stream playback module 605 comprises:

[0174] The inner side repackaging module is configured to perform repackaging on the original media stream message on the inner side before playback according to the five tuple relationship of the media stream on the inner side after playback.

[0175] The outside repackaging module is configured to repack the outside original media stream message before playback according to the quintuple relationship of the outside played-back media stream.

[0176] The playback module is configured to sequentially play back the repackaged inside and outside media stream messages in the time sequence of the original media stream.

[0177] In some embodiments, the SIP message playback system further comprises:

[0178] The SIP message acquisition module acquires the inside SIP message and the outside SIP message to be played back using a packet capturing tool.

[0179] In order for those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the SIP message playback method provided by the embodiments of the present disclosure is described in detail below through specific embodiments:

[0180] Embodiment One

[0181] The SIP message playback method of the present disclosure can be applied in VoIP communication, unified communication system, video conference and the like.

[0182] It is assumed that the side where the client A is located is the inside of the network forwarding device, and the other side is the outside of the network forwarding device. The network topology relationship of Figure 7 is taken as an example to describe the playback process.

[0183] Figure 7 The network topology structure of the SIP message playback tool of the embodiments of the present disclosure is shown, and the message transmission process between the network forwarding device and the simulated SIP client and the SIP proxy server is described.

[0184] As shown in Figure 7 , the central network forwarding device connects two network areas: the inside network (IP address is 192.168.40.121) and the outside network (IP address is 11.0.0.121). The network forwarding device is responsible for forwarding SIP message and media stream between the inside and outside networks, and realizes the communication and interaction between the inside and outside networks.

[0185] The message playback tool simulates the playback of SIP messages and media streams to test the functionality of network forwarding devices. Specifically, it includes: a simulated SIP client A (IP address 192.168.40.98) located on the internal network, used to send SIP requests; a simulated SIP proxy server (IP address 11.0.0.3) located on the external network, used to process and forward SIP requests; and a simulated SIP client B (IP address 11.0.0.101) located on the external network, used to receive SIP responses. By replaying messages and media streams, the functional performance of network forwarding devices in real-world communication scenarios can be verified to ensure they meet expected behavior.

[0186] Figure 7 The playback process is shown as follows:

[0187] 1) On-site packet capture

[0188] Use a packet capture tool (for example, Wireshark) to capture the SIP packets at the internal network port of the network forwarding device (IP address 192.168.40.121) and save the captured SIP packets as a file named sip_int.pcap.

[0189] At the same time, use a packet capture tool (for example, Wireshark) to capture packets at the external network port of the network forwarding device (IP address 11.0.0.121) and save the captured SIP packets as a file named sip_ext.pcap.

[0190] Start the call process of the SIP client and ensure that all SIP messages during the call process are recorded in the aforementioned packet capture file to serve as the basic data for subsequent playback of the SIP session.

[0191] 2) Configuration restoration of network forwarding equipment

[0192] Export the configuration information of the current on-site network forwarding equipment, including key information such as network configuration and access control policies, to prepare for the subsequent restoration of the on-site environment;

[0193] Prepare the same network forwarding equipment as on-site in the test environment and import the on-site configuration into the equipment. This process can accurately restore the on-site network topology and policy configuration, ensuring consistency with the actual communication environment recorded in the packet capture file, thereby providing accuracy guarantee for subsequent SIP message playback.

[0194] 3) Filter and group the captured files by five tuples

[0195] i. Filter the packet capture file sip_int.pcap of the internal network port of the network forwarding device (IP address: 192.168.40.121) according to the five-tuple to extract the internal SIP message;

[0196] For example, suppose the source address of a SIP message is 192.168.40.98, the source port is 5060, and the destination address is 192.168.40.121, and the destination port is 5060. Based on the five-tuple information of this SIP message, the qualified messages are filtered out and arranged in order. The filtered messages are divided into two categories: request messages (192.168.40.98:5060→192.168.40.121:5060) and reply messages (192.168.40.121:5060→192.168.40.98:5060). In this way, the SIP messages arranged in order are obtained.

[0197] ii. Group the packets filtered by the five-tuple according to the request and response directions. The specific grouping method is to group consecutive packets in the same direction as a group, and the grouping sequence number starts from 1. For example, the packet grouping results of sip_int.pcap are as follows: Group 1: contains request direction packets, such as 1. INVITE packet; Group 2: contains multiple reply direction packets, such as 2.100 Trying, 3.180 Ringing, 4.200 OK; Group 3: contains subsequent request packets, such as 5. ACK;

[0198] iii. Perform quintuple filtering on the packet capture file sip_ext.pcap of the external network port of the network forwarding device (IP address: 11.0.0.121) to extract the external SIP message;

[0199] For example, suppose the source address of a SIP message is 11.0.0.121, the source port is 5060, and the destination address is 11.0.0.3, with a destination port of 5060. Messages that meet these conditions are filtered out and sorted in order. Similarly, the filtered messages are divided into request messages (11.0.0.121:5060→11.0.0.3:5060) and reply messages (11.0.0.3:5060→11.0.0.121:5060).

[0200] iv. Group the filtered outer messages according to the request and response directions in the same way as the inner file, that is, consecutive messages in the same direction are grouped together, and the grouping sequence starts from 1; for example, the message results after sip_ext.pcap grouping are as follows: Group 1: contains messages in the request direction, such as 1. INVITE message; Group 2: contains multiple messages in the reply direction, such as 2.100 Trying, 3.180 Ringing, 4.200 OK; Group 3: contains subsequent request messages, such as 5. ACK.

[0201] The above steps arrange and group the inner and outer SIP messages according to the request and reply direction by quintuple filtering and grouping, to form a clear message sequence. The grouped data provides a structured basis for subsequent SIP playback operation, ensuring that the order and direction of the request and response are consistent with the original communication.

[0202] 4) Extract the quintuple relationship of the media stream according to the SDP information of the SIP message before playback, specifically, extract the quintuple relationship of the media stream from the SDP information in the INVITE and corresponding 200 OK messages.

[0203] Before analyzing the media information in the SIP message, first understand the basic fields of the SDP protocol, because the body part of the SIP message is in SDP format; in the format of the SDP protocol, each line of text contains a "key = value" pair to define the attributes of the media stream. Here, the "=" symbol is used to separate the attribute name (key) and attribute value (value) of this line, for example, c = IN IP4 192.168.40.98, where c represents the connection address, and the value is IN IP4 192.168.40.98, meaning that the session is on an IPv4 network, and the IP address is 192.168.40.98; m = video 5006 RTP / AVP 96, where m represents the media stream information, and the value is video (video stream), 5006 (port number), RTP / AVP 96 (transmission protocol and encoding), which helps to identify and extract the key information of the media stream.

[0204] i. Obtain the quintuple relationship of the inner media stream: find the corresponding INVITE and 200 OK messages from the inner packet capture file sip_int.pcap; each session contains a unique CALL_ID, in this example, the CALL_ID is 0ae8359546a65faab6661b97fa2d7bca@0:0:0:0:0:0:0:0; this CALL_ID is used to uniquely identify a group of related INVITE and 200 OK messages, ensuring that the same session is analyzed;

[0205] Analyze the SDP information in the inner INVITE message before playback to obtain the media information of the call direction;

[0206] For example, according to the INVITE message example in the network forwarding device as shown in Figure 8 , the media information of the call direction includes: media source address, 192.168.40.98; media stream port, 5006; transmission protocol, UDP;

[0207] Analyzing the playback pre-INVITE message corresponding to the playback pre-200 OK message inside the network forwarding device, the media information of the reply direction is obtained;

[0208] For example, according to the 200 OK message corresponding to the INVITE message inside the network forwarding device as shown in the table, the media information of the reply direction with the same CALL_ID 0ae8359546a65faab6661b97fa2d7bca@0:0:0:0:0:0:0:0 includes: the reply media address, 192.168.40.121; the media stream port, 29064; the transmission protocol, UDP. Figure 9

[0209] According to the media information inside the network forwarding device before playback obtained from the INVITE and the 200 OK message corresponding to the INVITE, the five-tuple relationship of the media stream before playback inside the network forwarding device is as follows: the UDP media stream of 192.168.40.98:5006←→192.168.40.121:29064.

[0210] ii. Obtain the five-tuple relationship of the media stream before playback outside: find the INVITE and 200 OK messages corresponding to the same CALL_ID from the outside packet capture file sip_ext.pcap; in this example, the CALL_ID is 0ae8359546a65faab6661b97fa2d7bca@0:0:0:0:0:0:0:0.

[0211] Extract the media information of the call direction from the playback pre-INVITE message outside the same CALL_ID.

[0212] For example, according to the INVITE message outside the network forwarding device as shown in the table, the media information of the call direction with the same CALL_ID includes: the media source address, 11.0.0.121; the media stream port, 22434; the transmission protocol, UDP. Figure 10 Analyzing the 200 OK message corresponding to the INVITE outside the network forwarding device before playback, the media information of the reply direction is obtained.

[0213] For example, according to the 200 OK message corresponding to the INVITE message outside the network forwarding device as shown in the table, the media information of the reply direction with the same CALL_ID includes: the media address, 11.0.0.101; the media stream port, 5000; the transmission protocol, UDP.

[0214] Figure 11

[0215] ​​​According to the outside media information before playback obtained from the INVITE and the 200 OK message corresponding to the INVITE, the quintuple relationship of the media stream before playback outside the network forwarding device is as follows: UDP media stream of 11.0.0.121:22434←→11.0.0.101:5000.

[0216] iii. Generating the media stream mapping relationship: finally, according to the quintuple relationship of the media stream before playback inside and outside the network forwarding device, the quintuple mapping relationship of the media stream inside and outside the network forwarding device with the same CALL_ID is generated as follows:

[0217] Inside the network forwarding device: 192.168.40.98:5006←→192.168.40.121:29064

[0218] Outside the network forwarding device: 11.0.0.121:22434←→11.0.0.101:5000

[0219] The above operations complete the mapping of the media stream inside and outside, and provide accurate quintuple relationship of the media stream for subsequent network data playback. These information will be used to accurately replay the media stream data to ensure the reproduction of the original communication process.

[0220] 5) Completing the playback of the SIP message through the network forwarding device;

[0221] i. Configuring the IP address of the simulation device, in the SIP session playback environment, configuring each device to simulate different roles, for example, configuring the device IP as 192.168.40.98 to simulate the SIP client A; configuring the IP as 11.0.0.3 to simulate the SIP proxy server; configuring the IP as 11.0.0.101 to simulate the SIP client B;

[0222] ii. Determining the grouping relationship of the SIP message;

[0223] According to the analysis result of step 3), the SIP messages inside and outside the network forwarding device have been grouped as: group 1, INVITE message; group 2, 100 Trying, 180 Ringing, 200 OK message; group 3, ACK message; these groups correspond one by one inside and outside the network forwarding device. For example, the message of group 1 inside passes through the network forwarding device, and the corresponding message is the message of group 1 outside; after receiving the message of group 1 outside, the message of group 2 is sent, and after passing through the network forwarding device, the corresponding message is the message of group 2 inside.

[0224] iii. The playback process of the SIP message only needs to playback the sending message corresponding to the network forwarding device side, and receive the corresponding message forwarded by the network forwarding device on the other side;

[0225] For example, the inner side sends group 1, and the outer side collects group 1 messages through the network forwarding device; the outer side sends group 2 messages, and the inner side collects group 2 messages after passing through the network forwarding device. In this way, the SIP signaling is completed, and the playback through the network forwarding device. For the playback of the media stream corresponding to the SIP signaling, only the corresponding media stream relationship is extracted according to the playback signaling after passing through the network forwarding device when the SIP signaling is played back, and the playback can be performed.

[0226] 6) playing back the media stream corresponding to the SIP message through the network forwarding device;

[0227] i. According to the outer side INVITE message after playback and the original 200OK message, the five tuple relationship of the outer side media stream is determined to obtain the key information required for the media stream playback of the outer side;

[0228] For example, on the outer side of the network forwarding device, the INVITE message forwarded from the inner side is received; the received INVITE message has been repackaged by the network forwarding device, and is similar to the original INVITE message analyzed in step 4), but after the device repackaging, the media port has changed, for example, it is assumed that the original port 22434 is modified to 32434;

[0229] When the outer side device receives this repackaged INVITE message, the repackaged INVITE message is associated with the original 200OK message, and the five tuple relationship of the outer side media stream is determined to be 11.0.0.121:32434(UDP)←→11.0.0.101:5000(UDP).

[0230] ii. According to the inner side 200OK message after playback and the original INVITE message, the five tuple relationship of the inner side media stream is determined to obtain the key information required for the media stream playback of the inner side;

[0231] For example, on the inner side of the network forwarding device, the 200OK message forwarded from the outer side is received; at this time, the received 200OK message has been repackaged by the network forwarding device, and is similar to the original 200OK message analyzed in step 4), but after the network forwarding device repackaging, the media port has changed, for example, it is assumed that the original port 29064 is modified to 39064;

[0232] When the inner side device receives this repackaged 200OK message, the repackaged 200OK message is associated with the original INVITE message, and the five tuple relationship of the inner side media stream is determined to be 192.168.40.98:5006(UDP)←→192.168.40.121:39064(UDP).

[0233] iii. play back the media stream;

[0234] Based on the call identifier of CALL_ID being 0ae8359546a65faab6661b97fa2d7bca@0:0:0:0:0:0:0:0, the five-tuple relationship of the media stream before playback is determined first:

[0235] Inside the network forwarding device: 192.168.40.98:5006←→192.168.40.121:29064

[0236] Outside the network forwarding device: 11.0.0.121:22434←→11.0.0.101:5000

[0237] Using the same CALL_ID, the five-tuple relationship of the media stream after playback is determined:

[0238] Inside the network forwarding device: 192.168.40.98:5006(UDP)←→192.168.40.121:39064(UDP)

[0239] Outside the network forwarding device: 11.0.0.121:32434(UDP)←→11.0.0.101:5000(UDP)

[0240] According to the five-tuple relationship of the media stream before playback, the original media stream content that needs to be played back is identified, and then the original media stream content is repackaged and played back according to the five-tuple relationship of the media stream after playback, so as to complete the playback of the corresponding media stream.

[0241] The method of the present disclosure ensures that the SIP message playback process can be performed in an environment consistent with the live environment, facilitating operations such as fault diagnosis, compatibility testing, and performance analysis.

[0242] The key points of the technology of the present disclosure include: filtering, extracting, grouping, signaling and media flow association, and playback of two groups of original SIP messages on both sides of the network forwarding device by using two packet capture files captured on both sides of the network forwarding device; capturing the newly generated SIP signaling and media flow after the playback of the network forwarding device, extracting the signaling and media flow information again, and associating them with the original media flow. According to the new signaling description information after the repackaging, the original media flow is repackaged to match the new SIP signaling and media flow relationship. Finally, the repackaged media flow is played back to reproduce the repackaged media flow data transmission process. According to the new message description information, the original media flow is repackaged and played back, thereby realizing the complete scene of simulating multiple SIP clients and SIP proxy servers interacting through the network forwarding device on a single device. The method realizes the complete message playback process of simulating multiple SIP clients and SIP proxy servers interacting through the network forwarding device on a single device. The method not only can playback the interaction process of SIP messages on the network forwarding device, but also can synchronize the playback of the corresponding media flow.

[0243] In order to solve the deficiencies of the prior art, the present application aims to solve the following technical problems:

[0244] The SIP protocol messages passing through the network forwarding device are completely played back. The method can reproduce the interaction process of SIP messages on the network forwarding device and can synchronize the playback of the corresponding media flow.

[0245] The main technical effects of the present disclosure are as follows:

[0246] The playback of SIP protocol messages on the network forwarding device is realized. Through this method, the actual environment of the network forwarding device can be conveniently restored, debugging and problem positioning are supported, and the complexity of building a field environment is saved.

[0247] Those of ordinary skill in the art will realize and understand that all or some of the steps in the methods disclosed above and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. Furthermore, it is common knowledge to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.

[0248] Example embodiments have been disclosed herein and, although the use of specific terms is expressly used herein, they are intended in a generic sense only and are not intended to limit the scope of the present disclosure. In some instances, it will be apparent to those skilled in the art that features, characteristics or / and elements described in connection with a particular embodiment can be used in conjunction with other embodiments unless otherwise explicitly stated. As such, those skilled in the art will appreciate that various changes can be made in form and detail without departing from the scope of the disclosure as set forth in the appended claims.

Claims

1. A SIP message playback method, comprising: extracting the inside and outside message sets according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, grouping them respectively according to the sending and receiving directions, and establishing the correspondence of the inside and outside message groups; determining the five-tuple relationship of the inside and outside original media streams respectively by analyzing the original INVITE message and the corresponding original 200 OK message in the inside and outside message sets, and extracting the original media stream messages inside and outside before playback according to the five-tuple relationship; alternately playing back the inside and outside message groups according to the correspondence of the inside and outside message groups in the simulated network forwarding device environment; determining the five-tuple relationship of the media streams inside and outside after playback respectively by analyzing the INVITE message and the corresponding 200 OK message in the inside and outside message groups after playback; repacking the original media stream messages inside and outside before playback according to the five-tuple relationship of the media streams inside and outside after playback, and playing back the repacked media stream messages in turn.

2. The SIP message playback method of claim 1, wherein, extracting the inside and outside message sets according to the five-tuple relationship of the SIP messages to be played back inside and outside the network forwarding device, grouping them respectively according to the sending and receiving directions, and establishing the correspondence of the inside and outside message groups, comprising: extracting the inside and outside message sets from the inside and outside SIP messages to be played back respectively according to the five-tuple relationship of the SIP messages inside and outside the network forwarding device; grouping the messages in the inside and outside message sets in turn according to the same sending or receiving direction until the grouping of all messages is completed; establishing a one-to-one correspondence of the message groups on both sides of the network forwarding device in order.

3. The SIP message playback method of claim 2, wherein, grouping the messages in the inside and outside message sets in turn according to the same sending or receiving direction until the grouping of all messages is completed, comprising: in the inside or outside message set, starting from the first message, grouping the messages with the same direction successively into the first message group according to their direction; grouping the next continuous messages with different directions into the second message group; alternately grouping in this way until all messages are grouped.

4. The SIP message playback method of claim 3, wherein, establishing a one-to-one correspondence of the message groups on both sides of the network forwarding device in order, comprising: establishing a correspondence between the first message group of the inside message set and the first message group of the outside message set; establishing a correspondence between the second message group of the inside message set and the second message group of the outside message set; corresponding to each message group in the inside and outside message sets in turn in this order until all message groups have established a one-to-one correspondence.

5. The SIP message playback method of claim 4, wherein, determining the five-tuple relationship of the inside and outside original media streams respectively by analyzing the original INVITE message and the corresponding original 200 OK message in the inside and outside message sets, and extracting the original media stream messages inside and outside before playback according to the five-tuple relationship, comprising: analyzing the original INVITE message inside and outside to extract the media information of the request direction on each side respectively; analyzing the original 200 OK message corresponding to the original INVITE message inside and outside to extract the media information of the response direction on each side respectively; determine five-tuple relationships of the original media streams of the inner side and the outer side respectively based on media information of the request and the response direction of each side; extract the inner and outer original media stream messages before playback according to the five-tuple relationships of the original media streams of the inner side and the outer side.

6. The SIP message playback method of claim 5, wherein, in a simulated network forwarding device environment, alternately play back the inner and outer message groups according to the corresponding relationship between the inner and outer message groups, including: simulate the same network forwarding device environment to match the actual running environment and establish a simulated communication environment according to the configuration and network topology of the network forwarding device on site; arrange the inner and outer message groups alternately according to the sending and receiving order according to the corresponding relationship between the inner and outer message groups, so as to realize the interactive order of the request and the response; start the playback of each message group in turn according to the arrangement order, so as to realize the playback of the SIP message; wherein, in the playback process of each message group, the network forwarding device performs repackaging processing on the received message group, and forwards the repackaged message group as the corresponding mapping message group.

7. The SIP message playback method of claim 6, wherein, determine the five-tuple relationships of the media streams of the inner side and the outer side after playback by analyzing the INVITE message and the corresponding 200 OK message in the inner and outer message groups after playback, including: extract media information from the outer INVITE message after playback, and combine the media information extracted from the outer original 200 OK message to generate the five-tuple relationship of the media stream of the outer side after playback; extract media information from the inner 200 OK message after playback, and combine the media information extracted from the inner original INVITE message to generate the five-tuple relationship of the media stream of the inner side after playback.

8. The SIP message playback method of claim 7, wherein, repackage the original media stream messages of the inner and outer sides before playback according to the five-tuple relationships of the media streams of the inner and outer sides after playback, and sequentially play back the repackaged media stream messages, including: repackage the inner original media stream messages before playback according to the five-tuple relationship of the media stream after playback of the inner side; repackage the outer original media stream messages before playback according to the five-tuple relationship of the media stream after playback of the outer side; sequentially play back the repackaged inner and outer media stream messages according to the time order of the original media streams.

9. The SIP message playback method according to any one of claims 1 to 8, wherein, before extracting the inner and outer message sets according to the five-tuple relationships of the SIP messages of the inner and outer sides of the network forwarding device to be played back, grouping them according to the sending and receiving directions respectively, and establishing the corresponding relationship between the inner and outer message groups, further including: use a packet capture tool to obtain the inner side SIP message and the outer side SIP message of the network forwarding device to be played back. 10.An electronic device, comprising: one or more processors; a memory having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the SIP message playback method according to any one of claims 1 to 9. 11.A computer readable medium having a computer program stored thereon, when the computer program is executed by a processor, the computer program implements the SIP message playback method according to any one of claims 1 to 9.

12. A computer program product comprising computer programs or instructions, which, when executed by a processor, implement the SIP message playback method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Stream media playback method, device and system

    CN101115011A

  • Method and system for playing back and monitoring remote multi-media records based on IPPBX equipment

    CN105282473A