WO2010130193A1 - Device, method for controlling audio media packet transmission and audio media server - Google Patents

Device, method for controlling audio media packet transmission and audio media server Download PDF

Info

Publication number
WO2010130193A1
WO2010130193A1 PCT/CN2010/072616 CN2010072616W WO2010130193A1 WO 2010130193 A1 WO2010130193 A1 WO 2010130193A1 CN 2010072616 W CN2010072616 W CN 2010072616W WO 2010130193 A1 WO2010130193 A1 WO 2010130193A1
Authority
WO
WIPO (PCT)
Prior art keywords
media
pointer array
message
time
index
Prior art date
Application number
PCT/CN2010/072616
Other languages
French (fr)
Chinese (zh)
Inventor
丁向军
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2010130193A1 publication Critical patent/WO2010130193A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor

Definitions

  • Audio media delivery control device method and audio media server
  • the present invention relates to a network communication technology in the field of computer applications, and in particular to an audio/media delivery control device based on Linux/vxworks, a media delivery control method, and an audio media server.
  • the media server is an important device in the Next Generation Network (NGN), and its location in the NGN network is shown in Figure 1.
  • NGN Next Generation Network
  • the media processing system in the existing media server involves key technologies such as parsing, streaming, and precise control of the packing interval.
  • key technologies such as parsing, streaming, and precise control of the packing interval.
  • media processing systems in media servers in the industry are mainly implemented in two ways: hardware mode - Digital Singnal Processing (DSP) and software mode - Host Media Processing (HMP) technology.
  • DSP Digital Singnal Processing
  • HMP Host Media Processing
  • the hardware method is costly, and the software method is cost-effective, but the capacity is too small. Once the capacity is increased, the fluidization and packing interval precision control performance is degraded.
  • the dedicated DSP technology is to process the media data through a specific algorithm in the dedicated chip.
  • the dedicated DSP chip has strong media processing capability, and the channel density is also large. The price of each channel is fixed, and the channel density is higher.
  • HMP technology is the development direction of the future media server, but compared with the dedicated DSP, the host media processing capacity is general, so in the case of large capacity, the packaging precision control will be significantly reduced, and the large capacity and packaging accuracy become its development. The bottleneck.
  • the technical problem to be solved by the present invention is to provide an audio media delivery control device, a media delivery control method, and an audio media server, which improve the accuracy of media packet packing interval.
  • the present invention provides an audio media delivery control device, where the device includes an expected delivery control module and a time management delivery control module, wherein The expected delivery control module is configured to: determine an expected transmission time of the media message to be sent, and attach the media message to a linked list indicated by the pointer array element corresponding to the expected transmission time;
  • the time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out, and the linked list pointed by the pointer array element is browsed according to the next pointer array element index.
  • the time management delivery control module is further configured to: when there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, if there is no media message, delay until the expected transmission of the pointer array element Time, and browse the linked list of pointer array elements according to the next pointer array element index.
  • the expected delivery control module is configured to determine an expected transmission time of the media message by: reading an expected transmission time of a current pointer array element being processed by the time management delivery control module; On the basis of time, a certain amount of time is added as the estimated sending time of the media message, so as to ensure that the time management sending module browses the media message attached to the corresponding pointer array element.
  • the expected allocation time of the pointer array element index and the media message on the linked list indicated by the pointer array element has a corresponding relationship, and the expected transmission time interval of the adjacent pointer array elements is fixed.
  • the predictive delivery control module and the time management delivery control module employ multi-thread processing technology.
  • the present invention further provides a media packet sending control method, including: a hooking step, comprising: determining an expected sending time of a media message to be sent and attaching the media packet to the device The step of the pointer array element corresponding to the expected sending time; and the sending step, comprising: browsing, according to the pointer array element index, whether there is a media message on the linked list indicated by the current pointer array element, and if there is a media message, The expected transmission time of the media message sends the media message, and browses the pointer array element according to the next pointer array element index.
  • the linked list if there is no media message, the delay is until the pointer array element is expected to send the time, according to the next pointer array element to read the linked list of pointer array elements.
  • the attaching step is implemented by a plurality of expected delivery threads, and the sending step is implemented by a plurality of time management delivery control threads. Before determining an expected transmission time of the media message to be sent, the attaching step further includes: It is expected that the sending thread browses the channel it is responsible for; when it is found that a channel requires to send a media message, the estimated sending time of the media message to be sent is determined as follows:
  • the read time manages the index index of the current pointer array element currently being processed in the dispatch control thread and the expected send time foresndtime;
  • nextpkt_tindex (index+n)% the number of elements of the pointer array
  • nextpkt_ foresndtime Foresndtime+n* The time interval represented by each pointer array 1; where "%” means modulo, "*" means multiplication
  • n is a preset index margin to ensure that the time management packet control thread browses To the media message attached to the corresponding pointer array element;
  • nextpkt_index nextpkt index + (packaging interval / time interval represented by each index) %
  • the sending step is implemented by multiple time management delivery control threads;
  • Each time management delivery control thread performs the sending step as follows: A: whether there is a media message to be sent on the linked list indicated by the pointer array element of the current pointer array element index, and if so, the media message is read, and the address and load information of the media message is read. And the expected sending time parameter of the batch of media messages is sent to the send message (sendmsg) function; the sendmsg function sends the batch of media messages in batches at the expected sending time, and then returns at the expected sending time, executing B; if in the current pointer The array element index pointer array element refers to the linked list does not have to send a media message, the time management packet control thread calls the delay function (DelayTime) delay until the current index list of the expected transmission time, execute B;
  • the attaching step further includes: adding, by each media message, a media message counter corresponding to the linked list by one; in the sending step, the time management sending packet control thread determines the current index of the linked list according to the media message counter Is there a media message to send?
  • the present invention provides an audio media server, including an audio media delivery control device, where the device includes an expected delivery control module and a time management delivery control module, wherein the predicted delivery control module is configured to: The expected sending time of the sent media message, and attaching the media message to the linked list indicated by the pointer array element corresponding to the expected sending time;
  • the time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out and browsed according to the next pointer array element index.
  • the expected delivery control module is configured to determine an expected transmission time of the media message by: reading an expected transmission time of a pointer array element being processed by the time management delivery control module; and an expected transmission time at the read Assuming a certain amount of time is added as the estimated sending time of the media message, to ensure that the time management sending module browses to the media message attached to the corresponding pointer array element.
  • the audio media server further includes a signaling forwarding unit, a main control unit, and a media storage and forwarding unit, where the signaling forwarding unit is configured to: implement unified forwarding of internal and external signaling of the server; Receiving and parsing the control signaling forwarded by the signaling forwarding unit, and generating a corresponding control message to control the media storage and forwarding unit; and the media storage and forwarding unit has an external network port, and the media storage and forwarding unit is configured to: The recording and the voice playing are implemented according to the control message sent by the main control unit, wherein in the recording and the voice playing, the audio media sending control device implements the packet sending control of the media message.
  • the media storage and forwarding unit is configured to implement recording and voice playback by using a multi-thread processing technology.
  • the audio media server further includes a media processing unit, where the media processing unit includes a call proxy module, a transceiver number module, and a conference processing module, where the call proxy module is configured to: implement a control message between the master control unit and the media processing unit. Interacting, if the control message is a transceiver number message, the notification transceiver module is processed, and if the control message is a transcoding or conference message, the conference processing module is notified; the transceiver number module is set as: performing the receiver resource setting, and is in the media stream.
  • the valid number is used for validity identification; and the control message generation number of the main control unit is set;
  • the conference processing module is configured to: process the media stream from each participant, and combine the input speech frames of different participants into a mixed speech frame. And the voice frame output to each participant is The mixed voice frame filters out the input speech frame of the participant;
  • the main control unit is further configured to: generate a control message for the media processing unit; and
  • the media storage and forwarding unit is further configured to: include a multi-tone dual frequency
  • the destination address of the media message of the DTMF number is converted into the address corresponding to the transceiver number channel.
  • the present invention provides a packet control apparatus and method for managing an accurate and effective control of a media message pointer array mount index and an estimated transmission time by using a packet thread to manage a pointer array with time information, and can efficiently and efficiently All media packets at the index location are sent in batches at a predetermined transmission time, which achieves precise control of the packetization interval, provides high-precision Qos (Quality of Service) performance, and uses multi-thread processing technology with large capacity.
  • the audio media server of the present invention is based on HMP, has low cost, and not only realizes precise control of the packaging interval, but also has the capacity comparable to a dedicated DSP, and can provide media processing functions in basic and enhanced services, including service sound supply, conference, and interactive. Features such as answering, notification, and advanced voice services.
  • FIG. 1 is a schematic diagram of a location of a media server in an NGN network
  • FIG. 2 is a schematic diagram of various functional modules of the media server of the present invention
  • FIG. 3 is a flowchart of audio source file parsing
  • Figure 5 is a block diagram showing the structure of the audio media packet transmission control apparatus of the present invention
  • Figure 6 is a schematic diagram of the audio packet delivery control method of the present invention
  • Figure 7 is a flowchart of the processing of the estimated packet delivery control module of the present invention
  • Figure 9 is a DTMF number transmission and reception number flow chart
  • Figure 10 is a flow chart of the conference call.
  • the audio media server of the present invention includes a signaling forwarding unit, a main control unit connected to the signaling forwarding unit, a control/media switching unit connected to the main control unit, and a control/ a media storage and forwarding unit and a media processing unit connected to the media switching unit, wherein the main control unit, the media storage and forwarding unit, and the media processing unit mutually control the flow or media stream through the control/media exchange unit, the media storage and forwarding unit, and the media processing unit It is a carrier for implementing the media processing technology of the present invention.
  • the signaling forwarding unit is configured to: mainly implement the isolation between the internal network of the system and the external network, and the control signaling is uniformly forwarded by the signaling forwarding unit to implement a single external Internet Protocol (IP) address presentation; wherein, the control signaling
  • IP Internet Protocol
  • the method includes: a Session Initiation Protocol (SIP), a UI 248, and a Media Gateway Control Protocol (MGCP).
  • SIP Session Initiation Protocol
  • UI 248 a UI 248, and a Media Gateway Control Protocol (MGCP).
  • MGCP Media Gateway Control Protocol
  • the main control unit is configured to: receive and parse control signaling, and generate corresponding control messages to control media storage.
  • the forwarding unit and the media processing unit perform corresponding channel processing on playback, recording, transceiving number, conference, and transcoding;
  • control signaling is a message in an international standard format, and the control message interprets each field in the control signaling after translation , composed of messages suitable for the delivery format inside the system.
  • the control/media exchange unit is configured to: complete server internal control message exchange and media data packet exchange, and implement the function of the switch, which is a bridge for communication between other modules, and details are not described herein again.
  • the media storage and forwarding unit is configured to: perform a large amount of multimedia data storage, including a voice library that implements a voice playback function and a storage of user recordings when the recording function is implemented.
  • the media storage and forwarding unit is provided with an external network port.
  • the media When the media does not need to perform additional conversion processing, the media is directly sent and received through the external network port on the media storage and forwarding unit.
  • the media packet sent through the external network port is a streamed media packet.
  • the packet is a packet conforming to the international standard format.
  • the recording service is implemented, the media stream is received through the external network port, if the terminal (such as a fixed battery) The terminal wants to record, and during the recording process, if no DTMF number (0-9, *, #) is pressed, then the DTMF number will not be included in the media stream; if the recording is completed (for example: # The number indicates the end of the recording.) Press # at this time, then the received media stream will contain the DTMF number (##).
  • the media storage and forwarding unit comprises an internal call proxy module, a recording media processing module, a sound media processing module, a delivery control module, a collection control module and a storage module, wherein the internal call (proxy) proxy module is set as: implementation and main control module
  • the interaction of control messages is implemented by the control plane of the control/media switching unit. If the received control message is analyzed as a recording, the recording processing module is notified; if it is playing, the playback processing module is notified.
  • the recording media processing module is configured to: after sorting the media messages received by the receiving control module, extract the payload into a specified file format (WAV/AMR).
  • the playback media processing module is configured to: find a sound source file from the storage module according to parameters in the playback control message, parse the audio source file, read valid data of the sound source, and package and stream the media message suitable for network transmission; If the media packet encoding format of the source data stream is inconsistent with the encoding format required by the terminal, it needs to be sent to the media processing unit for processing; the packet sending control module is configured to: send the media packet through the internal and external network ports, specifically, the sending packet
  • the control module that is, the delivery control device, is the core of the present invention and will be described in detail below.
  • the receiving control module is configured to: receive media packets through the internal and external network ports, and if the media message received from the external network port is inconsistent with the required stored source file format (WAV/AMR), it needs to be forwarded to the media processing unit. After being transcoded by the media processing unit, it is sent to the internal network port of the receiving control module, and then processed by the recording media processing module, and the destination address of the media message containing the DTMF number is converted into an address corresponding to the transceiver number channel.
  • the storage module is set to: Store the source file.
  • the media processing unit is set to: complete voice codec mode conversion, implement dual tone multi-frequency (Dual
  • the media processing unit has Ethernet port and time division multiplexing (Time Division Multiplex and Multiplexer, TDM) interface to meet the individual needs of IP users and Public Switched Telephone Network (PSTN) users.
  • the media processing unit includes a call proxy module, a transceiver number module, and a conference processing module.
  • the call proxy module is configured to: implement interaction of control messages between the master control unit and the media processing unit, and notify the sending and receiving number if the control message is a transceiver number message.
  • the module processes, if the control message is a transcoding or a conference message, notifies the conference processing module that the transceiver number module is set to: perform a receiver resource setting, and perform validity identification on the valid number in the media stream; and according to the main control unit
  • the control message generation number is set;
  • the conference processing module is configured to: process the media stream from each participant, combine the input speech frames of different participants into a mixed speech frame; and output the speech frame to each participant as a mixed speech frame.
  • the input speech frame of the participant is filtered out, thus preventing the user from hearing his own echo.
  • the audio media server of the present invention is a media processing technology implementation scheme suitable for various network users based on the Linux/vxworks operating system, and provides low cost and large capacity to overcome the shortage of the above DSP and HMP based on the improvement of the HMP mode.
  • the media server of the present invention provides media processing functions required for various services under the control of the application server, including: media processing technologies such as playback, recording, DTMF receiving, conference, and transcoding.
  • the main points of the media processing technology of the present invention are as follows: 1. Analysis and construction of the audio source file format: Since different types of files have different organization forms of audio sample data, it is necessary to analyze according to the corresponding format. In general, a file contains a description part and a data part of the data.
  • the processing of the audio source file supports waveform types (Wave Form, WAV) and Adaptive Multi-Rate (AMR).
  • WAV Waveform Form
  • AMR Adaptive Multi-Rate
  • Table 1 shows the WAV file format
  • Table 2 shows the AMR file format.
  • WAV Wide Form
  • other source types can be supported as required, completely controlled by software.
  • the WAV file header is one of the sound wave file formats used in multimedia, and is based on the Resource Interchange File Format (RIFF) format.
  • RIFF Resource Interchange File Format
  • Table 1 WAV file format
  • the block diagram of the analysis of the WAV file and the AMR file is shown in Figure 3.
  • the construction flow is similar.
  • the process of parsing the WAV file includes: reading a file header of the WAV file; extracting file header information, including data encoding mode, channel Number, sample frequency, and number of bits required for each sample; skip file description information; read data from audio data portion.
  • the parsing process of the AMR file includes: reading the magic number of the file; reading the first frame data; calculating the size of the frame data according to the frame header; reading the frame header; determining whether the frame is bad, and reading the next frame header if the frame is bad, Otherwise, the frame voice data is read. 2.
  • Streaming of voice data and voice structure of streamed data Streaming processing means that the data in the read source file is packaged by Real-time Transport Protocol (RTP) and constructed to be transmitted on the IP network.
  • RTP Real-time Transport Protocol
  • the conversion processing is not required, and is directly streamed by the playback processing module of the media storage and forwarding unit and then sent through the external network port; if the voice data is encoded
  • the format is inconsistent with the codec format required by the end user (such as G.711a/u, G.729, G.723), and voice data conversion is required.
  • the process of streaming processing is shared by the media storage and forwarding unit and the media processing unit. Upon completion, the media stream interaction between the two is achieved through the media plane of the control/media switching unit.
  • the streaming process can be implemented in the following two ways: Method 1: The playback processing module of the media storage and forwarding unit restores the voice data to the PCM8 or PCM16 format, and the media processing unit converts it to the corresponding G.711/ by an algorithm. The encoded data of G.729/G.723, and finally the playback processing module of the media storage and forwarding unit performs the composition processing based on RTP. Manner 2: The playback processing module of the media storage and forwarding unit directly streams the voice data in the audio file, such as a/u-law or AMR frame, into an RTP message in the G.71 la/u or RFC3267 payload format.
  • the conference processing module of the media processing unit then transcodes the RTP processed data into the destination codec G.729/G.723 mode.
  • the second method is recommended for use in the present invention.
  • the source data encoding format is in the file header.
  • the source and destination address information of IP/UDP is determined by the parameters brought by the main control unit, and the length of the payload data is determined by the packetization time information brought by the main control unit.
  • the rfc3267 standard it is necessary to refer to the rfc3267 standard to change the storage format to the streaming data of the transport format. This involves the issue of different payload formats: byte-aligned format and bandwidth-efficient format.
  • Each operation implemented by each module of the media storage and forwarding unit includes file header information construction during recording processing, RTP packet payload extraction, audio source parsing during effective voice storage and playback processing, data reading, streaming, packaging, and delivery. All use multi-thread processing technology, that is, each operation has multiple threads processed in parallel, thus achieving the characteristics of multi-channel and large capacity.
  • the present invention utilizes a thread family (that is, multiple threads) to simulate an asynchronous read operation; a read request thread determines whether to initiate a read operation, and a read file thread reads data; Such a read request thread and a read file thread constitute a read request thread family and a read file thread family; thus, the asynchronous read file operation can be simulated by concurrently reading the file thread, and the structure of the RTP package thread family for packing processing is also shown in the figure.
  • a thread family that is, multiple threads
  • the delivery control device of the present invention implements a method for managing an array of pointers with time information by sending a packet thread.
  • the delivery control device of the present invention includes an expected delivery control module. And a time management delivery control module, wherein: the expected delivery control module is configured to: cache the media message after the streaming media processing module is streamed, determine the estimated transmission time and attach to the linked list of the elements corresponding to the sending time of the pointer array. .
  • Each network port corresponds to a certain number of caches for storing media packets. When no media packets are to be processed, all caches are on the idlelist.
  • the packet control module is expected to be
  • the application cache is used to load the media packet on the idle list idlelist, and then the packet is attached to the pointer array element managed by the time management delivery control module corresponding to the network port. After the time management packet control module sends the message on the array element, the cache is attached to the idle list idlelist of the network port.
  • the estimated transmission time of the media message is determined as follows: reading the expected transmission time of the current pointer array element being processed by the time management delivery control module; adding a certain time remainder based on the expected transmission time of the reading The quantity is used as the expected sending time of the media message to ensure that the time management sending module browses the media message attached to the corresponding pointer array element.
  • the index of the pointer array element and the expected transmission time of the media message on the linked list pointed by the pointer array element have a corresponding correspondence relationship, and the expected transmission time interval of the adjacent pointer array element is fixed.
  • the time management packet control module is configured to: sequentially read the media message on the linked list of the pointer array element according to the pointer array element index, and send it out at the expected sending time; if the pointer array element chain header does not carry any media message, then A delay is required until the element is expected to be sent.
  • the media packet sending control method of the present invention includes the following steps: Step 601: The attaching step includes: determining an expected sending time of a media packet to be sent, and attaching the media packet to the packet On the linked list indicated by the pointer array element corresponding to the expected transmission time;
  • Step 602 The sending step includes: sequentially reading, according to the pointer array element index, the media message on the linked list indicated by the pointer array element, and sending the media message at the expected sending time; if the pointer array element If there is no media message on the list, it is delayed until the expected delivery time of the element.
  • the sending step includes: browsing, according to the pointer array element index, whether there is a media message on the linked list indicated by the current pointer array element, and if there is a media message, sending the media message at the expected sending time of the media message, and According to the next pointer array element index browsing the linked list of the pointer array element; if there is no media message, the delay until the pointer array element is expected to send time, according to the next pointer array element index read the pointer array element refers to the linked list
  • the flow chart of the expected packet control module is shown in Figure 7.
  • the expected packet-issuing thread family of the packet-issuing control module When it is expected that the expected packet-issuing thread family of the packet-issuing control module is created by the scheduling process, it enters the permanent while loop. In this while loop, the thread will be responsible for all the channels. Once a channel is found to require sending a media message, it will enter the packing function. In the packing function, it will check whether the media message to be sent is the first one. , then proceed as follows: A.
  • the read time manages the index index of the array of pointers currently being processed in the thread control thread and the expected send time foresndtime; in order to be able to send the first media message, then the first medium
  • the index and expected transmission time of the message must be the index and time after index and foresndtime, so it is necessary to reserve a certain margin (index margin and time margin) on index and foresndtime, so that the time management package control thread will browse to (Time management delivery control thread is browsed by index); currently
  • the current time interval represented by each pointer array index is the fixed transmission interval of the adjacent pointer array elements (eg 10ms).
  • the index and the expected sending time are in fact corresponding to each other.
  • the first media packet is indexed by the current index, and the index is moved backward by n indexes.
  • the corresponding estimated sending time is the current estimated sending time. The time interval is found. After the index number is found, the media message is attached to the linked list of the corresponding index of the pointer array, and the media message counter in the linked list structure is incremented by one.
  • nextpkt_index nextpkt index + (packaging interval/time interval represented by each cable) % (number of elements in the pointer array)
  • Nextpkt_foresndtime nextpkt— foresndtime+ (packaging interval) where “/” means divide; the packing interval here is an integer multiple of the time interval represented by each index. The simplest case is that the packing interval and the time interval represented by each index are identical.
  • the second media message sent by the channel is used to find the linked list of the corresponding index of the pointer array by using the above calculated index number and expected transmission time, and the media message counter in the linked list structure is incremented by one.
  • step B The index number and expected transmission time of the subsequent media message are repeated in step B until the media message is processed.
  • the media packet that can be guaranteed by the pointer array element index of the media message is sent, and no packet loss occurs.
  • the corresponding linked list is introduced, thereby providing a prerequisite for batch sending of media messages.
  • the flow chart of the time management delivery control module is shown in Figure 8.
  • the current system time is obtained, and the time is rounded to the second as a pointer.
  • Index ( Index+1 ) % (the maximum number of elements in the pointer array)
  • index ( Index+1 ) % (the maximum number of elements in the pointer array)
  • Indicates the foresndtime foresndtime+ time interval represented by each index;
  • the code is implemented as follows:
  • the delivery control device of the invention can efficiently and efficiently send all the media messages of the index position at a predetermined transmission time by accurately and effectively controlling the media message in the pointer array and predicting the transmission time. .
  • the DTMF transceiver number function is implemented on the transceiver module of the media processing unit. As shown in FIG. 9, when the transceiver unit of the media processing unit receives the request from the main control unit to open the transceiver number, the first series is performed. The setting of the receiver resource (including the creation of the transceiver number channel; setting the voice channel parameters, the detection mode of the DTMF number, and the activation of the receiver resource), and then the media storage and forwarding unit passes the network address translation (NAT) to the external network.
  • NAT network address translation
  • the incoming media stream containing the DTMF number is forwarded to the receiving resource of the corresponding media processing unit, and the valid number in the media stream is detected and validated by the receiving resource (in accordance with the national standard GB9038-88)
  • the sending number is to generate a valid DTMF number according to GB9038-88 and forward it to the destination terminal through the NAT of the media storage and forwarding unit.
  • the above describes the process of transmitting and receiving numbers on the IP side.
  • the transceiver number of the TDM side needs to introduce the Pulse Code Modulation (PCM) stream to the receiving resource of the media processing unit through E1/T1 for the same process.
  • PCM Pulse Code Modulation
  • the main control module configures the parameters of the transceiver number through the control message, so that the transceiver number is in the working state.
  • the media stream is forwarded through the nat of the media storage and forwarding unit, because the external network device can only When the external network port of the media storage and forwarding unit is displayed, the destination address of the media packet is also the address of the external network port (ip+port). Therefore, the media storage and forwarding unit needs to replace the destination address of the media packet with the external network port.
  • conference/transcoding can combine the input speech frames of different participants into a mixed speech frame; the speech frame output to each participant is to filter the mixed speech frames out of the participants. Enter a speech frame to prevent the user from hearing their own echo.
  • Each participant can be a different codec; transcoding is just a special form of meeting.
  • Participants in the conference can be set to a "mute" state, at which point the mixer will silently process the participant, but the participant can hear the voices of other participants; participants of the conference can be set to "keep” State, at this point the mixer treats the participant as silent, and the participant does not hear the voices of other participants; the participants of the conference can be set to the "announce hold” state, at which point the mixer takes the participation As a mute process, the participant can hear the voice of the source participant; the participant of the conference can be set to the "source participant” state, at which point the mixer inputs the participant's input to the other "announcement hold” Participants, the participants of other "announcement” can hear the voice of "source participants”;"sourceparticipants” are typically used to play music, news, announcements, and so on.
  • the implementation process of creating a conference is as shown in FIG. 10.
  • the conference processing module receives the create conference message sent by the main control unit, if the conference ID already exists, the conference control unit is reported, otherwise the conference ID and the participant ID are created, and the participant parameters are set.
  • the session corresponding to the participant is enabled, the process of performing the mixed voice frame and filtering the participant's own voice frame is performed during the conference; when the participant joins the conference message, the participant ID is also executed and the participant parameter is set.
  • the present invention provides a packet control device and method for managing an array of pointers with time information by using an issue thread
  • the method realizes accurate and effective control of the index of the media message pointer array and the expected transmission time, and can efficiently send all the media messages of the index position in batches at a predetermined sending time, thereby realizing the accuracy of the packing interval.
  • Control can provide high-quality quality of service (Qos) performance, in addition to multi-threaded processing technology, with large capacity.
  • the audio media server of the present invention is based on HMP implementation, has low cost, and not only realizes precise control of the packaging interval, but also has the capacity comparable to a dedicated DSP, and can provide media processing functions in basic and enhanced services, including service sound supply, conference, and Features such as interactive answering, notifications, and advanced voice services.

Abstract

A device for controlling audio media packet sending includes a predictive packet transmission (PPT) control module and a time management packet transmission control module. The PPT control module is set to determine a predicted transmission time for a media message to be sent, and to link said media message with a link list indicated by a pointer array element corresponding to said predicted transmission time. The time management packet transmission control module is set to browse the link list indicated by the pointer array element according to an index of said element and determine whether a media message exists in the link list; if it does, the time management packet transmission control module transmits said media message at its predicted transmission time, and browses the link list indicated by the pointer array element according to the index of the next pointer array element. Correspondingly, the present invention also provides a method for controlling media packet transmission and an audio media server. Based on Host Media Processing (HMP), the present invention enables accurate control of packing intervals, and, in terms of capacity, is as good as a dedicated Digital Signal Processor (DSP).

Description

音频媒体发包控制装置、 方法及音频媒体服务器  Audio media delivery control device, method and audio media server
技术领域 本发明属于计算机应用领域的网络通信技术, 具体涉及一种基于 Linux/vxworks的音频媒体发包控制装置、媒体发包控制方法及音频媒体服务 器。 TECHNICAL FIELD The present invention relates to a network communication technology in the field of computer applications, and in particular to an audio/media delivery control device based on Linux/vxworks, a media delivery control method, and an audio media server.
背景技术 Background technique
媒体服务器是下一代网络(Next Generation Network, NGN ) 中的重要 设备, 其在 NGN网络中的位置如图 1所示。 现有媒体服务器中媒体处理系 统涉及到对大量数据的解析、 流化以及打包间隔的精确控制等关键技术。 针 对这些关键技术,目前业内媒体服务器中媒体处理系统主要用两种方式实现: 硬件方式-专用数字信号处理 (Digital Singnal Processing , DSP)和软件方式 -主机媒体处理(Host Media Processing, HMP )技术。但是它们的缺陷在于: 硬件方式成本高, 软件方式虽然成本降低了, 但是容量却太小, 一旦增加容 量又造成流化和打包间隔精确控制性能降低。专用 DSP技术是通过专用芯片 中的特定算法来进行媒体数据的处理,一般来说专用 DSP芯片媒体处理能力 强, 通道密度也即容量大, 每个通道的价格一定的话, 通道密度越高成本也 就越高; 而 HMP技术是未来媒体服务器的发展方向, 但相对于专用 DSP, 主机媒体处理能力一般, 因此在大容量的情况下,打包精度控制会显著下降, 大容量和打包精度成为其发展的瓶颈。  The media server is an important device in the Next Generation Network (NGN), and its location in the NGN network is shown in Figure 1. The media processing system in the existing media server involves key technologies such as parsing, streaming, and precise control of the packing interval. For these key technologies, media processing systems in media servers in the industry are mainly implemented in two ways: hardware mode - Digital Singnal Processing (DSP) and software mode - Host Media Processing (HMP) technology. However, their drawbacks are: The hardware method is costly, and the software method is cost-effective, but the capacity is too small. Once the capacity is increased, the fluidization and packing interval precision control performance is degraded. The dedicated DSP technology is to process the media data through a specific algorithm in the dedicated chip. Generally, the dedicated DSP chip has strong media processing capability, and the channel density is also large. The price of each channel is fixed, and the channel density is higher. HMP technology is the development direction of the future media server, but compared with the dedicated DSP, the host media processing capacity is general, so in the case of large capacity, the packaging precision control will be significantly reduced, and the large capacity and packaging accuracy become its development. The bottleneck.
发明内容 本发明要解决的技术问题是提供一种音频媒体发包控制装置、 媒体发包 控制方法及音频媒体服务器, 提高媒体报文打包间隔精度。 SUMMARY OF THE INVENTION The technical problem to be solved by the present invention is to provide an audio media delivery control device, a media delivery control method, and an audio media server, which improve the accuracy of media packet packing interval.
为解决上述技术问题, 本发明提供一种音频媒体发包控制装置, 该装置 包括预计发包控制模块及时间管理发包控制模块, 其中, 所述预计发包控制模块设置为:确定要发送的媒体报文的预计发送时间, 及将所述媒体报文挂接到与所述预计发送时间对应的指针数组元素所指的链 表上; In order to solve the above technical problem, the present invention provides an audio media delivery control device, where the device includes an expected delivery control module and a time management delivery control module, wherein The expected delivery control module is configured to: determine an expected transmission time of the media message to be sent, and attach the media message to a linked list indicated by the pointer array element corresponding to the expected transmission time;
所述时间管理发包控制模块设置为: 根据指针数组元素索引浏览指针数 组元素所指的链表上是否有媒体报文, 若有媒体报文, 则在所述媒体报文的 预计发送时间将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览 指针数组元素所指的链表。 所述时间管理发包控制模块还设置为: 根据指针数组元素索引浏览指针 数组元素所指的链表上是否有媒体报文时, 若没有媒体报文, 则延时直到所 述指针数组元素的预计发送时间, 并根据下一指针数组元素索引浏览指针数 组元素所指的链表。 所述预计发包控制模块是设置为通过如下方式确定所述媒体报文的预计 发送时间: 读取所述时间管理发包控制模块正在处理的当前指针数组元素的 预计发送时间; 在读取的预计发送时间的基础上增加一定的时间余量作为所 述媒体报文的预计发送时间, 以保证所述时间管理发包模块浏览到挂接在对 应的指针数组元素的所述媒体报文。 所述指针数组元素索引及所述指针数组元素所指的链表上的媒体报文的 预计发送时间具有依次对应的关系, 且相邻指针数组元素的预计发送时间间 隔是固定的。 所述预计发包控制模块及时间管理发包控制模块釆用多线程处理技术。  The time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out, and the linked list pointed by the pointer array element is browsed according to the next pointer array element index. The time management delivery control module is further configured to: when there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, if there is no media message, delay until the expected transmission of the pointer array element Time, and browse the linked list of pointer array elements according to the next pointer array element index. The expected delivery control module is configured to determine an expected transmission time of the media message by: reading an expected transmission time of a current pointer array element being processed by the time management delivery control module; On the basis of time, a certain amount of time is added as the estimated sending time of the media message, so as to ensure that the time management sending module browses the media message attached to the corresponding pointer array element. The expected allocation time of the pointer array element index and the media message on the linked list indicated by the pointer array element has a corresponding relationship, and the expected transmission time interval of the adjacent pointer array elements is fixed. The predictive delivery control module and the time management delivery control module employ multi-thread processing technology.
为解决上述技术问题, 本发明还提供了一种媒体发包控制方法, 包括: 挂接步骤, 其包括: 确定要发送的媒体报文的预计发送时间并将所述媒 体报文挂接到与所述预计发送时间对应的指针数组元素所指的链表上; 以及 发送步骤, 其包括: 根据指针数组元素索引浏览当前指针数组元素所指 的链表上是否有媒体报文, 若有媒体报文则在所述媒体报文的预计发送时间 将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览指针数组元素 所指的链表; 若没有媒体报文,则延时直到所述指针数组元素预计发送时间, 根据下一指针数组元素索弓 )读取指针数组元素所指的链表。 所述挂接步骤由多个预计发包线程实现, 所述发送步骤由多个时间管理 发包控制线程实现; 确定要发送的媒体报文的预计发送时间之前, 所述挂接步骤还包括: 每 个预计发包线程浏览其负责的通道; 当发现某个通道要求发送媒体报文时, 按照如下方式确定要发送的媒体 文的预计发送时间: In order to solve the above technical problem, the present invention further provides a media packet sending control method, including: a hooking step, comprising: determining an expected sending time of a media message to be sent and attaching the media packet to the device The step of the pointer array element corresponding to the expected sending time; and the sending step, comprising: browsing, according to the pointer array element index, whether there is a media message on the linked list indicated by the current pointer array element, and if there is a media message, The expected transmission time of the media message sends the media message, and browses the pointer array element according to the next pointer array element index. The linked list; if there is no media message, the delay is until the pointer array element is expected to send the time, according to the next pointer array element to read the linked list of pointer array elements. The attaching step is implemented by a plurality of expected delivery threads, and the sending step is implemented by a plurality of time management delivery control threads. Before determining an expected transmission time of the media message to be sent, the attaching step further includes: It is expected that the sending thread browses the channel it is responsible for; when it is found that a channel requires to send a media message, the estimated sending time of the media message to be sent is determined as follows:
A:读取时间管理发包控制线程中当前正在处理的当前指针数组元素的索 引 index和预计发送时间 foresndtime; A: The read time manages the index index of the current pointer array element currently being processed in the dispatch control thread and the expected send time foresndtime;
B:确定要发送的第一个媒体报文的挂接索引 nextpkt— tindex及预计发送 时间 nextpkt— foresndtime , 其中, nextpkt— tindex=(index+n)%指针数组的元素个数; nextpkt— foresndtime=foresndtime+n*每个指针数组索 1代表的时间间隔; 其中, "%" 表示取模, "*" 表示乘; n 为预先设定的索引余量, 以保证所述时间管理发包控制线程浏览 到挂接在对应的指针数组元素的所述媒体报文; B: Determine the hook index of the first media message to be sent nextpkt_tindex and the expected transmission time nextpkt_foresndtime, where nextpkt_tindex=(index+n)% the number of elements of the pointer array; nextpkt_ foresndtime= Foresndtime+n* The time interval represented by each pointer array 1; where "%" means modulo, "*" means multiplication; n is a preset index margin to ensure that the time management packet control thread browses To the media message attached to the corresponding pointer array element;
C:确定后续媒体报文的挂接索引 nextpkt— tindex 及预计发送时间 nextpkt— foresndtime , 直到所有媒体报文处理完毕 , 其中: nextpkt_index= nextpkt index + (打包间隔 /每个索引代表的时间间隔) %C: Determine the hook index of the subsequent media message nextpkt—tindex and the expected sending time nextpkt— foresndtime , until all media messages are processed, where: nextpkt_index= nextpkt index + (packaging interval / time interval represented by each index) %
(指针数组的元素个数), 其中, 所述打包间隔是每个索引代表的时间间隔的 整数倍; "/" 表示除; nextpkt— foresndtime= nextpkt— foresndtime+ (打包间隔) 。 所述发送步骤由多个时间管理发包控制线程实现; (the number of elements of the pointer array), wherein the packing interval is an integer multiple of the time interval represented by each index; "/" means division; nextpkt_foresndtime= nextpkt_foresndtime+ (packaging interval). The sending step is implemented by multiple time management delivery control threads;
各时间管理发包控制线程按如下方式执行所述发送步骤: A: 浏览当前指针数组元素索引的指针数组元素所指的链表上是否有要 发送的媒体报文, 若有, 则读取所述媒体报文, 并把所述媒体报文的地址和 载荷信息以及这批媒体报文的预计发送时间参数传到发送消息( sendmsg )函 数; sendmsg 函数在预计发送时间把这批媒体报文批量发送出去, 然后在预 计发送时间返回, 执行 B; 若在当前指针数组元素索引的指针数组元素所指的链表上没有要发送媒 体报文, 所述时间管理发包控制线程调用延时函数(DelayTime )延时直到当 前索引链表的预计发送时间, 执行 B; Each time management delivery control thread performs the sending step as follows: A: whether there is a media message to be sent on the linked list indicated by the pointer array element of the current pointer array element index, and if so, the media message is read, and the address and load information of the media message is read. And the expected sending time parameter of the batch of media messages is sent to the send message (sendmsg) function; the sendmsg function sends the batch of media messages in batches at the expected sending time, and then returns at the expected sending time, executing B; if in the current pointer The array element index pointer array element refers to the linked list does not have to send a media message, the time management packet control thread calls the delay function (DelayTime) delay until the current index list of the expected transmission time, execute B;
B: 更新当前索引 index 以及当前索引的链表上媒体报文的预计发送时 间, 返回 A; 其中, 当前索引: Index= ( Index+1 ) % (指针数组最大元素个数) ; 当前索引对应的预计发送时间: foresndtime=foresndtime+每个索引代表 的时间间隔。 所述挂接步骤还包括: 每挂接一个媒体报文, 对应链表的媒体报文计数 器加 1 ; 所述发送步骤中, 由时间管理发包控制线程根据所述媒体报文计数器确 定当前索引的链表上是否有要发送的媒体报文。  B: Update the current index index and the expected sending time of the media message on the linked list of the current index, and return A; where, the current index: Index= ( Index+1 ) % (the maximum number of elements in the pointer array); the prediction corresponding to the current index Send time: foresndtime=foresndtime+ The time interval represented by each index. The attaching step further includes: adding, by each media message, a media message counter corresponding to the linked list by one; in the sending step, the time management sending packet control thread determines the current index of the linked list according to the media message counter Is there a media message to send?
为解决上述技术问题, 本发明提供一种音频媒体服务器, 包括音频媒体 发包控制装置 , 所述装置包括预计发包控制模块及时间管理发包控制模块, 其中, 所述预计发包控制模块设置为:确定要发送的媒体报文的预计发送时间, 及将所述媒体报文挂接到与所述预计发送时间对应的指针数组元素所指的链 表上; In order to solve the above technical problem, the present invention provides an audio media server, including an audio media delivery control device, where the device includes an expected delivery control module and a time management delivery control module, wherein the predicted delivery control module is configured to: The expected sending time of the sent media message, and attaching the media message to the linked list indicated by the pointer array element corresponding to the expected sending time;
所述时间管理发包控制模块设置为: 根据指针数组元素索引浏览指针数 组元素所指的链表上是否有媒体报文, 若有媒体报文, 则在所述媒体报文的 预计发送时间将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览 指针数组元素所指的链表; 若没有媒体报文, 则延时直到所述元素指针数组 的预计发送时间并根据下一指针数组元素索引浏览指针数组元素所指的链 表。 所述预计发包控制模块是设置为通过如下方式确定所述媒体报文的预计 发送时间: 读取所述时间管理发包控制模块正在处理的指针数组元素的预计 发送时间; 在读取的预计发送时间的基础上增加一定的时间余量作为所述媒 体报文的预计发送时间, 以保证所述时间管理发包模块浏览到挂接在对应的 指针数组元素的所述媒体报文。 所述音频媒体服务器还包括信令转发单元、 主控单元及媒体存储转发单 元, 其中, 所述信令转发单元设置为: 实现服务器内部与外部信令的统一转发; 所述主控单元设置为: 接收并解析所述信令转发单元转发的控制信令, 并生成相应的控制消息来控制媒体存储转发单元; 以及 所述媒体存储转发单元具有对外网口, 所述媒体存储转发单元设置为: 根据所述主控单元下发的控制消息实现录音及语音播放, 其中, 在录音及语 音播放中, 由所述音频媒体发包控制装置实现媒体报文的发包控制。 所述媒体存储转发单元是设置为釆用多线程处理技术实现录音及语音播 放。 所述音频媒体服务器还包括媒体处理单元, 所述媒体处理单元包括呼叫 代理模块、 收发号模块及会议处理模块, 其中, 呼叫代理模块设置为: 实现主控单元和媒体处理单元之间控制消息的交 互, 若控制消息为收发号消息则通知收发号模块处理, 若控制消息为转码或 者会议消息则通知会议处理模块处理; 收发号模块设置为: 进行收号器资源设置, 并对媒体流中的有效号码进 行有效性识别; 以及 居主控单元的控制消息产生号码; 会议处理模块设置为: 处理来自各个参与者的媒体流, 把不同参与者的 输入语音帧合成在一起作为混合语音帧, 且输出给每个参与者的语音帧是把 混和语音帧滤掉该参与者的输入语音帧; 所述主控单元还设置为: 生成对所述媒体处理单元的控制消息; 以及 所述媒体存储转发单元还设置为:将含有多音双频 DTMF号码的媒体报 文的目的地址转换成收发号器通道对应的地址。 The time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out and browsed according to the next pointer array element index. The linked list pointed to by the pointer array element; if there is no media message, the delay is until the expected sending time of the element pointer array and the linked list indicated by the pointer array element is browsed according to the next pointer array element index. The expected delivery control module is configured to determine an expected transmission time of the media message by: reading an expected transmission time of a pointer array element being processed by the time management delivery control module; and an expected transmission time at the read Assuming a certain amount of time is added as the estimated sending time of the media message, to ensure that the time management sending module browses to the media message attached to the corresponding pointer array element. The audio media server further includes a signaling forwarding unit, a main control unit, and a media storage and forwarding unit, where the signaling forwarding unit is configured to: implement unified forwarding of internal and external signaling of the server; Receiving and parsing the control signaling forwarded by the signaling forwarding unit, and generating a corresponding control message to control the media storage and forwarding unit; and the media storage and forwarding unit has an external network port, and the media storage and forwarding unit is configured to: The recording and the voice playing are implemented according to the control message sent by the main control unit, wherein in the recording and the voice playing, the audio media sending control device implements the packet sending control of the media message. The media storage and forwarding unit is configured to implement recording and voice playback by using a multi-thread processing technology. The audio media server further includes a media processing unit, where the media processing unit includes a call proxy module, a transceiver number module, and a conference processing module, where the call proxy module is configured to: implement a control message between the master control unit and the media processing unit. Interacting, if the control message is a transceiver number message, the notification transceiver module is processed, and if the control message is a transcoding or conference message, the conference processing module is notified; the transceiver number module is set as: performing the receiver resource setting, and is in the media stream. The valid number is used for validity identification; and the control message generation number of the main control unit is set; the conference processing module is configured to: process the media stream from each participant, and combine the input speech frames of different participants into a mixed speech frame. And the voice frame output to each participant is The mixed voice frame filters out the input speech frame of the participant; the main control unit is further configured to: generate a control message for the media processing unit; and the media storage and forwarding unit is further configured to: include a multi-tone dual frequency The destination address of the media message of the DTMF number is converted into the address corresponding to the transceiver number channel.
相较于现有技术, 本发明发包控制装置和方法利用发包线程管理带时间 信息的指针数组的方法实现对媒体报文指针数组挂载索引和预计发送时间的 准确有效的控制, 能高效的把该索引位置的所有媒体报文在预定发送时刻批 量的发送出去, 实现了对打包间隔的精确控制, 能够提供高精度 Qos(Quality of Service)性能, 另外釆用多线程处理技术, 具有大容量的特点。 本发明音频媒体服务器, 基于 HMP 实现, 成本低, 不仅实现对打包间 隔的精确控制, 容量可与专用 DSP媲美, 可以提供基本和增强业务中的媒体 处理功能, 包括业务音提供、 会议、 交互式应答、 通知和高级语音业务等功 能。 Compared with the prior art, the present invention provides a packet control apparatus and method for managing an accurate and effective control of a media message pointer array mount index and an estimated transmission time by using a packet thread to manage a pointer array with time information, and can efficiently and efficiently All media packets at the index location are sent in batches at a predetermined transmission time, which achieves precise control of the packetization interval, provides high-precision Qos (Quality of Service) performance, and uses multi-thread processing technology with large capacity. Features. The audio media server of the present invention is based on HMP, has low cost, and not only realizes precise control of the packaging interval, but also has the capacity comparable to a dedicated DSP, and can provide media processing functions in basic and enhanced services, including service sound supply, conference, and interactive. Features such as answering, notification, and advanced voice services.
附图概述 图 1是 NGN网络中媒体服务器的位置的示意图; 图 2是本发明媒体服务器各个功能模块的示意图; 图 3是音源文件解析流程图; 图 4是本发明釆用的多线程处理技术示意框图; 图 5是本发明音频媒体发包控制装置的模块结构示意图; 图 6是本发明音频媒体发包控制方法的示意图; 图 7是本发明预计发包控制模块的处理流程图; 图 8是本发明时间管理发包控制模块处理流程图; 图 9是 DTMF号码收发号流程图; 图 10是会议电话流程图。 1 is a schematic diagram of a location of a media server in an NGN network; FIG. 2 is a schematic diagram of various functional modules of the media server of the present invention; FIG. 3 is a flowchart of audio source file parsing; Figure 5 is a block diagram showing the structure of the audio media packet transmission control apparatus of the present invention; Figure 6 is a schematic diagram of the audio packet delivery control method of the present invention; Figure 7 is a flowchart of the processing of the estimated packet delivery control module of the present invention; Time management delivery control module processing flow chart; Figure 9 is a DTMF number transmission and reception number flow chart; Figure 10 is a flow chart of the conference call.
本发明的较佳实施方式 如图 2所示, 本发明音频媒体服务器包括信令转发单元、 与信令转发单 元连接的主控单元、 与主控单元连接的控制 /媒体交换单元以及与控制 /媒体 交换单元连接的媒体存储转发单元和媒体处理单元, 其中主控单元、 媒体存 储转发单元及媒体处理单元均通过控制 /媒体交换单元相互交互控制流或媒 体流,媒体存储转发单元、媒体处理单元是本发明媒体处理技术实现的载体。 信令转发单元设置为: 主要实现系统内部网络与外部网络的隔离, 控制 信令统一通过信令转发单元转发, 实现设备对外单一的网际协议 (Internet Protocol , IP)地址呈现; 其中, 控制信令包括: 会话初始化协议 (Session Initiation Protocol , SIP) , Η248以及媒体网关控制协议 (Media Gateway Control Protocol, MGCP); 主控单元设置为: 接收并解析控制信令, 生成相应的控制消息来控制媒 体存储转发单元和媒体处理单元对放音、 录音、 收发号、 会议和转码进行相 应通道处理; 控制信令是按国际标准格式的消息 , 而控制消息是把控制信令中的各个 字段解释翻译后, 组成的适合于系统内部的传递格式的消息。 控制 /媒体交换单元设置为: 完成服务器内部控制消息交换和媒体数据包 交换, 其实现交换机的功能, 是其他模块之间通信的桥梁, 在此不再赘述。 媒体存储转发单元设置为: 完成海量的多媒体数据存储, 包括实现语音 播放功能的语音库和实现录音功能时对用户录音的存储。 媒体存储转发单元 设置有对外网口, 当媒体不需要额外转换处理时, 直接通过媒体存储转发单 元上的对外网口收发。 通过对外网口发送的媒体报文是流化后的媒体报文, 该报文是符合国际 标准格式的报文。 在实现录音业务时, 通过对外网口接收媒体流, 如果终端 (比如固定电 话终端)想录音, 并且在录制的过程中, 没有按任何 DTMF号码 (0-9、 *、 #), 那么此时媒体流中就不会含有 DTMF号码; 如果录制完毕时 (比如: 以#号 表示录音完毕的结束键), 此时按 #, 那么此时接收的媒体流中就含有 DTMF 号码(#号) , 探测到 #号后上报给主控单元, 主控单元就会下发控制消息来 关闭该通道停止录音。 媒体存储转发单元包括内部 call代理模块、 录音媒体处理模块、 放音媒 体处理模块、 发包控制模块、 收包控制模块及存储模块, 其中, 内部呼叫(call )代理模块设置为: 实现与主控模块之间控制消息的交互, 这些消息是通过控制 /媒体交换单元的控制平面实现的。若分析接收的控制消 息为录音则通知录音处理模块; 若为放音, 则通知放音处理模块。 录音媒体处理模块设置为:从把收包控制模块接收来的媒体报文排序后, 提取其有效载荷存储为指定的文件格式(WAV/AMR ) 。 放音媒体处理模块设置为: 根据放音控制消息中的参数从存储模块找到 音源文件, 并对音源文件进行解析、 读取音源的有效数据以及打包流化为适 合于网络传输的媒体报文; 若根据音源数据流化后的媒体报文编码格式与终 端需要的编码格式不一致, 需要发送到媒体处理单元进行处理; 发包控制模块设置为: 通过内外网口发送媒体报文, 具体地, 该发包控 制模块即发包控制装置, 是本发明的核心, 具体将在下文中进行详细说明。 收包控制模块设置为: 通过内外网口的接收媒体报文, 如果从外网口接 收到的媒体报文与需要的存储的音源文件格式 (WAV/AMR)不一致就需要转 发到媒体处理单元, 由媒体处理单元进行转码后发送到收包控制模块的内网 口, 然后给录音媒体处理模块处理, 以及将含有 DTMF号码的媒体报文的目 的地址转换成收发号器通道对应的地址。 存储模块设置为: 存储音源文件。 媒体处理单元设置为: 完成语音编解码方式转换、 实现双音多频 (DualA preferred embodiment of the present invention is shown in FIG. 2. The audio media server of the present invention includes a signaling forwarding unit, a main control unit connected to the signaling forwarding unit, a control/media switching unit connected to the main control unit, and a control/ a media storage and forwarding unit and a media processing unit connected to the media switching unit, wherein the main control unit, the media storage and forwarding unit, and the media processing unit mutually control the flow or media stream through the control/media exchange unit, the media storage and forwarding unit, and the media processing unit It is a carrier for implementing the media processing technology of the present invention. The signaling forwarding unit is configured to: mainly implement the isolation between the internal network of the system and the external network, and the control signaling is uniformly forwarded by the signaling forwarding unit to implement a single external Internet Protocol (IP) address presentation; wherein, the control signaling The method includes: a Session Initiation Protocol (SIP), a UI 248, and a Media Gateway Control Protocol (MGCP). The main control unit is configured to: receive and parse control signaling, and generate corresponding control messages to control media storage. The forwarding unit and the media processing unit perform corresponding channel processing on playback, recording, transceiving number, conference, and transcoding; control signaling is a message in an international standard format, and the control message interprets each field in the control signaling after translation , composed of messages suitable for the delivery format inside the system. The control/media exchange unit is configured to: complete server internal control message exchange and media data packet exchange, and implement the function of the switch, which is a bridge for communication between other modules, and details are not described herein again. The media storage and forwarding unit is configured to: perform a large amount of multimedia data storage, including a voice library that implements a voice playback function and a storage of user recordings when the recording function is implemented. The media storage and forwarding unit is provided with an external network port. When the media does not need to perform additional conversion processing, the media is directly sent and received through the external network port on the media storage and forwarding unit. The media packet sent through the external network port is a streamed media packet. The packet is a packet conforming to the international standard format. When the recording service is implemented, the media stream is received through the external network port, if the terminal (such as a fixed battery) The terminal wants to record, and during the recording process, if no DTMF number (0-9, *, #) is pressed, then the DTMF number will not be included in the media stream; if the recording is completed (for example: # The number indicates the end of the recording.) Press # at this time, then the received media stream will contain the DTMF number (##). After the ## is detected, it will be reported to the main control unit, and the main control unit will issue the control. The message is used to close the channel to stop recording. The media storage and forwarding unit comprises an internal call proxy module, a recording media processing module, a sound media processing module, a delivery control module, a collection control module and a storage module, wherein the internal call (proxy) proxy module is set as: implementation and main control module The interaction of control messages is implemented by the control plane of the control/media switching unit. If the received control message is analyzed as a recording, the recording processing module is notified; if it is playing, the playback processing module is notified. The recording media processing module is configured to: after sorting the media messages received by the receiving control module, extract the payload into a specified file format (WAV/AMR). The playback media processing module is configured to: find a sound source file from the storage module according to parameters in the playback control message, parse the audio source file, read valid data of the sound source, and package and stream the media message suitable for network transmission; If the media packet encoding format of the source data stream is inconsistent with the encoding format required by the terminal, it needs to be sent to the media processing unit for processing; the packet sending control module is configured to: send the media packet through the internal and external network ports, specifically, the sending packet The control module, that is, the delivery control device, is the core of the present invention and will be described in detail below. The receiving control module is configured to: receive media packets through the internal and external network ports, and if the media message received from the external network port is inconsistent with the required stored source file format (WAV/AMR), it needs to be forwarded to the media processing unit. After being transcoded by the media processing unit, it is sent to the internal network port of the receiving control module, and then processed by the recording media processing module, and the destination address of the media message containing the DTMF number is converted into an address corresponding to the transceiver number channel. The storage module is set to: Store the source file. The media processing unit is set to: complete voice codec mode conversion, implement dual tone multi-frequency (Dual
Tone Multi-Frequency, DTMF)收发号以及会议混音功能。 媒体处理单元有以太网口和时分复用 (Time Division Multiplex and Multiplexer , TDM )接口, 来实现 IP用户和公用交换电话网(Public Switched Telephone Network , PSTN)用户的各自需要。 媒体处理单元包括 call代理模块、 收发号模块及会议处理模块, 其中, call代理模块设置为: 实现主控单元和媒体处理单元之间控制消息的交 互, 若控制消息为收发号消息则通知收发号模块处理, 若控制消息为转码或 者会议消息则通知会议处理模块处理 收发号模块设置为: 进行收号器资源设置, 以及对媒体流中的有效号码 进行有效性识别; 以及根据主控单元的控制消息产生号码; 会议处理模块设置为: 处理来自各个参与者的媒体流, 把不同参与者的 输入语音帧合成在一起作为混合语音帧; 输出给每个参与者的语音帧是把混 和语音帧滤掉该参与者的输入语音帧, 这样就避免该用户听到自己的回声。 本发明的音频媒体服务器是一种基于 Linux/vxworks操作系统的适用于 各种网络用户的媒体处理技术实现方案, 在 HMP方式改进的基础上提供低 成本和大容量来克服上述 DSP和 HMP的不足, 本发明媒体服务器在应用服 务器的控制下,提供各种业务所需的媒体处理功能,包括:放音,录音, DTMF 收号, 会议和转码等媒体处理技术。 本发明媒体处理技术的要点如下: 一、 对于音源文件格式的解析和构造: 由于不同类型的文件对音频釆样数据的组织形式不同, 所以需要根据相 应的格式进行分析。 一般来说, 文件包含对数据的描述部分和数据部分。 目 前, 对音源文件的处理支持波形(Wave Form , WAV)和自适应多速率 (Adaptive Multi-Rate, AMR)等文件类型, 表 1所示为 WAV文件格式, 表 2 所示为 AMR文件格式, 当然根据要求也可以支持其他的音源类型, 完全由 软件控制。 Tone Multi-Frequency, DTMF) Transceiver number and conference mixing function. The media processing unit has Ethernet port and time division multiplexing (Time Division Multiplex and Multiplexer, TDM) interface to meet the individual needs of IP users and Public Switched Telephone Network (PSTN) users. The media processing unit includes a call proxy module, a transceiver number module, and a conference processing module. The call proxy module is configured to: implement interaction of control messages between the master control unit and the media processing unit, and notify the sending and receiving number if the control message is a transceiver number message. The module processes, if the control message is a transcoding or a conference message, notifies the conference processing module that the transceiver number module is set to: perform a receiver resource setting, and perform validity identification on the valid number in the media stream; and according to the main control unit The control message generation number is set; the conference processing module is configured to: process the media stream from each participant, combine the input speech frames of different participants into a mixed speech frame; and output the speech frame to each participant as a mixed speech frame. The input speech frame of the participant is filtered out, thus preventing the user from hearing his own echo. The audio media server of the present invention is a media processing technology implementation scheme suitable for various network users based on the Linux/vxworks operating system, and provides low cost and large capacity to overcome the shortage of the above DSP and HMP based on the improvement of the HMP mode. The media server of the present invention provides media processing functions required for various services under the control of the application server, including: media processing technologies such as playback, recording, DTMF receiving, conference, and transcoding. The main points of the media processing technology of the present invention are as follows: 1. Analysis and construction of the audio source file format: Since different types of files have different organization forms of audio sample data, it is necessary to analyze according to the corresponding format. In general, a file contains a description part and a data part of the data. At present, the processing of the audio source file supports waveform types (Wave Form, WAV) and Adaptive Multi-Rate (AMR). Table 1 shows the WAV file format, and Table 2 shows the AMR file format. Of course, other source types can be supported as required, completely controlled by software.
WAV文件头作为多媒体中使用的声波文件格式之一, 它是以资源交换 文件格式 (Resource Interchange File Format, RIFF)格式为标准的。 AMR全称 Adaptive Multi-Rate, 自适应多速率编码, 主要用于移动设备的音频, 压缩比 比较大。 表 1: WAV文件格式 The WAV file header is one of the sound wave file formats used in multimedia, and is based on the Resource Interchange File Format (RIFF) format. AMR full name Adaptive Multi-Rate, adaptive multi-rate encoding, mainly used for audio in mobile devices, the compression ratio is relatively large. Table 1: WAV file format
RIFF WAVE Chunk RIFF WAVE Chunk
ID = 'RIFF'  ID = 'RIFF'
RiffType = 'WAVE'  RiffType = 'WAVE'
Format Chunk Format Chunk
ID = 'fmt '  ID = 'fmt '
Fact Chunk(optional) Fact Chunk(optional)
ID = 'fact'  ID = 'fact'
Data Chunk Data Chunk
ID = 'data' 表 2: AMR文件格式  ID = 'data' Table 2: AMR file format
+ +  + +
I Header | t t | P| FT |Q|p|p|  I Header | t t | P| FT |Q|p|p|
一二二二 +-+-+-+-+-+-+-+-+  One two two two +-+-+-+-+-+-+-+-+
I speech frame π |  I speech frame π |
+ +  + +
0 1 2 30 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 + | P| FT=2 |Q| P| P| I + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + | P | FT=2 |Q| P| P| I +
I I  I I
+ speech bits fmr f rame - b, cick n, channel k + + speech bits fmr f rame - b, cick n, channel k +
I I I I
+ +-+-+ + +-+-+
I |P| P| +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 +一 + I |P| P| + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one + one +
WAV文件和 AMR文件的解析流程框图如图 3, 构造流程与此类似。 其 中, 对 WAV文件的解析过程包括: 读取 WAV文件的文件头; 提取文件头信息, 包括数据编码方式、 频道 数、 釆样频率以及每个釆样需要的 bit数等信息; 跳过文件描述信息; 从音 频数据部分读取数据。 对 AMR文件的解析过程包括: 读取文件的 magic number;读取首帧数据;根据帧头计算帧数据的大小; 读帧头; 判断是否坏帧, 若坏帧则读取下一个帧头, 否则读取本帧语音数据。 二、 语音数据的流化和流化数据的语音构造 流化处理指把读取的音源文件中的数据进行实时传送协议 ( Real-time Transport Protocol, RTP )打包处理,构造成可在 IP网上传输的符合 RFC3550 标准的媒体 ^艮文。 这其中包括构造 IP/用户数据 ^艮协议 (User Datagram Protocol , UDP)/RTP头和有效载荷(payload )数据。 若语音数据的编码格式与终端用户所要求的编解码格式相同, 则不需要 转换处理, 直接由媒体存储转发单元的放音处理模块进行流化处理后通过对 外网口发送; 若语音数据的编码格式与终端用户所要求的编解码格式(如 G.711a/u、 G.729、 G.723 ) 不一致, 则需要进行语音数据转换, 流化处理的过程由媒体 存储转发单元和媒体处理单元共同完成, 两者之间的媒体流交互通过控制 / 媒体交换单元的媒体平面实现。 The block diagram of the analysis of the WAV file and the AMR file is shown in Figure 3. The construction flow is similar. The process of parsing the WAV file includes: reading a file header of the WAV file; extracting file header information, including data encoding mode, channel Number, sample frequency, and number of bits required for each sample; skip file description information; read data from audio data portion. The parsing process of the AMR file includes: reading the magic number of the file; reading the first frame data; calculating the size of the frame data according to the frame header; reading the frame header; determining whether the frame is bad, and reading the next frame header if the frame is bad, Otherwise, the frame voice data is read. 2. Streaming of voice data and voice structure of streamed data Streaming processing means that the data in the read source file is packaged by Real-time Transport Protocol (RTP) and constructed to be transmitted on the IP network. The RFC3550-compliant media ^艮文. This includes constructing IP/User Data (User Datagram Protocol, UDP)/RTP headers and payload data. If the encoding format of the voice data is the same as the encoding and decoding format required by the terminal user, the conversion processing is not required, and is directly streamed by the playback processing module of the media storage and forwarding unit and then sent through the external network port; if the voice data is encoded The format is inconsistent with the codec format required by the end user (such as G.711a/u, G.729, G.723), and voice data conversion is required. The process of streaming processing is shared by the media storage and forwarding unit and the media processing unit. Upon completion, the media stream interaction between the two is achieved through the media plane of the control/media switching unit.
可以通过以下两种方式实现流化处理过程: 方式一: 媒体存储转发单元的放音处理模块将语音数据还原成 PCM8或 PCM16 的格式, 媒体处理单元通过算法将其转为对应的 G.711/G.729/G.723 的编码数据, 最后媒体存储转发单元的放音处理模块基于 RTP 进行构包处 理。 方式二: 媒体存储转发单元的放音处理模块将音源文件中的语音数据, 比如 a/u-law或者 AMR帧, 直接流化处理成 G.71 la/u或者 RFC3267 payload 格式的 RTP报文, 媒体处理单元的会议处理模块再将 RTP处理后数据转码 为目的编解码 G.729/G.723方式。 本发明推荐使用第二种方式。 当然对于 WAV文件的流化, 需要知道 WAV文件中的音源数据编码格 式(音源数据编码格式在文件头中)。 IP/UDP的源和目的地址信息由主控单 元带下来的参数决定, payload数据的长度由主控单元带下来的打包时长信息 决定。 对于 AMR文件的流化,需要参考 rfc3267标准把存储格式变为传输格式 的流化数据。 这里涉及到不同的 payload格式的问题: 字节对齐格式和带宽 效率格式。需要根据信令中会话描述协议(Session Description Protocol, SDP ) 描述选择不同的格式, 再进行音源语音帧在 payload中的格式变换。 流化数据的语音构造相反: 就是把流化数据中的 payload变化为音源数 据进行存储。 在这个过程中需要对接收的 RTP数据进行排序和抖动处理, 并 进行格式转换以便语音数据按正确格式存于相应的文件类型。 三、 大容量的多线程处理技术 The streaming process can be implemented in the following two ways: Method 1: The playback processing module of the media storage and forwarding unit restores the voice data to the PCM8 or PCM16 format, and the media processing unit converts it to the corresponding G.711/ by an algorithm. The encoded data of G.729/G.723, and finally the playback processing module of the media storage and forwarding unit performs the composition processing based on RTP. Manner 2: The playback processing module of the media storage and forwarding unit directly streams the voice data in the audio file, such as a/u-law or AMR frame, into an RTP message in the G.71 la/u or RFC3267 payload format. The conference processing module of the media processing unit then transcodes the RTP processed data into the destination codec G.729/G.723 mode. The second method is recommended for use in the present invention. Of course, for the streaming of WAV files, you need to know the source data encoding in the WAV file. (the source data encoding format is in the file header). The source and destination address information of IP/UDP is determined by the parameters brought by the main control unit, and the length of the payload data is determined by the packetization time information brought by the main control unit. For the streaming of AMR files, it is necessary to refer to the rfc3267 standard to change the storage format to the streaming data of the transport format. This involves the issue of different payload formats: byte-aligned format and bandwidth-efficient format. It is necessary to select different formats according to the Session Description Protocol (SDP) description in the signaling, and then perform format conversion of the audio voice frame in the payload. The voice structure of the streaming data is reversed: the payload in the streamed data is changed to the source data for storage. In this process, the received RTP data needs to be sorted and dithered, and format converted so that the voice data is stored in the correct file type in the correct format. Third, large-capacity multi-threaded processing technology
媒体存储转发单元的各模块实现的各个操作, 包括录音处理时文件头信 息构造、 RTP报文载荷提取、 有效语音存储及放音处理时的音源解析、 数据 读取、 流化、 打包以及发包, 都釆用多线程处理技术, 即每种操作有多个线 程并行处理, 从而实现多通道大容量的特点。  Each operation implemented by each module of the media storage and forwarding unit includes file header information construction during recording processing, RTP packet payload extraction, audio source parsing during effective voice storage and playback processing, data reading, streaming, packaging, and delivery. All use multi-thread processing technology, that is, each operation has multiple threads processed in parallel, thus achieving the characteristics of multi-channel and large capacity.
操作文件最常用的一个模型是同步阻塞 I/O模型。 在这个模型中, 用户 空间的应用程序执行一个系统调用, 这会导致应用程序阻塞。 如图 4所示, 以读操作为例, 本发明利用线程族 (也就是起多个线程)来模拟异步读操作; 读请求线程决定是否发起读操作, 读文件线程读取数据; 由多个这样的读请 求线程和读文件线程构成读请求线程族和读文件线程族; 这样通过并发读文 件线程就可以模拟异步读文件操作了, 另外图中还显示了进行打包处理的构 造 RTP包线程族及执行发包处理的发包线程族。 写文件的模拟也是类似的。 在需要执行文件操作时, 在读写请求线程与读写文件线程之间用消息队列的 方式在两个线程族之间通信。 一旦某些通道需要发送媒体流, 那么对于所读取的语音数据要不停的打 包和发包处理。 如果全由一个进程或线程来处理, 肯定会造成 "拥塞" 的情 况, 这就对大容量造成了限制; 而多个线程并发处理的运用对这些问题的解 决奠定了基础。 四、 高精度发包控制技术 媒体服务器中有大量的媒体流从媒体存储转发单元的发包控制模块即发 包控制装置的内外网口发送。 为了对流化数据(RTP数据) 的打包间隔进行 精确控制 , 本发明发包控制装置通过发包线程管理带时间信息的指针数组的 方法实现, 如图 5所示, 本发明发包控制装置包括预计发包控制模块及时间 管理发包控制模块, 其中: 预计发包控制模块设置为: 緩存放音媒体处理模块流化后的媒体报文, 确定预计发送时间并挂接到指针数组对应发送时刻的元素所指的链表上。 每个网口都对应一定数量的緩存, 用来存储媒体报文; 当没有媒体报文 要处理时, 所有的緩存都在 idlelist上, 若有媒体报文需要处理, 预计发包控 制模块就会从空闲链表 idlelist上申请緩存用来装载媒体报文, 然后把该报文 挂接到该网口对应的时间管理发包控制模块管理的指针数组元素上。 等时间 管理发包控制模块把该数组元素上的报文发送完毕后, 又会把这些緩存挂接 到该网口的空闲链表 idlelist上。 所述媒体报文的预计发送时间是这样确定的: 读取所述时间管理发包控 制模块正在处理的当前指针数组元素的预计发送时间; 在读取的预计发送时 间的基础上增加一定的时间余量作为所述媒体报文的预计发送时间, 以保证 所述时间管理发包模块浏览到挂接在对应的指针数组元素的所述媒体报文。 所述指针数组元素的索引及所述指针数组元素指向的链表上的媒体报文 的预计发送时间具有依次对应关系, 相邻指针数组元素的预计发送时间间隔 是固定的。 时间管理发包控制模块设置为: 根据指针数组元素索引依次读取指针数 组元素所指链表上的媒体报文, 并在预计发送时间发送出去; 如果指针数组 元素链表头没有携带任何媒体报文, 那么需要延时到该元素预计发送时间。 One of the most common models for manipulating files is the synchronous blocking I/O model. In this model, the user space application executes a system call, which causes the application to block. As shown in FIG. 4, taking a read operation as an example, the present invention utilizes a thread family (that is, multiple threads) to simulate an asynchronous read operation; a read request thread determines whether to initiate a read operation, and a read file thread reads data; Such a read request thread and a read file thread constitute a read request thread family and a read file thread family; thus, the asynchronous read file operation can be simulated by concurrently reading the file thread, and the structure of the RTP package thread family for packing processing is also shown in the figure. And the family of dispatching threads that perform the processing of the delivery package. The simulation of writing files is similar. When a file operation needs to be performed, a communication queue is used between the read/write request thread and the read-write file thread to communicate between the two thread families. Once some channels need to send media streams, they are constantly packed and packetized for the voice data being read. If it is handled by a process or thread, it will definitely cause "congestion", which will limit the large capacity; and the application of multiple threads concurrent processing solves these problems. The foundation laid the foundation. 4. High-precision packet transmission control technology A large number of media streams are sent from the inner and outer network ports of the packet transmission control unit of the media storage and forwarding unit. In order to accurately control the packetization interval of the streaming data (RTP data), the delivery control device of the present invention implements a method for managing an array of pointers with time information by sending a packet thread. As shown in FIG. 5, the delivery control device of the present invention includes an expected delivery control module. And a time management delivery control module, wherein: the expected delivery control module is configured to: cache the media message after the streaming media processing module is streamed, determine the estimated transmission time and attach to the linked list of the elements corresponding to the sending time of the pointer array. . Each network port corresponds to a certain number of caches for storing media packets. When no media packets are to be processed, all caches are on the idlelist. If media packets need to be processed, the packet control module is expected to be The application cache is used to load the media packet on the idle list idlelist, and then the packet is attached to the pointer array element managed by the time management delivery control module corresponding to the network port. After the time management packet control module sends the message on the array element, the cache is attached to the idle list idlelist of the network port. The estimated transmission time of the media message is determined as follows: reading the expected transmission time of the current pointer array element being processed by the time management delivery control module; adding a certain time remainder based on the expected transmission time of the reading The quantity is used as the expected sending time of the media message to ensure that the time management sending module browses the media message attached to the corresponding pointer array element. The index of the pointer array element and the expected transmission time of the media message on the linked list pointed by the pointer array element have a corresponding correspondence relationship, and the expected transmission time interval of the adjacent pointer array element is fixed. The time management packet control module is configured to: sequentially read the media message on the linked list of the pointer array element according to the pointer array element index, and send it out at the expected sending time; if the pointer array element chain header does not carry any media message, then A delay is required until the element is expected to be sent.
所述预计发包控制模块及时间管理发包控制模块釆用多线程处理技术实 现。 对应地, 如图 6所示, 本发明媒体发包控制方法包括以下步骤: 步骤 601 : 挂接步骤, 包括: 确定要发送的媒体报文的预计发送时间, 并将所述媒体报文挂接到与所述预计发送时间对应的指针数组元素所指的链 表上; The expected delivery control module and the time management delivery control module adopt multi-thread processing technology Now. Correspondingly, as shown in FIG. 6, the media packet sending control method of the present invention includes the following steps: Step 601: The attaching step includes: determining an expected sending time of a media packet to be sent, and attaching the media packet to the packet On the linked list indicated by the pointer array element corresponding to the expected transmission time;
步骤 602: 发送步骤, 包括: 根据指针数组元素索引依次读取指针数组 元素所指的链表上的媒体报文, 并在所述预计发送时间将所述媒体报文发送 出去; 若该指针数组元素所指的链表上没有媒体报文, 则延时到该元素预计 发送时间。 进一步地, 发送步骤包括: 根据指针数组元素索引浏览当前指针 数组元素所指的链表上是否有媒体报文, 若有媒体报文则在媒体报文的预计 发送时间将媒体报文发送出去, 并根据下一指针数组元素索引浏览指针数组 元素所指的链表; 若没有媒体报文,则延时直到指针数组元素预计发送时间, 根据下一指针数组元素索引读取指针数组元素所指的链表  Step 602: The sending step includes: sequentially reading, according to the pointer array element index, the media message on the linked list indicated by the pointer array element, and sending the media message at the expected sending time; if the pointer array element If there is no media message on the list, it is delayed until the expected delivery time of the element. Further, the sending step includes: browsing, according to the pointer array element index, whether there is a media message on the linked list indicated by the current pointer array element, and if there is a media message, sending the media message at the expected sending time of the media message, and According to the next pointer array element index browsing the linked list of the pointer array element; if there is no media message, the delay until the pointer array element is expected to send time, according to the next pointer array element index read the pointer array element refers to the linked list
以下结合附图对模块功能及步骤进行详细的说明: 预计发包控制模块的流程图如图 7所示, 当预计发包控制模块的预计发 包线程族由调度进程创建起来后进入永远的 while循环,在这个 while循环中 会浏览该线程负责所有的通道, 一旦发现某个通道要求发送媒体报文就会进 入打包函数中, 在打包函数中会查看一下要发送的媒体报文是否第一个, 如 果是, 那么按以下步骤进行: A、读取时间管理发包控制线程中当前正在处理的指针数组的索引 index 和预计发送时间 foresndtime; 为了能够把该第一个媒体报文发送出去, 那么 第一个媒体报文的索引和预计发送时间必须是 index和 foresndtime之后的索 引和时间, 所以需要在 index和 foresndtime上保留一定的余量(索引余量及 时间余量) , 以便时间管理发包控制线程会浏览到 (时间管理发包控制线程 按索引递增浏览的 ); 目前第一个媒体报文的索引 nextpkt— tindex及预计发送 时间 nextpkt— foresndtime的计算方法为: nextpkt— tindex=(index+n)%指针数组的元素个数; nextpkt— foresndtime=foresndtime+n*每个指针数组索 1代表的时间间隔; 其中, "%" 表示取模; The function and steps of the module are described in detail below with reference to the accompanying drawings: The flow chart of the expected packet control module is shown in Figure 7. When it is expected that the expected packet-issuing thread family of the packet-issuing control module is created by the scheduling process, it enters the permanent while loop. In this while loop, the thread will be responsible for all the channels. Once a channel is found to require sending a media message, it will enter the packing function. In the packing function, it will check whether the media message to be sent is the first one. , then proceed as follows: A. The read time manages the index index of the array of pointers currently being processed in the thread control thread and the expected send time foresndtime; in order to be able to send the first media message, then the first medium The index and expected transmission time of the message must be the index and time after index and foresndtime, so it is necessary to reserve a certain margin (index margin and time margin) on index and foresndtime, so that the time management package control thread will browse to (Time management delivery control thread is browsed by index); currently The index of the first media message nextpkt_tindex and the expected transmission time nextpkt_foresndtime are calculated as: nextpkt- tindex=(index+n)% the number of elements in the pointer array; nextpkt—foresndtime=foresndtime+n* The time interval represented by the pointer array 1; Where "%" means modulo;
*" 表示乘; n为预先设定的索引余量(比如 η=5 ) , 以保证所述时间管理发包控制 线程浏览到挂接在对应的指针数组元素的所述媒体报文; 对应的时间余量即 索引余量 n与每个指针数组索 )代表的时间间隔的乘积。 目前每个指针数组索引代表的时间间隔即相邻指针数组元素的预计发送 时间间隔是固定的(如 10ms ) , 索引和预计发送时间其实是依次对应的关系 的, 第一个媒体报文的发送索引是当前索引往后移 n个索引, 对应的预计发 送时间是当前预计发送时间往后移 n个索引对应的时间间隔。 索引号找到后 会把该媒体报文挂接到指针数组的对应索引的链表上, 同时该链表结构中的 媒体报文计数器会加 1。 *" indicates multiplication; n is a preset index margin (such as η = 5) to ensure that the time management packet control thread browses to the media message attached to the corresponding pointer array element; corresponding time The remainder is the product of the index margin n and the time interval represented by each pointer array. The current time interval represented by each pointer array index is the fixed transmission interval of the adjacent pointer array elements (eg 10ms). The index and the expected sending time are in fact corresponding to each other. The first media packet is indexed by the current index, and the index is moved backward by n indexes. The corresponding estimated sending time is the current estimated sending time. The time interval is found. After the index number is found, the media message is attached to the linked list of the corresponding index of the pointer array, and the media message counter in the linked list structure is incremented by one.
B、 计算该通道的下一个要发送的媒体报文的索引和预计发送时间, 算 法如下: nextpkt_index= nextpkt index + (打包间隔 /每个索 1代表的时间间隔) % (指针数组的元素个数) nextpkt_foresndtime= nextpkt— foresndtime+ (打包间隔) 其中, "/"表示除; 这里的打包间隔是每个索引代表的时间间隔的整数 倍, 最简单的情况就是打包间隔与每个索引代表的时间间隔是相同的。 该通道接下来的发送的第二个媒体报文就利用以上计算的索引号和预计 发送时间找到指针数组的对应索引的链表上, 同时该链表结构中的媒体报文 计数器会加 1。  B. Calculate the index and expected transmission time of the next media message to be sent in the channel. The algorithm is as follows: nextpkt_index= nextpkt index + (packaging interval/time interval represented by each cable) % (number of elements in the pointer array) Nextpkt_foresndtime= nextpkt— foresndtime+ (packaging interval) where “/” means divide; the packing interval here is an integer multiple of the time interval represented by each index. The simplest case is that the packing interval and the time interval represented by each index are identical. The second media message sent by the channel is used to find the linked list of the corresponding index of the pointer array by using the above calculated index number and expected transmission time, and the media message counter in the linked list structure is incremented by one.
C、 后续的媒体报文的所挂接的索引号和预计发送时间都重复 B步骤进 行, 直到媒体报文处理完毕。 根据以上方式确定媒体报文的指针数组元素索引可以保证的媒体报文都 会被发送, 不会产生丟包的现象。 每个指针元素上存放的媒体报文没有量的 限制, 即使同时有多个通道的媒体报文需要发送, 只要根据以上原则确定指 针数组元素索引, 以上多个通道的媒体报文可以存放在同一指针数组元素索 引对应的链表上, 从而为媒体报文的批量发送提供了前提条件。 时间管理发包控制模块的流程图如图 8 , 当时间管理发包控制模块的时 间管理发包控制线程族由调度进程创建起来后, 就会获取当前系统时间, 并 把该时间圓整到秒, 作为指针数组第一个索引 0链表上携带的媒体报文的预 计发送时间 TO, 当前索引 index=0, 然后永远的 while循环, 在这个 while循 环中会: C. The index number and expected transmission time of the subsequent media message are repeated in step B until the media message is processed. According to the above manner, the media packet that can be guaranteed by the pointer array element index of the media message is sent, and no packet loss occurs. There is no limit on the number of media messages stored on each pointer element. Even if media packets with multiple channels need to be sent at the same time, as long as the pointer array element index is determined according to the above principles, the media packets of the above multiple channels can be stored in the same Pointer array element The corresponding linked list is introduced, thereby providing a prerequisite for batch sending of media messages. The flow chart of the time management delivery control module is shown in Figure 8. When the time management of the time management delivery control module is created by the scheduling process, the current system time is obtained, and the time is rounded to the second as a pointer. The expected transmission time of the media message carried on the first index 0 list of the array is TO, the current index index=0, and then the always while loop, in this while loop will:
A、 浏览指针数组当前索引的链表上是否有要发送的媒体报文 (通过媒 体报文计数器) , 一旦发现当前索引的链表上有要发送媒体报文就会把这些 媒体报文取下来 , 然后把这些媒体报文的地址和载荷信息以及这批媒体报文 的预计发送时间参数传到 sendmsg函数中, 由该函数在预计发送时间把该批 报文批量发送出去, 然后在预计发送时间返回, 执行 B; 若在当前索引的链 表上没有要发送媒体报文, 那么会调用延时函数 DelayTime延时到该索引链 表的预计发送时间, 执行 B。 A. Browse the pointer array to see if there is any media message to be sent (through the media message counter) on the linked list of the current index. Once the media list of the current index is found, the media message will be removed, and then the media message will be removed. The address and payload information of the media messages and the expected transmission time parameters of the batch of media messages are transmitted to the sendmsg function, and the batch messages are sent in batches at the expected transmission time, and then returned at the expected transmission time. Execution B; If there is no media message to be sent on the current index list, the delay function DelayTime is called to delay the expected transmission time of the index list, and B is executed.
B、 更新当前索引 index 以及当前索引的链表上媒体报文的预计发送时 间, 执行 C。 更新方法: 当前索引: B. Update the current index index and the expected transmission time of the media message on the linked list of the current index, and execute C. Update method: Current index:
Index= ( Index+1 ) % (指针数组最大元素个数) 当前索引对应的预计发送时间: foresndtime+=每个索引代表的时间间隔(10ms) 其中, "+=" 为力口法赋值运算符, 表示 foresndtime=foresndtime+每个索 引代表的时间间隔;  Index= ( Index+1 ) % (the maximum number of elements in the pointer array) The estimated transmission time corresponding to the current index: foresndtime+=the time interval represented by each index (10ms) where "+=" is the force assignment operator. Indicates the foresndtime=foresndtime+ time interval represented by each index;
C、 重复步骤八、 B , 永远的循环下去 C, repeat step eight, B, forever loop
代码实现如下: The code is implemented as follows:
void* TimeQueueThread(void *arg) gettimeofday(&tpSndTime, NULL); tpSndTime.tv— sec += 3; Void* TimeQueueThread(void *arg) gettimeofday(&tpSndTime, NULL); tpSndTime.tv — sec += 3;
tpSndTime.tv— usee = 0; tpSndTime.tv—usee = 0;
tpLastSndTime = tpSndTime;  tpLastSndTime = tpSndTime;
wQStartlndex = 0; wQStartlndex = 0;
Pointer Array [wQStartIndex].QForeCastSndTime  Pointer Array [wQStartIndex].QForeCastSndTime
=tpSndTime; while(l) wQIndex = wQStartlndex;  =tpSndTime; while(l) wQIndex = wQStartlndex;
wEleNum= Pointer Array [wQIndex] . wElememtNum wEleNum= Pointer Array [wQIndex] . wElememtNum
if(!wEleNum)  If(!wEleNum)
DelayTime(); DelayTime();
Else Else
Sendmsg(); Sendmsg();
NextTv(&tpLastSndTime,MinPktTime*1000,&tpSndTime); tpLastSndTime = tpSndTime; wQStartlndex += 1; NextTv(&tpLastSndTime,MinPktTime*1000,&tpSndTime); tpLastSndTime = tpSndTime; wQStartlndex += 1;
wQStartlndex = wQStartlndex %QUEUE_MAX;  wQStartlndex = wQStartlndex %QUEUE_MAX;
Pointer Array [wQStartIndex].QForeCastSndTime  Pointer Array [wQStartIndex].QForeCastSndTime
=tpSndTime; 因为对终端用户来说, 打包间隔如果抖动过大那么就会严重影响语音质 量, 这个打包间隔精确度是 Qos的重要指标, 直接影响运营商对产品质量的 评估。 可以说, 在文件读取数据和打包能够及时供给的情况下, Qos就完全 依赖打包间隔精确度了。 本发明发包控制装置 , 通过对媒体报文的在指针数组挂载索弓 )和预计发 送时间的准确有效的控制, 能高效的把该索引位置的所有媒体报文在预定发 送时刻批量的发送出去。 五、 DTMF收发号功能, 支持带内方式和 RFC2833方式 =tpSndTime; Because for the end user, if the packetization interval is too large, it will seriously affect the voice quality. This packing interval accuracy is an important indicator of Qos, which directly affects the operator's evaluation of product quality. It can be said that in the case that the file read data and the package can be supplied in time, Qos completely depends on the accuracy of the packaging interval. The delivery control device of the invention can efficiently and efficiently send all the media messages of the index position at a predetermined transmission time by accurately and effectively controlling the media message in the pointer array and predicting the transmission time. . Five, DTMF transceiver number function, support in-band mode and RFC2833 mode
DTMF收发号功能是在媒体处理单元的收发号模块上实现的, 如图 9所 示, 当媒体处理单元的收发号模块收到主控单元要求打开收发号器收发号码 时, 首先进行一系列的收号器资源的设置 (包括创建收发号通道; 设置语音 通道参数、 DTMF号码的探测方式及激活收号器资源) , 然后媒体存储转发 单元通过网络地址转换 ( Network Address Translation, NAT )把外网来的含 有 DTMF号码的媒体流转发到对应的媒体处理单元的收号资源上, 由收号资 源对该媒体流中的有效号码进行探测和有效' 1·生的识别(符合国标 GB9038-88); 发送号码, 就是根据 GB9038-88产生有效的 DTMF号码通过 媒体存储转发单元的 NAT转发到目的终端上去。 以上是描述了 IP侧的收发 号过程, TDM侧的收发号, 需要通过 E1/T1 把脉冲编码调制 (Pulse Code Modulation, PCM)流引入到媒体处理单元的收号资源上作同样的流程处理。 只不过配置收发号时配置参数不一样。 主控模块是通过控制消息对收发号器的参数进行配置 , 让收发号器处于 工作状态, 当想收号的, 媒体流是通过媒体存储转发单元的 nat转发进来的, 由于外网设备只能看到媒体存储转发单元的外网口, 其媒体报文的目的地址 也是外网口的地址 (ip+port), 因此需要媒体存储转发单元把该媒体报文的目 的地址在外网口替换成收发号器通道对应的地址, 然后发送到收发号器通道 上, 而外网口的地址与收发号器通道对应的地址的映射关系就是在 nat表保 存着的; 当想发送号码时需要根据主控发号消息的指示产生号码。 六、 支持 3方及多方会议功能, 最大可支持 64方混音 会议 /转码都是在媒体处理单元的会议处理模块上实现的;会议是允许多 个用户参与到一个会议中, 每个用户可以听到其他用户的谈话。 会议的参与 者可以是 TDM用户也可以是 IP用户。会议 /转码中有关键的处理方法, 该方 法能够把不同参与者的输入语音帧合成在一起作为混合语音帧; 输出给每个 参与者的语音帧是把混和语音帧滤掉该参与者的输入语音帧, 这样就避免该 用户听到自己的回声。 每个参与者可以是不同的编解码; 转码只是会议的一 种特殊形式。 会议的参与者可以设置为 "哑音" 状态, 此时混音器会把该参与者作为 静音处理, 但是该参与者可以听到其他参与者的声音; 会议的参与者可以设 置为 "保持" 状态, 此时混音器把该参与者作为静音处理, 并且该参与者也 听不到其他参与者的声音; 会议的参与者可以设置为 "通告保持" 状态, 此 时混音器把该参与者作为静音处理, 该参与者可听到源参与者的声音; 会议 的参与者可以设置为 "源参与者" 状态, 此时混音器把该参与者的输入输到 其他 "通告保持" 的参与者, 使其他 "通告保持" 的参与者都能够听到 "源 参与者" 的声音; "源参与者"典型的用来播放音乐、 新闻、 以及通告等等。 创建会议的实现流程如图 10, 当会议处理模块接收到主控单元发送的创 建会议消息时, 若会议 ID已经存在则上报主控单元, 否则创建会议 ID及参 与者 ID, 并设置参与者参数、 使能参与者对应的通道, 会议进行中执行混合 语音帧、 过滤参与者自身的语音帧的处理过程; 当收到参与者加入会议的消 息时, 同样执行创建参与者 ID及设置参与者参数、 使能参与者对应的通道 的过程; 若在会议进行中收到主控单元下发的撤销会议参与者的消息, 则使 时, 撤销会议 ID。 The DTMF transceiver number function is implemented on the transceiver module of the media processing unit. As shown in FIG. 9, when the transceiver unit of the media processing unit receives the request from the main control unit to open the transceiver number, the first series is performed. The setting of the receiver resource (including the creation of the transceiver number channel; setting the voice channel parameters, the detection mode of the DTMF number, and the activation of the receiver resource), and then the media storage and forwarding unit passes the network address translation (NAT) to the external network. The incoming media stream containing the DTMF number is forwarded to the receiving resource of the corresponding media processing unit, and the valid number in the media stream is detected and validated by the receiving resource (in accordance with the national standard GB9038-88) The sending number is to generate a valid DTMF number according to GB9038-88 and forward it to the destination terminal through the NAT of the media storage and forwarding unit. The above describes the process of transmitting and receiving numbers on the IP side. The transceiver number of the TDM side needs to introduce the Pulse Code Modulation (PCM) stream to the receiving resource of the media processing unit through E1/T1 for the same process. The configuration parameters are different only when the transceiver number is configured. The main control module configures the parameters of the transceiver number through the control message, so that the transceiver number is in the working state. When the number is desired, the media stream is forwarded through the nat of the media storage and forwarding unit, because the external network device can only When the external network port of the media storage and forwarding unit is displayed, the destination address of the media packet is also the address of the external network port (ip+port). Therefore, the media storage and forwarding unit needs to replace the destination address of the media packet with the external network port. Address corresponding to the channel, and then sent to the transceiver channel The mapping relationship between the address of the external network port and the address corresponding to the transceiver number channel is saved in the nat table; when the number is to be sent, the number needs to be generated according to the instruction of the master control number message. Sixth, support for 3-party and multi-party conferencing functions, maximum support for 64-party mixing conference/transcoding is implemented on the conference processing module of the media processing unit; the conference allows multiple users to participate in a conference, each user You can hear conversations from other users. Participants in the conference can be either TDM users or IP users. There are key processing methods in conference/transcoding, which can combine the input speech frames of different participants into a mixed speech frame; the speech frame output to each participant is to filter the mixed speech frames out of the participants. Enter a speech frame to prevent the user from hearing their own echo. Each participant can be a different codec; transcoding is just a special form of meeting. Participants in the conference can be set to a "mute" state, at which point the mixer will silently process the participant, but the participant can hear the voices of other participants; participants of the conference can be set to "keep" State, at this point the mixer treats the participant as silent, and the participant does not hear the voices of other participants; the participants of the conference can be set to the "announce hold" state, at which point the mixer takes the participation As a mute process, the participant can hear the voice of the source participant; the participant of the conference can be set to the "source participant" state, at which point the mixer inputs the participant's input to the other "announcement hold" Participants, the participants of other "announcement" can hear the voice of "source participants";"sourceparticipants" are typically used to play music, news, announcements, and so on. The implementation process of creating a conference is as shown in FIG. 10. When the conference processing module receives the create conference message sent by the main control unit, if the conference ID already exists, the conference control unit is reported, otherwise the conference ID and the participant ID are created, and the participant parameters are set. The session corresponding to the participant is enabled, the process of performing the mixed voice frame and filtering the participant's own voice frame is performed during the conference; when the participant joins the conference message, the participant ID is also executed and the participant parameter is set. The process of enabling the channel corresponding to the participant; if the message of the revocation conference participant sent by the main control unit is received during the conference, the conference ID is cancelled.
本发明发包控制装置和方法, 利用发包线程管理带时间信息的指针数组 的方法实现对媒体报文指针数组挂载索引和预计发送时间的准确有效的控 制,能高效的把该索引位置的所有媒体报文在预定发送时刻批量的发送出去, 实现了对打包间隔的精确控制, 能够提供高精度服务质量 (Quality of Service, Qos)性能, 另外釆用多线程处理技术, 具有大容量的特点。 The present invention provides a packet control device and method for managing an array of pointers with time information by using an issue thread The method realizes accurate and effective control of the index of the media message pointer array and the expected transmission time, and can efficiently send all the media messages of the index position in batches at a predetermined sending time, thereby realizing the accuracy of the packing interval. Control, can provide high-quality quality of service (Qos) performance, in addition to multi-threaded processing technology, with large capacity.
工业实用性 本发明音频媒体服务器基于 HMP 实现, 成本低, 不仅实现对打包间隔 的精确控制, 容量可与专用 DSP媲美, 可以提供基本和增强业务中的媒体处 理功能, 包括业务音提供、 会议、 交互式应答、 通知和高级语音业务等功能。 Industrial Applicability The audio media server of the present invention is based on HMP implementation, has low cost, and not only realizes precise control of the packaging interval, but also has the capacity comparable to a dedicated DSP, and can provide media processing functions in basic and enhanced services, including service sound supply, conference, and Features such as interactive answering, notifications, and advanced voice services.

