Search

EP-4742625-A1 - VOIP CALL METHOD AND RELATED APPARATUS

EP4742625A1EP 4742625 A1EP4742625 A1EP 4742625A1EP-4742625-A1

Abstract

This application discloses a VoIP call method and a related apparatus, applied to an electronic device. The method includes: receiving a VoIP call message sent by an application server of a first VoIP application through a push server, where the VoIP call message is used to request to perform a VoIP call; starting a first VoIP lightweight process of the first VoIP application, and providing the VoIP call message to the first VoIP lightweight process; displaying a call notification based on the VoIP call message obtained by the first VoIP lightweight process; and the first VoIP lightweight process establishes a persistent connection to the application server. In this way, the VoIP call can be implemented at low power consumption and memory costs.

Inventors

  • ZHAO, XIAOLEI
  • LI, FENG
  • LI, YIBING
  • LI, CHAO
  • WEN, Baofu

Assignees

  • Huawei Technologies Co., Ltd.

Dates

Publication Date
20260513
Application Date
20241228

Claims (20)

  1. A VoIP call method, applied to an electronic device, wherein the electronic device comprises a first VoIP application, and the method comprises: receiving a VoIP call message sent by an application server of the first VoIP application through a push server, wherein the VoIP call message is used to request to perform a VoIP call; starting a first VoIP lightweight process of the first VoIP application, and providing the VoIP call message to the first VoIP lightweight process; displaying a call notification based on the VoIP call message obtained by the first VoIP lightweight process; and establishing, by the first VoIP lightweight process, a persistent connection to the application server.
  2. The method according to claim 1, after displaying the call notification based on the VoIP call message obtained by the first VoIP lightweight process, further comprising: receiving a first operation, wherein the first operation is used to answer the VoIP call; loading, by the first VoIP lightweight process in response to the first operation, an answering page of the VoIP call; displaying the answering page; and executing, by the first VoIP lightweight process based on the persistent connection, a call operation with the application server.
  3. The method according to claim 2, after executing, by the first VoIP lightweight process, the call operation with the application server, further comprising: receiving a second operation, wherein the second operation is used to hang up the VoIP call; and in response to the second operation, destroying the first VoIP lightweight process and stopping displaying the answering page.
  4. The method according to claim 2, after executing, by the first VoIP lightweight process, the call operation with the application server for the VoIP call message, further comprising: receiving a first message sent by the application server, wherein the first message indicates that the caller hangs up the VoIP call; and based on the first message, destroying the first VoIP lightweight process and stopping displaying the answering page.
  5. The method according to claim 1, after displaying the call notification based on the VoIP call message obtained by the first VoIP lightweight process, further comprising: receiving a third operation, wherein the third operation is used to decline the VoIP call corresponding to the VoIP call message or delete the call notification; and destroying the first VoIP lightweight process in response to the third operation.
  6. The method according to claim 1, after displaying the call notification based on the VoIP call message obtained by the first VoIP lightweight process, further comprising: destroying the first VoIP lightweight process when it is detected that a user does not answer the VoIP call within first duration.
  7. The method according to claim 1, after executing, by the first VoIP lightweight process, the call operation with the application server for the VoIP call message, further comprising: receiving a second message sent by the application server, wherein the second message indicates that the caller cancels calling the VoIP call; and destroying the first VoIP lightweight process based on the second message.
  8. The method according to any one of claims 1 to 7, wherein the first VoIP lightweight process is independent of a main application process of the first VoIP application.
  9. The method according to any one of claims 1 to 7, wherein the electronic device comprises an API blocklist, and the first VoIP lightweight process is prohibited from invoking an API in the API blocklist.
  10. The method according to any one of claims 1 to 7, before destroying the first VoIP lightweight process, further comprising: performing pre-destruction processing on the first VoIP lightweight process.
  11. The method according to any one of claims 1 to 10, wherein the electronic device further comprises a push service, a lightweight process management service, a VoIP call management service, and a notification management service, and receiving the VoIP call message sent by the application server of the first VoIP application through the push server comprises: receiving, by the push service, the VoIP call message sent by the application server through the push server; and sending, by the push service, the VoIP call message to the lightweight process management service; starting the first VoIP lightweight process of the first VoIP application, and providing the VoIP call message to the first VoIP lightweight process comprises: starting, by the lightweight process management service, the first VoIP lightweight process of the first VoIP application, and sending the VoIP call message to the first VoIP lightweight process; and displaying the call notification based on the VoIP call message obtained by the first VoIP lightweight process comprises: sending, by the first VoIP lightweight process, incoming call information of the VoIP call message to the VoIP call management service; and indicating, by the VoIP call management service, the notification management service to display the call notification of the VoIP call message based on the incoming call information.
  12. The method according to claim 11, after sending, by the push service, the VoIP call message to the lightweight process management service, further comprising: enabling a first timer by the lightweight process management service; and after sending, by the first VoIP lightweight process, the incoming call information of the VoIP call message to the VoIP call management service, further comprising: sending, by the VoIP call management service, a call status to the lightweight process management service, wherein the call status indicates that the incoming call information is reported; and before the first timer expires, if the lightweight process management service has received the call status, disabling the first timer by the lightweight process management service; or before the first timer expires, if the lightweight process management service has not received the call status, destroying, by the lightweight process management service, the first VoIP lightweight process when the first timer expires.
  13. The method according to claim 11, after sending, by the push service, the VoIP call message to the lightweight process management service, further comprising: sending, by the lightweight process management service, first indication information of the VoIP call message to the VoIP call management service; after sending, by the first VoIP lightweight process, the incoming call information of the VoIP call message to the VoIP call management service, further comprising: verifying, by the VoIP call management service, validity of the incoming call information based on the first indication information; and indicating, by the VoIP call management service, the notification management service to display the call notification of the VoIP call message based on the incoming call information comprises: when it is verified that the incoming call information is valid, displaying, by the notification management service, the call notification of the VoIP call message based on the incoming call information.
  14. The method according to claim 11, wherein loading, by the first VoIP lightweight process in response to the first operation, the answering page of the VoIP call comprises: invoking, by the notification management service in response to the first operation, an answering service of the VoIP call management service; creating, by the answering service, a first window, wherein the first window comprises a first page; invoking, by the answering service, an answering loading module on the first page; and invoking, by the answering loading module according to a cross-process loading mechanism, the first VoIP lightweight process to load the answering page of the VoIP call, and rendering the answering page on the first page; and displaying the answering page comprises: displaying the first window.
  15. The method according to claim 11, wherein in response to the second operation, destroying the first VoIP lightweight process and stopping displaying the answering page, or based on the first message, destroying the first VoIP lightweight process and stopping displaying the answering page comprises: destroying the answering page by the first VoIP lightweight process in response to the second operation or based on the second message; sending, by the first VoIP lightweight process, a hang-up state to the VoIP call management service; destroying, by the VoIP call management service, the first page based on the hang-up state, and sending the hang-up state to the lightweight process management service; and destroying, by the lightweight process management service, the first VoIP lightweight process based on the hang-up state.
  16. The method according to claim 11, wherein destroying the first VoIP lightweight process in response to the third operation comprises: invoking, by the notification management service in response to the third operation, a declining service of the VoIP call management service; indicating, by the declining service, the notification management service to delete the call notification; indicating, by the declining service, the first VoIP lightweight process to perform declining processing on the VoIP call message; sending, by the first VoIP lightweight process, a declining state to the lightweight process management service, wherein the declining state indicates that the VoIP call is declined; and destroying, by the lightweight process management service, the first VoIP lightweight process based on the declining state.
  17. The method according to claim 11, wherein destroying the first VoIP lightweight process when it is detected that the user does not answer the VoIP call within the first duration or destroying the first VoIP lightweight process based on the second message comprises: sending, by the first VoIP lightweight process, an unanswered state to the VoIP call management service based on the second message or when it is detected that the user does not answer the VoIP call within the first duration; indicating, by the VoIP call management service based on the unanswered state, the notification management service to delete the call notification, and sending the unanswered state to the lightweight process management service; and destroying, by the lightweight process management service, the first VoIP lightweight process based on the unanswered state.
  18. The method according to claim 11, further comprising: when starting the first VoIP lightweight process of the first VoIP application, loading, by the lightweight process management service, an API that can be invoked other than the API in the API blocklist to process space of the first VoIP lightweight process.
  19. An electronic device, comprising a processor and a memory, wherein the memory is coupled to the processor, the memory is configured to store computer program code, the computer program code comprises computer instructions, and when the processor reads the computer instructions from the memory, the electronic device is enabled to perform the VoIP call method according to any one of claims 1 to 18.
  20. A computer-readable storage medium, comprising computer instructions, wherein when the computer instructions are run on a terminal device, the electronic device is enabled to perform the VoIP call method according to any one of claims 1 to 18.

