SIP (Session Initiation Protocol) media stream and signaling consistency forwarding method, electronic equipment, readable medium and program product

By establishing a three- and five-yuan expected forwarding relationship in the network forwarding device, dynamically mapping the addresses and ports in the media stream and signaling messages in the SIP protocol, the forwarding problem caused by the media stream arrives before the 200OK message is solved. , ensuring the correct forwarding of media streams.

CN119420740AActive Publication Date: 2025-02-11BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411715480.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-02-11
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

In SIP protocol communication, the media stream is sent before the 200OK confirmation message of the INVITE message arrives, and the network forwarding device performs port conversion to the media stream, and the media receiver enables media stream consistency verification when the media stream and signaling consistency verification is enabled. will fail, thus refusing to receive the media stream.

Method used

By establishing a three- and five-yuan expected forwarding relationship, dynamic mapping of address and port conversion in media streams and signaling messages is realized. The specific steps include generating a three-way expected forwarding relationship when INVITE is received, and updating it to a five-way expected forwarding relationship when the 200 OK message or media stream first packet arrives.

Benefits of technology

It effectively solves the forwarding exception caused by the media stream arrives before the 200OK packet, and ensures that the media stream in the SIP session can be forwarded to the target client correctly and reliably.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420740A_ABST
    Figure CN119420740A_ABST
Patent Text Reader

Abstract

The invention provides an SIP (Session Initiation Protocol) media stream and signaling consistency forwarding method, which comprises the following steps of: generating a ternary expected forwarding relationship in an INVITE direction based on a conversion relationship formed by an INVITE message passing through an SIP protocol; receiving a media stream, and matching a ternary expected forwarding relationship according to a quintuple relationship of the media stream; if the matching is successful and the 200OK message is not received, generating a quintuple expected forwarding relationship based on a quintuple relationship of the media stream; receiving a 200OK message corresponding to the INVITE message, and checking whether a five-element expected forwarding relationship exists or not; under the condition that the five-element expected forwarding relation does not exist, generating the five-element expected forwarding relation based on the conversion relation formed through the 200OK message and the three-element expected forwarding relation; and converting the received media stream according to the five-element expected forwarding relation, and forwarding the converted media stream. The disclosure also provides an electronic device, a computer readable medium, and a computer program product. According to the invention, the address and port consistency forwarding of the SIP media stream and the signaling message is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network communication technology, and in particular to a method for forwarding SIP media streams and signaling consistency, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] The Session Initiation Protocol (SIP) is an application-layer control protocol widely used to establish, modify, and terminate multimedia sessions, such as internet telephony and video conferencing. SIP is particularly popular in video conferencing systems and audio and video transmission in security applications.

[0003] Network forwarding devices protect network security and are typically deployed between the intranet and the extranet. Their primary function is to block data that doesn't comply with pre-defined security policies and securely filter qualified data before transmitting it to the target network. These devices effectively defend against potential external attacks through physical isolation and blocking mechanisms, ensuring the security of the internal network.

[0004] When transmitting SIP protocol data across intranets and extranets, network forwarding devices need to perform special conversions on addresses and ports. This is especially true when processing SIP protocol media data, which involves more complex operations. During this process, it is necessary to ensure the consistency of SIP protocol signaling and media data.

[0005] However, when a network forwarding device applies port translation technology, the media stream may fail to pass the consistency check, causing the client to refuse to receive the media stream. Summary of the Invention

[0006] Embodiments of the present disclosure provide a method for forwarding SIP media streams and signaling in a consistent manner, an electronic device, a computer-readable medium, and a computer program product.

[0007] In a first aspect, an embodiment of the present disclosure provides a method for consistent forwarding of SIP media streams and signaling, comprising: generating a ternary expected forwarding relationship in the INVITE direction based on a conversion relationship formed by an INVITE message of the SIP protocol; receiving a media stream, and matching the ternary expected forwarding relationship according to a quintuple relationship of the media stream; if the match is successful and a 200OK message has not been received, generating a quintuple expected forwarding relationship based on the quintuple relationship of the media stream; receiving a 200OK message corresponding to the INVITE message, and checking whether a quintuple expected forwarding relationship already exists; if no quintuple expected forwarding relationship exists, generating a quintuple expected forwarding relationship based on the conversion relationship formed by the 200OK message and the ternary expected forwarding relationship; converting the received media stream according to the quintuple expected forwarding relationship, and forwarding the converted media stream.

[0008] In some embodiments, based on the conversion relationship formed by the INVITE message of the SIP protocol, a ternary expected forwarding relationship in the INVITE direction is generated, including: parsing the INVITE message of the SIP protocol to extract a call identifier and media information, wherein the media information includes a transmission protocol, a first address and a first port; selecting a first mapping address and a first mapping port corresponding to the first address and the first port, and generating a corresponding conversion relationship; based on the call identifier, the transmission protocol and the conversion relationship, a ternary expected forwarding relationship in the INVITE direction is generated, wherein the ternary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the first mapping address and the first mapping port; according to the generated ternary expected forwarding relationship, the first address and the first port in the INVITE message are replaced with the corresponding first mapping address and the first mapping port, and the modified INVITE message is forwarded.

[0009] In some embodiments, receiving a media stream and matching the ternary expected forwarding relationship according to the quintuple relationship of the media stream includes: receiving the media stream, extracting the quintuple relationship of the media stream; and matching the ternary expected forwarding relationship based on the extracted quintuple relationship.

[0010] In some embodiments, if the match is successful and the 200OK message has not been received, a five-tuple expected forwarding relationship is generated based on the five-tuple relationship of the media stream, including: if the match is successful and the 200OK message has not been received, the corresponding mapping address and mapping port of the second address and the second port in the five-tuple relationship of the media stream are selected to generate a corresponding conversion relationship; based on the generated conversion relationship, the three-tuple expected forwarding relationship is updated to generate a five-tuple expected forwarding relationship.

[0011] In some embodiments, receiving a 200OK message corresponding to the INVITE message and checking whether a five-way expected forwarding relationship already exists includes: receiving a 200OK message corresponding to the INVITE message, extracting a call identifier and media information from the 200OK message, wherein the media information includes a transmission protocol, a second address and a second port; and based on the call identifier, checking whether a five-way expected forwarding relationship already exists.

[0012] In some embodiments, after receiving the 200OK message corresponding to the INVITE message and checking whether a five-way expected forwarding relationship already exists, it also includes: when confirming that a five-way expected forwarding relationship already exists, according to the five-way expected forwarding relationship, replacing the second address and the second port in the received 200OK message with the corresponding mapping address and mapping port, and forwarding the modified 200OK message.

