Disclosure of Invention
The embodiment of the application provides a method and a device for establishing session connection, which solve the problems in the prior art, so as to reduce the workload of a terminal and improve the user experience.
In a first aspect, a method for establishing a session connection is provided, where the method may include:
receiving a session connection establishment request sent by a source terminal, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
if the stored contact person information corresponding to the session identification code of the source user is detected to have the user name of the target user, acquiring the session identification code corresponding to the user name of the target user from the contact person information;
sending a target session connection establishment request to a target terminal bound by a user name of the target user, wherein the target session connection establishment request comprises a session identification code of the source user, a session identification code of the target user and a session connection establishment instruction, so that the target terminal establishes session connection between the source terminal and the target terminal according to the session connection establishment instruction and the session identification code of the source user;
receiving a target session connection establishment response which is sent by the target terminal and contains indication information of successful establishment, and sending a session connection establishment response which contains the indication information of successful establishment to the source terminal.
In an optional implementation, sending a target session connection establishment request to a destination terminal bound to a user name of the destination user includes:
and if the stored terminal state of the target terminal bound by the user name of the target user is an idle state, sending a target session connection establishment request to the target terminal.
In an optional implementation, the method further comprises:
if the stored terminal state of the destination terminal bound by the user name of the destination user is a non-idle state, sending a session connection establishment response to the source terminal, wherein the session connection establishment response comprises indication information of establishment failure;
or, executing the operation preset by the source user.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, after sending a session connection setup response including the indication information of successful setup to the source terminal, the method further includes:
receiving state updating information respectively sent by the source terminal and the target terminal, wherein the state updating information is respectively used for indicating that the terminal state of the source terminal and the terminal state of the target terminal are updated to be in a conversation state;
and updating the stored terminal state of the source terminal and the terminal state of the target terminal to be a call state according to the state updating information.
In an optional implementation, the method further comprises:
and if the stored contact person information corresponding to the session identification code of the source user does not have the user name of the target user, sending a session connection establishment response to the source terminal, wherein the session connection establishment response comprises indication information that the target user is empty.
In an optional implementation, the method further comprises:
acquiring new contact information corresponding to the session identification code of the source user;
and updating the stored contact information with the new contact information.
In an alternative implementation, the session connection type includes a session connection of a mobile communication network and a session connection of an application having a session function;
the session connection establishment request includes a session connection establishment request of a mobile communication network in the source terminal and a session connection establishment request of the application program in the source terminal.
In a second aspect, a method for establishing a session connection is provided, and the method may include:
a terminal acquires a session connection establishment request, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
sending the session connection establishment request to a server;
if the server detects that the stored contact person information corresponding to the session identification code of the source user has the user name of the target user, receiving a session establishment response sent by the server, wherein the session establishment response comprises indication information of successful establishment;
if receiving a target session connection establishment request sent by the server, establishing session connection between the server and other terminals according to the session connection establishment indication and the session identification codes of the users bound with the other terminals; the target session connection establishment request comprises session identification codes of users bound by other terminals, session identification codes of the users bound by the terminals and session connection establishment instructions;
and sending a target session connection establishment response containing indication information of successful establishment to the server.
In an optional implementation, if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, a session connection establishment response sent by the server is received, where the session connection establishment response includes indication information of establishment failure.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, after receiving the session establishment response sent by the server, the method further includes:
and sending state updating information to the server, wherein the state updating information is used for indicating that the terminal state of the source terminal is updated to be a call state.
In an optional implementation, the method further comprises:
and receiving a session establishment response sent by the server, wherein the session establishment response comprises indication information that the target user is empty.
In a third aspect, an apparatus for establishing a session connection is provided, and the apparatus may include: the device comprises a receiving unit, an acquiring unit and a sending unit;
the receiving unit is used for receiving a session connection establishment request sent by a source terminal, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
the obtaining unit is configured to obtain, if it is detected that the stored user name of the destination user exists in the contact information corresponding to the session identification code of the source user and the terminal state of the destination terminal bound to the stored user name of the destination user is an idle state, the session identification code corresponding to the user name of the destination user from the contact information;
the sending unit is configured to send a session connection establishment response to a destination terminal bound to a user name of the destination user, where the session connection establishment response includes a session identification code of the source user, a session identification code of the destination user, and a session connection establishment instruction, so that the destination terminal establishes a session connection between the source terminal and the destination terminal according to the session connection establishment instruction and the session identification code of the source user;
the receiving unit is further configured to receive a target session connection establishment response that is sent by the destination terminal and contains indication information indicating that establishment is successful;
the sending unit is further configured to send a session connection establishment response including the indication information of successful establishment to the source terminal.
In an optional implementation, the sending unit is specifically configured to send a target session connection establishment request to the destination terminal if the stored terminal state of the destination terminal bound to the user name of the destination user is an idle state.
In an alternative implementation, the apparatus further comprises an execution unit;
the sending unit is further specifically configured to send a session connection establishment response to the source terminal if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, where the session connection establishment response includes indication information of establishment failure;
or, the execution unit is configured to execute an operation preset by the source user.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an alternative implementation, the apparatus further comprises a first updating unit;
the receiving unit is further configured to receive state update information sent by the source terminal and the target terminal, where the state update information is used to indicate that the terminal state of the source terminal and the terminal state of the target terminal are updated to be in a call state;
and the first updating unit is used for updating the stored terminal state of the source terminal and the stored terminal state of the target terminal into a call state according to the state updating information.
In an optional implementation, the sending unit is further configured to send a session connection establishment response to the source terminal if it is detected that the stored contact information corresponding to the session identification code of the source user does not include the user name of the destination user, where the session connection establishment response includes indication information that the destination user is empty.
In an optional implementation, the apparatus further comprises a second updating unit;
the acquiring unit is further used for acquiring new contact information corresponding to the session identification code of the source user;
the second updating unit is used for updating the stored contact information with the new contact information.
In an alternative implementation, the session connection type includes a session connection of a mobile communication network and a session connection of an application having a session function;
the session connection establishment request includes a session connection establishment request of a mobile communication network in the source terminal and a session connection establishment request of the application program in the source terminal.
In a fourth aspect, a session connection establishment apparatus is provided, which may include: the device comprises an acquisition unit, a sending unit, a receiving unit and an establishing unit;
the acquiring unit is used for acquiring a session connection establishing request, wherein the session connection establishing request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a target user; the session identification code is the unique identification for session connection of users in each session connection type;
the sending unit is used for sending the session connection establishment request to a server;
the receiving unit is configured to receive a session establishment response sent by the server if the server detects that the stored user name of the destination user exists in the contact information corresponding to the session identification code of the source user and the terminal state of the destination terminal bound to the stored user name is an idle state, where the session establishment response includes the session identification code of the destination user and a session establishment instruction;
the receiving unit is further configured to receive a target session connection establishment request sent by the server, where the target session connection establishment request includes a session identification code of a user bound to another terminal, a session identification code of the user bound to the terminal, and a session connection establishment instruction;
the establishing unit is used for establishing the session connection between the terminal and the other terminals according to the session connection establishing indication and the session identification codes of the users bound with the other terminals;
the sending unit is further configured to send a target session connection establishment response including indication information of successful establishment to the server.
In an optional implementation, the receiving unit is further configured to receive a session connection establishment response sent by the server if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, where the session connection establishment response includes indication information of an establishment failure.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, the sending unit is further configured to send status update information to the server, where the status update information is used to indicate that the terminal status of the source terminal is updated to the call-in status.
In an optional implementation, the receiving unit is further configured to receive a session establishment response sent by the server, where the session establishment response includes indication information that the destination user is null.
In a fifth aspect, a system for establishing session connection is provided, where the system includes a source terminal, a server, and a destination terminal;
the source terminal is used for acquiring a session connection establishment request, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type; sending the session connection establishment request to a server; and receiving a session establishment response sent by the server, wherein the session establishment response comprises indication information of successful establishment.
The server is used for receiving a session connection establishment request sent by a source terminal, and acquiring a session identification code corresponding to a user name of a target user from contact information if the fact that the stored user name of the target user exists in the contact information corresponding to the session identification code of the source user is detected; sending a target session connection establishment request to a target terminal bound by the user name of the target user, wherein the target session connection establishment request comprises the session identification code of the source user, the session identification code of the target user and a session connection establishment instruction; receiving a target session connection establishment response which is sent by the target terminal and contains indication information of successful establishment, and sending a session connection establishment response which contains the indication information of successful establishment to the source terminal;
the destination terminal is used for receiving a target session connection establishment request sent by the server; establishing session connection between the terminal and the other terminals according to the session connection establishment indication and the session identification codes of the users bound with the other terminals; and sending a target session connection establishment response containing indication information of successful establishment to the server.
In a sixth aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other via the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any of the above first aspects or the method steps of any of the above second aspects when executing a program stored in a memory.
In a seventh aspect, a computer-readable storage medium is provided, in which a computer program is stored, which computer program, when being executed by a processor, performs the method steps of any of the above-mentioned first aspects or the method steps of any of the above-mentioned second aspects.
In the method for establishing the session connection provided by the embodiment of the invention, after the server receives the session connection establishment request sent by the source terminal, the session connection establishment request comprises the session connection type, the session identification code of the source user corresponding to the session connection type and the user name of the destination user; the session identification code is the unique identification for the session connection of the user in each session connection type; if the stored contact person information corresponding to the session identification code of the source user is detected to have the user name of the target user, acquiring the session identification code corresponding to the user name of the target user from the contact person information; sending a target session connection establishment request to a target terminal, wherein the target session connection establishment request comprises a session identification code of a source user, a session identification code of the target user and a session connection establishment instruction, so that the target terminal establishes session connection between the source terminal and the target terminal according to the session connection establishment instruction and the session identification code of the source user; receiving a target session connection establishment response which is sent by the destination terminal and contains indication information of successful establishment, and sending a session connection establishment response which contains the indication information of successful establishment to the source terminal. The method reduces the workload of the terminal and improves the user experience.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The method for establishing session connection provided by the embodiment of the present invention may be applied to the system architecture shown in fig. 1, and the system may include a server and at least one terminal.
The server may be an application server or a cloud server;
the Terminal may be a User Equipment (UE) such as a Mobile phone, a smart phone, a laptop, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), etc.
The terminal is not limited to the voice interaction module and the call module supported by the Android system or the Linux system, and the call module may include a call mode of the Android system itself or an application APP with a call function installed at the terminal, such as a voice call of a WeChat, and the like, and can support integration of call SDKs of various different manufacturers. When the user executes the call operation, the terminal can transmit the terminal state to the server for state management.
The system of the embodiment of the invention responds to the session connection establishment request received by the terminal, whether the session connection is established or not, and the work of managing the contact information is completed by the server, so that the subsequent updating and maintenance of the call function are facilitated, the working load of the terminal is reduced, the hardware cost of the terminal can be reduced to a great extent, and the sequential updating of all devices under the user name of the user is avoided.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 2 is a flowchart illustrating a method for establishing a session connection according to an embodiment of the present invention. As shown in fig. 2, the method may include:
step 210, the source terminal obtains a session connection establishment request of the source user.
The source terminal is an initiating terminal of the session connection establishment request, and the source user is a user of the source terminal.
The session connection establishment request may include the source terminal identification, the session connection type, the session identification code of the source user corresponding to the session connection type, and the user name of the destination user.
The source terminal may also obtain other intent requests of the source user. The source user's intent request may include a HONECALL request, an ACCEPT request, a REFUSE request, and a CALLING request, among others.
The session connection type comprises session connection of a mobile communication network, such as session connection of a self-contained call system of a mobile phone and a session connection of an application program with a session function, such as WeChat, nailing and the like. The session identifier is a unique identifier for the session connection of each session connection type, such as a micro signal, an international Mobile Subscriber identity imsi (international Mobile Subscriber identity number), and the like. When a source user needs to establish session connection with a target user, a session connection establishment function of a source terminal is triggered, so that a session connection establishment request of the source user is obtained. The session connection establishment request may include a session connection establishment request of the mobile communication network in the source terminal and a session connection establishment request of the application program in the source terminal.
The session connection establishment request may be an outgoing call request of the source user received by the source terminal, or an incoming call request of the destination user received by the source terminal.
If the session connection establishment request is an outgoing call request of the source user received by the source terminal, the source terminal may obtain the session connection establishment request through an operation platform of the source terminal, such as a keyboard key, or receive the session connection establishment request in a voice form through a microphone.
Step 220, the source terminal sends a session connection establishment request to the server.
Step 230, the server detects the stored contact information corresponding to the session identification code of the source user in the session connection establishment request.
The contact information may include communication information composed of contact identifiers and session identifiers, incoming ring tones, incoming display pictures, and the like corresponding to the corresponding contact identifiers.
The terminal states may include IDLE and non-IDLE, and the non-IDLE may include five states of ACTIVE (on call), inactive (incoming call), inactive (outgoing call), try dialing, and inactive (incoming call).
And if the stored contact person information corresponding to the session identification code of the source user is detected to have the user name of the target user, acquiring the session identification code corresponding to the user name of the target user from the contact person information.
Optionally, if it is detected that the stored contact information corresponding to the session identification code of the source user does not have the user name of the destination user, a session connection establishment response is sent to the source terminal, where the session connection establishment response includes indication information that the destination user is empty.
Step 240, the server sends a target session connection establishment request to the destination terminal bound to the user name of the destination user.
Before executing the step, the server can detect the terminal state of the destination terminal;
and if the terminal state of the target terminal bound by the stored user name of the target user is an idle state, sending a target session connection establishment request to the target terminal. The target session connection establishment request may include a session identification code of the source user, a session identification code of the destination user, and a session connection establishment indication.
Optionally, the target session connection establishment request may further include communication information such as an incoming call ring.
The server supports a user to configure incoming call ring for each contact corresponding to the user account, when the incoming call information is received, the terminal reports the incoming call information to the server, then queries a database according to the incoming call information reported by the terminal, judges whether a target user in the incoming call information is the contact of the user, and if so, returns the incoming call ring of the corresponding contact preset by the user and the name of the contact to enable the target terminal to broadcast; if not, the destination terminal broadcasts the incoming call number and default incoming call ring.
Optionally, if the terminal state of the destination terminal bound by the stored user name of the destination user is a non-idle state, sending a session connection establishment response to the source terminal, where the session connection establishment response includes indication information of establishment failure;
alternatively, the server performs an operation set in advance by the source user.
For example, when the server detects that the terminal state of the destination terminal bound with the stored user name of the destination user is a non-idle state, if the terminal state is in a call state, the server may also continue to send a target session connection establishment request including a session connection establishment instruction to the destination terminal, and after the destination terminal outputs the target session connection establishment request, obtain an operation instruction input by the destination user, such as an operation instruction for hanging up, answering, and the like, and execute the operation instruction.
The non-idle state may include, among other things, an on-call state, an attempted-to-dial state, an incoming call ring state, an outgoing call ring, and an incoming call received state.
Further, the server may also return different indication information to the source terminal according to other terminal states of the destination terminal, as shown in table 1.
TABLE 1
As shown in table 1, if the terminal state is the IDLE state and the user request is a PHONE CALL dialing request, the returned indication information is indication information of successful dialing;
if the terminal state is the ACTIVE state of the CALL and the request of the user is the CALL dialing request, the returned indication information is the indication information currently in the CALL;
and if the terminal state is the ACTIVE state and the request of the user is a hang-up REFUSE request, returning the indication information as the hang-up indication information.
And step 250, the destination terminal establishes the session connection between the source terminal and the destination terminal according to the session connection establishment instruction and the session identification code of the source user.
Step 260, the destination terminal sends a target session connection establishment response to the server.
The target session connection setup response may contain an indication that the setup was successful.
Step 270, the server sends a session connection establishment response to the source terminal.
The session connection setup response may contain indication information that the setup was successful.
Optionally, the server may further receive state update information sent by the source terminal and the target terminal, where the state update information is used to indicate that the terminal state of the source terminal and the terminal state of the target terminal are updated to the call state;
and the server updates the stored terminal state of the source terminal and the terminal state of the target terminal into the call state according to the state updating information.
Optionally, the server may further obtain new contact information corresponding to the session identification code of the source user; and updating the stored contact information with the new contact information.
Specifically, the server may obtain new contact information corresponding to the user identifier, such as new contact information in which at least one new contact is added, communication information in which at least one historical contact is deleted, or communication information in which at least one historical contact is updated, and the like; and updating the stored contact information corresponding to the user identification with the new contact information. Therefore, the operation that in the prior art, all terminals under the user identification of the user need to be updated respectively under the condition that the contact information is changed is avoided, the workload of the terminals is reduced, and the user experience is improved.
Therefore, the terminal is only responsible for collecting the call request and calling the call related application program, the server is responsible for processing the request intention of the user and managing the contact information, the terminal can support various communication manufacturers, and the realization of fixed call functions such as mobile, communication, Tencent and the like is realized, and the reusability is high. The server can realize the management of different communication manufacturers on the contact information, and the user can realize the management of data among different manufacturers through one user account.
In the method for establishing the session connection provided by the embodiment of the invention, after the server receives the session connection establishment request sent by the source terminal, the session connection establishment request comprises the session connection type, the session identification code of the source user corresponding to the session connection type and the user name of the destination user; the session identification code is the unique identification for the session connection of the user in each session connection type; if the stored contact person information corresponding to the session identification code of the source user is detected to have the user name of the target user, acquiring the session identification code corresponding to the user name of the target user from the contact person information; sending a target session connection establishment request to a target terminal, wherein the target session connection establishment request comprises a session identification code of a source user, a session identification code of the target user and a session connection establishment instruction, so that the target terminal establishes session connection between the source terminal and the target terminal according to the session connection establishment instruction and the session identification code of the source user; receiving a target session connection establishment response which is sent by the destination terminal and contains indication information of successful establishment, and sending a session connection establishment response which contains the indication information of successful establishment to the source terminal. The method reduces the workload of the terminal and improves the user experience.
Corresponding to the foregoing method, an embodiment of the present invention further provides an apparatus for establishing a session connection, where as shown in fig. 3, the session apparatus includes: a receivingunit 310, an acquiringunit 320, and a transmittingunit 330;
a receivingunit 310, configured to receive a session connection establishment request sent by a source terminal, where the session connection establishment request includes a session connection type, a session identification code of a source user corresponding to the session connection type, and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
an obtainingunit 320, configured to obtain, if it is detected that the stored user name of the destination user exists in the contact information corresponding to the session identifier of the source user and the terminal state of the destination terminal bound to the stored user name of the destination user is an idle state, the session identifier corresponding to the user name of the destination user from the contact information;
a sendingunit 330, configured to send a target session connection establishment request to a destination terminal bound to a user name of the destination user, where the target session connection establishment request includes a session identification code of the source user, a session identification code of the destination user, and a session connection establishment instruction, so that the destination terminal establishes a session connection between the source terminal and the destination terminal according to the session connection establishment instruction and the session identification code of the source user.
The receivingunit 310 is further configured to receive a target session connection establishment response sent by the destination terminal and containing indication information of successful establishment.
The sendingunit 330 is further configured to send a session connection establishment response including the indication information that the establishment is successful to the source terminal.
In an optional implementation, the sendingunit 330 is specifically configured to send a target session connection establishment request to the destination terminal if the stored terminal state of the destination terminal bound to the user name of the destination user is an idle state.
In an alternative implementation, the apparatus further comprises an execution unit 340;
the sendingunit 330 is further specifically configured to send a session connection establishment response to the source terminal if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, where the session connection establishment response includes indication information of establishment failure;
or, the execution unit 340 is configured to execute an operation preset by the source user.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an alternative implementation, the apparatus further comprises a first updating unit 350;
a receivingunit 310, further configured to receive status update information sent by the source terminal and the target terminal, where the status update information is used to indicate that a terminal status of the source terminal and a terminal status of the target terminal are updated to be in a call state;
a first updating unit 350, configured to update the stored terminal state of the source terminal and the stored terminal state of the target terminal to the call-in-progress state according to the state update information.
In an optional implementation, the sendingunit 330 is further configured to send a session connection establishment response to the source terminal if it is detected that the stored contact information corresponding to the session identification code of the source user does not include the user name of the destination user, where the session connection establishment response includes indication information that the destination user is empty.
In an alternative implementation, the apparatus further comprises a second updating unit 360;
the obtainingunit 320 is further configured to obtain new contact information corresponding to the session identifier of the source user;
a second updating unit 360, configured to update the stored contact information with the new contact information.
In an alternative implementation, the session connection type includes a session connection of a mobile communication network and a session connection of an application having a session function;
the session connection establishment request includes a session connection establishment request of a mobile communication network in the source terminal and a session connection establishment request of the application program in the source terminal.
The functions of the functional units of the communication device provided in the above embodiments of the present invention may be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of the units in the communication device provided in the embodiments of the present invention are not described herein again.
Corresponding to the foregoing method, an embodiment of the present invention further provides a session connection establishing apparatus, and as shown in fig. 4, the session apparatus includes: an acquiringunit 410, a sendingunit 420, a receivingunit 430 and a establishingunit 440;
an obtainingunit 410, configured to obtain a session connection establishment request, where the session connection establishment request includes a session connection type, a session identification code of a source user corresponding to the session connection type, and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
a sendingunit 420, configured to send the session connection establishment request to a server;
a receivingunit 430, configured to receive a session establishment response sent by the server if the server detects that the stored user name of the destination user exists in the contact information corresponding to the session identification code of the source user and the terminal state of the destination terminal bound to the stored user name is an idle state, where the session establishment response includes the session identification code of the destination user and a session establishment instruction;
a receivingunit 430, configured to receive a target session connection establishment request sent by the server, where the target session connection establishment request includes a session identifier of a user bound to another terminal, a session identifier of the user bound to the terminal, and a session connection establishment instruction;
an establishingunit 440, configured to establish a session connection between the terminal and the other terminal according to the session connection establishment indication and the session identifier of the user bound to the other terminal;
the sendingunit 420 is further configured to send a target session connection establishment response including indication information that establishment is successful to the server.
In an optional implementation, the receivingunit 430 is further configured to receive a session connection establishment response sent by the server if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, where the session connection establishment response includes indication information of an establishment failure.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, the sendingunit 420 is further configured to send status update information to the server, where the status update information is used to indicate that the terminal status of the source terminal is updated to the call-in status.
In an optional implementation, the receivingunit 430 is further configured to receive a session establishment response sent by the server, where the session establishment response includes information indicating that the destination user is null.
The functions of the functional units of the communication device provided in the above embodiments of the present invention may be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of the units in the communication device provided in the embodiments of the present invention are not described herein again.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, including aprocessor 510, acommunication interface 520, amemory 530 and acommunication bus 540, where theprocessor 510, thecommunication interface 520, and thememory 530 complete mutual communication through thecommunication bus 540.
Amemory 530 for storing a computer program;
theprocessor 510, when executing the program stored in thememory 530, implements the following steps:
receiving a session connection establishment request sent by a source terminal, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a destination user; the session identification code is the unique identification for session connection of users in each session connection type;
if the stored contact person information corresponding to the session identification code of the source user is detected to have the user name of the target user, acquiring the session identification code corresponding to the user name of the target user from the contact person information;
sending a target session connection establishment request to a target terminal bound by a user name of the target user, wherein the target session connection establishment request comprises a session identification code of the source user, a session identification code of the target user and a session connection establishment instruction, so that the target terminal establishes session connection between the source terminal and the target terminal according to the session connection establishment instruction and the session identification code of the source user;
receiving a target session connection establishment response which is sent by the target terminal and contains indication information of successful establishment, and sending a session connection establishment response which contains the indication information of successful establishment to the source terminal.
In an optional implementation, sending a target session connection establishment request to a destination terminal bound to a user name of the destination user includes:
and if the stored terminal state of the target terminal bound by the user name of the target user is an idle state, sending a target session connection establishment request to the target terminal.
In an optional implementation, the method further comprises:
if the stored terminal state of the destination terminal bound by the user name of the destination user is a non-idle state, sending a session connection establishment response to the source terminal, wherein the session connection establishment response comprises indication information of establishment failure;
or, executing the operation preset by the source user.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, after sending a session connection setup response including the indication information of successful setup to the source terminal, the method further includes:
receiving state updating information respectively sent by the source terminal and the target terminal, wherein the state updating information is respectively used for indicating that the terminal state of the source terminal and the terminal state of the target terminal are updated to be in a conversation state;
and updating the stored terminal state of the source terminal and the terminal state of the target terminal to be a call state according to the state updating information.
In an optional implementation, the method further comprises:
and if the stored contact person information corresponding to the session identification code of the source user does not have the user name of the target user, sending a session connection establishment response to the source terminal, wherein the session connection establishment response comprises indication information that the target user is empty.
In an optional implementation, the method further comprises:
acquiring new contact information corresponding to the session identification code of the source user;
and updating the stored contact information with the new contact information.
In an alternative implementation, the session connection type includes a session connection of a mobile communication network and a session connection of an application having a session function;
the session connection establishment request includes a session connection establishment request of a mobile communication network in the source terminal and a session connection establishment request of the application program in the source terminal.
Or, the following steps are implemented:
acquiring a session connection establishment request, wherein the session connection establishment request comprises a session connection type, a session identification code of a source user corresponding to the session connection type and a user name of a target user; the session identification code is the unique identification for session connection of users in each session connection type;
sending the session connection establishment request to a server;
if the server detects that the stored contact person information corresponding to the session identification code of the source user has the user name of the target user, receiving a session establishment response sent by the server, wherein the session establishment response comprises indication information of successful establishment;
if receiving a target session connection establishment request sent by the server, establishing session connection between the server and other terminals according to the session connection establishment indication and the session identification codes of the users bound with the other terminals; the target session connection establishment request comprises session identification codes of users bound by other terminals, session identification codes of the users bound by the terminals and session connection establishment instructions;
and sending a target session connection establishment response containing indication information of successful establishment to the server.
In an optional implementation, if the stored terminal state of the destination terminal bound to the user name of the destination user is a non-idle state, a session connection establishment response sent by the server is received, where the session connection establishment response includes indication information of establishment failure.
In an alternative implementation, the non-idle states include an on-call state, an attempted-to-dial state, an incoming call ringtone state, an outgoing call ringtone, and an incoming call state.
In an optional implementation, after receiving the session establishment response sent by the server, the method further includes:
and sending state updating information to the server, wherein the state updating information is used for indicating that the terminal state of the source terminal is updated to be a call state.
In an optional implementation, the method further comprises:
and receiving a session establishment response sent by the server, wherein the session establishment response comprises indication information that the target user is empty.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Since the implementation manner and the beneficial effects of the problem solving of each device of the electronic device in the foregoing embodiment can be implemented by referring to each step in the embodiment shown in fig. 2, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the session connection establishment method described in any one of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for establishing a session connection as described in any of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.