CN115696325A - Session method, device, server and storage medium - Google Patents

Session method, device, server and storage medium Download PDF

Info

Publication number
CN115696325A
CN115696325A CN202110877166.1A CN202110877166A CN115696325A CN 115696325 A CN115696325 A CN 115696325A CN 202110877166 A CN202110877166 A CN 202110877166A CN 115696325 A CN115696325 A CN 115696325A
Authority
CN
China
Prior art keywords
session
terminal
link
server
media
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110877166.1A
Other languages
Chinese (zh)
Inventor
薛志刚
陈晓晖
童春荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202110877166.1A priority Critical patent/CN115696325A/en
Publication of CN115696325A publication Critical patent/CN115696325A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a conversation method, and belongs to the field of network communication. The transmission of the session control signaling of the session between the terminal and the session control server is recovered by updating the session information in the signaling connection server, and the purpose of rapidly recovering the session can be realized without carrying out identity authentication on the terminal again in the process of recovering the transmission of the session control signaling, so that the session is effectively maintained.

Description

Session method, device, server and storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a session method, an apparatus, a server, and a storage medium.
Background
With the development of network communication technology, more and more users choose to implement remote communication in a session manner, a Session Initiation Protocol (SIP) is widely applied to session control, and meanwhile, in order to ensure security of session contents, encryption is often performed through a Transport Layer Security (TLS) protocol. In the process of executing one session, the SIP session control server and the media server are respectively used for transmitting session control signaling and media data of the session, the user equipment and the SIP session control server establish a TLS link, identity authentication of the user equipment is carried out based on the TLS link, after the identity authentication is passed, the user equipment and the SIP session control server establish the session, in the process of establishing the session, the media server distributes an IP address and a port for transmitting the media data for the session established by the user equipment, and meanwhile, the TLS link can be used for transmitting the session control signaling, so that the secure transmission of the session control signaling and the media data between the user equipment and the server is realized. However, the user equipment is often a terminal device that is easy to move, and once the network is switched due to the movement of the location of the user equipment, the IP address and the port of the user equipment change, the TLS link is disconnected, and the authentication identity of the user equipment is lost, thereby resulting in a session interruption.
In the prior art, if network switching occurs in the user equipment, the user equipment reestablishes a TLS link with the server, performs SIP user identity authentication again, and continues transmission of session signaling and media data by reestablishing a session or media negotiation, thereby maintaining the session.
In the above technology, the process from the establishment of the TLS link to the session recovery usually results in long time for session recovery, and the session cannot be effectively maintained.
Disclosure of Invention
In order to solve the problem that in the prior art, in a scenario where a network switch occurs at a terminal, a session recovery consumes a long time, embodiments of the present application provide a session method, an apparatus, a server, and a storage medium. The technical scheme is as follows:
in a first aspect, a session method performed by a signaling connection server is provided, and the method includes: receiving a link binding message of a terminal, wherein the link binding message carries a session identifier of a session and an identifier of a first link, and the first link is a link which is established by the terminal and a signaling connection server and is used for transmitting a session control signaling of the session; responding to the link binding message, updating the identifier of a second link in session information to the identifier of the first link, wherein the session information comprises the corresponding relation among the session identifier, the identifier of the second link and the port number of a port of the signaling connection server, and the port is used for signaling interaction with a session control server; and forwarding the session control signaling of the session between the session control server and the terminal based on the updated session information.
According to the session method provided by the embodiment, the session information in the signaling connection server is updated, the transmission of the session control signaling of the session between the terminal and the session control server is recovered, and the purpose of rapidly recovering the session can be realized without performing identity authentication on the terminal again in the process of recovering the transmission of the session control signaling, so that the session is effectively maintained.
Due to network switching and the like, the terminal address (e.g. IP address) of the terminal changes during the session, which results in the failure (e.g. disconnection) of the original second link of the session, and re-establishes the first link for performing the session, so that the terminal sends a link binding message to the signaling connection server to continue the session without performing signaling interaction processes such as identity authentication again.
In some embodiments, before the receiving the link binding message of the terminal, the method further comprises: receiving an identity authentication request of the terminal, wherein the identity authentication request carries the identifier of the second link; allocating the port for the session; sending the identity authentication request to the session control server; if the identity authentication of the terminal passes, receiving a session establishment response of the session control server, wherein the session establishment response carries the session identifier; and recording the session information, wherein the session information comprises the corresponding relation among the session identifier, the port number of the port and the identifier of the second link.
After the identity authentication is passed, the signaling connection server acquires information required for forwarding the session control signaling for the session by recording the corresponding relation among the port number of the allocated port, the session identifier and the identifier of the second link, so that the purpose of communicating the session is achieved.
In some embodiments, a cleaning mechanism is provided for the session information, and if no other session control instruction is received within the first time length of receiving any session control signaling, the session information is deleted. In some embodiments, a release mechanism is provided for a port, such as releasing the port in the event that session information is deleted. For another example, no other session control command is received within the first time length of receiving any session control signaling, and the port is released. By the method, the signaling continuation server can provide forwarding of the session control signaling for the terminals, and confusion and service blockage can not be caused.
In some embodiments, before the sending the authentication request to the session control server, the method further comprises: allocating the port for the session, and recording initial session information, wherein the initial session information includes a corresponding relationship between the identifier of the second link, the identifier of the initial session, and the port number of the port; if the identity authentication of the terminal passes, receiving a session establishment response of the session control server, wherein the session establishment response carries the session identifier; and updating the initial session identifier in the initial session information to the session identifier to obtain the session information.
In the embodiment, when the identity authentication is not completed, the initial session information including the initial session identifier is recorded, and then the initial session information is updated based on the session identifier obtained after the identity authentication is passed.
In some embodiments, the second link is: before the signaling connection server receives the link binding message, the established link for transmitting the session control signaling of the session between the terminal and the signaling connection server. After the terminal has performed the network handover, the second link is in a disconnected state, and the first link is established between the terminal and the signaling connection server as in the above embodiment in order to continue the session.
In some embodiments, the forwarding, between the session control server and the terminal, session control signaling for the session based on the updated session information includes: receiving a first session control signaling from the terminal, wherein the first session control signaling carries a session identifier of the session; and determining the session information corresponding to the session identification, and forwarding the first session control signaling to the session control server based on the port indicated by the session information.
In the above embodiment, the transmission of the uplink signaling from the terminal to the session control server can be realized through the updated session information, so that the normal transmission of the session control signaling is ensured while the efficiency of session recovery is improved.
In some embodiments, the forwarding session control signaling for the session between the session control server and the terminal based on the updated session information includes: receiving a second session control signaling from the session control server based on the port, determining session information corresponding to the port number of the port, and forwarding the second session control signaling to the terminal based on the first link indicated by the session information; under the condition that the session control signaling is received through any port, a link used for sending the session control signaling can be quickly determined based on the port, and the session efficiency is improved.
Or the like, or, alternatively,
in some implementations, the forwarding, between the session control server and the terminal, session control signaling for the session based on the updated session information includes:
and receiving a second session control signaling from the session controller based on the port, determining session information corresponding to a session identifier carried by the second session control signaling, and forwarding the second session control signaling to the terminal based on the first link indicated by the session information.
In the above embodiment, the updated session information can be used to implement downlink signaling transmission from the session control server to the signaling connection server, so that the normal transmission of the session control signaling is ensured while the efficiency of session recovery is improved. Optionally, in the foregoing embodiment, when the second session control signaling carries the session identifier, the link used for sending the session control signaling can be quickly determined based on the session identifier, so that the session efficiency is improved.
In a second aspect, a session method is provided, which is performed by a media server, and includes: receiving a first media message through a service address of the media server, wherein the first media message carries a first terminal address, media data of a session and a password corresponding to the session, and the first terminal address is an address of the terminal after network switching; in response to receiving the first media packet, verifying the password based on the service address; if the verification is passed and the first terminal address is inconsistent with the second terminal address in the session information, updating the second terminal address in the session information into the first terminal address, wherein the session information comprises a first corresponding relation between the service address corresponding to the session and the second terminal address, and the second terminal address is the address of the terminal before network switching occurs; and transmitting the media message of the session based on the updated session information.
The session method provided by the embodiment of the application recovers the transmission of the media message of the session between the terminal and the media server by updating the session information in the media server, and can realize the purpose of rapidly recovering the session because the transmission process of the media message is recovered without re-establishing a media transmission channel for the terminal, thereby effectively maintaining the session.
In some embodiments, before receiving the first media packet through the service address of the media server, the method further includes: distributing the service address and the password for the session, and recording a second corresponding relation between the service address and the password; receiving a second media message through the service address, wherein the second media message carries the second terminal address, the media data of the session and the password; and responding to the verification passing of the password carried by the second media message based on the second corresponding relation, and recording the session information, wherein the session information comprises the corresponding relation between the service address and the second terminal address. By recording the session information, the media server can acquire the information required by the media message transmission between the media server and the terminal, and the session communication is realized.
In some embodiments, the first media packet is an RTP packet, and the password is located in a header of the RTP packet.
In some embodiments, the method further comprises: and in response to receiving the third media message, discarding the third media message, wherein the third media message does not carry the password. By discarding the media message not carrying the password, the media server can be prevented from further processing the media message, the security of the media server is improved, and the processing resources are saved.
In some embodiments, the verification pass refers to: and the password authentication of a plurality of continuous first media messages passes. And the security of the media server can be improved by carrying out corresponding processing steps after the password authentication based on the continuous first media messages passes.
In some embodiments, the transmitting the media packets of the session based on the updated session information includes: and determining session information corresponding to the service address, and transmitting a media message of the session with the terminal based on the first terminal address in the session information. In the above embodiment, the media message transmission from the media server to the terminal can be realized through the updated session information, so that the normal operation of the session is ensured while the efficiency of session recovery is improved.
In a third aspect, a conversation device is provided, which comprises a plurality of functional modules for executing corresponding steps in the conversation method as provided in the first aspect.
In a fourth aspect, a conversational apparatus is provided, the apparatus comprising a plurality of functional modules for performing corresponding steps in the conversational method as provided in the second aspect.
In a fifth aspect, a server is provided, which includes a communication bus for transmitting information between the above components, at least one network interface for communicating with other devices or communication networks, a memory storing program codes, and at least one processor implementing any one of the steps of the session method in the first or second aspect by reading and executing the program codes stored in the memory.
In a sixth aspect, a computer readable storage medium is provided, in which program code is enabled, when executed by a processor of a server, to perform any of the steps of the session method of the first or second aspect described above.
Drawings
Fig. 1 is a schematic diagram of an implementation environment of a session method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a server 200 according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps of a session method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a signaling connection server according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of a session method according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating steps of a session method according to an embodiment of the present application;
fig. 7 is a schematic diagram of a first package learning process provided by an embodiment of the present application;
FIG. 8 is a diagram illustrating a session context provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a session device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a session device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment of a session method provided in an embodiment of the present application, where the implementation environment includes: a terminal 101, a first Network Address Translation (NAT) device 102, a second NAT device 103, a session control server 104, a signaling connection server 105, and a media server 106.
The terminal 101 is a User Equipment (UE), an application program supporting a session is installed in the terminal 101, and optionally, the terminal 101 is a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like, but is not limited thereto.
The first NAT device 102 and the second NAT device 103 are configured to allocate an Internet Protocol (IP) address and a port of a wide area network to the terminal 101, so that the terminal 101 can perform session control signaling transmission and media message transmission of a session with the session control server 104, the signaling connection server 105, and the media server 106 in the wide area network. The terminal 101 accesses the wide area network through the first NAT device on the first network, and if the terminal 101 enters the second network after network switching occurs, the terminal 101 accesses the wide area network through the second NAT device.
The session control server 104, the signaling connection server 105, and the media server 106 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content Delivery Networks (CDNs), and large data and artificial intelligence platforms.
The terminal 101 generally refers to one of a plurality of terminals, and this embodiment is only illustrated by the terminal 101, and the terminal 101 located in the local area network can establish a session with another terminal through the session control server 104, the signaling connection server 105, and the media server 106 located in the wide area network. The session control server 104 is configured to transmit session control signaling with the terminal 101 to control a session. The signaling connection server 105 is configured to forward the session control signaling between the terminal 101 and the session control server 104, and the signaling connection server 105 is connected to the session control server 104 through a wired or wireless network. The media server 106 is connected to the terminal 101, and is configured to transmit a media packet of a session, where the media packet carries media data of the session, and the media data includes video data and voice data of the session.
Optionally, the session control server 104, the signaling connection server 105, and the media server 106 may be one device or multiple devices, which is not limited in this embodiment.
Fig. 2 is a schematic structural diagram of a server 200 according to an embodiment of the present application. The server 200 shown in fig. 2 is any one of the session control server 104, the signaling connection server 105 and the media server 106, which are used for executing the operations involved in the session method, and as shown in fig. 2, the server 200 includes at least one processor 201, a communication bus 202, a memory 203 and at least one network interface 204.
The processor 201 is, for example, a Central Processing Unit (CPU), a Network Processor (NP), a Graphics Processing Unit (GPU), a neural-Network Processing Unit (NPU), a Data Processing Unit (DPU), a microprocessor, or one or more integrated circuits for implementing the present disclosure. For example, the processor 201 includes an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. PLDs are, for example, complex Programmable Logic Devices (CPLDs), field-programmable gate arrays (FPGAs), general Array Logic (GAL), or any combination thereof.
A communication bus 202 is used to transfer information between the above components. The communication bus 202 is optionally divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 2, but it is not intended that there be only one bus or one type of bus.
The memory 203 is, for example, but not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 203 is, for example, separate and connected to the processor 201 via the communication bus 202. Or alternatively the memory 203 and processor 201 are integrated.
The network interface 204 uses any transceiver or the like for communicating with other devices or a communication network. The network interface 204 includes a wired network interface and optionally also a wireless network interface. The wired network interface is, for example, an ethernet interface. The ethernet interface is for example an optical interface, an electrical interface or a combination thereof. The wireless network interface is, for example, a Wireless Local Area Network (WLAN) interface, a cellular network interface, or a combination thereof.
In some embodiments, processor 201 includes one or more CPUs, such as CPU0 and CPU1 shown in FIG. 2.
In some embodiments, server 200 optionally includes multiple processors, such as processor 201 and processor 205 shown in FIG. 2. Each of these processors is, for example, a single-core processor, or, for example, a multi-core processor. A processor herein may alternatively refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In some embodiments, server 200 also includes output devices and input devices. The output device optionally displays information in a variety of ways. For example, the output device may alternatively be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. An input device is in communication with the processor 201, optionally receiving user input in a variety of ways. For example, the input device is optionally a mouse, keyboard, touch screen device, or sensing device, etc.
Alternatively, the processor 201 implements the method in the following embodiments by reading the program code 210 saved in the memory 203, or the processor 201 implements the method in the following embodiments by internally stored program code. In the case where the processor 201 implements the method in the following embodiments by reading the program code 210 stored in the memory 203, the program code implementing the conversation method provided by the embodiment of the present application is stored in the memory 203.
For more details of the processor 201 to implement the above functions, reference is made to the following description of various method embodiments, which are not repeated here.
Embodiments of the present application also provide a computer readable storage medium, such as a memory 203, comprising program code, which is executable by a processor 201 of a server 200 to perform a session method. Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a compact-disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
Based on the implementation environment shown in fig. 1, the embodiment of the present application takes a process in which a terminal performs a session based on a first NAT device, network switching occurs, and the terminal continues to perform the session through a second NAT device after network switching as an example, and describes a session method. The session includes interaction of session control signaling and interaction of media packets, and the following describes interaction of session control signaling in the session before the network handover occurs in the terminal based on the embodiment shown in fig. 3.
Fig. 3 is a flowchart of steps of a session method provided in an embodiment of the present application, where the method is executed by a signaling connection server, and as shown in fig. 3, the method includes the following steps:
301. the terminal initiates a session, a Link is established between the terminal and the signaling connection server, and the Link mark of the Link is Link1.
The signaling connection server can provide the forwarding function of the session control signaling between the terminal and the session control server, so that the session control server is shielded from the change caused by the network switching of the terminal, and the transmission of the session control signaling is quickly recovered. The Link marked as Link1 is used for interacting the session control signaling between the terminal and the signaling connection server, and the Link is a transmission channel of the session control signaling established based on the TLS protocol. In some embodiments, the link is used for encrypted transmission of session control signaling for the session, thereby ensuring the security of the session. After the link is established successfully, the terminal can send the session control signaling to the signaling connection server based on the link, and the signaling connection server can also forward the session control signaling to the terminal based on the link.
Illustratively, the process of establishing the link is explained. The method comprises the steps that a terminal sends a first message to a signaling connection server, the first message is used for initiating a request for establishing a TLS link to the signaling connection server, the signaling connection server responds to the first message and exchanges a public key with the terminal, the public key is a parameter for generating a secret key, the signaling connection server and the terminal generate the secret key based on the exchanged public key, the generation of the secret key is responded, the terminal and the signaling connection server respectively send confirmation messages to an opposite terminal, and then the link establishment is completed.
It should be noted that the communication of the TLS link is established on the basis that the terminal and the signaling connection server have already acquired the IP address and the port of the opposite terminal, and if the IP address and the port are changed due to network switching of the terminal, the TLS link is disconnected, and the terminal needs to establish the TLS link with the signaling connection server again.
302. The terminal sends an identity authentication request M1 to the signaling connection server, wherein the identity authentication request M1 carries a Link identification Link1.
The identity authentication request M1 is used to instruct the signaling connection server to establish a corresponding relationship between the established link between the terminal and the signaling connection server and the session control server. In some embodiments, the terminal sends the identity authentication request M1 to the signaling connection server based on the link established in step 301, and the signaling connection server receives the identity authentication request M1 of the terminal.
303. And the signaling connection server responds to the identity authentication request M1 and allocates a port of the signaling connection server for the session initiated by the terminal.
The session control server is based on SIP protocol and is used for transmitting session control signaling with the terminal and controlling the session. For example, the session control server releases the session that the terminal has established in response to the end session signaling of the terminal. A port allocated to a session initiated by a terminal is a User Datagram Protocol (UDP) port, a Transmission Control Protocol (TCP) port, or another protocol port of a signaling connection server, which is not limited in this embodiment of the present application.
In some embodiments, the signaling connection server responds to the identity authentication request M1, obtains a Link identifier Link1 carried by the identity authentication request M1, and allocates a port of the signaling connection server for a session initiated by the terminal. When allocating the port, the signaling connection server may allocate a free port to the session initiated by the terminal based on a principle of random allocation. After the port allocation is completed, the signaling connection server may forward the session control signaling of the terminal to the session control server based on the port, and may also receive the session control signaling sent by the session control server based on the port. Because the signaling connection server allocates ports for sessions initiated by each terminal, for the session control server, the received session control signaling is all sent through a certain port of the signaling connection server, and changes such as network switching on the terminal side cannot be sensed.
In some embodiments, if the port is a TCP port, the signaling connection server may establish a link with the session control server based on the port allocated for the session, forward the session control signaling of the session to the session control server through the link, and the port number of the port may be used to identify the link between the signaling connection server and the session control server.
304. The signaling connection server sends the identity authentication request M1 to the session control server.
305. The session control server responds to the identity authentication request M1 and sends 401 a response to the signaling connection server.
The 401 response is an authentication response and is used for indicating the terminal to return identity authentication information, the 401 response carries encryption information, and the encryption information is used for generating the identity authentication information of the terminal.
306. The signaling connection server receives the 401 response and sends the 401 response to the terminal.
307. The terminal receives the 401 response and sends an identity authentication request M2 to the signaling connection server, wherein the identity authentication request M2 carries identity authentication information of the terminal.
In some embodiments, the terminal receives the 401 response, generates identity authentication information based on the encrypted information carried in the 401 response, and sends an identity authentication request M2 to the signaling connection server, where the identity authentication request M2 carries the identity authentication information.
308. The signaling connection server receives the identity authentication request M2 and sends the identity authentication request M2 to the session control server.
309. The session control server receives the identity authentication request M2, verifies the identity authentication information of the terminal, and if the verification is passed, the session control server sends a first 200 response to the signaling connection server, wherein the first 200 response carries a session identifier.
The first 200 response is a session establishment response, which is used to indicate that the terminal identity authentication is successful, and session establishment can be performed.
In some embodiments, if the authentication information of the terminal is verified by the session control server, it is determined that the terminal is a valid user, that is, the session control server completes authentication of the terminal, allocates a session identifier for a session initiated by the terminal, and sends a first 200 response to the signaling connection server, and if the authentication information is not verified, the signaling connection server continues to send 401 responses to the terminal.
310. The signaling connection server receives the first 200 response, records session information C1, where the session information C1 includes a session identifier, a Link identifier Link1, and a corresponding relationship between port numbers of ports of the signaling connection server, and sends the first 200 response to the terminal.
In this embodiment of the present application, the session information C1 includes related information of a session initiated by a terminal before network handover, and specifically, may include: the corresponding relation among the session identification of the session, the link identification of the link and the port number of the port of the signaling connection server. The Link identifier Link1 is an identifier of a Link established between the terminal and the signaling connection server before network switching, and the port is a port allocated by the signaling connection server for a session initiated by the terminal.
In some embodiments, the signaling connection server parses the received first 200 response, obtains the session identifier, and correspondingly stores the session identifier, the Link identifier Link1, and the port number of the port of the signaling connection server, to obtain the session information C1.
Through the session information C1, a corresponding relationship between the session identifier, the Link identifier Link1 and the port number of the port of the signaling connection server is established, so that the signaling connection server can forward the session control signaling of the session established by the terminal between the terminal and the session control server based on the session information C1, and a stable session control signaling transmission channel is established between the terminal and the session control server.
In some embodiments, the signaling connection server can obtain the session information C1 by recording the initial session information OC1 first, and then updating the initial session information OC1 based on the session identifier, illustratively, the signaling connection server allocates a port of the signaling connection server for the session established by the terminal, correspondingly stores the initial session identifier, the Link identifier Link1 and a port number of the port of the signaling connection server to obtain the initial session information OC1, sends the authentication request M1 to the session control server, receives a session establishment response of the session control server if the authentication of the terminal passes, where the session establishment response carries the session identifier, and updates the initial session identifier in the initial session information OC1 to the session identifier to obtain the session information C1. The initial session identifier is an invalid session identifier, and is used for recording initial session information when the identity authentication of the terminal is not completed, and after the identity authentication of the terminal is completed and an actual session identifier is distributed by the session control server subsequently, the purpose of rapidly acquiring the session information can be achieved directly by updating the session identifier in the initial session information. For example, the initial session identifier is a preset invalid value.
It should be noted that, the signaling connection server may record the session information C1 first and then send the first 200 response to the terminal, or the signaling connection server may send the first 200 response to the terminal first and then record the session information C1, which is not limited in this embodiment of the present application.
311. And the terminal receives the first 200 response, and sends an Invite1 message to the session control server through a signaling connection server, wherein the Invite1 message carries the session identifier.
The Invite1 message is a first session Invite message, and is used to instruct the session control server to establish a session corresponding to the session identifier.
312. The session control server receives the Invite1 message, and continues the server through the signaling, and sends 407 a response to the terminal, where the 407 response is used to instruct the terminal to return authentication information, and the authentication information is used to perform call authentication on the terminal.
Wherein the 407 response is an authentication response. The authentication information is the identity authentication information generated by the terminal in the above step 307. The step of performing call authentication on the terminal means that the session control server verifies the identity authentication information of the terminal again to determine that the terminal completes identity authentication, so that the phenomenon of maliciously stealing the IP address and the port of the terminal is avoided.
In some embodiments, the session control server receives the Invite1 message, and if it is detected that the Invite1 message does not carry authentication information, the session establishment procedure is not performed, and a response is sent 407 to the terminal through the signaling connection server.
313. The terminal receives the 407 response, continues the server through the signaling, and sends an ACK1 message to the session control server.
Wherein the ACK1 message is used to indicate that the 407 response has been received.
314. The session control server receives the ACK1 message.
315. The terminal continues the server through the signaling, and sends Invite2 message to the session control server, where the Invite2 message carries the session identifier and the authentication information.
The Invite2 message is a second session invitation message, and is used to instruct the session control server to verify the authentication information, and establish a session corresponding to the session identifier.
316. And the session control server receives the Invite2 message, verifies the authentication information, establishes a session corresponding to the session identifier if the authentication is passed, and transmits a second 200 response to the terminal through a signaling connection server.
Wherein the second 200 response is used to indicate that the session establishment was successful. In some embodiments, if the session control server does not verify the authentication information, the session control server continues signaling the connection server to send 407 a response to the terminal.
317. And the terminal receives the second 200 response and continues the server through signaling to send an ACK2 message to the session control server.
Wherein the ACK2 message is used to indicate that the second 200 response has been received.
It should be noted that, the steps 311 to 317 are a session establishment procedure with call authentication, and in some embodiments, the terminal and the session control server can directly establish a session. Illustratively, the terminal sends an Invite message to the session control server through the signaling connection server, where the Invite message carries the session identifier, the session control server creates a session corresponding to the session identifier, and sends a 200 response to the terminal through the signaling connection server, the terminal receives the 200 response, and sends an ACK message to the session control server through the signaling connection server, where at this time, the session creation is completed.
It should be noted that, the aforementioned that the terminal sends the message to the session control server through the signaling connection server means that the terminal sends the message to the signaling connection server, and the signaling connection server receives the message and sends the message to the session control server. The session control server sending the response to the terminal through the signaling connection server means that the session control server sends the response to the signaling connection server, and the signaling connection server receives the response and sends the response to the terminal.
In some embodiments, the signaling connection server can implement the above steps through 3 services, as shown in fig. 4, the signaling connection server includes: link processing services, translation services, and session mapping services. The link processing service is configured to perform the above steps 301, 306, 311-313, and 315-317 to complete establishing a link with the terminal and interacting with the terminal, the conversion service is configured to perform the above steps 303, 304, 308, 311-313, and 315-317 to complete allocating a port of a signaling connection server for a session established for the terminal and interacting with the session control server, and the session mapping service is configured to perform the above step 310 to complete recording session information of the session established by the terminal.
The above embodiment corresponding to fig. 3 is to describe a process of establishing a session control signaling transmission channel before a network handover occurs in a terminal, and next, with reference to fig. 5, a process of recovering a session control signaling transmission after a network handover occurs in a terminal is described, fig. 5 is a flowchart of steps of a session method provided in an embodiment of the present application, and as shown in fig. 5, the method includes the following steps:
501. the terminal is switched over the network.
In some embodiments, if the location of the terminal changes and enters the coverage of the second network from the coverage of the first network, the terminal is switched from the first network to the second network, that is, the terminal has network handover. Before the terminal is switched, the terminal is accessed to the wide area network through the first NAT equipment in the first network, after the terminal is switched, the terminal is accessed to the wide area network through the second NAT equipment in the second network, so that the IP address and the port of the terminal are changed, the Link which is identified as Link1 and is established between the terminal and the signaling connection server is disconnected, the signaling connection server cannot forward the session control signaling through the session information C1, and a session control signaling transmission channel between the terminal and the session control server is disconnected.
502. The terminal sends a Link binding message M3 to the signaling connection server, and the Link binding message M3 carries the session identifier and the Link identifier Link2 of the session established by the terminal.
The Link binding message M3 is used to indicate the signaling connection server to update the session information C1, where the session identifier is a session identifier allocated by the session control server to the terminal in step 309 and is used to indicate a session established before the network handover occurs in the terminal, the Link identifier Link2 is used to indicate a Link newly established with the signaling connection server after the network handover occurs in the terminal, and the Link is a TLS Link and is used to perform encrypted transmission on the session control signaling of the session after the network handover occurs in the terminal, so as to ensure the security of the session.
In some embodiments, the terminal re-establishes a Link with the signaling connection server based on the method similar to the above step 301, where the identifier of the Link is Link2, and the terminal sends a Link binding message M3 to the signaling connection server based on the re-established Link, and the signaling connection server receives the Link binding message M3 of the terminal.
503. The signaling connection server responds to the Link binding message M3, and updates the Link identifier Link1 in the session information C1 corresponding to the session identifier to the Link identifier Link2, so as to obtain the session information C2.
The Link indicated by the Link identifier Link1 is a Link established between the terminal and the signaling connection server for transmitting the session control signaling of the session before the signaling connection server receives the Link binding message M3, that is, a Link established between the terminal and the signaling connection server before the network handover occurs.
In some embodiments, in response to the Link binding message M3, the signaling connection server determines, according to the session identifier in the Link binding message M3, session information C1 corresponding to the session identifier, updates the Link identifier Link1 corresponding to the session information C1 before network handover to a Link identifier Link2 corresponding to the session information C1 after network handover, and obtains session information C2, where the Link indicated by the Link identifier Link1 is a Link that has been disconnected by the terminal.
By updating the session information C1, the corresponding relationship between the link identifier of the link re-established after the network switching of the terminal and the port number of the port of the signaling connection server is re-recorded, and the port is a port allocated to the session established by the signaling connection server for the terminal and used for interaction between the signaling connection server and the session control service, so that the signaling connection server can continue to forward the session control signaling of the session between the terminal and the session control server, thereby recovering the transmission of the session control signaling.
504. The signaling connection server forwards the session control signaling of the session between the session control server and the terminal based on the session information C2.
In some embodiments, after the terminal has undergone network handover, the signaling connection server determines, in response to receiving a first session control signaling sent by the terminal, session information C2 corresponding to a session identifier carried in the first session control signaling, and forwards the first session control signaling to the session control server based on a port indicated by the session information C2. In some embodiments, if the signaling connection server establishes a link with the session control server based on the port, the signaling connection server forwards the first session control signaling to the session control server through the link indicated by the port number of the port.
In some embodiments, after the terminal has undergone network handover, the signaling connection server determines, in response to receiving, by the port, a second session control signaling sent by the session control server, session information C2 corresponding to the port number of the port, and forwards, to the terminal, the second session control signaling based on the Link indicated by the Link identification Link2 in the session information.
It should be noted that, for the signaling connection server, when a link between the signaling connection server and the terminal is established, the link binding refers to a port of the signaling connection server facing the terminal, so that when any signaling needs to be sent to the terminal, the signaling connection server can send the signaling through a corresponding link on the bound port.
According to the session method provided by the embodiment of the application, after the network switching of the terminal occurs, the signaling connection server establishes the corresponding relationship between the Link identifier (Link 2) of the Link reestablished by the terminal between the network switching and the signaling connection server and the port of the signaling connection server corresponding to the session established by the terminal by updating the Link identifier in the session information C1, so that the signaling connection server can forward the session control signaling between the terminal and the session control server based on the Link identifier (Link 2) and the port recorded in the updated session information, thereby recovering the transmission of the session control signaling between the terminal and the session control server.
Based on the implementation environment shown in fig. 1, in the embodiment of the present application, a session method is described by taking an example that a network is switched in a process in which a terminal performs a session based on a first NAT device, and the terminal continues to perform a session through a second NAT device after the network is switched. Next, the interaction of media packets in the session before and after the network switch is described with reference to fig. 6.
Fig. 6 is a flowchart of steps of a session method provided by an embodiment of the present application, where the method is executed by a media server, and as shown in fig. 6, the method includes the following steps:
601. the media server distributes the service address and the password of the media server for the session established by the terminal, records the corresponding relation R1 between the address of the media server and the password, and the password is used for verifying whether the media message of the session is a legal message.
The media server is configured to transmit a media packet of the session, where the media packet carries media data of the session, and a service address of the media server includes an IP address and a port of the media server.
In some embodiments, in a session establishment process, a terminal sends an Invite message to a session control server, the session control server sends an indication message to a media server in response to the Invite message, the indication message is used for indicating the media server to allocate a service address and a password to a session established by the terminal, the media server allocates the service address and the password of the media server to the session established by the terminal in response to the indication message, the service address and the password of the allocated media server are stored correspondingly so as to record a corresponding relation R1 between the service address of the media server and the password, and the service address and the password are sent to the session control server, and the session control server sends an establishment success response to the terminal, wherein the establishment success response carries the service address and the password. And the terminal receives the successful establishment response and acquires the service address and the password of the media server from the successful establishment response. After the allocation of the service address is completed, the terminal can send the media message of the session to the media server based on the service address, and the media server can also receive the media message of the session based on the service address.
It should be noted that, in this step 601, a process of allocating a service address and a password to a session established by a terminal by a media server is not currently established, and a corresponding relationship between the service address and the terminal address is not yet established.
602. The terminal sends a media message M4 to the media server based on the service address of the media server, the media message M4 carries a terminal address D1, media data of the session and a password, and the terminal address D1 is an address of the terminal before network switching occurs.
The media message M4 is a real-time transport protocol (RTP) message, a password carried by the media message may be located in a message header of the RTP message, and a terminal address D1 carried by the media message is an IP address and a port of the terminal before network switching occurs.
In some embodiments, after the terminal and the session control server complete the session establishment, the terminal sends a plurality of media packets M4 to the service address of the media server within the target duration.
603. The media server receives the media message M4 of the terminal through the service address, and records session information C3 in response to the fact that the password carried by the media message M4 passes the verification based on the corresponding relationship R1, where the session information C3 includes the corresponding relationship R2 between the service address and the terminal address D1.
In some embodiments, as shown in fig. 7, in response to that the media server continuously receives multiple media packets M4 within the target duration, and the passwords carried by the multiple media packets M4 are the same as the password corresponding to the service address, that is, the passwords carried by the multiple media packets M4 are verified based on the correspondence R1 between the service address and the password, the media server correspondingly stores the terminal address D1 carried by the media packet M4 and the service address allocated for the session, so as to obtain session information C3, where the process may be referred to as a process of performing first packet learning by the media server.
By recording the session information C3, the corresponding relation R2 between the terminal address D1 of the terminal before network switching and the service address of the media server is recorded, so that the media server can determine the terminal address of the terminal based on the service address, and thus transmit the media packet of the session with the terminal, and since the terminal already acquires the service address allocated by the media server to the terminal when the session is created, a stable media packet transmission channel is established between the terminal and the media server, and media packet transmission of the session can be performed.
It should be noted that, after the media server records the session information C3, the address of the media server in the correspondence between the stored service address and the password can be updated to the session information C3, that is, the password assigned to the session and the session information of the service address are stored correspondingly, so as to obtain the session context of the session established by the terminal, and optionally, the session context further includes other information of the session, such as an encoding method and a decoding method of media data. If there are multiple terminals performing media packet transmission of a session through the media server, as shown in fig. 8, the media server allocates different service addresses and different passwords to the session of each terminal, and creates a corresponding session context (the session context includes session information), where n in fig. 8 represents the number of terminals, and n is an integer greater than 0.
604. The terminal is switched over the network.
In some embodiments, if the location of the terminal changes and the terminal enters the coverage of the second network from the coverage of the first network, the terminal is switched from the first network to the second network, that is, the terminal performs network switching, before the terminal performs network switching, the terminal accesses the wide area network through the first NAT device in the first network, and after the terminal performs network switching, the terminal accesses the wide area network through the second NAT device in the second network, so that the IP address and the port of the terminal change, the media server cannot send the media packet to the terminal through the session information C3, and a media packet transmission channel between the terminal and the media server is disconnected.
605. The terminal sends a media message M5 to the media server based on the service address of the media server, the media message M5 carries a terminal address D2, media data of the session and a password, and the terminal address D2 is an address of the terminal after network switching occurs.
The media message M5 is a media message sent to a media server after a network switch occurs to a terminal, the terminal address D2 carried by the media message M5 is an IP address and a port of the terminal after the network switch occurs, the media message M5 may be an RTP message, and a password carried by the media message M5 may be located in a message header of the RTP message.
After the terminal is switched to the network, because the service address of the media server is not changed, the terminal can send the media message M5 to the service address of the media server.
606. The media server receives the media message M5 of the terminal through the service address, and verifies the password carried by the media message M5 based on the service address.
In some embodiments, the media server receives the media message M5 through a service address of the media server, and verifies whether the password carried in the media message M5 is consistent with the password corresponding to the service address in response to receiving the media message M5, and if so, the verification is passed, and if not, the verification is not passed.
In some embodiments, this step 606 further comprises: the media server responds to the received media message M6 and discards the media message M6; for example, if the media message M6 does not carry the password, or the media server does not verify the password carried by the media message M6, that is, the media message M6 is an illegal message. By discarding the illegal message, the occupation of the illegal message on the server resource is avoided, and the security of the session is further ensured.
607. If the verification is passed and the terminal address D2 is not consistent with the terminal address D1 in the session information C3, the media server updates the terminal address D1 in the session information C3 to the terminal address D2 to obtain the session information C4.
In some embodiments, this step 607 includes: if the multiple continuous media messages M5 received by the media server pass the verification, and the terminal addresses D2 carried by the multiple media messages M5 are inconsistent with the terminal addresses D1 in the session information C3 corresponding to the service address, the terminal addresses D1 in the session information C3 are updated to the terminal addresses D2 carried by the media messages M5, and session information C4 is obtained.
By updating the session information C3, the corresponding relationship R3 between the terminal address D2 after the network switching of the terminal and the service address of the media server is recorded, so that the media server can continue to send media packets to the terminal after the network switching of the terminal occurs, and the media packet transmission can be recovered without re-establishing a media packet transmission channel of the session, and meanwhile, since the transmission frequency of the media packets M5 is high during the session, the media server can update the session information C3 through the received media packets M5 in a short time after the network switching of the terminal occurs, thereby improving the efficiency of recovering the media packet transmission of the session.
608. The media server transmits the media message of the session based on the session information C4.
In some embodiments, after the terminal has a network switch, the media server determines the session information C4 corresponding to the service address classified for the session, and transmits the media packet of the session with the terminal based on the terminal address D2 in the session information C4.
According to the session method provided by the embodiment of the application, after the terminal is switched over, the media server updates the terminal address in the session information C3 by verifying the password and the terminal address in the received continuous media messages M5, so that the media message transmission of the session is recovered, and because the transmission frequency of the media messages M5 is very high in the session process, the method can quickly recover the media message transmission of the session after the terminal is switched over, so that the session is effectively maintained.
In some embodiments, if a network handover occurs during a session of a terminal, based on the methods provided in the embodiments corresponding to fig. 3, fig. 5, and fig. 6, session control signaling transmission and media packet transmission for quickly resuming the session can be implemented, the session is effectively maintained, and a user cannot perceive that the session is interrupted, thereby improving user experience.
It can be understood that, in a scenario where a network handover occurs at a terminal, the method provided in the embodiment corresponding to fig. 3, 5, and 6 may be adopted to respectively recover session control signaling transmission and media packet transmission of a session, or the method provided in the embodiment corresponding to fig. 3 and 5 is adopted to recover transmission of session control signaling and any method is adopted to recover transmission of media packets, or the method provided in the embodiment corresponding to fig. 6 is adopted to recover transmission of media packets and any method is adopted to recover transmission of session control signaling, and by using the foregoing methods, a purpose of rapidly recovering a session can be achieved.
Fig. 9 is a schematic structural diagram of a session device according to an embodiment of the present application, where the session device is configured to execute steps in executing the session method, and referring to fig. 9, the session device includes: a receiving module 901, an updating module 902 and a forwarding module 903.
A receiving module 901, configured to receive a link binding message of a terminal, where the link binding message carries a session identifier of a session and an identifier of a first link, and the first link is a link that is established between the terminal and a signaling connection server and is used for transmitting a session control signaling of the session;
an updating module 902, configured to update, in response to the link binding message, an identifier of a second link in session information to an identifier of the first link, where the session information includes a correspondence between the session identifier, the identifier of the second link, and a port number of a port of the signaling connection server, and the port is used for signaling interaction with a session control server;
a forwarding module 903, configured to forward session control signaling of the session between the session control server and the terminal based on the updated session information.
In some embodiments of the present invention, the,
the receiving module 901 is further configured to receive an identity authentication request of the terminal, where the identity authentication request carries an identifier of the second link;
the device also includes: the allocation module is used for allocating the port for the session;
the forwarding module 903 is further configured to send the identity authentication request to the session control server;
the receiving module 901 is further configured to receive a session establishment response of the session control server if the identity authentication of the terminal passes, where the session establishment response carries the session identifier;
and the recording module is used for recording the session information, wherein the session information comprises the corresponding relation among the session identifier, the port number of the port and the identifier of the second link.
In some embodiments, the allocating module is configured to allocate the port for the session, and record initial session information, where the initial session information includes a correspondence between an identifier of the second link, an initial session identifier, and a port number of the port;
the receiving module 901 is further configured to receive a session establishment response of the session control server if the identity authentication of the terminal passes, where the session establishment response carries the session identifier;
the updating module 902 is configured to update the initial session identifier in the initial session information to the session identifier, so as to obtain the session information.
In some embodiments, the second link is: before the signaling connection server receives the link binding message, the link which is established between the terminal and the signaling connection server and is used for transmitting the session control signaling of the session.
In some embodiments, the forwarding module 903 is configured to receive a first session control signaling from the terminal, where the first session control signaling carries a session identifier of the session; and determining session information corresponding to the session identification, and forwarding the first session control signaling to the session control server based on the port indicated by the session information.
In some embodiments, the forwarding module 903 is configured to receive a second session control signaling from the session control server based on the port, determine session information corresponding to the port number of the port, and forward the second session control signaling to the terminal based on the first link indicated by the session information;
or the like, or, alternatively,
the forwarding module 903 is configured to receive a second session control signaling from the session controller based on the port, determine session information corresponding to a session identifier carried in the second session control signaling, and forward the second session control signaling to the terminal based on the first link indicated by the session information.
Fig. 10 is a schematic structural diagram of a session apparatus for performing the steps in the execution of the session method according to an embodiment of the present application, and referring to fig. 10, the session apparatus includes: a receiving module 1001, a verifying module 1002, an updating module 1003 and a transmitting module 1004.
A receiving module 1001, configured to receive a first media packet through a service address of the media server, where the first media packet carries a first terminal address, media data of a session, and a password corresponding to the session, and the first terminal address is an address of a terminal after network switching occurs;
a verification module 1002, configured to verify the password based on the service address in response to receiving the first media packet;
an updating module 1003, configured to update the second terminal address in the session information to the first terminal address if the verification passes and the first terminal address is inconsistent with the second terminal address in the session information, where the session information includes a first correspondence between the service address corresponding to the session and the second terminal address, and the second terminal address is an address of the terminal before network handover occurs;
a transmission module 1004, configured to transmit the media packet of the session based on the updated session information.
In some embodiments, the apparatus further comprises:
the allocation module is used for allocating the service address and the password for the session and recording a second corresponding relation between the service address and the password;
the receiving module 1001 is further configured to receive a second media packet through the service address, where the second media packet carries the second terminal address, the media data of the session, and the password;
and the recording module is used for recording the session information in response to the verification passing of the password carried by the second media message based on the second corresponding relationship, wherein the session information comprises the corresponding relationship between the service address and the second terminal address.
In some embodiments, the first media packet is an RTP packet, and the password is located in a header of the RTP packet.
In some embodiments, the apparatus further comprises:
and the discarding module is used for discarding the third media message in response to receiving the third media message, wherein the third media message does not carry the password.
In some embodiments, the verification pass refers to: and the password authentication of a plurality of continuous first media messages passes.
In some embodiments, the transmitting module 1004 is configured to determine session information corresponding to the service address, and transmit a media packet of the session with the terminal based on the first terminal address in the session information.
It should be noted that: in the embodiment corresponding to fig. 9 and fig. 10, when a conversation is performed, the above-mentioned division of each function module is merely used as an example to illustrate that, in practical applications, the above-mentioned function distribution may be completed by different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the above-mentioned functions. In addition, the session device and the session method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
The terms "first," "second," and the like in this application are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency or limitation on the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first response may be referred to as a second response, and similarly, a second response may be referred to as a first response, without departing from the scope of the various described examples. Both the first response and the second response may be responses, and in some cases, may be separate and distinct responses.
The term "at least one" in this application means one or more, and the term "plurality" in this application means two or more, e.g., a plurality of sessions means two or more sessions.
It is also understood that the term "if" may be interpreted to mean "when" ("where" or "upon") or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined." or "if [ a stated condition or event ] is detected" may be interpreted to mean "upon determining.. Or" in response to determining. "or" upon detecting [ a stated condition or event ] or "in response to detecting [ a stated condition or event ]" depending on the context.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device.
The computer program instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wire or wirelessly. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media such as Digital Video Disks (DVDs), or semiconductor media (e.g., solid state disks), among others.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (20)