Description

This application claims priority to Chinese Patent Application No. 202311865222.5, filed with the China National Intellectual Property Administration on December 29, 2023, and entitled "VOIP CALL METHOD AND RELATED APPARATUS", which is incorporated herein by reference in its entirety. This application claims priority to Chinese Patent Application No. 202410042257.7, filed with the China National Intellectual Property Administration on January 10, 2024, and entitled "VOIP CALL METHOD AND RELATED APPARATUS", which is incorporated herein by reference in its entirety. TECHNICAL FIELD This application relates to the field of electronic technologies, and in particular, to a VoIP call method and a related apparatus. BACKGROUND With development of mobile internets and improvement of people's living standards, more users use terminal devices such as mobile phones to make calls. A call between mobile phones may be a carrier call implemented through a carrier network, or may be a voice over internet protocol (Voice over Internet Protocol, VoIP) implemented through the internet. An application that can implement a VoIP call (the application may be a VoIP application for short) may be installed on the mobile phone. When the VoIP application is run in the foreground, a persistent connection may be established between the VoIP application and an application server to perform device-cloud call communication, and a VoIP call between users is implemented through the application server. When the VoIP application is switched to the background, a system of the terminal device freezes or directly destroys a process of the application from a perspective of device power consumption. In this case, the VoIP application cannot communicate with the application server. Currently, when the VoIP application is switched to the background, how to implement a VoIP call at low costs needs to be studied. SUMMARY Embodiments of this application provide a VoIP call method and a related apparatus, to implement a VoIP call at low power consumption and memory costs. According to a first aspect, this application provides a VoIP call method, applied to an electronic device, where the electronic device includes a first VoIP application, and the method includes: receiving a VoIP call message sent by an application server of a first VoIP application through a push server, where the VoIP call message is used to request to perform a VoIP call; starting a first VoIP lightweight process of the first VoIP application, and providing the VoIP call message to the first VoIP lightweight process; displaying a call notification based on the VoIP call message obtained by the first VoIP lightweight process; and the first VoIP lightweight process establishes a persistent connection to the application server. In this embodiment of this application, after receiving the VoIP call message, the push server starts a VoIP lightweight process, and establishes the persistent connection to the application server based on the VoIP lightweight process, to implement the VoIP call without starting a main application process. In this way, the VoIP call can be implemented at low device power consumption and memory costs. In an implementation, after displaying the call notification based on the VoIP call message obtained by the first VoIP lightweight process, the method further includes: receiving a first operation, where the first operation is used to answer the VoIP call; the first VoIP lightweight process loads, in response to the first operation, an answering page of the VoIP call; displaying the answering page; and the first VoIP lightweight process executes, based on the persistent connection, a call operation with the application server. In this embodiment of this application, after a user answers the VoIP call, the VoIP lightweight process loads the answering page, and performs the VoIP call based on the persistent connection created by the VoIP lightweight process. In this way, user experience is consistent with that of "starting the main application process to answer the call", but the main application process is not started, and device power consumption and required memory are reduced. In an implementation, after the first VoIP lightweight process executes the call operation with the application server, the method further includes: receiving a second operation, where the second operation is used to hang up the VoIP call; and in response to the second operation, destroying the first VoIP lightweight process and stopping displaying the answering page. In this embodiment of this application, after a called user hangs up the VoIP call, the VoIP lightweight process is destroyed in time. In this way, a waste of device power consumption and memory caused by continuous running of the VoIP lightweight process after the called user hangs up the VoIP call is avoided. In an implementation, after the first VoIP lightweight process executes the call operation with the application serve