[0013] In some embodiments, in the absence of a five-ary expected forwarding relationship, a five-ary expected forwarding relationship is generated based on the conversion relationship formed by the 200OK message and the three-ary expected forwarding relationship, including: in the absence of a five-ary expected forwarding relationship, selecting the second mapping address and the second mapping port corresponding to the second address and the second port, and generating a corresponding conversion relationship; based on the call identifier, searching for the three-ary expected forwarding relationship; based on the conversion relationship and the three-ary expected forwarding relationship, generating a five-ary expected forwarding relationship, wherein the five-ary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the second mapping address, the second mapping port, the first mapping address, the first mapping port, the second address, and the second port; according to the generated five-ary expected forwarding relationship, the second address and the second port in the 200OK message are replaced with the corresponding second mapping address and the second mapping port, and the modified 200OK message is forwarded.

[0014] In some embodiments, the received media stream is converted according to the five-tuple expected forwarding relationship, and the converted media stream is forwarded, including: converting the five-tuple relationship of the received media stream according to the five-tuple expected forwarding relationship; and forwarding the media stream with the converted five-tuple relationship.

[0015] In a second aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; and a memory storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the SIP media stream and signaling consistency forwarding method described in the first aspect of the embodiment of the present disclosure.

[0016] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon. When the computer program is executed by a processor, the method for consistent forwarding of SIP media streams and signaling described in the first aspect of the embodiment of the present disclosure is implemented.