1. A session method, performed by a signaling relay server, the method comprising:
receiving a link binding message of a terminal, wherein the link binding message carries a session identifier of a session and an identifier of a first link, and the first link is a link which is established by the terminal and a signaling connection server and is used for transmitting a session control signaling of the session;
responding to the link binding message, updating an identifier of a second link in session information to an identifier of the first link, wherein the session information comprises a corresponding relation among the session identifier, the identifier of the second link and a port number of a port of the signaling connection server, and the port is used for signaling interaction with a session control server;
and forwarding the session control signaling of the session between the session control server and the terminal based on the updated session information.
2. The method of claim 1, wherein before the receiving the link binding message of the terminal, the method further comprises:
receiving an identity authentication request of the terminal, wherein the identity authentication request carries the identifier of the second link;
allocating the port for the session;
sending the identity authentication request to the session control server;
if the identity authentication of the terminal passes, receiving a session establishment response of the session control server, wherein the session establishment response carries the session identifier;
and recording the session information, wherein the session information comprises the corresponding relation among the session identifier, the port number of the port and the identifier of the second link.
3. The method according to claim 1 or 2, wherein the second link is: and before the signaling connection server receives the link binding message, the established link for transmitting the session control signaling of the session between the terminal and the signaling connection server.
4. The method according to claim 1, wherein forwarding session control signaling for the session between the session control server and the terminal based on the updated session information comprises:
receiving a first session control signaling from the terminal, wherein the first session control signaling carries a session identifier of the session;
and determining session information corresponding to the session identification, and forwarding the first session control signaling to the session control server based on the port indicated by the session information.
5. The method according to claim 1, wherein forwarding session control signaling for the session between the session control server and the terminal based on the updated session information comprises:
receiving a second session control signaling from the session control server based on the port, determining session information corresponding to the port number of the port, and forwarding the second session control signaling to the terminal based on the first link indicated by the session information;
or the like, or, alternatively,
receiving a second session control signaling from the session controller based on the port, determining session information corresponding to a session identifier carried by the second session control signaling, and forwarding the second session control signaling to the terminal based on the first link indicated by the session information.
6. A session method, performed by a media server, the method comprising:
receiving a first media message through a service address of the media server, wherein the first media message carries a first terminal address, media data of a session and a password corresponding to the session, and the first terminal address is an address of the terminal after network switching;
in response to receiving the first media packet, verifying the password based on the service address;
if the verification is passed and the first terminal address is inconsistent with a second terminal address in session information, updating the second terminal address in the session information into the first terminal address, wherein the session information comprises a first corresponding relation between the service address corresponding to the session and the second terminal address, and the second terminal address is an address of the terminal before network switching occurs;
and transmitting the media message of the session based on the updated session information.
7. The method of claim 6, wherein before receiving the first media packet via the service address of the media server, the method further comprises:
distributing the service address and the password for the session, and recording a second corresponding relation between the service address and the password;
receiving a second media message through the service address, wherein the second media message carries the second terminal address, the media data of the session and the password;
and responding to the verification of the password carried by the second media message based on the second corresponding relation, and recording the session information, wherein the session information comprises the corresponding relation between the service address and the second terminal address.
8. The method according to claim 6 or 7, wherein the verification pass is: and the password authentication of a plurality of continuous first media messages passes.
9. The method according to any one of claims 6 to 8, wherein the transmitting the media packet of the session based on the updated session information comprises:
and determining session information corresponding to the service address, and transmitting a media message of the session with the terminal based on the first terminal address in the session information.
10. A conversation apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive a link binding message of a terminal, where the link binding message carries a session identifier of a session and an identifier of a first link, and the first link is a link that is established between the terminal and a signaling connection server and is used for transmitting a session control signaling of the session;
an update module, configured to update an identifier of a second link in session information to an identifier of the first link in response to the link binding message, where the session information includes a correspondence between the session identifier, the identifier of the second link, and a port number of a port of the signaling connection server, and the port is used for signaling interaction with a session control server;
and the forwarding module is used for forwarding the session control signaling of the session between the session control server and the terminal based on the updated session information.
11. The apparatus of claim 10,
the receiving module is configured to receive an identity authentication request of the terminal, where the identity authentication request carries an identifier of the second link;
the device further comprises: an allocation module for allocating the port for the session;
the forwarding module is used for sending the identity authentication request to the session control server;
the receiving module is configured to receive a session establishment response of the session control server if the identity authentication of the terminal passes, where the session establishment response carries the session identifier;
and the recording module is used for recording the session information, wherein the session information comprises the corresponding relation among the session identifier, the port number of the port and the identifier of the second link.
12. The apparatus of claim 10 or 11, wherein the second link is: and before the signaling connection server receives the link binding message, the established link between the terminal and the signaling connection server is used for transmitting the session control signaling of the session.
13. The apparatus of claim 10, wherein the forwarding module is configured to receive a first session control signaling from the terminal, and the first session control signaling carries a session identifier of the session; and determining session information corresponding to the session identification, and forwarding the first session control signaling to the session control server based on the port indicated by the session information.
14. The apparatus according to claim 10, wherein the forwarding module is configured to receive a second session control signaling from the session control server based on the port, determine session information corresponding to a port number of the port, and forward the second session control signaling to the terminal based on the first link indicated by the session information;
or the like, or, alternatively,
the forwarding module is configured to receive a second session control signaling from the session controller based on the port, determine session information corresponding to a session identifier carried by the second session control signaling, and forward the second session control signaling to the terminal based on the first link indicated by the session information.
15. A conversation apparatus, characterized in that the apparatus comprises:
a receiving module, configured to receive a first media packet through a service address of the media server, where the first media packet carries a first terminal address, media data of a session, and a password corresponding to the session, and the first terminal address is an address of a terminal after network switching occurs;
a verification module, configured to verify the password based on the service address in response to receiving the first media packet;
an updating module, configured to update a second terminal address in session information to the first terminal address if the verification passes and the first terminal address is inconsistent with the second terminal address in the session information, where the session information includes a first correspondence between the service address corresponding to the session and the second terminal address, and the second terminal address is an address of the terminal before network handover occurs;
and the transmission module is used for transmitting the media message of the session based on the updated session information.
16. The apparatus of claim 15, further comprising:
the allocation module is used for allocating the service address and the password for the session and recording a second corresponding relation between the service address and the password;
the receiving module is configured to receive a second media packet through the service address, where the second media packet carries the second terminal address, the media data of the session, and the password;
and the recording module is used for recording the session information in response to the verification of the password carried by the second media message based on the second corresponding relationship, wherein the session information comprises the corresponding relationship between the service address and the second terminal address.
17. The apparatus according to claim 15 or 16, wherein the authentication pass is: and the password authentication of a plurality of continuous first media messages passes.
18. The apparatus according to any one of claims 15 to 17, wherein the transmitting module is configured to determine session information corresponding to the service address, and transmit a media packet of the session with the terminal based on the first terminal address in the session information.
19. A server, characterized in that it comprises a communication bus for transferring information between the aforementioned components, at least one network interface for communicating with other devices or communication networks, a memory holding program code, and at least one processor implementing a session method according to any one of claims 1 to 5 or 6 to 9 by reading and executing program code held in the memory.
20. A computer-readable storage medium, wherein program code in the computer-readable storage medium, when executed by a processor of a server, enables the server to perform the session method of any one of claims 1 to 5 or claims 6 to 9.
CN202110877166.1A 2021-07-31 2021-07-31 Session method, device, server and storage medium Pending CN115696325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110877166.1A CN115696325A (en) 2021-07-31 2021-07-31 Session method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110877166.1A CN115696325A (en) 2021-07-31 2021-07-31 Session method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN115696325A true CN115696325A (en) 2023-02-03

