Network communication methods, devices, servers, and computer-readable storage media
By obtaining the IP address of the second terminal from the server and establishing a network communication connection based on the IP address, the call quality problems caused by complex environments and weak base station signals in 2G/3G/4G/5G calls are solved, realizing the stability and extended functions of instant calls and improving call quality.
Patent Information
- Application Number
- CN202310097192.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-02-02
AI Technical Summary
During 2G/3G/4G/5G calls, users may encounter complex and harsh environments, base station signal issues, etc., which may lead to automatic call termination, lack of notification, excessive noise, and no response to calls, seriously affecting service quality.
The server receives incoming call requests, determines whether the second terminal has the specified communication application installed, and if so, sends an incoming call message and obtains its IP address. It then establishes a network communication connection based on the IP address, converts the call link into a network call based on the IP address, and uses FreeSwitch and Coturn services to solve the NAT traversal problem, enabling the transmission of voice data encapsulated in IP packets.
It significantly reduces issues such as automatic hang-up, lack of message notification, and excessive noise in complex environments and weak base station signal scenarios, improves service quality during calls, and provides extended functions such as client-side noise reduction, sound optimization, and voice data packet recording, enhancing call stability and applicability.
Smart Images

Figure CN116074770B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a network communication method, apparatus, server, and computer-readable storage medium. Background Technology
[0002] Currently, during calls made using 2G / 3G / 4G / 5G networks, issues such as complex and harsh environments and base station signal problems frequently occur, leading to frequent occurrences of automatic disconnection, no message notifications, excessive noise, and unanswered calls, severely impacting service quality. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a network communication method, apparatus, server and computer-readable storage medium that can significantly improve the quality of service during a call.
[0004] In a first aspect, embodiments of the present invention provide a network communication method applied to a server. The method includes: receiving an incoming call request sent by a first terminal and determining a second terminal corresponding to the incoming call request; if the second terminal has a designated communication application installed, sending the incoming call message corresponding to the incoming call request to the designated communication application, so that the second terminal sends an address acquisition request to the server through the designated communication application; wherein the designated communication application is used to perform data interaction with the server; sending the IP (Internet Protocol) address corresponding to the second terminal to the second terminal, so that the second terminal sends a ready notification to the server upon receiving the IP address; when the ready notification is received, establishing a network communication connection between the first terminal and the second terminal based on the IP address, so that the first terminal and the second terminal can conduct instant calls based on the network communication connection.
[0005] In one implementation, the server is configured with a FreeSwitch service and a call interface backend service; receiving an incoming call request from a first terminal and determining the second terminal corresponding to the incoming call request includes: receiving the incoming call request from the first terminal through an E1 incoming call route configured in the FreeSwitch service; calling the call interface backend service in Outbound mode through the FreeSwitch service and sending the number to be called carried in the incoming call request to the call interface backend service; querying the user identifier corresponding to the number to be called through the call interface backend service and determining the terminal corresponding to the user identifier as the second terminal; wherein, the user identifier includes an application identifier and / or a user account.
[0006] In one implementation, sending the incoming call message corresponding to the incoming call request to the designated communication application includes: sending the incoming call message corresponding to the incoming call request to the designated communication application through the call interface backend service.
[0007] In one embodiment, the server is further configured with a Coturn service; sending the IP address corresponding to the second terminal to the second terminal includes: receiving the address acquisition request sent by the second terminal through the Coturn service, and sending the IP address corresponding to the second terminal to the second terminal.
[0008] In one implementation, when the readiness notification is received, establishing a network communication connection between the first terminal and the second terminal based on the IP address includes: receiving the IP address fed back by the second terminal through the FreeSwitch service or the call interface backend service; receiving the readiness notification fed back by the second terminal through the call interface backend service and sending a bridging command to the FreeSwitch service; and establishing a network communication connection between the first terminal and the second terminal based on the IP address through the FreeSwitch service.
[0009] In one embodiment, sending the IP address corresponding to the second terminal to the second terminal so that the second terminal can send a ready notification to the server upon receiving the IP address further includes: sending the IP address corresponding to the second terminal to the second terminal so that the second terminal can call the Hypertext Transfer Protocol interface to send a ready notification to the server upon receiving the IP address.
[0010] Secondly, embodiments of the present invention also provide a network communication device, which is applied to a server. The device includes: a terminal determination module, configured to receive an incoming call request sent by a first terminal and determine a second terminal corresponding to the incoming call request; a message sending module, configured to send an incoming call message corresponding to the incoming call request to the designated communication application if the second terminal has a designated communication application installed, so that the second terminal sends an address acquisition request to the server through the designated communication application; wherein the designated communication application is used to perform data interaction with the server; an address sending module, configured to send the IP address corresponding to the second terminal to the second terminal, so that the second terminal sends a ready notification to the server when it receives the IP address; and a communication module, configured to establish a network communication connection between the first terminal and the second terminal based on the IP address when the ready notification is received, so that the first terminal and the second terminal can conduct instant calls based on the network communication connection.
[0011] In one implementation, the server is configured with a FreeSwitch service and a call interface backend service; the terminal determination module is further configured to: receive an incoming call request sent by a first terminal through an E1 incoming call route configured in the FreeSwitch service; call the call interface backend service in Outbound mode through the FreeSwitch service, and send the number to be called carried in the incoming call request to the call interface backend service; query the user identifier corresponding to the number to be called through the call interface backend service, and determine the terminal corresponding to the user identifier as a second terminal; wherein, the user identifier includes an application identifier and / or a user account.
[0012] Thirdly, embodiments of the present invention also provide a server, including a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method described in any of the first aspects.
[0013] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in any one of the first aspects.
[0014] This invention provides a network communication method, apparatus, server, and computer-readable storage medium. Applied to a server, when an incoming call request is received from a first terminal, the method determines the second terminal corresponding to the request. If the second terminal has a specified communication application installed, the method sends the incoming call message corresponding to the request to the specified communication application, enabling the second terminal to send an address retrieval request to the server through the specified communication application. The specified communication application is used for data interaction with the server. The method then sends the IP address corresponding to the second terminal to the second terminal, so that the second terminal sends a ready notification to the server upon receiving the IP address. Upon receiving the ready notification, a network communication connection is established between the first and second terminals based on the IP address, enabling the first and second terminals to conduct instant calls based on the network communication connection. When the above method receives a call request from the first terminal, it obtains the IP address of the second terminal from the server and sends a notification to the server that the call link is ready to be called. This converts the original 2G / 3G / 4G / 5G network into a network call based on the IP address. In complex and harsh environments with poor base station signal, this significantly reduces the occurrence of automatic disconnection, no message notification, excessive noise, and no call response, thereby significantly improving the service quality during the call.
[0015] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a network communication method provided in an embodiment of the present invention;
[0019] Figure 2 A flowchart illustrating another network communication method provided in an embodiment of the present invention;
[0020] Figure 3 A flowchart illustrating another network communication method provided in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of a network communication device provided in an embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Currently, existing instant messaging technologies suffer from poor service quality stability in complex and harsh environments and in scenarios with poor base station signals. Based on this, the present invention provides a network communication method, device, server, and computer-readable storage medium that can significantly improve service quality during calls.
[0025] To facilitate understanding of this embodiment, a network communication method disclosed in this invention will first be described in detail, applied to a server. See [link to relevant documentation]. Figure 1 The diagram shows a flowchart of a network communication method, which mainly includes the following steps S102 to S108:
[0026] Step S102: Receive the incoming call request sent by the first terminal and determine the second terminal corresponding to the incoming call request. The first terminal is the terminal that sends the call request (incoming call request) to the second terminal, and the second terminal is the terminal that accepts the call request from the first terminal. The terminal can include a smartphone, etc. In one embodiment, the user operates the first terminal to dial the number to be called. The server receives the incoming call request carrying the aforementioned number through the FreeSwitch service, and then determines the second terminal corresponding to the incoming call number through the call interface backend service.
[0027] Step S104: If the second terminal has a designated communication application installed, the incoming call message corresponding to the call request is sent to the designated communication application, so that the second terminal sends an address retrieval request to the server through the designated communication application. The designated communication application (APP, Application) is used for data interaction with the server. In one implementation, if the second terminal does not have the designated APP installed, the call interface backend service will not be able to determine the corresponding second terminal, and will continue to use 2G / 3G / 4G / 5G networks for instant calls. If the second terminal has the designated APP installed, the call interface backend service can find the corresponding second terminal and push the incoming call message corresponding to the call request to the designated APP of the second terminal, so that when the user of the second terminal views the incoming call message, they enter the call page. When entering the call page, the second terminal will request its IP address from the Coturn service in the server through the designated APP, and the Coturn service will then return the IP address to the second terminal.
[0028] Step S106: The IP address corresponding to the second terminal is sent to the second terminal so that the second terminal can send a ready notification to the server upon receiving the IP address. The Coturn service is built on the ICE (Interactive Connectivity Establishment) framework, which determines the truly usable transport address (i.e., the IP address) through continuous attempts. In one implementation, the Coturn service obtains the final routable IP address and sends it to the second terminal. After entering the call page, the user on the second terminal can click to connect. Upon connecting, the second terminal sends the IP address to the FreeSwitch service or the call interface backend service via a designated APP, and also sends a ready notification to the call interface backend service.
[0029] Step S108: Upon receiving the readiness notification, a network communication connection is established between the first terminal and the second terminal based on their IP addresses, enabling them to conduct real-time calls. In one implementation, after receiving the readiness notification, the call interface backend service sends a bridging command to the FreeSwitch service. The FreeSwitch service then establishes a network communication connection between the first terminal and the second terminal based on their IP addresses. After the network communication connection (channel) is successfully established, the users of the first terminal and the second terminal can begin calling.
[0030] The network communication method provided in this invention, upon receiving a call request from a first terminal, obtains the IP address of a second terminal from the server and sends a notification to the server indicating readiness. This converts the call link from the original 2G / 3G / 4G / 5G network to an IP address-based network call. Consequently, in complex and harsh environments with poor base station signal, it significantly reduces situations such as automatic disconnection, lack of notification, excessive noise, and unanswered calls, thereby significantly improving the service quality during the call.
[0031] For ease of understanding, embodiments of the present invention provide a general flow of a network communication method, see below. Figure 2 The diagram shows another network communication method. Figure 2 The diagram also illustrates the general process of network communication: First terminal A dials any number (e.g., 028-88888888) -> 4G operator network -> voice gateway -> routed to FreeSwitch service -> FreeSwitch service calls out the number of second terminal B, where the second terminal B has a specified APP installed.
[0032] Figure 2The diagram also illustrates that the server is configured with FreeSwitch service, call interface backend service, and Coturn service. Based on this, this embodiment of the invention provides an implementation of the aforementioned step S102. When performing the step of receiving an incoming call request sent by the first terminal and determining the second terminal corresponding to the incoming call request, see steps 1 to 3 below:
[0033] Step 1: Receive the incoming call request from the first terminal through the E1 inbound call route configured within the FreeSwitch service. In practical applications, during the stage of routing the call to the FreeSwitch service, an E1 inbound call route needs to be configured in the FreeSwitch service. The purpose of the E1 inbound call route is to enable voice gateway data to reach the FreeSwitch service for routing. The code is shown below:
[0034] "vim freeswitch / conf / dialplan / public / call_in.xml
[0035] <extension name="inbound_did">
[0036] <condition field="destination_number" expression="(\w)*">
[0037] <action application="set" data="domain_name=$${domain}" / >
[0038] <action application="transfer" data="1001 XML default" / >
[0039] < / condition>
[0040] < / extension> ".
[0041] Step 2: The FreeSwitch service uses Outbound mode to call the call interface backend service and sends the incoming call number carried in the call request to the call interface backend service. In practical applications, when the FreeSwitch service calls the number of the second terminal B, it is actually the call interface backend service that pushes the APP call notification (i.e., the incoming call message) to the second terminal B. Therefore, in order for the FreeSwitch service to call the call interface backend service, the FreeSwitch service needs to use Outbound mode to call the call interface backend service. Outbound mode is more powerful than embedded languages, more suitable for controlling single-channel calls, and implementing complex IVR (Interactive Voice Response) applications, among other benefits. Based on this, the FreeSwitch service is configured as follows:
[0042] "vim freeswitch / conf / dialplan / default.xml
[0043] <extension name="socket_outbound">
[0044] <condition field="destination_number" expression="^(\w)*$">
[0045] <action application="set" data="call_timeout=10" / >
[0046] <action application="set" data="leg_timeout=10" / >
[0047] <action application="set" data="park_timeout=10" / >
[0048] / / Use socket communication to query the actions that need to be performed when a call comes in.
[0049] <action application="socket" data="APP通话接口服务器地址:APP通话接口服务器端口 async full" / >
[0050] < / condition>
[0051] < / extension> ".
[0052] Step 3: Query the user identifier corresponding to the incoming call number through the call interface backend service, and determine the terminal corresponding to the user identifier as the second terminal. The user identifier includes an application identifier and / or a user account. The application identifier is also known as the APP identifier, and the user account can be a SIP (Session Initialization Protocol) account, which is the account used by the user to log in to the specified APP. In practical applications, there is a mapping relationship between the incoming call number and the APP identifier, and also a mapping relationship between the incoming call number and the SIP account. Therefore, the corresponding user identifier can be found based on the incoming call number, thereby determining the appropriate second terminal.
[0053] Based on the foregoing embodiments, this embodiment of the invention further provides an implementation of step S104. When executing the step of sending the incoming call message corresponding to the incoming call request to the designated communication application, the incoming call message corresponding to the incoming call request can be sent to the designated communication application through the call interface backend service. Furthermore, the call interface backend service is also used to send a bridging command to FreeSwitch upon receiving a readiness notification. Specifically, the core code of the call interface server is as follows:
[0054] "public class SampleOutboundHandler extendsAbstractOutboundClientHandler {
[0055] / / Other code
[0056] @SneakyThrows
[0057] @Override
[0058] protected void handleConnectResponse(ChannelHandlerContext ctx,EslEvent event) {
[0059] / / This is the response to the initial connect core code
[0060] if (event.getEventName().equalsIgnoreCase("CHANNEL_DATA")) {
[0061] System.out.println("======================= Outbound: incomingchannel data=============================");
[0062] / / Get the calling number and the called number
[0063] / / String sipCallerNumber = event.getEventHeaders().get("variable_user_name");
[0064] String callerNumber = event.getEventHeaders().get("Caller-Caller-ID-Number");
[0065] String dest_num = event.getEventHeaders().get("Caller-Destination-Number");
[0066] / / Send notification of incoming call information
[0067] String cid = Application.ctx.getBean(PublicObject.class).getMap().get(dest_num);
[0068] if (StrUtil.isNotBlank(cid)) {
[0069] / / Retract the previous notification + Send notification + Enter queue to wait
[0070] before(cid);
[0071] / / notifyBackByCid(cid,callerNumber);
[0072] pushToSingleByCid(callerNumber);
[0073] / / Cache channel information
[0074] channelMap.put(event.getEventHeaders().get("Caller-Destination-Number"), ctx);
[0075] uuidMap.put(event.getEventHeaders().get("Caller-Destination-Number"),event.getEventHeaders().get("Unique-ID"));
[0076] / / now bridge the call 执行需要的action动作
[0077] bridgeCall(ctx.getChannel(), event);
[0078] } else {
[0079] / / 挂机
[0080] SendMsg bridgeMsg = new SendMsg();
[0081] bridgeMsg.addCallCommand("execute");
[0082] bridgeMsg.addExecuteAppName("hangup");
[0083] EslMessage response = sendSyncMultiLineCommand(ctx.getChannel(),bridgeMsg.getMsgLines());
[0084] }
[0085] } else {
[0086] throw new IllegalStateException("Unexpected event after connect: [" +event.getEventName() + ']');
[0087] }
[0088] }
[0089] private void bridgeCall(Channel channel, EslEvent event) {
[0090] / / Play a piece of music to put the user into a waiting queue to wait for the call to be answered.
[0091] SendMsg bridgeMsg = new SendMsg();
[0092] bridgeMsg.addCallCommand("execute");
[0093] bridgeMsg.addExecuteAppName("answer");
[0094] EslMessage response = sendSyncMultiLineCommand(channel,bridgeMsg.getMsgLines());
[0095] bridgeMsg = new SendMsg();
[0096] bridgeMsg.addCallCommand("execute");
[0097] bridgeMsg.addExecuteAppName("playback");
[0098] bridgeMsg.addExecuteAppArg(" / usr / local / freeswitch / 123.wav");
[0099] response = sendSyncMultiLineCommand(channel, bridgeMsg.getMsgLines());
[0100] }
[0101] / / Other code
[0102] }”
[0103] In one implementation, for step S106 above, this embodiment of the invention also provides an implementation method for sending the IP address corresponding to the second terminal to the second terminal. This can be achieved by receiving the address acquisition request from the second terminal through the Coturn service and sending the IP address corresponding to the second terminal to the second terminal. In practical applications, the second terminal B may be located in a NAT (Network Address Translation) intranet. Both SIP and RTP (Real-time Transport Protocol) protocols require knowing the other party's IP address, but the other party's IP address is on an intranet, making the network situation complex. The NAT traversal problem needs to be solved for normal voice calls. Currently, there are three types of NAT traversal technologies: p2p, stun, and turn. Considering the complexity of the user's network situation, this embodiment of the invention uses the ICE framework to solve this problem. ICE can continuously try to determine the truly usable transmission address, so a coturn server needs to be built first, and then the client using the ICE service needs to be coded.
[0104] Specifically, the functions of the TURN service include: (1) NAT hole punching: If terminal A and terminal B need to communicate with each other, the TURN Server will instruct terminal A and terminal B to send a message to each other so that their respective NATs leave a hole in each other, facilitating communication between terminal A and terminal B. (2) Message forwarding for symmetric NAT: When either terminal A or terminal B is a symmetric NAT, a message is sent to that terminal. It should be noted that this can only be forwarded through the TURN Server. Specifically, the code of the specified APP installed on terminal B is shown below:
[0105] 1. Configure ICE service:
[0106] / / Configure WebSocket service
[0107] var websocketServerUrl = 'wss: / / ip:port';
[0108] / / Set the SIP outbound Proxy URL to empty
[0109] var sipOutboundProxyUrl = '';
[0110] / / ICE Servers address configuration
[0111] / / eg: [{ url: 'stun:ip:port'}, { url:'turn:ip:port', credential:'password'}]
[0112] var iceServers = [
[0113] { url: 'stun:ip:port'},
[0114] {
[0115] url: 'turn:ip:port',
[0116] username: 'name',
[0117] credential: 'password',
[0118] },
[0119] ]".
[0120] Second, activate ICE service:
[0121] / / Creates a PeerConnection instance (if the parameter is null, there is no iceserver; even without stunserver and turnserver, communication is only possible within the local area network).
[0122] var pc = new webkitRTCPeerConnection(iceServers)".
[0123] In one implementation, when performing the aforementioned step S108, steps a to c can be referred to below:
[0124] Step a: Receive the IP address from the second terminal via the FreeSwitch service or the call interface backend service. In one implementation, the second terminal B can send the IP address to the FreeSwitch service or the call interface backend service.
[0125] Step b involves receiving the readiness notification from the second terminal through the call interface backend service and sending a bridging command to the FreeSwitch service. In one implementation, the second terminal B can send the readiness notification to the call interface backend service. After receiving the readiness notification, the call interface backend service can send a bridging command (bridging channel command) to the FreeSwitch service.
[0126] Step c: Establish a network communication connection between the first terminal and the second terminal based on IP address using the FreeSwitch service.
[0127] In one implementation, the second terminal can call the Hypertext Transfer Protocol (HTTP) interface to send a readiness notification to the server upon receiving an IP address. In practical applications, after sending an app notification to inform the app of an incoming call, if the called user answers, the HTTP interface needs to be called to notify the app's call interface service that a two-way call can be bridged. The code provided by the HTTP interface is as follows:
[0128] "public class CallController {
[0129] @GetMapping(" / call")
[0130] public String call(@RequestParam("uid") String uid) throwsInboundConnectionFailure {
[0131] / / Find the channel of caller A based on UID
[0132] ChannelHandlerContext context = SampleOutboundHandler.channelMap.get(uid);
[0133] SendMsg bridgeMsg = new SendMsg();
[0134] if (Objects.nonNull(context)) {
[0135] / / Send bridging command
[0136] bridgeMsg.addCallCommand("execute");
[0137] bridgeMsg.addExecuteAppName("bridge");
[0138] bridgeMsg.addExecuteAppArg("[originate_timeout=30,ignore_early_media=true] user / " + uid);
[0139] try {
[0140] outboundHandler.sendSyncMultiLineCommand(context.getChannel(),bridgeMsg.getMsgLines());
[0141] return "success";
[0142] } catch (Exception e) {
[0143] return "Exception";
[0144] }
[0145] } else {
[0146] / / Caller ID not found
[0147] return "failed: no user call you";
[0148] }
[0149] }
[0150] }".
[0151] To facilitate understanding of the network communication method provided in the foregoing embodiments, this embodiment of the invention provides a specific implementation process of the network communication method, see below. Figure 3 The flowchart of another network communication method shown includes:
[0152] (1) Incoming call; (2) Find the APP and SIP account corresponding to the second terminal B; (3) Push the incoming call message to the APP of the second terminal B, so that the APP updates the SIP account or registers; (4.1) After opening the APP, request the Coturn service to obtain the IP address that the final route can reach; (4.2) After clicking the answer button, update the SIP account or register the SIP account and provide the correct IP address; (5) Notify the second terminal B that it is ready and can start bridging the call between the two parties; (6) Send the bridging channel command; (7) The channel is successfully established and the first terminal A and the second terminal B start the call.
[0153] In summary, the network communication method provided by this invention, based on the FreeSwitch and Coturn framework, solves the problem of ensuring connectivity in VoIP networks. The most important part is transforming the call link from the original 4G network to an IP-based TCP / IP architecture. This includes encapsulating voice data within IP packets, supporting UDP (User Datagram Protocol) packetization, achieving voice-to-Ethernet conversion, enabling communication between different network segments within the same segment or through a router, and providing extended functions such as call notifications. A complete call experience enhances the user experience, thereby improving product compatibility and adaptability to various extreme environments.
[0154] This invention addresses the poor service quality caused by complex and harsh user environments and weak base station signals through FreeSwitch and Coturn. It also provides many functions and scalability not available in traditional calling systems, including client-side noise reduction, sound quality optimization, voice data packet recording, custom ringback tones, and other extended functions. It achieves IP switching, provides high-speed data communication, and ensures stable call quality without having to call traditional circuit-switched networks.
[0155] Regarding the network communication method provided in the foregoing embodiments, this embodiment of the invention provides a network communication device applied to a server, see [link to documentation]. Figure 4 The diagram shows the structure of a network communication device, which mainly includes the following parts:
[0156] The terminal determination module 402 is used to receive the incoming call request sent by the first terminal and determine the second terminal corresponding to the incoming call request;
[0157] The message sending module 404 is used to send the incoming call message corresponding to the call request to the designated communication application if the second terminal has a designated communication application installed, so that the second terminal can send an address acquisition request to the server through the designated communication application; wherein, the designated communication application is used to interact with the server.
[0158] The address sending module 406 is used to send the IP address corresponding to the second terminal to the second terminal, so that the second terminal can send a ready notification to the server when it receives the IP address.
[0159] The communication module 408 is used to establish a network communication connection between the first terminal and the second terminal based on the IP address when a ready notification is received, so that the first terminal and the second terminal can make real-time calls based on the network communication connection.
[0160] The network communication device provided in this embodiment of the invention, upon receiving a call request from a first terminal, obtains the IP address of a second terminal from the server and sends a notification to the server indicating that it is ready to call. This allows the call link to be converted from the original 2G / 3G / 4G / 5G network to an IP address-based network call. In complex and harsh environments with poor base station signal, this significantly reduces the occurrence of automatic disconnection, no message notification, excessive noise, and no call response, thereby significantly improving the service quality during the call.
[0161] In one implementation, the server is configured with a FreeSwitch service and a call interface backend service; the terminal determination module 402 is further configured to: receive an incoming call request sent by a first terminal through the E1 incoming call route configured in the FreeSwitch service; call the call interface backend service in Outbound mode through the FreeSwitch service, and send the number to be called carried in the incoming call request to the call interface backend service; query the user identifier corresponding to the number to be called through the call interface backend service, and determine the terminal corresponding to the user identifier as the second terminal; wherein, the user identifier includes an application identifier and / or a user account.
[0162] In one implementation, the message sending module 404 is further configured to: send the incoming call message corresponding to the call request to the designated communication application through the call interface backend service.
[0163] In one implementation, the server is also configured with a Coturn service; the address sending module 406 is further configured to: receive an address acquisition request sent by the second terminal through the Coturn service, and send the IP address corresponding to the second terminal to the second terminal.
[0164] In one implementation, the communication module 408 is further configured to: receive the IP address fed back by the second terminal through the FreeSwitch service or the call interface backend service; receive the readiness notification fed back by the second terminal through the call interface backend service and send a bridging command to the FreeSwitch service; and establish a network communication connection between the first terminal and the second terminal based on the IP address through the FreeSwitch service.
[0165] In one embodiment, the communication module 408 is further configured to: send the IP address corresponding to the second terminal to the second terminal, so that when the second terminal receives the IP address, it calls the Hypertext Transfer Protocol interface to send a ready notification to the server.
[0166] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0167] This invention provides a server, specifically, the server includes a processor and a storage device; the storage device stores a computer program, which, when run by the processor, executes the method described in any of the above embodiments.
[0168] Figure 5 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. The server 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53. The processor 50, the communication interface 53 and the memory 51 are connected through the bus 52. The processor 50 is used to execute executable modules, such as computer programs, stored in the memory 51.
[0169] The memory 51 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 53 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0170] Bus 52 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0171] The memory 51 is used to store programs. After receiving an execution instruction, the processor 50 executes the programs. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 50 or implemented by the processor 50.
[0172] Processor 50 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 50 or by instructions in software form. Processor 50 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 51. The processor 50 reads the information in memory 51 and, in conjunction with its hardware, completes the steps of the above method.
[0173] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.
[0174] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0175] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A network communication method, characterized in that, The method is applied to a server, and the method includes: Receive an incoming call request sent by a first terminal and determine the second terminal corresponding to the incoming call request; If the second terminal has a designated communication application installed, the incoming call message corresponding to the call request is sent to the designated communication application, so that the second terminal sends an address acquisition request to the server through the designated communication application; wherein, the designated communication application is used to interact with the server. Send the IP address corresponding to the second terminal to the second terminal, so that the second terminal sends a ready notification to the server when it receives the IP address; When the ready notification is received, a network communication connection is established between the first terminal and the second terminal based on the IP address, so that the first terminal and the second terminal can make real-time calls based on the network communication connection. The server is configured with a FreeSwitch service and a call interface backend service. Receiving an incoming call request from a first terminal and determining the second terminal corresponding to the incoming call request includes: receiving the incoming call request from the first terminal through the E1 incoming call route configured within the FreeSwitch service; calling the call interface backend service in Outbound mode through the FreeSwitch service and sending the number to be called carried in the incoming call request to the call interface backend service; querying the user identifier corresponding to the number to be called through the call interface backend service and determining the terminal corresponding to the user identifier as the second terminal; wherein, the user identifier includes an application identifier and / or a user account.
2. The method according to claim 1, characterized in that, Sending the incoming call message corresponding to the incoming call request to the designated communication application includes: The call interface backend service sends the incoming call message corresponding to the call request to the designated communication application.
3. The method according to claim 1, characterized in that, The server is also configured with Coturn service; Sending the IP address corresponding to the second terminal to the second terminal includes: The Coturn service receives the address acquisition request sent by the second terminal and sends the IP address corresponding to the second terminal to the second terminal.
4. The method according to claim 1, characterized in that, Upon receiving the readiness notification, establishing a network communication connection between the first terminal and the second terminal based on the IP address includes: The IP address fed back by the second terminal is received through the FreeSwitch service or the call interface backend service; The backend service of the call interface receives the ready notification from the second terminal and sends a bridging command to the FreeSwitch service. The FreeSwitch service establishes a network communication connection between the first terminal and the second terminal based on the IP address.
5. The method according to claim 1, characterized in that, Sending the IP address corresponding to the second terminal to the second terminal, so that the second terminal sends a ready notification to the server upon receiving the IP address, further includes: The IP address corresponding to the second terminal is sent to the second terminal, so that when the second terminal receives the IP address, it calls the Hypertext Transfer Protocol interface to send a ready notification to the server.
6. A network communication device, characterized in that, The device is used in a server, and the device includes: A terminal determination module is used to receive an incoming call request sent by a first terminal and determine the second terminal corresponding to the incoming call request. The message sending module is used to send the incoming call message corresponding to the call request to the designated communication application if the second terminal has a designated communication application installed, so that the second terminal sends an address acquisition request to the server through the designated communication application; wherein, the designated communication application is used to interact with the server. The address sending module is used to send the IP address corresponding to the second terminal to the second terminal, so that the second terminal can send a ready notification to the server when it receives the IP address; The communication module is used to establish a network communication connection between the first terminal and the second terminal based on the IP address when the ready notification is received, so that the first terminal and the second terminal can make real-time calls based on the network communication connection; The server is configured with a FreeSwitch service and a call interface backend service; the terminal determination module is further configured to: receive an incoming call request sent by a first terminal through the E1 incoming call route configured in the FreeSwitch service; call the call interface backend service in Outbound mode through the FreeSwitch service, and send the number to be called carried in the incoming call request to the call interface backend service; query the user identifier corresponding to the number to be called through the call interface backend service, and determine the terminal corresponding to the user identifier as the second terminal; wherein, the user identifier includes an application identifier and / or a user account.
7. A server, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Network call method and device, mobile terminal, SIP (Session Initiation Protocol) server and storage medium
CN114915925A