Disclosure of Invention
In order to realize the audio-video interaction between the applet and the SIP contact center, the application provides a method for realizing the audio-video interaction between the applet and the SIP contact center.
In a first aspect, the method for implementing audio-video interaction between an applet and an SIP contact center provided by the present application adopts the following technical scheme.
A method for implementing applet interaction with SIP contact center audio video, comprising:
after receiving a call seat request sent by an applet, sending first SIP information to an SIP contact center according to the call seat request, wherein the first SIP information is used for triggering the SIP contact center to distribute the first SIP information to a seat;
After the seat answers, converting the received media stream sent by the applet into a media stream in a first file format supported by the SIP contact center, sending the media stream in the first file format to the SIP contact center, wherein the media stream in the first file format is used for triggering the SIP contact center to send the media stream in the first file format to the seat, and
After the seat answers, converting the media stream sent by the SIP contact center into a media stream in a second file format supported by the applet, and sending the media stream in the second file format to the applet, wherein the media stream sent by the SIP contact center is sent to the SIP contact center by the seat.
By adopting the technical scheme, the calling seat request sent by the small program is converted into the first SIP information of the SIP protocol, after the seat is connected, the media stream sent by the seat is converted into the media stream format supported by the small program, and the media stream sent by the small program is converted into the media stream format supported by the seat, so that the voice and video interaction between the small program and the seat is realized.
Optionally, after sending the first SIP information to the SIP contact center, the method further includes:
receiving the seat state information sent by the SIP contact center, wherein the seat state information is sent by the SIP contact center according to the response state of the seat after the seat receives the first SIP information, and
And sending the seat state information to the applet.
By adopting the technical scheme, the seat state information is sent to the applet, so that the applet can know the state of the seat conveniently.
Optionally, the applet is pre-registered, and the applet registering step includes:
Receiving a registration request sent by the applet, wherein the registration request is generated by the applet based on an account number, a user name and a password distributed by the SIP contact center;
transmitting SIP registration information to the SIP contact center based on the registration request;
Receiving the registration result information sent by the SIP contact center and
And sending the registration result information to the applet.
By adopting the technical proposal, the applet is registered in advance, and when the applet exchanges data with the seat, the seat is convenient to know the information of the applet terminal,
Optionally, after the applet is successfully registered, the method further includes:
receiving the heartbeat message sent by the applet, and
Judging whether the communication connection with the applet is successful or not based on the heartbeat information, and if not, canceling the registration state of the applet.
By adopting the technical scheme, the heartbeat message is convenient for knowing whether the applet fails or is stopped when the applet fails, so that whether the registration state of the applet is maintained is convenient for judgment.
Optionally, the method further comprises:
After receiving a call applet request sent by an SIP contact center, sending a call request to a corresponding applet based on the call applet request, wherein the call applet is received by the SIP contact center from a seat;
After the applet selects to answer, converting the received media stream sent by the applet into a media stream of a first file format supported by the SIP contact center, sending the media stream of the first file format to the SIP contact center, wherein the media stream of the first file format is used for triggering the SIP contact center to send the media stream of the first file format to a seat, and
After the applet selects to answer, converting the media stream sent by the SIP contact center into a media stream in a second file format supported by the applet, and sending the media stream in the second file format to the applet, wherein the media stream sent by the SIP contact center is sent to the SIP contact center by the seat.
By adopting the technical scheme, the seat is convenient to directly contact with registered applets.
Optionally, the method further comprises:
After receiving the hang-up request sent by the applet terminal, sending first hang-up information to the SIP contact center and stopping the conversion of the media stream, wherein the first hang-up information is used for triggering the SIP contact center to send the hang-up information to the seat, or
And after receiving the hanging-up request sent by the SIP contact center, sending second hanging-up information to the applet, and stopping the conversion of the media stream.
Optionally, converting the received media stream sent by the applet into a media stream in a first file format supported by the SIP contact center, including converting ACC-encoded voice information sent by the applet into an RTP stream of PCMA 8 k;
the method for converting the media stream sent by the SIP contact center into the media stream in the second file format supported by the applet comprises the steps of converting the RTP stream of PCMA 8k into ACC coded voice information and converting the RTP stream into H264 coded video information.
In a second aspect, the system for implementing audio-video interaction between the applet and the SIP contact center provided by the present application adopts the following technical scheme.
A system for enabling applet interaction with SIP contact center audio and video, comprising:
the receiving module is used for sending first SIP information to the SIP contact center according to the calling seat request after receiving the calling seat request sent by the applet, wherein the first SIP information is used for triggering the SIP contact center to distribute the first SIP information to the seat;
The first media stream conversion module is used for converting the received media stream sent by the applet into a media stream of a first file format supported by the SIP contact center after the seat answers, sending the media stream of the first file format to the SIP contact center, triggering the SIP contact center to send the media stream of the first file format to the seat, and
The second media stream conversion module is used for converting the media stream sent by the SIP contact center into the media stream in the second file format supported by the applet, and sending the media stream in the second file format to the applet, wherein the media stream sent by the SIP contact center is sent to the SIP contact center by the seat.
In a third aspect, the application discloses a computer device comprising a memory and a server, the memory having stored thereon a computer program loaded by the server and performing any of the methods described above.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program capable of being loaded by a server and executing any of the methods described above.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings 1 to 4 and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Applets have numerous instant use applications and are therefore favored by more and more users. In the related art, the applet does not support the UDP protocol as a media transmission channel, and the voice and video applications of the applet only support the RTMP protocol based on TCP, but most of the enterprise SIP contact centers at present are based on SIP architecture, so that the application based on the applet cannot access the SIP contact center through the standard SIP protocol.
In order to solve the technical problems, the application discloses a method for realizing audio-video interaction between an applet and an SIP contact center.
Referring to fig. 1, fig. 1 illustrates an exemplary system architecture to which the methods of the present application may be applied. The system architecture may include applet terminals, protocol conversion gateways, SIP contact centers (also referred to as call centers), and agent SIP terminals (simply referred to as agents). It should be understood that the numbers in fig. 1 are merely illustrative, and that any number of applet terminals and any number of seats may be selected as desired for implementation.
Referring to fig. 2, as an embodiment of a method for implementing audio-video interaction between an applet and a SIP contact center, the method is applied to a protocol conversion gateway, and the method includes the steps of:
And step 101, after receiving a call seat request sent by the applet, sending first SIP information to the SIP contact center according to the call seat request, wherein the first SIP information is used for triggering the SIP contact center to distribute the first SIP information to the seat.
Specifically, the user may initiate a call seat request to the protocol conversion gateway through the applet terminal according to the called object (i.e., SIP contact center or seat). After receiving the call seat request, the protocol conversion gateway sends first SIP information to the SIP contact center according to the call seat request, and the SIP contact center distributes the first SIP information to the seat.
In one embodiment of step 101, after receiving the call seat request, the protocol conversion gateway generates SIP INVITE a message (i.e., first SIP information) according to the information such as the calling number, the called number, the domain name, etc., and generates an SDP message body according to the IP of the machine in which the protocol conversion gateway is located, and then the protocol conversion gateway sends SIP INVITE a message to the SIP contact center, after receiving the SIP INVITE message, the SIP contact center allocates a seat, and sends SIP INVITE a message to the allocated seat.
Step 102, after the seat is received, converting the media stream sent by the received applet into a media stream in a first file format supported by the SIP contact center.
Specifically, since the audio and video formats supported by the applet are different from those supported by the SIP contact center, it is necessary to convert the media stream transmitted by the applet into the media stream of the first format supported by the SIP contact center after the seat is listened to.
And step 103, sending the media stream in the first file format to the SIP contact center, wherein the media stream in the first file format is used for triggering the SIP contact center to send the media stream in the first file format to the seat.
Specifically, the media stream in the first file format is sent to the SIP contact center, and the SIP contact center receives the media stream in the first file format and then sends the media stream to the previously allocated seat, so that the seat can receive the video and the audio sent by the applet.
And 104, after the seat answers, converting the media stream sent by the SIP contact center into a media stream in a second file format supported by the applet. The media stream sent by the SIP contact center is sent by the agent to the SIP contact center.
Specifically, the order in which the two parties send information is not constant when performing voice or video interaction, and thus the numerical order of step 104 and step 102 is not intended to limit the order in which step 104 follows step 102. After the media stream sent by the seat is received by the SIP contact center, the SIP contact center sends the media stream to the protocol conversion gateway, and the protocol conversion gateway converts the media stream sent by the SIP contact center into a media stream in a second file format.
Step 105, the media stream in the second file format is sent to the applet.
Specifically, the protocol conversion gateway converts the media stream sent by the SIP contact center into the media stream in the second file format, and sends the media stream to the applet, so that the applet can receive the voice and video information sent by the seat, and further data interaction of voice and video between the applet and the seat is realized.
As another implementation mode of the method for realizing the interaction of the applet and the audio and video of the SIP contact center, the method for converting the received media stream sent by the applet into the media stream in the first file format supported by the SIP contact center comprises the steps of converting ACC-coded voice information sent by the applet into RTP stream of PCMA 8k, and converting H264-coded video information sent by the applet into RTP stream;
converting the media stream sent by the SIP contact center into the media stream in the second file format supported by the applet comprises converting the RTP stream of PCMA 8k into ACC coded voice information and converting the RTP stream into H264 coded video information.
Specifically, after the seat is turned on, the protocol conversion gateway starts to establish a media transmission channel. The applet terminal pushes the collected media streams (voice and video) to the protocol conversion gateway through the live-pusher component (according to the difference of the media stream collection components supported by the applet, the live-pusher component can also be replaced by other media stream collection components), and meanwhile, the applet terminal receives and plays the media streams sent by the protocol conversion gateway through the live-player component (according to the difference of the audio and video play components supported by the applet, the live-player component can be replaced by other audio and video play components).
In one embodiment, if the voice code supported by the applet is AAC and the video code supported by the applet is H264, the SIP switch of the SIP contact center does not support AAC code, and the voice packet transmission protocol of the SIP switch is RTP, so that the protocol conversion gateway needs to implement the interconversion from the RTMP data stream to the RTP protocol and simultaneously needs to interconvert the AAC voice code and the voice PCMA code to implement the voice and video interaction between the applet and the seat.
The applet pushes the collected media stream (voice and video) to a protocol conversion gateway through a live-pusher component, after the protocol conversion gateway receives the applet and sends the media stream, the AAC format voice stream is converted into an RTP stream of PCMA 8k, the RTP stream of PCMA 8k is sent to an SIP switch of an SIP contact center, the protocol conversion gateway directly converts the H264 format video stream into an RTP stream, and the RTP stream is sent to the SIP switch of the SIP contact center. The protocol conversion gateway may send the ip and port of the server RTP in the SIP 200OK SDP message via the UDP protocol. Meanwhile, the protocol conversion gateway needs to monitor the RTP media stream sent by the SIP switch from the SIP contact center, the voice code sent by the SIP contact center is PCMA 8k, at the moment, the protocol conversion gateway needs to convert the media stream into the media stream of the RTMP protocol, and meanwhile, the converted media stream is pushed to the RTMP url2 address, and the applet terminal monitors the media stream from the RTMP url2 through the live-layer component, so that voice sent by the seat terminal is played by the applet terminal, and voice interaction is realized. Because the call in the video information contains the voice information, if the SIP switch supports H264 coding, the video information is not required to be transcoded, and the protocol conversion gateway combines the voice stream and the video stream into an RTMP stream to be pushed to the applet, so that the video interaction is realized.
As another embodiment of the method for implementing the interaction between the applet and the audio and video of the SIP contact center, after sending the first SIP information to the SIP contact center, the method further includes the following steps:
The method comprises the steps of receiving the position state information sent by an SIP contact center, wherein the position state information is sent by the SIP contact center according to the response state of the position after the position receives the first SIP information, and
And sending the seat state information to the applet.
Specifically, after receiving the call seat request, the protocol conversion gateway creates SIP INVITE a message, and then the protocol conversion gateway sends SIP INVITE a message to the SIP contact center, after receiving the SIP INVITE a message, the SIP contact center allocates a seat, and sends SIP INVITE a message to the allocated seat. The protocol conversion gateway forwards corresponding state information to the applet through websocket information according to the state of the seat response (ringing, answering, hanging up and other states). If the applet call fails, the protocol conversion gateway sends a corresponding error code (such as no number exists, no answer by the called person, etc.) to the applet, and the applet terminal displays the call state according to the seat state information sent by the protocol conversion gateway, so that the applet terminal can know the current communication state conveniently.
As another embodiment of a method for implementing applet interaction with SIP contact center audio video, the applet is pre-registered. The applet registering step includes the steps of:
step 201, receiving a registration request sent by an applet, wherein the registration request is generated by the applet based on an account number, a user name and a password distributed by an SIP contact center;
Step 202, SIP registration information is sent to an SIP contact center based on a registration request;
Step 203, receiving the registration result information sent by the SIP contact center, and
Step 204, the registration result information is sent to the applet.
Specifically, the applet generates a registration request based on an account number assigned by the SIP contact center, a set user name, and a set password. The applet sends the registration request to the protocol conversion gateway via websocket. After receiving the registration request, the protocol conversion gateway establishes a new SIP UAC object to form SIP registration information (i.e. SIP REGISTER message) of the extension account and the password, and then the protocol conversion gateway sends the SIP registration information to the SIP switch of the SIP contact center through the SIP UDP protocol. The protocol conversion gateway receives the registration result information sent by the SIP contact center and forwards the registration result information to the applet terminal through websocket information. The applet displays the success or failure of registration in the applet terminal according to the registration result.
As another embodiment of the method for implementing the interaction between the applet and the SIP contact center audio and video, after the applet is successfully registered, the method further includes:
receiving heartbeat messages sent by the applet, and
And judging whether the communication connection with the applet is successful or not based on the heartbeat information, and if not, canceling the registration state of the applet.
Specifically, the successfully registered applet needs to periodically send a heartbeat message to the protocol conversion gateway to keep the websocket connection clear, where the heartbeat message (Heartbeat Message) is a message sent from the sender to the receiver, and this message allows the receiver to determine whether and when the sender has failed or terminated. The protocol conversion gateway will save the check certificate when the user registers, and if the heartbeat information sent by the applet is not broken, the protocol conversion gateway will periodically send SIP REGISTER a request to the applet. After detecting that the connection of the applet is disconnected, the protocol conversion gateway automatically sends UnRegister a request to the SIP switch to cancel the registration state of the applet terminal.
As another embodiment of the method for implementing the interaction between the applet and the SIP contact center audio and video, the method for implementing the interaction between the applet and the SIP contact center audio and video further includes:
After receiving a call applet request sent by the SIP contact center, sending a call request to a corresponding applet based on the call applet request;
After the applet selects to answer, converting the received media stream sent by the applet into a media stream of a first file format supported by the SIP contact center, and sending the media stream of the first file format to the SIP contact center, wherein the media stream of the first file format is used for triggering the SIP contact center to send the media stream of the first file format to the seat, and
After the applet is selected to answer, converting the media stream sent by the SIP contact center into the media stream in the second file format supported by the applet, and sending the media stream in the second file format to the applet, wherein the media stream sent by the SIP contact center is sent to the SIP contact center by a seat.
Specifically, for applet terminals that are successfully registered, the agent of the SIP contact center may actively outbound the applet. The protocol conversion gateway receives a call applet request (Invite request) from the SIP contact center, converts the call applet request into a call request (i.e. an incoming call ringing request), sends the call request to the applet terminal through the websocket protocol, and after receiving the call request, the applet terminal can bounce the screen to allow the user to select to be switched on or reject, if the applet terminal is switched on, the applet starts to call the live-layer component and the live-pusher component to accept and send a media stream, and the conversion process of the media stream is consistent with the process of calling the seat of the SIP contact center as a calling party, which is not repeated herein. Through the arrangement, the interaction of voice and video between the seat end and registered applets is facilitated.
As another implementation mode of the method for realizing the interaction of the applet and the audio and video of the SIP contact center, after receiving the hang-up request sent by the applet terminal, the method sends first hang-up information to the SIP contact center and stops the conversion of the media stream, wherein the first hang-up information is used for triggering the SIP contact center to send the hang-up information to the seat, or
And after receiving the hanging-up request sent by the SIP contact center, sending second hanging-up information to the applet, and stopping the conversion of the media stream.
Specifically, when the seat or the applet transmits the hang-up request, the hang-up request is converted into information of a corresponding communication protocol through the protocol conversion gateway. For example, the seat end sends a hang-up request, the protocol conversion gateway converts the hang-up request into information of websocket protocol and then sends the information to the applet terminal, and simultaneously, the transmission of RTP message and the transmission of RTMP media stream are closed. When the applet terminal sends the hang-up request, the protocol conversion gateway converts the hang-up request into information of the SIP protocol and sends the information to the SIP switch, and simultaneously, the transmission of the RTP message and the transmission of the RTMP media stream are closed.
Referring to fig. 4, the present application further provides a system for implementing audio/video interaction between an applet and a SIP contact center, including:
The receiving module 401 is configured to send first SIP information to the SIP contact center according to the call seat request after receiving the call seat request sent by the applet;
a first media stream conversion module 402, configured to convert, after the seat is in answer, a media stream sent by the received applet into a media stream in a first file format supported by the SIP contact center, send the media stream in the first file format to the SIP contact center, the media stream in the first file format is used to trigger the SIP contact center to send the media stream in the first file format to the seat, and
The second media stream conversion module 403 is configured to convert a media stream sent by the SIP contact center into a media stream in a second file format supported by the applet, and send the media stream in the second file format to the applet, where the media stream sent by the SIP contact center is sent by the agent to the SIP contact center.
The embodiment of the application also discloses computer equipment.
Specifically, the device comprises a memory and a server, wherein the memory stores a computer program which can be loaded by the server and execute any method for realizing the audio-video interaction between the applet and the SIP contact center.
The embodiment of the application also discloses a computer readable storage medium.
Specifically, the computer readable storage medium stores a computer program that can be loaded by a server and execute any of the methods for implementing the audio/video interaction between an applet and a SIP contact center, and includes, for example, a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, and other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the application is not intended to limit the scope of the application in any way, including the abstract and drawings, in which case any feature disclosed in this specification (including abstract and drawings) may be replaced by alternative features serving the same, equivalent purpose, unless expressly stated otherwise. That is, each feature is one example only of a generic series of equivalent or similar features, unless expressly stated otherwise.