Claims

权 利 要 求 书 Claim
1、一种音频媒体发包控制装置, 包括预计发包控制模块及时间管理发包 控制模块, 其中, 所述预计发包控制模块设置为:确定要发送的媒体报文的预计发送时间, 及将所述媒体报文挂接到与所述预计发送时间对应的指针数组元素所指的链 表上; An audio media delivery control device, comprising an estimated delivery control module and a time management delivery control module, wherein the predicted delivery control module is configured to: determine an expected transmission time of a media message to be sent, and set the media The message is hooked onto the linked list indicated by the pointer array element corresponding to the expected sending time;
所述时间管理发包控制模块设置为: 根据指针数组元素索引浏览指针数 组元素所指的链表上是否有媒体报文, 若有媒体报文, 则在所述媒体报文的 预计发送时间将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览 指针数组元素所指的链表。  The time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out, and the linked list pointed by the pointer array element is browsed according to the next pointer array element index.
2、 如权利要求 1所述的装置, 其中: 所述时间管理发包控制模块还设置为: 根据指针数组元素索引浏览指针 数组元素所指的链表上是否有媒体报文时, 若没有媒体报文, 则延时直到所 述指针数组元素的预计发送时间, 并根据下一指针数组元素索引浏览指针数 组元素所指的链表。 2. The apparatus according to claim 1, wherein: the time management packet control module is further configured to: if there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, if there is no media message , then delay until the expected sending time of the pointer array element, and browse the linked list pointed by the pointer array element according to the next pointer array element index.
3、 如权利要求 1所述的装置, 其中: 所述预计发包控制模块是设置为通过如下方式确定所述媒体报文的预计 发送时间: 读取所述时间管理发包控制模块正在处理的当前指针数组元素的 预计发送时间; 在读取的预计发送时间的基础上增加一定的时间余量作为所 述媒体报文的预计发送时间, 以保证所述时间管理发包模块浏览到挂接在对 应的指针数组元素的所述媒体报文。 3. The apparatus according to claim 1, wherein: the expected delivery control module is configured to determine an expected transmission time of the media message by: reading a current pointer that the time management delivery control module is processing The estimated transmission time of the array element; adding a certain time margin to the expected transmission time of the media message based on the expected transmission time of the read, to ensure that the time management delivery module browses to the corresponding pointer The media message of the array element.
4、如权利要求 1或 2或 3所述的装置, 其中: 所述指针数组元素索引及 关系, 且相邻指针数组元素的预计发送时间间隔是固定的。 4. Apparatus according to claim 1 or 2 or 3, wherein: said pointer array element index and relationship, and the expected transmission time interval of adjacent pointer array elements is fixed.
5、如权利要求 1或 2或 3所述的装置, 其中: 所述预计发包控制模块及 时间管理发包控制模块釆用多线程处理技术。 The apparatus according to claim 1 or 2 or 3, wherein: said predictive delivery control module and said time management delivery control module employ multi-thread processing technology.
6、 一种媒体发包控制方法, 包括: 挂接步骤, 其包括: 确定要发送的媒体报文的预计发送时间并将所述媒 体报文挂接到与所述预计发送时间对应的指针数组元素所指的链表上; 以及 发送步骤, 其包括: 根据指针数组元素索引浏览当前指针数组元素所指 的链表上是否有媒体报文, 若有媒体报文则在所述媒体报文的预计发送时间 将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览指针数组元素 所指的链表; 若没有媒体报文,则延时直到所述指针数组元素预计发送时间, 根据下一指针数组元素索 )读取指针数组元素所指的链表。 A media packet control method, comprising: a hooking step, comprising: determining an expected sending time of a media message to be sent and attaching the media message to a pointer array element corresponding to the expected sending time And the sending step, comprising: displaying, according to the pointer array element index, whether there is a media message on the linked list indicated by the current pointer array element, and if there is a media message, the estimated sending time of the media message Sending the media message, and browsing the linked list of the pointer array element according to the next pointer array element index; if there is no media message, delaying until the pointer array element is expected to send time, according to the next pointer array The element) reads the linked list of pointer array elements.
7、如权利要求 6所述的方法, 其中: 所述挂接步骤由多个预计发包线程 实现, 所述发送步骤由多个时间管理发包控制线程实现; 确定要发送的媒体报文的预计发送时间之前, 所述挂接步骤还包括: 每 个预计发包线程浏览其负责的通道; 当发现某个通道要求发送媒体报文时, 按照如下方式确定要发送的媒体 文的预计发送时间: The method according to claim 6, wherein: the attaching step is implemented by a plurality of expected packet sending threads, and the sending step is implemented by a plurality of time management packet sending control threads; determining an expected sending of the media message to be sent Before the time, the attaching step further includes: each expected packet sending thread browses the channel it is responsible for; when it is found that a channel requires to send a media message, the estimated sending time of the media message to be sent is determined as follows:
A:读取时间管理发包控制线程中当前正在处理的当前指针数组元素的索 引 index和予贞计发送时间 foresndtime; A: read time management The index index of the current pointer array element currently being processed in the dispatch control thread and the preamble send time foresndtime;
B:确定要发送的第一个媒体报文的挂接索引 nextpkt— tindex及预计发送 时间 nextpkt— foresndtime, 其中, nextpkt— tindex=(index+n)%指针数组的元素个数; nextpkt— foresndtime=foresndtime+n*每个指针数组索 1代表的时间间隔; 其中, "%" 表示取模, "*" 表示乘; n 为预先设定的索引余量, 以保证所述时间管理发包控制线程浏览 到挂接在对应的指针数组元素的所述媒体报文; C:确定后续媒体报文的挂接索引 nextpkt— tindex 及预计发送时间 nextpkt foresndtime , 直到所有媒体报文处理完毕 , 其中: nextpkt_index= nextpkt index + (打包间隔 /每个索 1代表的时间间隔) % (指针数组的元素个数), 其中, 所述打包间隔是每个索引代表的时间间隔的 整数倍; "/" 表示除; nextpkt_foresndtime= nextpkt— foresndtime+ (打包间隔) 。 B: Determine the hook index of the first media message to be sent nextpkt_tindex and the expected transmission time nextpkt_foresndtime, where, nextpkt_tindex=(index+n)% the number of elements of the pointer array; nextpkt_ foresndtime= Foresndtime+n* The time interval represented by each pointer array 1; where "%" means modulo, "*" means multiplication; n is a preset index margin to ensure that the time management packet control thread browses To the media message attached to the corresponding pointer array element; C: Determine the hook index of the subsequent media message nextpkt_tindex and the expected sending time nextpkt foresndtime until all media packets are processed, where: nextpkt_index= nextpkt index + (packaging interval/time interval represented by each cable 1) (the number of elements of the pointer array), wherein the packing interval is an integer multiple of the time interval represented by each index; "/" means division; nextpkt_foresndtime= nextpkt_foresndtime+ (packaging interval).
8、如权利要求 6所述的方法, 其中: 所述发送步骤由多个时间管理发包 控制线程实现; 各时间管理发包控制线程按如下方式执行所述发送步骤: A: 浏览当前指针数组元素索引的指针数组元素所指的链表上是否有要 发送的媒体报文, 若有, 则读取所述媒体报文, 并把所述媒体报文的地址和 载荷信息以及这批媒体报文的预计发送时间参数传到发送消息( sendmsg )函 数; sendmsg 函数在预计发送时间把这批媒体报文批量发送出去, 然后在预 计发送时间返回, 执行 B; 若在当前指针数组元素索引的指针数组元素所指的链表上没有要发送媒 体报文, 所述时间管理发包控制线程调用延时函数(DelayTime )延时直到当 前索引链表的预计发送时间, 执行 B; 8. The method according to claim 6, wherein: said transmitting step is implemented by a plurality of time management delivery control threads; each time management delivery control thread performs said transmitting step as follows: A: browsing current pointer array element index Whether there is a media message to be sent on the linked list indicated by the pointer array element, and if so, reading the media message, and the address and payload information of the media message and the prediction of the batch of media messages The send time parameter is passed to the send message (sendmsg) function; the sendmsg function sends the batch of media messages in batches at the expected send time, and then returns at the expected send time, executing B; if the pointer array element in the current pointer array element index There is no media message to be sent on the linked list, and the time management packet control thread calls the delay function (DelayTime) delay until the expected transmission time of the current index list, and executes B;
B: 更新当前索引 index 以及当前索引的链表上媒体报文的预计发送时 间, 返回 A; 其中, 当前索引: Index= ( Index+1 ) % (指针数组最大元素个数) ; 当前索引对应的预计发送时间: foresndtime=foresndtime+每个索引代表 的时间间隔。  B: Update the current index index and the expected sending time of the media message on the linked list of the current index, and return A; where, the current index: Index= ( Index+1 ) % (the maximum number of elements in the pointer array); the prediction corresponding to the current index Send time: foresndtime=foresndtime+ The time interval represented by each index.
9、 如权利要求 7或 8所述的方法, 其中: 所述挂接步骤还包括: 每挂接一个媒体报文, 对应链表的媒体报文计数 器加 1 ; 所述发送步骤中, 由时间管理发包控制线程根据所述媒体报文计数器确 定当前索引的链表上是否有要发送的媒体报文。 The method according to claim 7 or 8, wherein: the attaching step further comprises: adding one media message to the media message counter corresponding to the linked list; In the sending step, the time management packet control thread determines, according to the media message counter, whether there is a media message to be sent on the linked list of the current index.
10、 一种音频媒体服务器, 包括音频媒体发包控制装置, 所述装置包括 预计发包控制模块及时间管理发包控制模块, 其中, 所述预计发包控制模块设置为:确定要发送的媒体报文的预计发送时间, 及将所述媒体报文挂接到与所述预计发送时间对应的指针数组元素所指的链 表上; An audio media server, comprising an audio media delivery control device, the device comprising an expected delivery control module and a time management delivery control module, wherein the predicted delivery control module is configured to: determine an estimate of a media message to be sent Transmitting time, and attaching the media message to a linked list indicated by a pointer array element corresponding to the expected sending time;
所述时间管理发包控制模块设置为: 根据指针数组元素索引浏览指针数 组元素所指的链表上是否有媒体报文, 若有媒体报文, 则在所述媒体报文的 预计发送时间将所述媒体报文发送出去, 并根据下一指针数组元素索引浏览 指针数组元素所指的链表; 若没有媒体报文, 则延时直到所述元素指针数组 的预计发送时间并根据下一指针数组元素索引浏览指针数组元素所指的链 表。  The time management delivery control module is configured to: browse whether there is a media message on the linked list indicated by the pointer array element according to the pointer array element index, and if there is a media message, the expected delivery time of the media message is The media message is sent out, and the linked list of the pointer array element is browsed according to the next pointer array element index; if there is no media message, the delay is until the expected sending time of the element pointer array and according to the next pointer array element index Browse the linked list of pointer array elements.
11、 如权利要求 10所述的音频媒体服务器, 其中: 所述预计发包控制模块是设置为通过如下方式确定所述媒体报文的预计 发送时间: 读取所述时间管理发包控制模块正在处理的指针数组元素的预计 发送时间; 在读取的预计发送时间的基础上增加一定的时间余量作为所述媒 体报文的预计发送时间, 以保证所述时间管理发包模块浏览到挂接在对应的 指针数组元素的所述媒体报文。 11. The audio media server of claim 10, wherein: the expected delivery control module is configured to determine an expected transmission time of the media message by: reading the time management delivery control module is processing The estimated transmission time of the pointer array element; adding a certain time margin to the expected transmission time of the media message based on the expected transmission time of the read, to ensure that the time management delivery module browses to the corresponding connection The media message of the pointer array element.
12、 如权利要求 10或 11所述的音频媒体服务器, 其中, 所述音频媒体 服务器还包括信令转发单元、 主控单元及媒体存储转发单元, 其中, 所述信令转发单元设置为: 实现服务器内部与外部信令的统一转发; 所述主控单元设置为: 接收并解析所述信令转发单元转发的控制信令, 并生成相应的控制消息来控制媒体存储转发单元; 以及 所述媒体存储转发单元具有对外网口, 所述媒体存储转发单元设置为: 根据所述主控单元下发的控制消息实现录音及语音播放, 其中, 在录音及语 音播放中, 由所述音频媒体发包控制装置实现媒体报文的发包控制。 The audio media server according to claim 10 or 11, wherein the audio media server further comprises a signaling forwarding unit, a main control unit, and a media storage and forwarding unit, wherein the signaling forwarding unit is configured to: Unified forwarding of the internal and external signaling of the server; the main control unit is configured to: receive and parse the control signaling forwarded by the signaling forwarding unit, and generate a corresponding control message to control the media storage and forwarding unit; and the media The storage and forwarding unit has an external network port, and the media storage and forwarding unit is configured to: perform recording and voice playback according to a control message sent by the main control unit, where In the sound playing, the audio media packet sending control device implements the packet control of the media message.
13、如权利要求 12所述的音频媒体服务器, 其中: 所述媒体存储转发单 元是设置为釆用多线程处理技术实现录音及语音播放。 13. The audio media server of claim 12, wherein: the media storage and forwarding unit is configured to implement recording and voice playback using a multi-thread processing technology.
14、如权利要求 12所述的音频媒体服务器, 其中: 所述音频媒体服务器 还包括媒体处理单元, 所述媒体处理单元包括呼叫代理模块、 收发号模块及 会议处理模块, 其中, 呼叫代理模块设置为: 实现主控单元和媒体处理单元之间控制消息的交 互, 若控制消息为收发号消息则通知收发号模块处理, 若控制消息为转码或 者会议消息则通知会议处理模块处理; 收发号模块设置为: 进行收号器资源设置, 并对媒体流中的有效号码进 行有效性识别; 以及 居主控单元的控制消息产生号码; The audio media server of claim 12, wherein: the audio media server further comprises a media processing unit, the media processing unit comprises a call proxy module, a transceiver number module, and a conference processing module, wherein the call proxy module is configured The method is: implementing the interaction of the control message between the main control unit and the media processing unit, and notifying the sending and receiving number module if the control message is a sending and receiving number message, and notifying the conference processing module if the control message is a transcoding or a conference message; Set to: set the receiver resource, and identify the validity of the valid number in the media stream; and generate the control message of the main control unit;
会议处理模块设置为: 处理来自各个参与者的媒体流, 把不同参与者的 输入语音帧合成在一起作为混合语音帧, 且输出给每个参与者的语音帧是把 混和语音帧滤掉该参与者的输入语音帧; 所述主控单元还设置为: 生成对所述媒体处理单元的控制消息; 以及 所述媒体存储转发单元还设置为:将含有多音双频 DTMF号码的媒体报 文的目的地址转换成收发号器通道对应的地址。  The conference processing module is configured to: process media streams from various participants, combine input speech frames of different participants into a mixed speech frame, and output the speech frames to each participant to filter out the mixed speech frames. Inputting a voice frame; the main control unit is further configured to: generate a control message to the media processing unit; and the media storage and forwarding unit is further configured to: media the message containing the multi-tone dual-frequency DTMF number The destination address is translated into the address corresponding to the transceiver channel.
PCT/CN2010/072616 2009-05-13 2010-05-11 Device, method for controlling audio media packet transmission and audio media server WO2010130193A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910142922.5 2009-05-13
CN2009101429225A CN101567853B (en) 2009-05-13 2009-05-13 Audio frequency media package-transmitting controller, method and audio frequency media server