[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the SIP media stream and signaling consistent forwarding method described in the first aspect of the embodiment of the present disclosure.

[0018] This disclosure provides a method for consistent forwarding of media streams and signaling in the SIP protocol. By establishing ternary and quinary expected forwarding relationships, this method dynamically maps the address and port conversions in media streams and signaling messages. Specifically, upon receiving an INVITE, the method extracts the address and port information to generate a ternary expected forwarding relationship. Upon the arrival of a 200OK message or the first packet of a media stream, the ternary expected forwarding relationship is updated to generate a quinary expected forwarding relationship. This method effectively resolves forwarding anomalies caused by media streams arriving before the 200OK message, ensuring that media streams in a SIP session are correctly and reliably forwarded to the target client. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 This is a flow chart of a method for forwarding SIP media streams and signaling consistency according to an embodiment of the present disclosure;

[0020] Figure 2 This is a schematic flow chart of a SIP protocol signaling forwarding method according to an embodiment of the present disclosure;

[0021] Figure 3 This is a schematic flow chart of a SIP media stream forwarding method according to an embodiment of the present disclosure;

[0022] Figure 4 is a schematic diagram of the composition of an electronic device according to an embodiment of the present disclosure;

[0023] Figure 5 is a block diagram of a SIP media stream and signaling consistency forwarding system according to an embodiment of the present disclosure;

[0024] Figure 6 A SIP call flow chart passing through a network forwarding device is shown. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the technical solution of the present disclosure is described in detail below with reference to the accompanying drawings.

[0026] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the example embodiments may 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 this disclosure to those skilled in the art.

[0027] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

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

[0029] The terms used herein are used only to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a," "an," and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements, and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof is not excluded.

[0030] 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 also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.

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

[0032] An INVITE message is a request message used in the SIP protocol to initiate a session. It is used to invite a party to participate in a call or multimedia session and contains session parameters and protocol information.

[0033] The CALL_ID is an identifier used in the SIP protocol to uniquely identify a session. The CALL_ID remains consistent across all messages in the same session and is used to correlate signaling and media streams within the session.

[0034] SDP (Session Description Protocol) is used to describe the detailed information of a multimedia session, including the transport protocol, media format, IP address and port number of the media stream. SDP information is typically embedded in SIP messages (such as INVITE and 200OK) and is used to negotiate media parameters between the two parties in the session.

[0035] The INVITE message is one of the request messages of the SIP protocol and is used to initiate a session request to the other party.

[0036] The 200OK message is a confirmation message in response to the INVITE request in the SIP protocol.

[0037] The source address (SRC_IP) and source port (SRC_PORT) refer to the IP address and port of the media stream sender, and are used to identify the source of the media stream data packet.

[0038] The destination address and destination port are the IP address and port number of the media stream receiver, used to identify the destination of the media stream. They are usually negotiated and specified in the SDP of the INVITE and 200OK messages.

[0039] Source address mapping (SRC_IP_NAT) and source port mapping (SRC_PORT_NAT) are alternative addresses and ports assigned by network forwarding devices to source addresses and source ports, and are used for address translation when transmitting across network boundaries (such as the intranet and the extranet).

[0040] Destination address mapping (IP_NAT) and destination port mapping (PORT_NAT) are alternative addresses and ports assigned by network forwarding devices to the destination address and destination port. They are used to replace the original destination address and port during media stream forwarding to ensure cross-network security and connection accuracy.

[0041] NAT (Network Address Translation) is a network translation mechanism used to convert IP addresses and ports between private and public networks, enabling devices on the internal network to communicate with the outside world through public IP addresses. NAT is widely used in SIP media streams to forward media streams across network segments.

[0042] A media stream quintuple, consisting of the protocol type (UDP / TCP), source address, source port, destination address, and destination port, uniquely identifies a media stream. This quintuple is often used by network forwarding devices to accurately match and process media stream forwarding rules.

[0043] Media stream forwarding is the process of transmitting media data packets from the source to the destination through network forwarding devices.

[0044] This disclosure aims to address the following issue: In SIP protocol communications, when a media stream is sent before the 200OK acknowledgment message of an INVITE message arrives, and the network forwarding device performs port translation on the media stream, the media receiver may fail to enable the media stream and signaling consistency check, thereby refusing to receive the media stream. The method proposed in this disclosure aims to ensure that the media stream can pass the consistency check in this situation and can be successfully received.

[0045] This application provides a method for solving the following problem in the SIP protocol: when a media stream arrives earlier than the 200OK message corresponding to the INVITE message, and the network forwarding device performs port conversion on the media stream, the media receiving end will detect failure after starting the media stream and signaling consistency check, and thus reject the media stream.

[0046] Figure 1 This is a flowchart of a method for forwarding SIP media streams and signaling consistency according to an embodiment of the present disclosure.

[0047] First, refer to Figure 1 The present disclosure provides a method for forwarding SIP media streams and signaling consistency, including:

[0048] S11. Based on the conversion relationship formed by the INVITE message through the SIP protocol, a ternary expected forwarding relationship in the INVITE direction is generated;

[0049] S12: Receive a media stream, and match the ternary expected forwarding relationship according to the quintuple relationship of the media stream;

[0050] S13. If the match is successful and the 200OK message has not been received, generate a five-tuple expected forwarding relationship based on the five-tuple relationship of the media stream;

[0051] S14. Receive a 200OK message corresponding to the INVITE message and check whether a five-way expected forwarding relationship already exists;

[0052] S15. If a five-ary expected forwarding relationship does not exist, generate a five-ary expected forwarding relationship based on the conversion relationship formed by the 200 OK message and the three-ary expected forwarding relationship;

[0053] S16: Convert the received media stream according to the five-element expected forwarding relationship, and forward the converted media stream.

[0054] In some embodiments, based on the conversion relationship formed by the INVITE message through the SIP protocol, a ternary expected forwarding relationship in the INVITE direction is generated, including:

[0055] Parsing the SIP protocol INVITE message to extract a call identifier and media information, wherein the media information includes a transmission protocol, a first address, and a first port;

[0056] Selecting a first mapping address and a first mapping port corresponding to the first address and the first port, and generating a corresponding conversion relationship;

[0057] Based on the call identifier, the transmission protocol, and the conversion relationship, generating a ternary expected forwarding relationship in the INVITE direction, wherein the ternary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the first mapping address, and the first mapping port;

[0058] According to the generated ternary expected forwarding relationship, the first address and the first port in the INVITE message are replaced with the corresponding first mapped address and the first mapped port, and the modified INVITE message is forwarded.

[0059] In the embodiment of the present disclosure, an INVITE message of the SIP protocol is received and parsed, and the call identifier CALL_ID and media information in the SDP, such as the transport protocol, media address and media port (i.e., UDP / TCP, IP:PORT) are extracted;

[0060] Select the mapping address IP_NAT and mapping port PORT_NAT of the media stream, and generate a conversion relationship from the original media information (UDP / TCP, IP:PORT) to the mapping information (UDP / TCP, IP_NAT:PORT_NAT);

[0061] Establish a three-way expected forwarding relationship for media streams in the direction of the call INVITE corresponding to the call ID: {CALL_ID:{UDP / TCP,IP,PORT,IP_NAT,PORT_NAT}}. (That is, when the media stream flows through the network forwarding device in the opposite direction of the INVITE, its destination address and port are checked to see if they are IP_NAT and PORT_NAT. If the destination address is IP_NAT, the destination port is PORT_NAT, and the transport protocol matches, the destination address of the media stream is converted to IP, and the destination port is converted to PORT.)

[0062] According to the ternary expected forwarding relationship of the media stream in the call INVITE direction corresponding to CALL_ID, the media information of the SDP in the INVITE message is modified (ie, IP:PORT is converted to IP_NAT:PORT_NAT), and the modified message is forwarded.

[0063] Through this ternary matching forwarding relationship, the network forwarding device can still correctly process the forwarding of the media stream even when the 200OK arrives later than the media stream.

[0064] In some embodiments, receiving a media stream and matching the ternary expected forwarding relationship according to a quintuple relationship of the media stream includes:

[0065] receiving a media stream, and extracting a quintuple relationship of the media stream;

[0066] Based on the extracted five-tuple relationship, the three-tuple expected forwarding relationship is matched.

[0067] In some embodiments, if the match is successful and the 200 OK message has not been received, a five-tuple expected forwarding relationship is generated based on the five-tuple relationship of the media stream, including:

[0068] If the match is successful and the 200OK message has not been received, the corresponding mapping address and mapping port of the second address and the second port in the five-tuple relationship of the media stream are selected to generate a corresponding conversion relationship;

[0069] The ternary expected forwarding relationship is updated based on the generated conversion relationship to generate a quinary expected forwarding relationship.

[0070] In the disclosed embodiment, in the case where a media stream is received before the 200OK corresponding to the INVITE is received when a ternary media expectation forwarding relationship matches, the ternary media expectation forwarding relationship does not specify a translation relationship between the source address and the source port. The source address can be converted based on the signaling translation relationship, and the source port selects an available port. This port cannot be guaranteed to be consistent with the original port. The source address and source port translation relationship is updated to the media expectation forwarding relationship recorded in the CALL_ID, and the message is forwarded according to the media expectation forwarding relationship.

[0071] For example, the network forwarding device receives a media stream from client B, and the five-tuple relationship of the media stream is TCP:11.0.0.3:20061<-11.0.0.4:20000. According to the five-tuple relationship of the media stream, the network forwarding device matches the three-tuple media expectation forwarding relationship {CALL_ID:845761442,{PROTO:TCP,

[0072] IP:192.168.40.3,PORT:10061,

[0073] IP_NAT:11.0.0.3,PORT_NAT:20061}}.

[0074] The network forwarding device selects the mapping information of the media stream source address and source port to obtain the corresponding conversion relationship; combines the three-way expected forwarding relationship to generate a five-way media expected forwarding relationship:

[0075] {CALL_ID:845761442,{PROTO:TCP,

[0076] IP:192.168.40.3,PORT:10061,

[0077] SRC_IP:192.168.40.4, SRC_PORT:10002,

[0078] IP_NAT:11.0.0.3,PORT_NAT:20061,

[0079] SRC_IP_NAT:11.0.0.4,SRC_PORT_NAT:20000}}.

[0080] In some embodiments, receiving a 200OK message corresponding to the INVITE message and checking whether a five-way expected forwarding relationship already exists includes:

[0081] receiving a 200OK message corresponding to the INVITE message, and extracting a call identifier and media information from the 200OK message, wherein the media information includes a transmission protocol, a second address, and a second port;

[0082] Based on the call identifier, it is checked whether a five-ary expected forwarding relationship already exists.

[0083] In some embodiments, after receiving the 200OK message corresponding to the INVITE message and checking whether a five-way expected forwarding relationship already exists, the method further includes:

[0084] When it is confirmed that a five-ary expected forwarding relationship exists, the second address and the second port in the received 200OK message are replaced with the corresponding mapping address and mapping port according to the five-ary expected forwarding relationship, and the modified 200OK message is forwarded.

[0085] In the disclosed embodiment, if a five-tuple expected forwarding relationship already exists before receiving the 200OK message, it means that media stream forwarding has already occurred. At this time, based on the five-tuple relationship of the media stream, the currently matched three-tuple expected forwarding relationship has been updated to a five-tuple expected forwarding relationship, which includes complete source address and source port information; the five-tuple expected forwarding relationship can be expressed as:

[0086] {CALL_ID:{UDP / TCP,IP,PORT,SRC_IP,SRC_PORT,IP_NAT,PORT_NAT,SRC_IP_NAT,SRC_PORT_NAT}};

[0087] After receiving the 200OK message, the media address and media port information of the SDP in the 200OK message are converted according to the five-element expected forwarding relationship, that is, the SRC_IP_NAT:SRC_PORT_NAT in the SDP is converted to SRC_IP:SRC_PORT; and the modified 200OK message is forwarded to client A to ensure that client A can identify the correct media address and port.

[0088] In some embodiments, when a five-ary expected forwarding relationship does not exist, generating a five-ary expected forwarding relationship based on the conversion relationship formed by the 200 OK message and the three-ary expected forwarding relationship includes:

[0089] In the absence of a five-way expected forwarding relationship, selecting a second mapping address and a second mapping port corresponding to the second address and the second port, and generating a corresponding conversion relationship;

[0090] searching the ternary expected forwarding relationship based on the call identifier;

[0091] Generate a five-element expected forwarding relationship based on the conversion relationship and the three-element expected forwarding relationship, wherein the five-element expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the second mapped address, the second mapped port, the first mapped address, the first mapped port, the second address, and the second port;

[0092] According to the generated five-ary expected forwarding relationship, the second address and the second port in the 200OK message are replaced with the corresponding second mapped address and the second mapped port, and the modified 200OK message is forwarded.

[0093] In the embodiment of the present disclosure, the call identifier CALL_ID and the media information in the SDP, such as the transport protocol, media address (SRC_IP_NAT) and media port (SRC_PORT_NAT), are extracted from the 200OK message corresponding to the INVITE message of the SIP protocol;

[0094] Select the mapping address SRC_IP and mapping port SRC_PORT of the media stream, and generate a conversion relationship from the original media information (UDP / TCP, SRC_IP_NAT:SRC_PORT_NAT) to the mapping information (UDP / TCP, SRC_IP:SRC_PORT);

[0095] The corresponding ternary expected forwarding relationship is found by CALL_ID, and a set of five-way expected forwarding relationship is formed by the conversion relationship formed by 200OK and the media address, media port, and transmission protocol in the ternary expected forwarding relationship. The relationship can be expressed as: {CALL_ID:{UDP / TCP,IP,PORT,SRC_IP,SRC_PORT,IP_NAT,PORT_NAT,SRC_IP_NAT,SRC_PORT_NAT}};

[0096] Modify the media address and media port in the SDP of the 200OK message according to the converted media address and media port of the 200OK direction determined in the generated five-way expected forwarding relationship (i.e., convert SRC_IP_NAT:SRC_PORT_NAT in the SDP to SRC_IP:SRC_PORT), and forward the modified message.

[0097] By matching the ternary expected forwarding relationship and generating the source address and source port translation relationship of the media stream, the media information in the 200OK signaling is modified according to the translation relationship of the source address and source port to ensure the consistency of the media information of the media stream and the signaling.

[0098] In some embodiments, converting the received media stream according to the five-way expected forwarding relationship and forwarding the converted media stream includes:

[0099] Converting the quintuple relationship of the received media stream according to the quintuple expected forwarding relationship;

[0100] Forward the media stream of the converted 5-tuple relationship.

[0101] In an embodiment of the present disclosure, a network forwarding device receives a media stream from a client, and the five-tuple relationship of the media stream is, for example, TCP:11.0.0.3:20061<-11.0.0.4:20000. The five-tuple expected forwarding relationship is converted, that is, TCP:11.0.0.3:20061<-11.0.0.4:20000 is converted to TCP:192.168.40.3:10061<-192.168.40.4:10002, and the forwarding is completed.

[0102] In the embodiments of the present disclosure, the method of the present disclosure is mainly aimed at the media stream in the SIP protocol, and can be described from two aspects: signaling forwarding and media stream forwarding.

[0103] 1) Handle the forwarding of media-related signaling in the SIP protocol

