CN108632249B - Codec unpacking implementation method and device for VoIP development and debugging - Google Patents
Codec unpacking implementation method and device for VoIP development and debugging Download PDFInfo
- Publication number
- CN108632249B CN108632249B CN201810253696.7A CN201810253696A CN108632249B CN 108632249 B CN108632249 B CN 108632249B CN 201810253696 A CN201810253696 A CN 201810253696A CN 108632249 B CN108632249 B CN 108632249B
- Authority
- CN
- China
- Prior art keywords
- codec
- input information
- unpacking
- packet
- module
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/10—Architectures or entities
- H04L65/1059—End-user terminal functionalities specially adapted for real-time communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/65—Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention relates to a codec unpacking implementation method and a codec unpacking implementation device for VoIP development and debugging, wherein the codec unpacking implementation device comprises a pcap file analysis module, a codec decoding module and an SRTP decryption module, wherein the pcap analysis module is used for reading a pcap file and analyzing the pcap file layer by layer to acquire unpacking input information; the SRTP decryption module is used for decrypting the RTP packet according to the encryption key in the unpacking input information; and the codec decoding module is used for decoding different types of codecs and generating the wav file. When the invention decodes the codec, the corresponding codec module can be searched according to the codec information in the unpacked input information, different types of codecs correspond to different codec modules, thereby realizing the analysis of various voice codecs.
Description
Technical Field
The invention relates to the field of VoIP phones, in particular to a codec unpacking implementation method and device for VoIP development and debugging.
Background
In the VoIP development and debugging, the problem of sound is solved, and most intuitively, the sound can be directly heard. However, in development, only packets in a call can be captured, and the packets are encoded and some are encrypted. This is a significant problem for development and testing, and the quality of sound at that time cannot be determined.
At present, it is common to parse captured packets by wireshark, but it is only possible to parse simple codecs such as PCMU and PCMA. Many of the current voice calls are more than just these codecs. In addition, many of the bale plucking files are encrypted, and the existing wireshark can not realize decryption.
Disclosure of Invention
The invention aims to provide a codec unpacking realizing method and a codec unpacking realizing device for VoIP development and debugging, which can analyze a plurality of voice codecs.
In order to achieve the purpose, the invention adopts the technical scheme that:
a codec unpacking implementation method for VoIP development and debugging comprises the following steps:
step 1, capturing and analyzing a pcap file to obtain an SDP (service description protocol) packet, entering step 2 if the SDP packet is successfully obtained, and entering step 3 if the SDP packet is failed to be obtained;
step 2, obtaining unpacking input information from the SDP packet, judging whether the unpacking input information is complete or not, and entering step 4 if the unpacking input information is complete; if the unpacking input information is incomplete, acquiring missing unpacking input information from the log file so as to completely unpack the input information, and entering the step 4;
the unpacking input information comprises IP addresses and ports of two ends of a call, codec information and whether encryption is carried out, and if the encryption is carried out, the unpacking input information also comprises an encryption key;
step 3, acquiring partial unpacking input information by identifying the packet head of the RTP packet, then acquiring missing unpacking input information according to the log file so as to completely unpack the input information, and then entering step 4;
step 4, when the input information of unpacking is complete, judging whether the RTP packet is encrypted according to the input information of unpacking, and if the RTP packet is not encrypted, entering step 5; if the RTP packet is encrypted, decrypting the RTP packet according to the encryption key in the unpacking input information, and entering the step 5 after the decryption is finished;
and 5, searching a corresponding codec module according to the codec information in the unpacked input information, and decoding the codec by using the codec module to generate a playable wav file.
The invention also provides another technical scheme:
a codec unpacking realizing device for VoIP development and debugging comprises a pcap parsing module, an SRTP decryption module and a codec decoding module,
the pcap analysis module is used for reading a pcap file, analyzing the pcap file layer by layer, acquiring an SDP (service description protocol) packet and acquiring unpacking input information; if the SDP packet is failed to be acquired, acquiring partial unpacking input information by identifying the packet head of the RTP packet, and acquiring missing unpacking input information by combining a log file;
the SRTP decryption module is used for decrypting the RTP packet according to the encryption key in the unpacking input information;
the codec decoding module is provided with more than two codec modules; and the codec module is used for searching the corresponding codec module in the codec decoding module according to the codec information in the unpacked input information, decoding the codec by using the codec module and generating the wav file.
After the scheme is adopted, when the codec is decoded, the corresponding codec module can be searched according to the codec information in the unpacked input information, and different types of codecs correspond to different codec modules, so that the analysis of various voice codecs is realized. And the codec module is flexibly and conveniently arranged and is easy to be added in the using process. In addition, the method can facilitate developers to quickly analyze the pcap package; aiming at technical support and the condition of no site, a call scene can be reproduced by using a packet capture file (pcap file) and a log file of a phone.
Drawings
FIG. 1 is a block diagram of the present invention;
FIG. 2 is a flow chart of the present invention.
Detailed Description
Fig. 1 is a block diagram of a codec unpacking device for VoIP development and debugging according to the present invention, and as shown in fig. 1, the codec unpacking device for VoIP development and debugging includes a pcap parsing module, an SRTP decryption module, and a codec decoding module.
The device comprises a pcap analysis module, an SDP (service description protocol) package and an unpacking module, wherein the pcap analysis module is used for reading a pcap file, analyzing the pcap file layer by layer, and acquiring the SDP package and unpacking input information; if the SDP packet is failed to be acquired, acquiring partial unpacking input information by identifying the packet head of the RTP packet, and acquiring missing unpacking input information by combining a log file.
The RTP packet is obtained by analyzing the pcap file, and is specifically identified by the following procedures:
according to the format of the network packet, identifying whether the network packet is an Ethernet frame, an IP packet or a UDP packet layer by layer;
whether the UDP payload length is greater than 12 bytes;
whether the first two bits of the UDP payload are 0x10, i.e., whether the version number of the RTP header is 2;
whether the RTP stream load type does not change;
whether the sequence number of the RTP stream is incremented;
whether the SSRC value of the RTP packet is a fixed value or not.
And the SRTP decryption module is used for decrypting the RTP packet according to the encryption key in the unpacking input information.
The codec decoding module is provided with more than two codec modules; and the codec module is used for searching the corresponding codec module in the codec decoding module according to the codec information in the unpacked input information, decoding the codec by using the codec module and generating the wav file.
Fig. 2 is a flowchart of a codec unpacking implementation method for VoIP development and debugging according to the present invention, and as shown in fig. 2, the flowchart of the codec unpacking implementation method for VoIP development and debugging specifically includes the following steps:
step 1, capturing and analyzing the pcap file to obtain an SDP packet, if the SDP packet is successfully obtained, entering step 2, and if the SDP packet is failed to be obtained, entering step 3.
Step 2, obtaining unpacking input information from the SDP packet, judging whether the unpacking input information is complete or not, and entering step 4 if the unpacking input information is complete; and if the unpacking input information is not complete, acquiring missing unpacking input information from the log file so as to completely unpack the input information, and entering the step 4.
The unpacking input information comprises IP addresses and ports of two call ends, codec information and whether encryption is carried out, and if the encryption is carried out, the unpacking input information also comprises an encryption key; the codec information includes a codec name, payload type, sampling rate, bit rate, and Ptime (media packetization time length).
And 3, acquiring partial unpacking input information by identifying the packet head of the RTP packet, acquiring missing unpacking input information according to the log file to completely unpack the input information, and entering the step 4.
Step 4, when the input information of unpacking is complete, judging whether the RTP packet is encrypted according to the input information of unpacking, and if the RTP packet is not encrypted, entering step 5; if the RTP packet is encrypted, the RTP packet is decrypted according to the encryption key in the unpacking input information, and the step 5 is carried out after the decryption is finished.
And 5, searching a corresponding codec module according to the codec information in the unpacked input information, and decoding the codec by using the codec module to generate a playable wav file.
The key point of the invention is that when the codec is decoded, the corresponding codec module can be searched according to the codec information in the unpacked input information, different types of codecs correspond to different codec modules, thereby realizing the analysis of various voice codecs. And the codec module is flexibly and conveniently arranged and is easy to be added in the using process. In addition, the method can facilitate developers to quickly analyze the pcap package; aiming at technical support and the condition of no site, a call scene can be reproduced by using a packet capture file (pcap file) and a log file of a phone.
The above description is only exemplary of the present invention and is not intended to limit the technical scope of the present invention, so that any minor modifications, equivalent changes and modifications made to the above exemplary embodiments according to the technical spirit of the present invention are within the technical scope of the present invention.
Claims (2)
1. A codec unpacking realizing method for VoIP development and debugging is characterized in that: the method comprises the following steps:
step 1, capturing and analyzing a pcap file to obtain an SDP (service description protocol) packet, entering step 2 if the SDP packet is successfully obtained, and entering step 3 if the SDP packet is failed to be obtained;
step 2, obtaining unpacking input information from the SDP packet, judging whether the unpacking input information is complete or not, and entering step 4 if the unpacking input information is complete; if the unpacking input information is incomplete, acquiring missing unpacking input information from the log file so as to completely unpack the input information, and entering the step 4;
the unpacking input information comprises IP addresses and ports of two ends of a call, codec information and whether encryption is carried out, and if the encryption is carried out, the unpacking input information also comprises an encryption key;
step 3, acquiring partial unpacking input information by identifying the packet head of the RTP packet, then acquiring missing unpacking input information according to the log file so as to completely unpack the input information, and then entering step 4; the RTP packet is obtained by analyzing the pcap file, and is specifically identified by the following procedures:
according to the format of the network packet, identifying whether the network packet is an Ethernet frame, an IP packet or a UDP packet layer by layer;
whether the UDP payload length is greater than 12 bytes;
whether the first two bits of the UDP payload are 0x10, i.e., whether the version number of the RTP header is 2;
whether the RTP stream load type does not change;
whether the sequence number of the RTP stream is incremented;
whether the SSRC value of the RTP packet is a fixed value;
step 4, when the input information of unpacking is complete, judging whether the RTP packet is encrypted according to the input information of unpacking, and if the RTP packet is not encrypted, entering step 5; if the RTP packet is encrypted, decrypting the RTP packet according to the encryption key in the unpacking input information, and entering the step 5 after the decryption is finished;
and 5, searching a corresponding codec module according to the codec information in the unpacked input information, and decoding the codec by using the codec module to generate a playable wav file.
2. A codec unpacks the implement device for VoIP development and debugging, its characteristic lies in: the method of claim 1 capable of being performed comprising a pcap parsing module, an SRTP decryption module, and a codec decoding module,
the pcap analysis module is used for reading a pcap file, analyzing the pcap file layer by layer, acquiring an SDP (service description protocol) packet and acquiring unpacking input information; if the SDP packet is failed to be acquired, acquiring partial unpacking input information by identifying the packet head of the RTP packet, and acquiring missing unpacking input information by combining a log file;
the SRTP decryption module is used for decrypting the RTP packet according to the encryption key in the unpacking input information;
the codec decoding module is provided with more than two codec modules; and the codec module is used for searching the corresponding codec module in the codec decoding module according to the codec information in the unpacked input information, decoding the codec by using the codec module and generating the wav file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810253696.7A CN108632249B (en) | 2018-03-26 | 2018-03-26 | Codec unpacking implementation method and device for VoIP development and debugging |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810253696.7A CN108632249B (en) | 2018-03-26 | 2018-03-26 | Codec unpacking implementation method and device for VoIP development and debugging |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108632249A CN108632249A (en) | 2018-10-09 |
CN108632249B true CN108632249B (en) | 2020-12-08 |
Family
ID=63696325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810253696.7A Active CN108632249B (en) | 2018-03-26 | 2018-03-26 | Codec unpacking implementation method and device for VoIP development and debugging |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108632249B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104813286A (en) * | 2012-12-20 | 2015-07-29 | 英特尔公司 | Method, apparatus, system for continuous automatic tuning of code regions |
CN106921609A (en) * | 2015-12-25 | 2017-07-04 | 中兴通讯股份有限公司 | Calling playback control method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7885396B2 (en) * | 2005-06-23 | 2011-02-08 | Cisco Technology, Inc. | Multiple simultaneously active telephone calls |
CN101247432B (en) * | 2007-07-18 | 2011-12-07 | 北京九合创胜网络科技有限公司 | VoIP voice data real-time monitoring method and device |
CN102882846A (en) * | 2012-08-17 | 2013-01-16 | 广东世纪网通信设备有限公司 | IP voice restoration method and device |
-
2018
- 2018-03-26 CN CN201810253696.7A patent/CN108632249B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104813286A (en) * | 2012-12-20 | 2015-07-29 | 英特尔公司 | Method, apparatus, system for continuous automatic tuning of code regions |
CN106921609A (en) * | 2015-12-25 | 2017-07-04 | 中兴通讯股份有限公司 | Calling playback control method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108632249A (en) | 2018-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5167501B2 (en) | Network monitoring system and its operation method | |
US9077667B2 (en) | Computing latency introduced by media transcoding operations | |
US10691748B2 (en) | Methods and apparatus to process call packets collected in a communications network | |
US20130185554A1 (en) | Method for analyzing coded data streams simultaneously transmitted in ip networks | |
RU2008105041A (en) | PROTECTION OF CONTENT ELEMENTARY FLOWS | |
WO2020006912A1 (en) | Method and device for analyzing network transmission quality, computer equipment and storage medium | |
CA2697799C (en) | Method for analyzing simultaneously transmitted, encoded data streams | |
US8018918B2 (en) | Methods and apparatus for dual-tone multi-frequency signal conversion within a media over internet protocol network | |
US8769665B2 (en) | IP communication device as firewall between network and computer system | |
CN107707549B (en) | Device and method for automatically extracting application characteristics | |
JP5242683B2 (en) | Improvements in or related to monitoring in the Internet Protocol (IP) domain | |
CN108632249B (en) | Codec unpacking implementation method and device for VoIP development and debugging | |
van De Wiel et al. | Enabling non-expert analysis of large volumes of intercepted network traffic | |
WO2015165419A1 (en) | Service signaling tracing method and device and computer storage medium | |
US8959025B2 (en) | System and method for automatic identification of speech coding scheme | |
WO2017084310A1 (en) | Method and device for transmitting mp4 video source | |
Wu et al. | Monitoring video resolution of adaptive encrypted video traffic based on HTTP/2 features | |
Pokharel et al. | Can Android VoIP voice conversations be decoded? I can eavesdrop on your Android VoIP communication | |
Kao et al. | Forensic artifacts of network traffic on WeChat calls | |
KR101893829B1 (en) | A method for encrypting and decrypting a record file through data modulation | |
US7526072B2 (en) | Audio device, system and method for archiving audio files based on distributed audio phone data received over a data network in encrypted or non-encrypted form | |
Jiang et al. | Real-time covert VoIP communications over smart grids by using AES-based audio steganography | |
EP3544253B1 (en) | Acquisition of files from an srtp-stream | |
CN107733833B (en) | Voice intercommunication method and system for CDMA and VoLTE terminals | |
Mohemmed Sha et al. | Forensic framework for skype communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |