Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a method for acquiring a bidirectional outbound voice stream applied to a call center, which copies a call signaling and a media stream of a bidirectional outbound through two different modes of network mirroring and active push stream, extracts SIP signaling information and voice RTP (Real-time Transport Protocol) data required by recording through packet capturing and filtering of a media server, and can adapt to various types of bidirectional outbound voice systems and relay lines
The aim of the invention can be achieved by the following technical scheme:
The invention provides a method for acquiring a bidirectional outbound voice stream applied to a call center, which comprises the following steps:
When receiving a double-outbound call request and initiating a call, adopting a network mirror image or active push flow mode to continuously synchronize SIP signaling messages in the double-outbound call through network packet capturing;
Analyzing the SIP signaling message to obtain an SIP session of a calling seat and an SIP session of a calling client, and combining the SIP session to obtain a target SIP session;
and after the call is initiated successfully, acquiring a corresponding RTP voice stream based on the target SIP session, and performing post-processing and storage based on the RTP voice stream to acquire the voice stream.
As a preferred technical solution, the process of synchronizing SIP signaling messages in a dual outbound call by adopting a network mirroring manner includes the following steps:
by configuring the mirroring policy of the network switch, SIP signaling messages in mirrored bi-directional outbound calls are obtained when the media server and/or SIP server receives/transmits data information streams.
As a preferred technical solution, the process of synchronizing SIP signaling messages in a dual outbound call by adopting an active push flow method includes the following steps:
And configuring an active push strategy based on the network card name and the IP address of the media server and/or the SIP server, and acquiring the SIP signaling message in the mirrored bidirectional outbound call through the active push data stream.
As a preferred technical solution, the process of determining whether the call origination is successful includes the following steps:
and analyzing the target SIP session, judging whether the target SIP session comprises SIP INVITE information and/or 200OK information, and if yes, indicating that the call initiation is successful.
As a preferred technical solution, after obtaining and merging the SIP session of the calling agent and the SIP session of the calling client, the method further includes:
And marking the merged RTP voice stream, marking the RTP voice stream from the relay gateway or the SBC to the media server as an agent side voice stream, and marking the RTP voice stream from the media server to the relay gateway or the SBC as a client side voice stream.
As a preferred technical solution, the post-processing and storing based on the RTP voice stream includes the following steps:
and clathrating the RTP files into temporary recording files, and acquiring the client-side recording files, the seat-side recording files and the double-side recording files based on the temporary recording files.
In the preferred technical scheme, in the double-sided recording file, recordings on the client side and the seat side are respectively arranged on the left and right channels.
As a preferable technical scheme, the method further comprises the following steps:
Judging whether the target SIP session comprises an SIP bye message or not, if so, ending the recording.
As a preferable technical scheme, the voice stream is converted by GSM coding or PCMU coding, named according to a preset naming rule and stored in a preset path according to different types of the record files.
As a preferred technical solution, after the post-processing and storing based on the RTP voice stream, the method further includes:
The method comprises the steps of obtaining the starting time, the ending time, the calling number, the called number, the client answering time and the recording unique ID of the double-outgoing call, and writing the unique ID into a preset database.
Compared with the prior art, the invention has the following advantages:
(1) The method is wide in application range, firstly, the call signaling and the media stream of the double-outbound call are copied, SIP signaling information and voice RTP data required by recording are extracted through packet grabbing and filtering of a media server, finally, acquisition and drainage are realized by utilizing the acquired RTP data, and the call signaling and the media stream of the double-outbound call are copied by adopting a network mirror image and active push flow scheme, so that the method has strong universality, and can adapt to various different types of bidirectional outbound voice systems and relay lines, including a digital relay line, an SIP relay line and a hybrid relay line.
(2) The method has low coupling degree, and the call in the double-outbound mode is independently recorded without depending on the functions of third party equipment or a third party system.
(3) The recording data has strong regularity, the method can analyze the call associated data of the dual-outbound mode in real time, acquire accurate information such as calling number, called number and the like, mark SIP signaling information and voice RTP information, standard seat side information and client side information, and realize the adaptation of AI application such as intelligent voice quality inspection and the like. The method and the system of the invention realize the real-time analysis of the call path data in the double-outward call mode by analyzing the SIP message and the source address and the target address of the message, and mark the seat and the client.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Example 1
As shown in fig. 1, the present embodiment provides a method for obtaining a bidirectional outbound voice stream applied to a call center, including the following steps:
step S1, the media server receives a two-way callback call request initiated by the application end, and initiates the initiation of the call.
Step S1, when the media server initiates a call, the SIP signaling message and RTP voice stream of the two-way callback call are copied to the recording control system, the copying method is two,
The method 1 is a network mirroring mode. The media server, the SIP server and the recording control system server in the two-way outbound voice system are respectively connected with the independent network card interfaces of the same network switch. In the configuration management of network switch, a port mirror strategy is configured, the port number of network switch connected with media server and SIP server is used as the source address of port mirror, and the port number of network switch connected with recording control system server is used as the destination address of port mirror. When the network switch ports connected with the media server and the SIP server receive and send data information streams, the port mirroring strategy mirrors all the data information streams to the network switch ports connected with the recording control system server. The recording control system extracts the needed SIP signaling message and RTP voice stream through the received data information stream.
The method 2 is an active plug flow mode. And installing and deploying a plug flow management module provided by a recording control system in a media server and a Session Initiation Protocol (SIP) server in the bidirectional outbound voice system. The push strategy is configured through the push management module, the network card name and the IP address of the media server and the SIP server which are responsible for processing the data information stream are used as push sources, and the network card name and the IP address of the recording control system server which are responsible for receiving the data information stream are used as push targets. When the media server and the SIP server receive and send the data information streams, all the data information streams are actively pushed to the recording control system server according to a push configuration strategy. The recording control system receives the data information flow and extracts the needed SIP signaling message and RTP voice flow.
And S3, the recording control system acquires the SIP signaling message in the received data information stream through the network packet capturing module, and analyzes and acquires the SIP message of the double-outbound call.
Step S4, analyzing the path data in the SIP header of the SIP message, and according to the principle of a double-outbound mode, in a double-outbound, analyzing 2 SIP calls initiated by a media server, namely SIP Call 1 and SIP Call 2.
And S5, defining a first Call SIP Call 1 as a Call seat and a second Call SIP Call 2 as a Call client under the service application scene of the default double-outbound Call. When the double-outbound Call is connected, the SIP Call 1 and the SIP Call 2 are combined into the SIP Call 1, so the recording control system starts recording the SIP Call 1.
And S6, the recording control system analyzes the SIP message of the SIP Call 1, and when receiving SIP INVITE and 200OK messages, the recording control system represents that the Call is initiated successfully and starts recording.
And S7, the recording control system continues to analyze the SIP message of the SIP Call 1, determines the IP address and the port of the RTP voice stream used by the SIP Call 1, and acquires the RTP voice stream corresponding to the SIP Call 1.
Further, the recording control system marks the RTP voice stream of the SIP Call 1 after the combination Call. The RTP voice stream from the relay gateway/SBC to the media server is marked as the seat side voice stream, and the RTP voice stream from the media server to the relay gateway/SBC is marked as the client side voice stream.
And S8, the recording control system synthesizes the received SIP Call 1RTP voice stream into a temporary recording file in real time. Typically 50 RTP packets are generated per second on average, the size of a single RTP packet being 160 bytes, a buffer of 8 kbytes is set, so that the temporary audio record file is written once per second increment on average.
Furthermore, when the temporary recording files are synthesized, the temporary recording files are split into two independent recording files according to the agents and the clients, wherein only voice RTP streams at the agents are arranged in one recording file, and only voice RTP streams at the clients are arranged in the other recording file, so that the recording of the separation of the speakers is realized.
Furthermore, on the basis of separation of the talkers, a temporary recording file is synthesized, and the recording file contains all RTP voice streams of the agents and the clients.
Further, when the temporary recording file is synthesized, the recording control system respectively fixes the seat side voice RTP stream and the client side voice RTP stream at the left channel and the right channel, so that when the follow-up recording is played in a tuning mode, one channel is the seat sound, and the other channel is the client sound.
Step S9, the recording control system analyzes the SIP message of the SIP Call 1, and when receiving the SIP bye message, the recording control system stops recording when the Call is ended.
And S10, the recording control system compresses the temporary recording file according to the GSM coding rule, converts the compressed temporary recording file into a standard recording file in wav format and stores the standard recording file in a preset storage path. The audio file storage paths are grouped by year/month/day/time, e.g., 2022/12/15/11.
Furthermore, the recording control system can convert the temporary recording file into the wav format recording file with 8k16bit according to the PCM coding rule, and can be used for a third-party intelligent voice quality inspection system.
Furthermore, the recording control system can convert the temporary recording file into the wav format recording file with 8k8bit according to PCMU coding rules, and can be used for a third-party intelligent voice quality inspection system.
Furthermore, the recording control system can judge according to the types of the recording files, and store the recording files of different types in different storage paths, so that the third-party intelligent voice quality inspection system can be conveniently called. If the voice record files are separated, the voice record files on the seat side and the voice record files on the client side are stored in two different storage paths.
Step S11, the recording control system collects the starting time, ending time, calling number, called number, customer answering time, recording unique ID and the like of the bidirectional outbound according to the SIP message and the SIP header associated data of the SIP Call 1. Writing the collected data into a recording detail database.
Further, the recording control system associates the unique recording ID with the unique calling ID in the two-way outbound voice system, and each recording corresponds to a two-way outbound call. Meanwhile, service information fields such as the seat name, the customer name and the like can be obtained through data association inquiry, and the service information fields are written into detail data fields corresponding to the record.
The method can realize call recording in the double-outbound mode of the call center.
The call diagram of fig. 2 is a call diagram of a call center in a dual outbound mode, comprising the following steps:
Step1, the media receives a call request initiated by an application terminal, inquires a number list and identifies the seat mobile phone number and the customer mobile phone number in the request.
Step2, the media server initiates a first call to call the seat mobile phone number.
Step3, after the seat mobile phone number is connected, the media server initiates a second call to call the customer mobile phone number.
Step4, after the mobile phone number of the client is connected, the media server merges the two-way call.
Step5, the seat mobile phone and the client mobile phone establish a call.
Compared with the prior art, the method provided by the application has the following advantages,
1. The method is a universal method and system, and can be suitable for various different bidirectional outbound voice systems and trunk line types, including digital trunk lines, SIP trunk lines and hybrid trunk lines. The communication signaling and media stream of the double-outbound call are duplicated through two different modes, namely network mirroring and active push flow, and SIP signaling information and voice RTP data required by recording are extracted through packet grabbing and filtering of a media server.
2. The method has low coupling degree with other systems, and does not need to rely on third party equipment or third party system functions. The method and the system independently complete the recording of the call in the double-outbound mode.
3. The method can analyze the call associated data of the dual outbound mode in real time, acquire accurate information such as calling numbers, called numbers and the like, mark SIP signaling messages and voice RTP messages, standard seat side messages and client side messages, and realize the adaptation of AI applications such as intelligent voice quality inspection and the like. The method and the system of the invention realize the real-time analysis of the call path data in the double-outward call mode by analyzing the SIP message and the source address and the target address of the message, and mark the seat and the client.
Example 2
As shown in fig. 3, the present embodiment provides a voice stream obtaining apparatus, which includes a recording control server, a recording server, a recording management server, a recording query server, and a controller. The controller is preset with instructions to implement the two-way outbound voice stream acquisition method as described in embodiment 1.
The recording control server is used for analyzing the SIP information of the double-outward call and identifying the invite and bye of each call key and the corresponding 200OK information. Starting to start the recording of the through call according to the invite message and the corresponding 200OK message, and ending the recording of the through call according to the bye message and the corresponding 200OK message.
Further, the recording control server analyzes the SIP header of the SIP message, obtains the information of the initiator and the target in the double-outbound mode, sets the mobile phone number of the seat as a calling party, and sets the mobile phone number of the client as a called party.
Further, the recording control server resolves the source address and the destination address of the SIP message, marks the message from the relay gateway/SBC to the media server as a seat side message, and marks the message from the media server to the relay gateway/SBC as a client side message.
The recording control server is also used for analyzing the recording data and writing the recording data into a recording detail database. The recording control server collects the call starting time, the call hang-up time, the calling number, the called number, the client answering time and the recording unique ID by analyzing the SIP information of the double-outbound call, and stores the data in a warehouse.
The recording and recording server is used for capturing data packets, capturing packets of the network card of the recording and recording server through a packet capturing tool integrated in the recording and recording server, and copying a network mirror image or an active plug flow mode to the recording and recording server for data flow collection and recording.
Further record servers can filter when the packet data stream is grabbed. The filtering can be done by IP address, directly discarding data streams of undesired targets or desired recordings. The running performance of the system can be remarkably improved by directionally filtering and then grabbing the package.
The sound recording server is also used for generating sound recording files. And converting the two-way outbound voice RTP data stream obtained by the packet grabbing into a wav recording file according to a voice coding rule (GSM coding, PCM coding and PCMU coding).
The further recording server converts one-way double-call into a recording file at the seat side, a recording file at the client side and a recording file mixed by the seat client according to the seat side message and the client side message marked by the recording control server when the recording file is generated. Or converting the one-way two-way outbound call into a two-way record file for the client who acts as the seat and the right channel.
The recording management server is used for configuring various operation parameters of the recording control system, including recording file storage target information, recording coding format, speaker separation type, recording filtering condition and the like. When the recording control server and the recording server start running and start recording, the recording management server is accessed, and each set running parameter is obtained.
The recording management server is also used for recording permission control. The control of the concurrent recording capacity of the two-way outbound mode call is achieved by controlling the number of simultaneous recordings.
The recording inquiry server is used for inquiring recording results and data. The recording inquiry server can inquire and display recording detail data put in storage by the recording control server, and can inquire according to the fields, such as inquiring according to names, inquiring according to time ranges and the like. Through management inquiry and conversion of information such as calling and called in the original record, more convenient and readable data display such as seat name, customer name and the like is formed.
Example 3
The embodiment provides an electronic device, which comprises one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs comprise instructions for executing the bidirectional outbound voice stream acquiring method according to the embodiment 1.
Example 4
The present embodiment provides a computer-readable storage medium including one or more programs for execution by one or more processors of an electronic device, the one or more programs including instructions for performing the two-way outbound voice stream acquisition method as described in embodiment 1.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.