[0104] When processing an INVITE message, the network forwarding device extracts and records the relevant media address and port information and establishes a preliminary forwarding relationship to ensure that even if the media stream arrives before the successful response message, the device can still identify and correctly process the subsequent media stream.

[0105] 2) Processing media stream forwarding in the SIP protocol

[0106] When the media stream arrives, the network forwarding device maps the address and port information of the media stream according to the established forwarding relationship to ensure that the media stream can pass through the network forwarding device correctly, even if the 200OK message has not arrived yet.

[0107] Figure 2 This is a schematic flowchart of a SIP protocol signaling forwarding method according to an embodiment of the present disclosure.

[0108] In the embodiments of the present disclosure, refer to Figure 2 , a SIP protocol signaling forwarding method, comprising:

[0109] Receive the INVITE message of the SIP protocol;

[0110] Parse the SDP information in the INVITE message and generate a ternary expected forwarding relationship in the INVITE direction based on the parsing result;

[0111] Receive the 200OK message corresponding to the INVITE message;

[0112] Parse the SDP information in the 200OK message and match it with the media information in the corresponding INVITE message to form a five-tuple relationship;

[0113] According to the formed five-tuple relationship, the corresponding five-tuple expected forwarding relationship in the INVITE and 200OK directions is issued.

[0114] Figure 3 This is a schematic flowchart of a SIP media stream forwarding method according to an embodiment of the present disclosure.

[0115] In the embodiments of the present disclosure, refer to Figure 3 , a SIP media stream forwarding method, comprising:

[0116] Receive the first data packet of the media stream and match it with the expected forwarding relationship;

[0117] Prioritize matching five-element expected forwarding relationships;

[0118] If the match is successful, it indicates that the 200OK message has been received (i.e., the 200OK is received first and then the media stream is received), and a five-way expected forwarding relationship has been established based on the 200OK and the corresponding INVITE, and the data packet is forwarded directly according to the five-way expected forwarding relationship;

[0119] If the five-way forwarding relationship is not matched successfully, continue to match the three-way forwarding relationship;

[0120] If the ternary expected forwarding relationship matches successfully, it means that the 200OK message has not been received, only the INVITE message has been received, and the ternary expected forwarding relationship has been established based on the INVITE;

[0121] Since the ternary expectation forwarding relationship does not specify the conversion relationship between the source address and the source port, the source address can be converted according to the conversion relationship of the signaling, and the source port can select an available port. This port cannot be guaranteed to be consistent with the original port. The source address and port are then updated to the ternary expectation forwarding relationship table corresponding to the CALL_ID, forming a five-way expectation forwarding relationship.

[0122] forwarding the media stream data packet according to the five-element expected forwarding relationship;

[0123] If the ternary expected forwarding relationship fails to match, the data packet is discarded.

[0124] By prioritizing the five-way expected forwarding, the situation where 200OK is forwarded before the media stream is handled. By prioritizing the three-way expected forwarding, the situation where 200OK is forwarded later than the media stream is handled.

[0125] Figure 4 It is a schematic diagram of the composition of an electronic device according to an embodiment of the present disclosure.

[0126] Secondly, refer to Figure 4 , an embodiment of the present disclosure provides an electronic device, comprising:

[0127] One or more processors 401;

[0128] A memory 402 storing one or more programs, which, when executed by one or more processors, enables the one or more processors to implement the method for consistent forwarding of SIP media streams and signaling according to the first aspect of the embodiment of the present disclosure;

[0129] One or more I / O interfaces 403 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.

[0130] Among them, the processor 401 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 402 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) 403 is connected between the processor 401 and the memory 402, and can realize information interaction between the processor 401 and the memory 402, including but not limited to a data bus (Bus), etc.

[0131] In some embodiments, the processor 401 , the memory 402 , and the I / O interface 403 are connected to each other via a bus 404 , and further connected to other components of the computing device.

[0132] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon. When the program is executed by a processor, the method for consistent forwarding of SIP media streams and signaling described in the first aspect of the embodiment of the present disclosure is implemented.

[0133] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the SIP media stream and signaling consistent forwarding method described in the first aspect of the embodiment of the present disclosure.

[0134] Figure 5 It is a block diagram of a SIP media stream and signaling consistency forwarding system according to an embodiment of the present disclosure.

[0135] Fifth, refer to Figure 5 The present disclosure provides a SIP media stream and signaling consistency forwarding system, including:

[0136] The ternary expected forwarding relationship generating module 501 generates a ternary expected forwarding relationship in the INVITE direction based on the conversion relationship formed by the INVITE message of the SIP protocol;

[0137] A matching module 502 receives a media stream and matches the ternary expected forwarding relationship according to the quintuple relationship of the media stream;

[0138] The media stream five-tuple expected forwarding relationship generating module 503 generates a five-tuple expected forwarding relationship based on the five-tuple relationship of the media stream if the match is successful and the 200OK message has not been received;

[0139] The checking module 504 receives a 200OK message corresponding to the INVITE message and checks whether a five-way expected forwarding relationship already exists;

[0140] The message five-element expected forwarding relationship generating module 505 generates a five-element expected forwarding relationship based on the conversion relationship formed by the 200 OK message and the three-element expected forwarding relationship when the five-element expected forwarding relationship does not exist;

[0141] The conversion module 506 converts the received media stream according to the five-element expected forwarding relationship and forwards the converted media stream.

[0142] In some embodiments, the ternary expected forwarding relationship generation module 501 includes:

[0143] a first media information extraction module, which parses the INVITE message of the SIP protocol to extract a call identifier and media information, wherein the media information includes a transmission protocol, a first address, and a first port;

[0144] A first selection module selects a first mapping address and a first mapping port corresponding to the first address and the first port, and generates a corresponding conversion relationship;

[0145] A first generating module is configured to generate a ternary expected forwarding relationship in the INVITE direction based on the call identifier, the transmission protocol, and the conversion relationship, wherein the ternary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the first mapping address, and the first mapping port;

[0146] The first replacement module replaces the first address and the first port in the INVITE message with the corresponding first mapping address and the first mapping port according to the generated ternary expected forwarding relationship, and forwards the modified INVITE message.

[0147] In some embodiments, the matching module 502 includes:

[0148] An extraction module receives a media stream and extracts a quintuple relationship of the media stream;

[0149] The five-tuple relationship matching module matches the three-tuple expected forwarding relationship based on the extracted five-tuple relationship.

[0150] In some embodiments, the media stream five-element expected forwarding relationship generation module 503 includes:

[0151] The second selection module selects the corresponding mapping address and mapping port of the second address and the second port in the five-tuple relationship of the media stream if the match is successful and the 200OK message has not been received, and generates a corresponding conversion relationship;

[0152] The second generating module updates the ternary expected forwarding relationship based on the generated conversion relationship to generate a quinary expected forwarding relationship.

[0153] In some embodiments, the inspection module 504 includes:

[0154] A second media information extraction module receives a 200OK message corresponding to the INVITE message, and extracts a call identifier and media information from the 200OK message, wherein the media information includes a transmission protocol, a second address, and a second port;

[0155] The five-way expected forwarding relationship checking module checks whether a five-way expected forwarding relationship already exists based on the call identifier.

[0156] In some embodiments, the SIP media stream and signaling consistency forwarding system further includes:

[0157] The second replacement module, when confirming that a five-way expected forwarding relationship already exists, replaces the second address and the second port in the received 200OK message with the corresponding mapping address and mapping port according to the five-way expected forwarding relationship, and forwards the modified 200OK message.

[0158] In some embodiments, the message five-element expected forwarding relationship generation module 505 includes:

[0159] a third selection module, which selects, when no five-way expected forwarding relationship exists, a second mapping address and a second mapping port corresponding to the second address and the second port, and generates a corresponding conversion relationship;

[0160] A search module, configured to search for the ternary expected forwarding relationship based on the call identifier;

[0161] A third generating module is configured to generate a five-element expected forwarding relationship based on the conversion relationship and the three-element expected forwarding relationship, wherein the five-element expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the second mapped address, the second mapped port, the first mapped address, the first mapped port, the second address, and the second port;

[0162] The third replacement module replaces the second address and the second port in the 200OK message with the corresponding second mapping address and the second mapping port according to the generated five-way expected forwarding relationship, and forwards the modified 200OK message.

[0163] In some embodiments, the conversion module 506 includes:

[0164] a five-tuple relationship conversion module, which converts the five-tuple relationship of the received media stream according to the five-tuple expected forwarding relationship;

[0165] The forwarding module forwards the media stream with the converted five-tuple relationship.

[0166] In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the SIP media stream and signaling consistent forwarding method provided by the embodiments of the present disclosure is described in detail below through specific examples:

[0167] Example 1

[0168] Figure 6 A SIP call flow chart passing through a network forwarding device is shown.