Family

ID=85059778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110877166.1A Pending CN115696325A (en) 2021-07-31 2021-07-31 Session method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN115696325A (en)

Similar Documents

Publication Publication Date Title
WO2020259509A1 (en) Method and device for application migration
US20180309716A1 (en) Session Identifier for a Communication Session
US7533178B2 (en) Resuming a computing session when rebooting a computing device
US20160380966A1 (en) Media Relay Server
EP3720100A1 (en) Service request processing method and device
US10897509B2 (en) Dynamic detection of inactive virtual private network clients
US8374079B2 (en) Proxy server, communication system, communication method and program
US11683218B2 (en) Compromised network node detection system
EP1746801A2 (en) Transmission of packet data over a network with a security protocol
WO2017157144A1 (en) Sip over tcp/tls-based communication method and associated device
CN112188227A (en) Streaming media data distribution method and device
CN107995233B (en) Method for establishing connection and corresponding equipment
US20230164234A1 (en) Service continuity event notification method, and apparatus
WO2017076278A1 (en) Method and device for flexibly processing link between network elements
KR20190103382A (en) Routing Method and Device
CN109819439A (en) The method and related entities of key updating
WO2013189398A2 (en) Application data push method, device, and system
CN112994946A (en) Link aggregation method
CN111586017A (en) Method and device for authenticating communication user
WO2019154017A1 (en) Multipath establishing method and apparatus
CN115696325A (en) Session method, device, server and storage medium
US20210203604A1 (en) Load balancing method, device and system
JP2016162324A (en) Information processing system, control program and control method
CN114281373A (en) Device state updating method and device, computer device and storage medium
CN114222290A (en) Communication method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication