Mining SIP network telephone communication system based on CAN bus
By using the CAN bus to transmit SPEEX format audio data between the mining vehicle terminal and the voice broadcaster, and combining the software design in C/S mode to communicate with the VoIP server, the problem of noise interference and real-time requirements in the prior art is solved, and a high reliability, stability and real-time mining SIP network telephone communication system is realized.
Patent Information
- Application Number
- CN202411609549.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-11
AI Technical Summary
The voice transmission of existing mining vehicle-mounted terminals is susceptible to noise interference, and it is necessary to increase relay equipment or increase transmission power during long-distance transmission, which increases communication cost and complexity. PLC cannot meet performance requirements when it is highly real-time and complex computing requirements.
The CAN bus-based mining SIP network telephone communication system is adopted, including a mining vehicle terminal and a voice broadcaster, and the SPEEX format audio data transmission is carried out through the CAN bus. Combined with the C/S mode software design, the SIP protocol stack, RTCP/RTP protocol and SDP protocol are used to establish sessions and transmit data with the VoIP server.
It improves the reliability and stability of the system, can operate stably in harsh environments, reduces noise interference, improves real-time and communication quality, simplifies system installation and maintenance, and reduces maintenance costs and time.
Smart Images

Figure CN119603282A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of mine communication, in particular to a mine SIP network telephone communication system based on a CAN bus. Background Art
[0002] If analog voice signals are used for voice transmission in mining vehicle terminals, they are easily interfered by noise during transmission, and the noise will accumulate with the increase of transmission distance, affecting the call quality. In addition, when analog voice signals are transmitted over long distances, it is often necessary to add relay equipment or increase the transmission power, which increases the communication cost and complexity. Although PLC is suitable for most industrial applications, in mining network telephone communications, extremely high real-time performance or the ability to process complex calculations are required, and PLC may not be able to meet the performance requirements. Summary of the invention
[0003] The technical problem to be solved by the present invention is: in order to solve the problems existing in the prior art in the above-mentioned background technology, a mining SIP network telephone communication system based on CAN bus is provided.
[0004] The technical solution adopted by the present invention to solve the technical problem is: a mining SIP network telephone communication system based on CAN bus, comprising: The hardware part includes a mine vehicle terminal and a voice amplifier. The mine vehicle terminal is connected to the voice amplifier through a CAN bus. The voice amplifier has a speaker and a microphone. The mine vehicle terminal has a WIFI antenna and a WIFI module. The software part adopts C / S mode and is integrated on the mining vehicle terminal. It includes a client and a server. The client sends a request, and the server transmits data according to the request and feeds back the processed result to the client. The server establishes a session with the VOIP server through the RTCP protocol / RTP protocol or SDP protocol and transmits data. The mining vehicle terminal uses the SIP protocol stack to send audio data in SPEEX format based on the CAN bus.
[0005] Furthermore, the data transmission between the mining vehicle terminal and the voice amplifier is specifically as follows: The microphone collects audio data and sends it to the CODEC chip in the voice amplifier. The CODEC chip encodes the audio data into PCM data. The SPEEX encoder in the voice amplifier compresses the PCM data and sends the compressed SPEEX data to the mining vehicle terminal through the CAN bus. The mining vehicle terminal decodes the SPEEX data into PCM data through the SPEEX decoder and compresses it into PCMU / A data. The PCMU / A data is then sent to the VoIP server through WIFI. The VoIP server sends the PCMU / A audio data to the mine vehicle terminal via WIFI. The mine vehicle terminal decompresses the PCMU / A data into PCM data. The mine vehicle terminal compresses the PCM data using the SPEEX algorithm. The compressed SPEEX data is sent to the voice amplifier via the CAN bus. The voice amplifier decompresses the SPEEX data using the SPEEX algorithm into PCM data and sends it to the CODEC chip. The CODEC chip decodes the PCM data into analog voice data and sends it to the speaker for playback.
[0006] Furthermore, a session channel and a media stream channel are established between the server and the VOIP server. The session channel establishes a session between the mining vehicle terminal and the voice broadcaster based on the SDP protocol and transmits system control commands. The media stream channel transmits audio and video data based on the RTCP protocol / RTP protocol.
[0007] Furthermore, the C / S mode interaction of the software part is specifically as follows: Program initialization, using IP address 0.0.0.0 as the internal server address, the client uses port 6668 as the control interaction port, in the control interaction thread, receives the data sent by the client through the callback function, and implements SIP registration server IP address initialization, SIP registration phone number initialization, SIP registration password initialization, SIP 10s automatic answer initialization, SIP thread creation, SIP thread reset and restart, get the current call status, answer the call, hang up the call, get the other end number, get the registration status, and make a call through protocol parsing; The client uses 6669 as the data interaction port. In the data interaction thread, the SPEEX data sent by the client is received through the callback function and decoded and stored in the buffer. The SIP protocol stack extracts the data in the buffer every 20ms and sends it to the network. The PCMU / PCMA voice data received from the network is converted into PCM data and then SPEEX encoded and stored in the buffer, and then sent to the client to realize voice stream data interaction.
[0008] Furthermore, the program of the SIP protocol stack is initialized, and the server IP, client IP, authentication user name, display name, registration password, set user name, and whether to automatically answer the call in 10 seconds are set as global variables, and at the same time, a SIP main thread, a SIP timeout thread, a local incoming call ringing thread, and a remote outgoing call ringing thread are created.
[0009] Furthermore, the local incoming call ringing thread is initialized and determines whether it is in the host incoming call ringing state. If it is in the ringing state, it rings, otherwise it does not ring; the remote outgoing call ringing thread is initialized and determines whether it is in the remote outgoing call ringing state. If it is in the ringing state, it rings, otherwise it does not ring.
[0010] Furthermore, in the SIP main thread, SIP state initialization, SDP state initialization, UDP initialization, SIP registration initialization, and SPEEX algorithm initialization are first performed, and then a state machine loop is entered. In the loop, the SIP registration function is first performed. If the registration is not successful, the registration is performed once every 5 seconds, and if the registration is successful, the registration is performed once every 5 minutes. If the registration is not successful, the registration will be performed several times, and then the registration will not be performed quickly to prevent the SIP server protection mechanism from being triggered. Then, the SIP heartbeat sending function is performed. After the registration state machine changes to registration, the OPTION heartbeat is actively sent to the server every 60 seconds, and then the server data query, dialing action, and hang-up action are obtained through the SDP / UDP protocol to change the state machine state.
[0011] Furthermore, the mining vehicle terminal performs codec conversion on the PCM voice data and the SPEEX voice data, and the specific steps are as follows: S1. Speech signal preprocessing: Frame and window the speech signal to extract short-term speech signal segments suitable for encoding; S2, linear prediction analysis: perform linear prediction analysis on each frame of speech signal to extract vocal tract parameters; S3, codebook search: search for the best excitation vector combination in the adaptive codebook and the fixed codebook; S4, quantization and encoding: quantizing and encoding the searched optimal excitation vector sequence number and its gain; S5, Synthesis and Evaluation: Generate a synthesized speech signal through a synthesis filter using the quantized parameters and excitation vector, and evaluate the perceptual difference between it and the original speech signal; S6, transmission and decoding: The encoded data is transmitted to the receiving end, and decoded at the receiving end to restore the original voice signal.
[0012] Furthermore, the client performs the SIP voice phone function, first executes SIP configuration initialization and server registration, executes a loop judgment according to the task cycle, obtains the SIP registration status and the SIP state machine status, the SIP state machine includes hang up idle state, outgoing calls, incoming calls and connected calls, and executes the sending and receiving of SIP voice CAN frames and TCP messages in the call state, and obtains the SIP state machine status at intervals of 200ms.
[0013] Furthermore, the sending and receiving of SIP voice CAN frames and TCP messages are executed in the call state. Specifically, when multiple SIP control commands are triggered together, they will be filled in the buffer area in sequence, and the SIP control instructions will be executed sequentially. Within a task cycle, the execution of the called control instructions will be judged. The control instruction types include SIP modifying IP, SIP modifying number, SIP modifying password, SIP automatic connection, SIP initialization, SIP Reboot, SIP obtain state machine, SIP make a call, SIP answer a call, SIP hang up, SIP obtain the other party's number and SIP obtain registration status.
[0014] Beneficial effects of the present invention: (1) High reliability and stability: The CAN bus uses a differential signal transmission method, which has good anti-interference ability and can operate stably in harsh environmental conditions such as mines; the differential signal can effectively resist electromagnetic interference and noise interference, ensuring the integrity and accuracy of the communication signal; the CAN bus also uses a redundant check and error recovery mechanism, which can automatically detect and correct errors in the communication process, further improving the reliability of the system; this mechanism ensures that even if there is a brief interference or error during the communication process, the system can quickly recover and continue to communicate.
[0015] (2) Real-time performance: The CAN bus has a low transmission delay and can meet the real-time requirements of SIP network telephone communications in mines. In scenarios such as mines where instant communication is required, low-latency communication methods can ensure rapid transmission of information and timely response. The CAN bus uses a fixed communication cycle for data transmission, which helps maintain the continuity and stability of communication. The fixed communication cycle enables the system to collect and transmit data at predetermined time intervals, thereby ensuring real-time updates of information.
[0016] (3) Good interoperability: The CAN bus supports multi-host systems, and multiple nodes can send and receive messages at the same time; this multi-node system structure enables mining SIP network telephone communications to cover a wider area and more users, improving the flexibility and scalability of the system.
[0017] (4) Easy to install and maintain: The mining SIP network telephone communication system based on CAN bus usually adopts a modular design, which makes the installation and maintenance of the system simpler and more convenient; the modular design also makes the system easy to upgrade and expand, and functions can be added or adjusted as needed.
[0018] (5) Network management: The network management method realized by CAN bus technology enables the system to centrally monitor and manage the working status and data transmission of each node. This network management method improves the maintainability and manageability of the system and reduces maintenance costs and time. BRIEF DESCRIPTION OF THE DRAWINGS The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0019] Figure 1 It is a schematic diagram of the structure of the hardware part of the present invention.
[0020] Figure 2 It is a structural diagram of the software part of the present invention.
[0021] Figure 3 yes Figure 2 Control block diagram of C / S mode interaction.
[0022] Figure 4 yes Figure 2 Control block diagram of the SIP protocol stack.
[0023] Figure 5 yes Figure 4 Flowchart of the local incoming call ringing thread and the remote outgoing call ringing thread.
[0024] Figure 6 yes Figure 4 Flowchart of the SIP main thread.
[0025] Figure 7 It is a flow chart of encoding and decoding conversion between PCM voice data and SPEEX voice data in the present invention.
[0026] Figure 8 yes Figure 2 Flowchart of the SIP voice call function of the client.
[0027] Fig. 9 yes Figure 8 Flowchart of the SIP voice phone function in the call state.
[0028] In the figure: 1. Mine vehicle terminal; 2. Voice amplifier; 21. Loudspeaker; 22. Microphone. DETAILED DESCRIPTION
[0029] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0030] Explain the technical terms in this embodiment: VoIP Internet phone technology based on SIP protocol is an advanced technology that uses Internet Protocol (IP) for voice communication. SIP (Session Initiation Protocol) is the core protocol of this technology, proposed by IETF (Internet Engineering Task Force), which aims to create, modify and terminate multimedia sessions. VoIP (Voice over Internet Protocol) technology converts voice signals into data packets through digital transmission technology, and transmits them on IP network with low distortion, so as to realize voice calls. This technology has many advantages over traditional telephone systems, such as low call charges, small bandwidth occupation, and support for multimedia services. VoIP Internet phone systems based on SIP protocol usually consist of customer voice terminals and servers, in which customer voice terminals use embedded technology to realize voice data collection and playback, while servers are responsible for terminal management, call management and other functions. In actual applications, users need to register SIP accounts and initiate calls through telephone clients or software that support SIP protocol. SIP proxy servers will implement routing functions to ensure the smooth progress of calls. The entire communication process follows the process specified by SIP protocol, including the initiation, response, and confirmation of sessions. With the increase of network bandwidth and the decrease of multimedia terminal equipment cost, VoIP network telephone technology based on SIP protocol is gradually becoming popular and playing an important role in enterprise communication, remote office and other fields.
[0031] SPEEX codec technology is an open source, free voice codec designed for voice communication. It is based on the CELP (Code Excited Linear Prediction) algorithm, provides efficient voice compression and decompression functions, and is suitable for different bit rate requirements, including narrowband, broadband and ultra-wideband modes. SPEEX has the characteristics of low latency, strong packet loss compensation capability, and excellent sound quality. It is widely used in scenarios such as VoIP (Internet phone) and voice messaging, and is one of the key technologies in modern digital voice communication.
[0032] The CAN bus data transmission technology based on SAE-J1939 is a standardized protocol specifically used for vehicle network communication. It is based on the CAN (Controller Area Network) bus technology and has been further encapsulated and optimized. The technology has many advantages, including high real-time performance, high reliability, complete functions, high cost performance and short development cycle. It supports multiple message types, such as broadcast messages, request-response messages and periodic messages, to meet different communication needs. In terms of data transmission, the SAE-J1939 protocol specifies the disassembly and reassembly mechanism of messages, allowing data greater than 8 bytes to be transmitted through multiple CAN data frames, and the maximum batch transmission data volume can reach 1785 bytes. In addition, the SAE-J1939 protocol also defines the specifications of the physical layer and data link layer, including parameters such as electrical interface, physical medium, transmission rate, maximum number of nodes, and maximum cable length, to ensure the stability and reliability of communication. In general, the CAN bus data transmission technology based on SAE-J1939 is an important part of modern vehicle network communication, providing strong support for the interoperability and flexibility of vehicle systems.
[0033] Soft PLC control technology based on CODESYS is an important technology in the field of industrial automation. CODESYS (Controller Development System) is a widely used integrated development environment (IDE) for developing and programming industrial automation control systems, especially soft PLCs. Unlike traditional hardware PLCs (Programmable Logic Controllers), soft PLCs are PLC systems running on general-purpose computers or embedded systems. It simulates the functions of hardware PLCs through software to achieve control of industrial equipment.
[0034] PCM (Pulse Code Modulation) is a technology for converting analog signals into digital signals. PCMU (G.711U) and PCMA (G.711A) are two audio coding formats based on the G.711 standard. They are mainly used for voice transmission in digital communications.
[0035] A mining SIP network telephone communication system based on CAN bus, including hardware and software parts, such as Figure 1 As shown, the hardware part includes a mining vehicle terminal 1 and a voice amplifier 2. The mining vehicle terminal 1 is connected to the voice amplifier 2 via a CAN bus 3. The voice amplifier 2 has a speaker 21 and a microphone 22. The mining vehicle terminal 1 has a WIFI antenna and a WIFI module.
[0036] The data transmission between the mining vehicle terminal and the voice amplifier is mainly for sound pickup and playback. Sound pickup: the microphone 22 collects audio data and sends it to the CODEC chip in the voice amplifier 2. The CODEC chip encodes the audio data into PCM data. The SPEEX encoder in the voice amplifier 2 compresses the PCM data and sends the compressed SPEEX data to the mining vehicle terminal 1 through the CAN bus 3. The mining vehicle terminal 1 decodes the SPEEX data into PCM data through the SPEEX decoder and compresses it into PCMU / A data. Then the PCMU / A data is sent to the mining vehicle terminal 1 through WIFI. Sent to the VoIP server; Playback: The VoIP server sends the PCMU / A audio data to the mining vehicle terminal 1 via WIFI, the mining vehicle terminal 1 decompresses the PCMU / A data into PCM data, the mining vehicle terminal 1 compresses the PCM data using the SPEEX algorithm, and the compressed SPEEX data is sent to the voice amplifier 2 via the CAN bus 3, the voice amplifier 2 decompresses the SPEEX data using the SPEEX algorithm into PCM data and sends it to the CODEC chip, the CODEC chip decodes the PCM data into analog voice data and sends it to the speaker 21 for playback.
[0037] like Figure 2 As shown, the software part adopts C / S mode and is integrated on the mining vehicle terminal 1, which includes a client and a server. The client sends a request, and the server transmits data according to the request and feeds back the processed result to the client. The server establishes a session with the VOIP server through the RTCP protocol / RTP protocol or SDP protocol and transmits data. The mining vehicle terminal 1 uses the SIP protocol stack to send audio data in SPEEX format based on the CAN bus. A session channel and a media stream channel are established between the server and the VOIP server. The session channel establishes a session between the mining vehicle terminal 1 and the voice broadcaster 2 based on the SDP protocol and transmits system control commands. The media stream channel transmits audio and video data based on the RTCP protocol / RTP protocol.
[0038] like Figure 3 As shown in the figure, the C / S mode interaction of the software part is as follows: Program initialization, using IP address 0.0.0.0 as the internal server address, the client uses port 6668 as the control interaction port, in the control interaction thread, receives the data sent by the client through the callback function, and implements SIP registration server IP address initialization, SIP registration phone number initialization, SIP registration password initialization, SIP 10s automatic answer initialization, SIP thread creation, SIP thread reset and restart, get the current call status, answer the call, hang up the call, get the other end number, get the registration status, and make a call through protocol parsing; The client uses 6669 as the data interaction port. In the data interaction thread, the SPEEX data sent by the client is received through the callback function and decoded and stored in the buffer. The SIP protocol stack extracts the data in the buffer every 20ms and sends it to the network. The PCMU / PCMA voice data received from the network is converted into PCM data and then SPEEX encoded and stored in the buffer, and then sent to the client to realize voice stream data interaction.
[0039] like Figure 4 As shown in the figure, the SIP protocol stack runs on Linux. The program is initialized, and the server IP, client IP, authentication user name, display name, registration password, set user name, and whether to automatically answer the call in 10 seconds are set as global variables. At the same time, the SIP main thread, SIP timeout thread, local incoming call ringing thread, and remote outgoing call ringing thread are created. The SIP timeout thread calculates the program function timeout time to complete the change of the state machine.
[0040] like Figure 5 As shown in (a), the local incoming call ringing thread is initialized and determines whether it is in the host incoming call ringing state. If it is in the ringing state, it rings, otherwise it does not ring. Figure 5 As shown in (b), the remote outgoing call ringing thread is initialized and whether it is in the remote outgoing call ringing state is determined. If it is in the ringing state, it rings, otherwise it does not ring.
[0041] like Figure 6 As shown, in the SIP main thread, the SIP state initialization, SDP state initialization, UDP initialization, SIP registration initialization, and SPEEX algorithm initialization are first performed, and then the state machine loop is entered. In the loop, the SIP registration function is first performed. If the registration is not successful, the registration is performed once every 5 seconds, and after the registration is successful, the registration is performed once every 5 minutes. If the registration is not successful, it will register several times and then not register quickly to prevent the SIP server protection mechanism from being triggered. Then the SIP heartbeat sending function is performed. After the registration state machine changes to registration, the OPTION heartbeat is actively sent to the server every 60 seconds. After that, the server data query, dialing action, and hang-up action are obtained through the SDP / UDP protocol to change the state machine state. The state machine states include idle state, host sending invitation state, waiting for server response state, host incoming call ringing state, remote outgoing call ringing state, and call state, completing the Voip function based on SIP.
[0042] like Figure 7 As shown, the mining vehicle terminal 1 performs codec conversion on the PCM voice data and the SPEEX voice data, and the specific steps are as follows: S1. Speech signal preprocessing: Frame and window the speech signal to extract short-term speech signal segments suitable for encoding; S2, linear prediction analysis: perform linear prediction analysis on each frame of speech signal to extract vocal tract parameters; S3, codebook search: search for the best excitation vector combination in the adaptive codebook and the fixed codebook; S4, quantization and encoding: quantizing and encoding the searched optimal excitation vector sequence number and its gain; S5, Synthesis and Evaluation: Generate a synthesized speech signal through a synthesis filter using the quantized parameters and excitation vector, and evaluate the perceptual difference between it and the original speech signal; S6, transmission and decoding: The encoded data is transmitted to the receiving end, and decoded at the receiving end to restore the original voice signal.
[0043] like Figure 8 As shown, the client performs the SIP voice call function, first performs SIP configuration initialization and server registration, executes loop determination according to the task cycle, obtains the SIP registration status and SIP state machine status, the SIP state machine includes hang up idle state, outgoing call, incoming call and connected call, executes the sending and receiving of SIP voice CAN frames and TCP messages in the call state, and obtains the SIP state machine status at intervals of 200ms.
[0044] like Fig. 9 As shown, the sending and receiving of SIP voice CAN frames and TCP messages are executed in the call state. Specifically, when multiple SIP control commands are triggered together, they will be filled in the buffer area in sequence, and the SIP control instructions will be executed in sequence. Within a task cycle, the execution of the called control instructions will be judged. The control instruction types include SIP modifying IP, SIP modifying number, SIP modifying password, SIP automatic connection, SIP initialization, SIP Reboot, SIP obtain state machine, SIP call, SIP answer call, SIP hang up, SIP obtain the other party's number and SIP obtain registration status.
[0045] In C / S mode, the functions of the protocol messages for interaction between the CODESYS process and the SIP process are shown in the following table:
[0046] The length of VOIP call voice data is: 24 bytes at SPEEX_8kbps; 44 bytes at SPEEX_16kbps; the data page bit is 1, the PDU format is 101, the specific PDU segment is the target address (supports global address), the default priority is 3, and the parameter group number is 91392 (016500 16 ).
[0047] For mining equipment calls, you only need to add a server that can implement VoIP based on the on-site network conditions to implement Internet calls, which can significantly reduce communication costs. VoIP can provide more complex functions than traditional phones. It not only provides basic voice call functions, but also supports video calls, group calls, conference calls and other communication methods. VoIP also has advanced functions such as call forwarding and voice mailbox to meet users' diverse communication needs.
[0048] The SPEEX algorithm has low decoding latency, which is critical for real-time voice communications; low latency means that mining vehicle terminals can experience a smoother and more natural conversation experience when making voice calls. Although SPEEX is a lossy compression algorithm, it can maintain high voice quality at a lower bit rate through sophisticated encoding technology. The SPEEX algorithm shows strong adaptability in unstable network environments.
[0049] The SPPX algorithm is used to convert audio data into digital voice signals. During the transmission process, due to its discreteness and coding characteristics, it is more resistant to external interference. Even in a complex electromagnetic environment, it can effectively reduce noise interference and ensure the clarity and accuracy of voice signals. It can also reduce the bandwidth required for data transmission while ensuring voice quality, which enables digital voice signals to be transmitted with high quality over longer distances to meet the needs of remote communications.
[0050] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A mining SIP network telephone communication system based on CAN bus, characterized in that: include: The hardware part includes a mine vehicle terminal and a voice amplifier. The mine vehicle terminal is connected to the voice amplifier through a CAN bus. The voice amplifier has a speaker and a microphone. The mine vehicle terminal has a WIFI antenna and a WIFI module. The software part adopts C / S mode and is integrated on the mining vehicle terminal. It includes a client and a server. The client sends a request, and the server transmits data according to the request and feeds back the processed result to the client. The server establishes a session with the VOIP server through the RTCP protocol / RTP protocol or SDP protocol and transmits data. The mining vehicle terminal uses the SIP protocol stack to send audio data in SPEEX format based on the CAN bus.
2. The CAN bus-based mining SIP network telephone communication system according to claim 1 is characterized in that: The data transmission between the mining vehicle terminal and the voice amplifier is specifically as follows: The microphone collects audio data and sends it to the CODEC chip in the voice amplifier. The CODEC chip encodes the audio data into PCM data. The SPEEX encoder in the voice amplifier compresses the PCM data and sends the compressed SPEEX data to the mining vehicle terminal through the CAN bus. The mining vehicle terminal decodes the SPEEX data into PCM data through the SPEEX decoder and compresses it into PCMU / A data. The PCMU / A data is then sent to the VoIP server through WIFI. The VoIP server sends the PCMU / A audio data to the mine vehicle terminal via WIFI. The mine vehicle terminal decompresses the PCMU / A data into PCM data. The mine vehicle terminal compresses the PCM data using the SPEEX algorithm. The compressed SPEEX data is sent to the voice amplifier via the CAN bus. The voice amplifier decompresses the SPEEX data using the SPEEX algorithm into PCM data and sends it to the CODEC chip. The CODEC chip decodes the PCM data into analog voice data and sends it to the speaker for playback.
3. The CAN bus-based mining SIP network telephone communication system according to claim 1 is characterized in that: A session channel and a media stream channel are established between the server and the VOIP server. The session channel establishes a session between the mining vehicle terminal and the voice broadcaster based on the SDP protocol and transmits system control commands. The media stream channel transmits audio and video data based on the RTCP protocol / RTP protocol.
4. The mining SIP network telephone communication system based on CAN bus according to claim 1 is characterized in that: The C / S mode interaction of the software part is specifically as follows: Program initialization, using IP address 0.0.0.0 as the internal server address, the client uses port 6668 as the control interaction port, in the control interaction thread, receives the data sent by the client through the callback function, and implements SIP registration server IP address initialization, SIP registration phone number initialization, SIP registration password initialization, SIP 10s automatic answer initialization, SIP thread creation, SIP thread reset and restart, get the current call status, answer the call, hang up the call, get the other end number, get the registration status, and make a call through protocol parsing; The client uses 6669 as the data interaction port. In the data interaction thread, the SPEEX data sent by the client is received through the callback function and decoded and stored in the buffer. The SIP protocol stack extracts the data in the buffer every 20ms and sends it to the network. The PCMU / PCMA voice data received from the network is converted into PCM data and then SPEEX encoded and stored in the buffer, and then sent to the client to realize voice stream data interaction.
5. The CAN bus-based mining SIP network telephone communication system according to claim 4 is characterized in that: The program of the SIP protocol stack is initialized, and the server IP, client IP, authentication user name, display name, registration password, set user name, and whether to automatically answer the call in 10 seconds are set as global variables, and at the same time, a SIP main thread, a SIP timeout thread, a local incoming call ringing thread, and a remote outgoing call ringing thread are created.
6. The mining SIP network telephone communication system based on CAN bus according to claim 5 is characterized in that: The local incoming call ringing thread is initialized and determines whether it is in the host incoming call ringing state. If it is in the ringing state, it rings, otherwise it does not ring; the remote outgoing call ringing thread is initialized and determines whether it is in the remote outgoing call ringing state. If it is in the ringing state, it rings, otherwise it does not ring.
7. The CAN bus-based mining SIP network telephone communication system according to claim 5 is characterized in that: In the SIP main thread, SIP state initialization, SDP state initialization, UDP initialization, SIP registration initialization, and SPEEX algorithm initialization are first performed, and then a state machine loop is entered. In the loop, the SIP registration function is first performed. If the registration is not successful, the registration is performed once every 5 seconds, and if the registration is successful, the registration is performed once every 5 minutes. If the registration is not successful, the registration will be performed several times, and then the registration will not be performed quickly to prevent the SIP server protection mechanism from being triggered. Then, the SIP heartbeat sending function is performed. After the registration state machine changes to registration, the OPTION heartbeat is actively sent to the server every 60 seconds. Then, the server data query, dialing action, and hang-up action are obtained through the SDP / UDP protocol to change the state machine state.
8. The CAN bus-based mining SIP network telephone communication system according to claim 1 is characterized in that: The mining vehicle terminal performs encoding and decoding conversion on the PCM voice data and the SPEEX voice data, and the specific steps are as follows: S1. Speech signal preprocessing: Frame and window the speech signal to extract short-term speech signal segments suitable for encoding; S2, linear prediction analysis: perform linear prediction analysis on each frame of speech signal to extract vocal tract parameters; S3, codebook search: search for the best excitation vector combination in the adaptive codebook and the fixed codebook; S4, quantization and encoding: quantizing and encoding the searched optimal excitation vector sequence number and its gain; S5, Synthesis and Evaluation: Generate a synthesized speech signal through a synthesis filter using the quantized parameters and excitation vector, and evaluate the perceptual difference between it and the original speech signal; S6, transmission and decoding: The encoded data is transmitted to the receiving end, and decoded at the receiving end to restore the original voice signal.
9. The mining SIP network telephone communication system based on CAN bus according to claim 1 is characterized in that: The client performs the SIP voice phone function, first executes SIP configuration initialization and server registration, executes loop determination according to the task cycle, obtains SIP registration status and SIP state machine status, the SIP state machine includes hang up idle state, outgoing call, incoming call and connected call, executes SIP voice CAN frame and TCP message sending and receiving in the call state, and obtains the SIP state machine status at intervals of 200ms.
10. The CAN bus-based mining SIP network telephone communication system according to claim 9, characterized in that: In the call state, the SIP voice CAN frames and TCP messages are sent and received. Specifically, when multiple SIP control commands are triggered together, they will be filled in the buffer area in sequence, and the SIP control instructions will be executed in sequence. Within a task cycle, the execution of the called control instructions will be judged. The control instruction types include SIP modify IP, SIP modify number, SIP modify password, SIP automatic connection, SIP initialization, SIP Reboot, SIP obtain state machine, SIP make a call, SIP answer a call, SIP hang up, SIP obtain the other party's number and SIP obtain registration status.