[0169] like Figure 6 As shown, SIP client A sends an INVITE request to SIP client B to try to establish a call; the network forwarding device forwards the response messages, including 100Trying, 180Ringing and 200OK, in sequence, from SIP client B to SIP client A via the SIP proxy server; after receiving 200OK, SIP client A sends an ACK confirmation, and then the media stream is transmitted between the clients through the network forwarding device; when either party sends a BYE request to end the call, the network forwarding device forwards the end response (200OK). Figure 6 This is a SIP call flow diagram that shows the signaling and media stream forwarding process through network forwarding devices.

[0170] The important media information in the SDP of media stream negotiation related signaling is as follows:

[0171] Example 1

[0172]

[0173] Based on Example 1, analyzing the SDP information in the INVITE signaling sent by SIP client A shows that the IP address of the video media stream negotiated by the requester of this call is 192.168.40.3, the media port is 10061, and the transmission protocol is TCP.

[0174] By analyzing the SDP information in the 200OK signaling corresponding to the INVITE received by SIP client A, we can know that the IP address of the video media stream negotiated by the responder of this call is 192.168.40.4, the media port is 10000, and the transmission protocol is TCP.

[0175] In summary, through the SDP information in the INVITE message and the corresponding 200OK message on the SIP client A side, a negotiated media stream quintuple relationship can be determined: TCP:192.168.40.3:10061<->192.168.40.4:10000.

[0176] Example 2

[0177]

[0178] Based on Example 2, analyzing the SDP information in the INVITE signaling sent by the SIP network forwarding device proxy shows that the IP address of the video media stream negotiated by the requester of this call is 11.0.0.3, the media port is 20061, and the transmission protocol is TCP;

[0179] Analysis of the SDP information in the 200OK signaling corresponding to the INVITE received by the SIP network forwarding device proxy shows that the IP address of the video media stream negotiated by the respondent of this call is 11.0.0.4, the media port is 20000, and the transmission protocol is TCP.

[0180] In summary, through the SDP information in the INVITE message and the corresponding 200OK message on the SIP client B side, a negotiated media stream quintuple relationship can be determined: TCP:11.0.0.3:20061<->11.0.0.4:20000.

[0181] By analyzing the SDP media information in the INVITE and corresponding 200OK messages on both sides of the network forwarding device, the corresponding media stream conversion relationship can be determined as follows:

[0182] Conversion relationship: TCP:192.168.40.3:10061<->192.168.40.4:10000 and TCP:11.0.0.3:20061<->11.0.0.4:20000

[0183] The network forwarding device will issue the following conversion rules:

[0184] The network forwarding device receives the media stream from SIP client A on one side. The specific stream information is TCP:192.168.40.3:10061->192.168.40.4:10000. The network forwarding device then sends this media stream from the other side in the format of TCP:11.0.0.3:20061->11.0.0.4:20000 to SIP client B.

[0185] The network forwarding device receives the media stream from SIP client B on the other side. The specific stream information is TCP:11.0.0.4:20000->11.0.0.3:20061. The network forwarding device then sends this media stream from the other side in the format of TCP:192.168.40.4:10000->192.168.40.3:10061 to SIP client A.

[0186] Complete the forwarding of the SIP corresponding media stream.

[0187] Press Figure 6 The specific implementation steps for the SDP media information forwarding method in the deployment shown and Examples 1 and 2 are as follows:

[0188] (1) The specific steps of SIP protocol media-related signaling forwarding are:

[0189] i. Receive and parse the INVITE message to establish a ternary expectation forwarding relationship: The network forwarding device receives and parses the SIP protocol INVITE message, and establishes a ternary expectation forwarding relationship for the media stream in the call direction of the INVITE corresponding to the CALL_ID based on the extracted CALL_ID and media information;

[0190] For example, the network forwarding device receives an INVITE message from client A, extracts the video media stream information of CALL_ID 845761442, whose IP address is 192.168.40.3 and port is 10061. The mapped address is 11.0.0.3 and port is 20061. A ternary expectation forwarding relationship is generated based on the extracted media information and recorded in JSON format, for example, {CALL_ID:845761442,{PROTO:TCP,IP:192.168.40.3,PORT:10061,IP_NAT:11.0.0.3,PORT_NAT:20061}}.

[0191] Modify the media address and port in the SDP: Use the generated ternary expected forwarding relationship to modify the IP in the SDP information in the INVITE message, modify IP:192.168.40.3 and PORT:10061 to 11.0.0.3 and 20061, and forward the modified message.

[0192] ii. After receiving and parsing the 200OK message of the SIP protocol INVITE, the network forwarding device extracts the CALL_ID and media information. Then, it queries the corresponding media forwarding relationship based on the CALL_ID:

[0193] If a forwarding relationship between the source address and source port already exists, it indicates that the media stream forwarding has been processed;

[0194] If the forwarding relationship of the source address and source port is not generated, it means that the media stream forwarding has not been processed. At this time, the corresponding forwarding relationship of the source address and source port is generated for the 200OK message, and the media forwarding relationship table is updated.

[0195] For example, if the media forwarding relationship {CALL_ID:845761442,{PROTO:TCP,IP:192.168.40.3,PORT:10061,IP_NAT:11.0.0.3,PORT_NAT:20061}} is found based on the CALL_ID in the 200OK message, and there is no source address and source port forwarding relationship, then the source address and source port forwarding relationship corresponding to the 200OK message is generated and updated to the media forwarding relationship table. Otherwise, the media stream has already been forwarded.

[0196] iii. Handle the situation where the media stream has been forwarded.

[0197] When the media stream matches the ternary expected forwarding relationship, the source address (SRC_IP) and source port (SRC_PORT) have been selected, and the source address and source port of the ternary expected forwarding relationship are updated to form a five-way media expected forwarding relationship;

[0198] For example, according to the CALL_ID in the 200OK message (for example, 845761442), the media mapping relationship of the call is found to be {CALL_ID:845761442, {PROTO:TCP,

[0199] IP:192.168.40.3,PORT:10061,

[0200] SRC_IP:192.168.40.4, SRC_PORT:10002,

[0201] IP_NAT:11.0.0.3,PORT_NAT:20061,

[0202] SRC_IP_NAT:11.0.0.4,SRC_PORT_NAT:20000}},

[0203] From the relationship, it can be seen that the media IP in the SDP in 200OK is 11.0.0.4, the media port is 20000, and the corresponding converted media address is 192.168.40.4, and the media port is 10002.

[0204] Modify the relevant information in the SDP in the 200OK packet, changing c=IN IP4 11.0.0.4 and m=video 20000TCP / RTP / AVP 96 to c=IN IP4 192.168.40.4 and m=video 10002TCP / RTP / AVP 96.