Publications (1)

Publication Number Publication Date
WO2010130193A1 true WO2010130193A1 (en) 2010-11-18

Family

ID=41283809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/072616 WO2010130193A1 (en) 2009-05-13 2010-05-11 Device, method for controlling audio media packet transmission and audio media server

Country Status (2)

Country Link
CN (1) CN101567853B (en)
WO (1) WO2010130193A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277900A (en) * 2018-12-05 2020-06-12 深圳市茁壮网络股份有限公司 Starting method and device of set top box

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101567853B (en) * 2009-05-13 2011-08-10 中兴通讯股份有限公司 Audio frequency media package-transmitting controller, method and audio frequency media server
CN105007281A (en) * 2015-08-10 2015-10-28 武汉中元华电软件有限公司 Time-prediction-based network synchronization message MD5 encryption apparatus and encryption method
CN107809435A (en) * 2017-11-10 2018-03-16 北京锐安科技有限公司 A kind of extracting method and device of AMR speech datas
CN112511463B (en) * 2020-11-18 2022-04-05 潍柴动力股份有限公司 Message sending method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1235481A (en) * 1998-03-02 1999-11-17 松下电器产业株式会社 Method of and system capable of precisely clipping continuous medium obtained from multiplexed bit stream
CN1383656A (en) * 2000-07-07 2002-12-04 松下电器产业株式会社 Data transmitter, data receiver, and data tansmitting/receiving method
CN1852423A (en) * 2006-01-10 2006-10-25 华为技术有限公司 Network flow-medium performance broadcasting system and method
CN101099142A (en) * 2004-03-03 2008-01-02 分组视频网络技术方案有限公司 System and method for retrieving digital multimedia content from a network node
CN101567853A (en) * 2009-05-13 2009-10-28 中兴通讯股份有限公司 Audio frequency media package-transmitting controller, method and audio frequency media server

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101136772B (en) * 2007-09-28 2010-10-27 华为技术有限公司 Timing transmission packet method and packet transmission module
CN101296184B (en) * 2008-05-30 2011-04-13 华为技术有限公司 Method, system and device for data transmission

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1235481A (en) * 1998-03-02 1999-11-17 松下电器产业株式会社 Method of and system capable of precisely clipping continuous medium obtained from multiplexed bit stream
CN1383656A (en) * 2000-07-07 2002-12-04 松下电器产业株式会社 Data transmitter, data receiver, and data tansmitting/receiving method
CN101099142A (en) * 2004-03-03 2008-01-02 分组视频网络技术方案有限公司 System and method for retrieving digital multimedia content from a network node
CN1852423A (en) * 2006-01-10 2006-10-25 华为技术有限公司 Network flow-medium performance broadcasting system and method
CN101567853A (en) * 2009-05-13 2009-10-28 中兴通讯股份有限公司 Audio frequency media package-transmitting controller, method and audio frequency media server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277900A (en) * 2018-12-05 2020-06-12 深圳市茁壮网络股份有限公司 Starting method and device of set top box
CN111277900B (en) * 2018-12-05 2022-12-23 深圳市茁壮网络股份有限公司 Starting method and device of set top box

Also Published As

Publication number Publication date
CN101567853A (en) 2009-10-28
CN101567853B (en) 2011-08-10

Similar Documents

Publication Publication Date Title
CN108234421B (en) A kind of method and system regarding networked terminals and the intercommunication of internet terminal audio data
US7286652B1 (en) Four channel audio recording in a packet based network
EP2067348B1 (en) Process for scalable conversation recording
US8170194B2 (en) Method and system for replicating ring back tones
CN107018446B (en) A kind of network video-on-demand and the plug-flow method of live streaming
US7508815B2 (en) Method and system for facilitating network troubleshooting
CN101115011A (en) Stream media playback method, device and system
CN101272383B (en) Real-time audio data transmission method
WO2010083737A1 (en) Method and apparatus for processing voice signal, method and apparatus for transmitting voice signal
CN102420815B (en) VOIP (Voice Over Internet Protocol) recording and playing system and method
WO2010130193A1 (en) Device, method for controlling audio media packet transmission and audio media server
TW201412080A (en) Time-shifting distribution of high definition audio data
CN101022545A (en) Method and system for realizing multimedia broadcasting via H.248 protocol
US20090299735A1 (en) Method for Transferring an Audio Stream Between a Plurality of Terminals
WO2007124690A1 (en) A method for realizing sound paly service and a media resource processing device
CN102231734A (en) Method, device and system for realizing audio transcoding of TTS (Text To Speech)
CN101860537A (en) Implementation method for media playing service and media server
CN102158615B (en) LINUX-based media server in (Voice Over Internet Protocol) system and playback method of media server
US20030174657A1 (en) Method, system and computer program product for voice active packet switching for IP based audio conferencing
WO2007115472A1 (en) A method of creating a multiparty conference and a system and device for creating the multiparty conference
CN1984353B (en) Method and device for mixing sound
TW201412083A (en) High definition audio distribution system
CN100461878C (en) Method for realizing media gateway control protocol playback
WO2015196823A1 (en) Method and device for achieving cyclic playing from text to voice service, and server
CN101867482A (en) Method, equipment and system for realizing playback of meeting members in media meeting

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10774534

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10774534

Country of ref document: EP

Kind code of ref document: A1