[0205] After updating the message length, the message is forwarded to client A.

[0206] iv. Handle the situation where the media stream has not been forwarded.

[0207] Extract the CALL_ID in the 200OK message corresponding to the INVITE of the SIP protocol, and extract the media information in the SDP, including the media address (SRC_IP_NAT) and media port (SRC_PORT_NAT);

[0208] Select the mapping address (SRC_IP) and mapping port (SRC_PORT) of the media stream, and generate the mapping information (UDP / TCP, SRC_IP: SRC_PORT) corresponding to the media information (UDP / TCP, SRC_IP_NAT: SRC_PORT_NAT);

[0209] Modify the message forwarding according to the expected media forwarding relationship;

[0210] For example, according to CALL_ID:845761442 in 200OK, the existing forwarding relationship is searched; for example, the existing media mapping relationship of the call is found as follows: {CALL_ID:845761442, {PROTO:TCP,

[0211] IP:192.168.40.3,PORT:10061,

[0212] IP_NAT:11.0.0.3,PORT_NAT:20061}}.

[0213] Among the expected forwarding relationships found, there is no source address and source port forwarding relationship. Therefore, a new media expected forwarding relationship needs to be established as follows:

[0214] Extract the original media information from the SDP portion of the 200OK, including the media address SRC_IP_NAT of 11.0.0.4 and the media port SRC_PORT_NAT of 20000.

[0215] Select the mapping address (SRC_IP) and mapping port (SRC_PORT) for the media stream in 200OK. SRC_IP is 192.168.40.4 and SRC_PORT is 10004.

[0216] Based on the existing ternary expected forwarding relationship, a new media expected forwarding relationship is updated and generated as follows: {CALL_ID:845761442,{PROTO:TCP,

[0217] IP:192.168.40.3,PORT:10061,

[0218] SRC_IP:192.168.40.4, SRC_PORT:10004,

[0219] IP_NAT:11.0.0.3,PORT_NAT:20061,

[0220] SRC_IP_NAT:11.0.0.4,SRC_PORT_NAT:20000}};

[0221] According to the relationship table, the media IP in the SDP of 200OK is 11.0.0.4, the media port is 20000, and the corresponding converted media address is 192.168.40.4, the media port is 10004;

[0222] According to the expected media forwarding relationship, the media information of the SDP in the 200OK message is forwarded to

[0223] c=IN IP4 11.0.0.4

[0224] m=video 20000TCP / RTP / AVP 96

[0225] Modified to

[0226] c=IN IP4 192.168.40.4

[0227] m=video 10004TCP / RTP / AVP 96

[0228] Recalculate the length of the modified 200OK message and then send it to client A.

[0229] (2) The specific steps of forwarding media streams are as follows:

[0230] i. Receive the first packet of the media stream and match it to the corresponding media expected forwarding relationship;

[0231] ii. Based on the matched media expected forwarding relationship, determine whether the matched policy is a five-tuple policy (which specifies the network layer protocol (UDP / TCP), destination address, destination port, source address, and source port) or a three-tuple policy (which specifies the network layer protocol (UDP / TCP), destination address, and destination port);

[0232] iii. If the five-tuple policy is matched, it must be the case that the 200OK corresponding to the INVITE is received first, and then the media stream is received; then it is forwarded directly according to the five-tuple media expected forwarding relationship. For example, the media stream is sent from client B to the network forwarding device, and the five-tuple relationship is TCP:11.0.0.3:20061<-11.0.0.4:20000. According to the five-tuple relationship, the expected forwarding relationship is matched: {CALL_ID:845761442,{PROTO:TCP,

[0233] IP:192.168.40.3,PORT:10061,

[0234] SRC_IP:192.168.40.4,SRC_PORT:10004,

[0235] IP_NAT:11.0.0.3,PORT_NAT:20061,

[0236] SRC_IP_NAT:11.0.0.4,SRC_PORT_NAT:20000}},

[0237] Then the media stream can be converted according to the relationship, that is, TCP:11.0.0.3:20061<-11.0.0.4:20000 is converted to TCP:192.168.40.3:10061<-192.168.40.4:10004, completing media stream forwarding.

[0238] iv. If a ternary media expectation forwarding relationship is matched, this means the media stream is received before the 200OK response corresponding to the INVITE is received. The ternary media expectation forwarding relationship does not specify a translation relationship between the source address and source port. The source address can be translated based on the signaling translation relationship, and the source port selects an available port. This port cannot be guaranteed to be the same as the original port. The source address and source port translation relationship is updated in the media expectation forwarding relationship of the CALL_ID record. The message is forwarded according to the media expectation forwarding relationship.

[0239] For example, a network forwarding device receives a media stream from client B, and the five-tuple relationship of the media stream is TCP:11.0.0.3:20061<-11.0.0.4:20000. According to the five-tuple relationship of the media stream, the network forwarding device can only match the three-tuple media expectation forwarding relationship {CALL_ID:845761442,{PROTO:TCP,

[0240] IP:192.168.40.3,PORT:10061,

[0241] IP_NAT:11.0.0.3,PORT_NAT:20061}}.

[0242] The network forwarding device selects the forwarding information of the media stream source address and source port and generates a five-way media expected forwarding relationship:

[0243] {CALL_ID:845761442,{PROTO:TCP,

[0244] IP:192.168.40.3,PORT:10061,

[0245] SRC_IP:192.168.40.4, SRC_PORT:10002,

[0246] IP_NAT:11.0.0.3,PORT_NAT:20061,

[0247] SRC_IP_NAT:11.0.0.4,SRC_PORT_NAT:20000}},

[0248] Then the media stream can be converted according to the five-element media expected forwarding relationship, that is, TCP:11.0.0.3:20061<-11.0.0.4:20000 is converted to TCP:192.168.40.3:10061<-192.168.40.4:10002, completing the media stream forwarding.

[0249] The key technical point of the present disclosure is to ensure the consistency check of SIP protocol media stream and signaling information, and to maintain consistency even when the order of arrival of 200OK response signaling and media stream is uncertain. When the INVITE signaling arrives, a ternary expectation forwarding relationship is first established, and the NAT mapping of the destination address and port is recorded in the network forwarding device. If the media stream data packet arrives before 200OK, the device will generate a five-tuple expectation forwarding relationship through the actual five-tuple information of the media stream, so as to start forwarding the data stream in advance. After the five-tuple forwarding relationship is formed, the media information of the SDP in the 200OK message is updated through the address-port mapping relationship therein to ensure that the address and port information of the signaling and media stream are consistent. Regardless of the order of arrival of the 200OK signaling and the media stream, the network forwarding device can process the traffic according to the ternary or five-tuple relationship to ensure that the signaling at the receiving end is consistent with the media stream information, thereby achieving a stable media stream forwarding effect.

[0250] The SIP media stream and signaling consistency forwarding method disclosed in this disclosure can bring the following beneficial effects:

[0251] The consistency check of media stream and signaling in the SIP protocol is realized: even if the media stream arrives before the 200OK message and the port has been converted in the network forwarding device, the receiving end can still pass the consistency check to ensure the consistency of the media stream and signaling. Compared with the existing solution of only changing the address, the present invention effectively avoids port conflicts by modifying the port. This solution solves the problem that the media stream arrives at the network forwarding device before 200OK, and the five-way forwarding relationship of media stream forwarding cannot be confirmed in advance through INVITE and 200OK signaling, which may cause inconsistency between signaling and media. Through this solution, the network forwarding device ensures that the media stream and signaling consistency check of the SIP protocol media receiving end is successful.

[0252] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may 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, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing 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 can be accessed by a computer. In addition, it is well known to those skilled 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 may include any information delivery media.

[0253] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A method for forwarding SIP media stream and signaling consistency, comprising: Based on the conversion relationship formed by the INVITE message of the SIP protocol, a ternary expected forwarding relationship in the INVITE direction is generated; receiving a media stream, and matching the ternary expected forwarding relationship according to a quintuple relationship of the media stream; If the match is successful and the 200OK message has not been received, a five-tuple expected forwarding relationship is generated based on the five-tuple relationship of the media stream; Receive a 200OK message corresponding to the INVITE message, and check whether a five-way expected forwarding relationship already exists; In the case where there is no five-way expected forwarding relationship, generating a five-way expected forwarding relationship based on the conversion relationship formed by the 200OK message and the three-way expected forwarding relationship; The received media stream is converted according to the five-element expected forwarding relationship, and the converted media stream is forwarded.

2. The SIP media stream and signaling consistency forwarding method according to claim 1, wherein: Based on the conversion relationship formed by the INVITE message of the SIP protocol, a ternary expected forwarding relationship in the INVITE direction is generated, including: Parsing the INVITE message of the SIP protocol to extract a call identifier and media information, wherein the media information includes a transmission protocol, a first address, and a first port; Selecting a first mapping address and a first mapping port corresponding to the first address and the first port, and generating a corresponding conversion relationship; Based on the call identifier, the transmission protocol and the conversion relationship, generate a ternary expected forwarding relationship in the INVITE direction, wherein the ternary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the first mapping address and the first mapping port; According to the generated ternary expected forwarding relationship, the first address and the first port in the INVITE message are replaced with the corresponding first mapping address and the first mapping port, and the modified INVITE message is forwarded.

3. The SIP media stream and signaling consistency forwarding method according to claim 2, wherein: Receiving a media stream, and matching the ternary expected forwarding relationship according to the quintuple relationship of the media stream, including: receiving a media stream, and extracting a quintuple relationship of the media stream; Based on the extracted five-tuple relationship, the three-tuple expected forwarding relationship is matched.

4. The SIP media stream and signaling consistency forwarding method according to claim 3, wherein: If the match succeeds and the 200OK message has not been received, a five-tuple expected forwarding relationship is generated based on the five-tuple relationship of the media stream, including: If the match is successful and the 200OK message has not been received, the corresponding mapping address and mapping port of the second address and the second port in the five-tuple relationship of the media stream are selected to generate a corresponding conversion relationship; The ternary expected forwarding relationship is updated based on the generated conversion relationship to generate a quinary expected forwarding relationship.

5. The SIP media stream and signaling consistency forwarding method according to claim 4, wherein: Receive a 200OK message corresponding to the INVITE message, and check whether a five-way expected forwarding relationship already exists, including: receiving a 200OK message corresponding to the INVITE message, and extracting a call identifier and media information from the 200OK message, wherein the media information includes a transmission protocol, a second address, and a second port; Based on the call identifier, it is checked whether a five-ary expected forwarding relationship already exists.

6. The SIP media stream and signaling consistency forwarding method according to claim 5, wherein: After receiving the 200OK message corresponding to the INVITE message and checking whether a five-way expected forwarding relationship already exists, the method further includes: When it is confirmed that a five-way expected forwarding relationship already exists, the second address and the second port in the received 200OK message are replaced with corresponding mapping addresses and mapping ports according to the five-way expected forwarding relationship, and the modified 200OK message is forwarded.

7. The SIP media stream and signaling consistency forwarding method according to claim 6, wherein: In the case where there is no five-way expected forwarding relationship, generating a five-way expected forwarding relationship based on the conversion relationship formed by the 200OK message and the three-way expected forwarding relationship includes: In the absence of a five-element expected forwarding relationship, selecting a second mapping address and a second mapping port corresponding to the second address and the second port, and generating a corresponding conversion relationship; Based on the call identifier, searching the ternary expected forwarding relationship; Based on the conversion relationship and the ternary expected forwarding relationship, a quinary expected forwarding relationship is generated, wherein the quinary expected forwarding relationship includes the call identifier, the transmission protocol, the first address, the first port, the second mapping address, the second mapping port, the first mapping address, the first mapping port, the second address, and the second port; According to the generated five-element expected forwarding relationship, the second address and the second port in the 200OK message are replaced with the corresponding second mapped address and the second mapped port, and the modified 200OK message is forwarded.

8. The SIP media stream and signaling consistency forwarding method according to any one of claims 1 to 7, wherein: Converting the received media stream according to the five-element expected forwarding relationship and forwarding the converted media stream includes: According to the five-tuple expected forwarding relationship, convert the five-tuple relationship of the received media stream; Forward the media stream of the converted five-tuple relationship.

9. An electronic device, comprising: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the SIP media stream and signaling consistency forwarding method according to any one of claims 1 to 8.

10. A computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for consistent forwarding of SIP media streams and signaling according to any one of claims 1 to 8 is implemented.

11. A computer program product, comprising a computer program or an instruction, wherein when the computer program or the instruction is executed by a processor, the method for consistent forwarding of SIP media stream and signaling according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • RTP (Real-time Transport Protocol) media stream crossing method, SIP (Session Initiation Protocol) server and SIP communication system

    CN106131084A

  • Communication method and device based on SIP media negotiation and NAT equipment

    CN111885219A

  • SIP data transmission method and device, storage medium and equipment

    CN117714428A