H.323 網網網網網網網網 網網網網網網網網 The Design and Implementation of Audio M onitoring and Recording System for H.323- based Internet Phone Speaker : 黃黃黃 Advisor : 黃黃黃 黃黃 Data : 2008 07/25 1
H.323 網路電話音訊監控與錄製系統之研製
The Design and Implementation of Audio Monitoring and Recording System for H.323-based Internet Phon
e
Speaker : 黃威穎Advisor : 柯開維 教授Data : 2008 07/251
Outline
Introduction Background Audio Recover System Framework Compare with Wireshark Conclusion Demo
2
Introduction
VoIP has already been the killer application.
Requirement of the audio recording system.
VoIP protocol H.323 SIP (Session Initiation Protocol)
Transport protocol RTP RTCP
3
Background
H.323 H.323 Related Software H.323 Related Protocol WinPcap How to Build WAVE File
4
H.323
H.323 is a multimedia conferencing protocol, which includes audio, video, and data conferencing over packet-switched networks.
Element of H.323 system Terminals Gatekeeper Multipoint Control Units (MCU) Gateway5
H.323 Framework
System
conrtrol
H.225Call
Signaling
R T P / R T C P
( R e a l - t i m e T r a n s p o r t
p r o t o c o l / R e a l - t i m e
T r a n s p o r t C o n t r o l
P r o t o c o l )
I P
U D PA u d i o C o d i n g / D e c o d i n g
( G . 7 1 1 )
H.225RAS
(Registration, Admission, and Status)
H.245Control
T C P
6
The Flowchart of H.323 Call Caller PC Callee PC Gatekeeper
Gatekeepr Request
Gatekeeper Confirm
Registration Request
Registration Confirm
Gatekeep Request
Gatekeeper Confirm
Registration Request
Registration Confirm
Admission Request
Admission Confirm
Admission Request
Admission Confirm
Setup
Call Proceeding
Alerting
Connect
Master Slave Determination
Terminal Capability Set
Open Logical Channel
RTP or RTCP
RTP or RTCP
.
.
.
RAS
H.225
RAS
H.225
H.245
Voice communication
7
H.323 Related Software
OpenH323 An open source library for the
development of applications using the H.323 protocol.
GNU Gatekeeper (GUNGK) An open source project that
implements an H.323 gatekeeper. Implement most of these functions
based on the OpenH323 protocol stack.8
H.323 Related Protocol
Q,931/H.225 H.245 RTP
9
Q.931/H.225
Q.931/H.225 call signaling is used to establish a H.323 call.
Q.931 Header StructureName Length(Octets) Note
Protocol Discriminator
1Always 0x08 for ISDN
Call Reference 1,2 or 3The call reference field
Message Type 2 Detail
IEs (Information Elements) various
Detail
10
H.245
H.245 is a control channel protocol and involves the line transmission of non-telephone signals.
H.245 signaling is intended to be carried out in parallel to H.225 signaling.
11
Important H.245 Message
Message Note Possible reply
Master-Slave Determinatio
n
Determines which terminal is the master.
Acknowledge, Reject, Release
Capability Exchange
Contains information about a terminal's capability.
Acknowledge, Reject, Release
Open and Close of Logical
Channels
Transport of audio and data information. Acknowledge,
Reject, Confirm
Close the H.245 Control
Channel
Indicates the end of the H.245 session.
No other H.245 message
12
RTP Header Structure
P : Padding Ex : Extension CSRC : contributing source identifiers count M : Mark
CSRC(Contributing source)……….
SSRC(Synchronization source)
SSRC(Synchronization source)
Timestamp
Timestamp
Sequence Number
Payload TypeMCSRC CounterExPVersion
1514131211109876543210
CSRC(Contributing source)……….
SSRC(Synchronization source)
SSRC(Synchronization source)
Timestamp
Timestamp
Sequence Number
Payload TypeMCSRC CounterExPVersion
1514131211109876543210
13
Payload Type
RTP PT
Name TypeClock rate
(Hz)
Audio channel
sReferences
0 PCMU Audio 8000 1 RFC 3551
2 G721 Audio 8000 1 RFC 3551
3 GSM Audio 8000 1 RFC 3551
8 PCMA Audio 8000 1 RFC 3551
9 G722 Audio 8000 1 RFC 3551
15 G728 Audio 8000 1 RFC 3551
18 G729 Audio 8000 1
14
WinPcap An architecture for packet capture and
network analysis for the Win32 platforms.
Application
Wpcap.dll
Packet.dll User Level
Kernel LevelNetgroup Packet Filter Device Driver
Packet
15
How to Build WAVE File
WAVE file format is a subset of RIFF (Resource Interchange File Format) specification.
16
WAVE file format
ByteRate = SampleRate * NumChannels * BitsPerSample / 8
BlockAlign = NumChannels * BitsPerSample / 8
Chunk ID
Chunk Size
Format
Subchunk 1 ID
Subchunk 1 Size
Audio Format
Num Channels
Sample Rate
Byte Rate
Block Align
Bits Per Sample
Subchnuk 2 ID
Subchunk 2 Size
Data
Field Size(Byte)
4
2
4
4
4
4
2
2
2
4
4
4
4
Subc
hunk
2 S
ize
RIFF chunk
fmt subchunk
Data subchunk
17
Audio Recover
Silence Suppression Synchronization Problem
Caller Monitor System Callee
Connect
RTP
RTP
RTP
RTP
(Time Instant of packet captured)
18
Silence Suppression
Stop sending RTP packets during silent periods is known as "Silence Suppression".
How to detect Silence Suppression? RTP mark bit RTP timestamp
19
Silence Suppression Handle
355920 - 355680 = 240((357120 – 355920) / 240) - 1 = 4
20
Synchronization Problem Handle
……
……
Time
Caller Audio Packet
Callee Audio Packet 21 3 4 5 6 7 8 9
1 2 3 4
……
……
Time
Caller Audio Packet
Callee Audio Packet 21 3 4 5 6 7 8 9
1 2 3 40 0 0 0 0
Combine
21
System Framework
System Environment of Network System Structure The Flow of Packet Handle The Interface between RecDrv_h323.
dll and RecApp.exe
22
System Environment of Network
Intranet
Ethernet
PDASmart Phone Internet
Phone
Software Internet Phone
Switch
Wireless Internet Phone
Audio Monitoring and Recording System for H.323-base Internet Phone
Wirless Network
Gate KeeperGate Keeper
Gate Keeper
23
System Structure
Packet
Packet Buffer
Monitor List Protocol Analyzer
RecDrv_h323.dll
Event Handle
H.323 Signal Recorder
Audio Recover
RecApp.exe
24
The Flow of Packet Handle
Packet Capture
Callback function call
H.323 signal event
Finish
RecDrv_h323.dll(H323 Packet Analysis)
RecApp.exe(EveHandleApp)
UDP TCP
RTP analysisOther H.323 signal
analysis
Does this IP need to be recorded?
TCP or UDP?
Is the port correct?
Is it H.323 signal?
Yes Yes
Yes
Finish
No
No No
H.323 signal handler
Silence Suppression handler
RTP payload decoder and file handler
Silence RTP event
RTP data eventSynchronization Problem handler
Synchronization RTP event
Event Type handler
25
The Interface between RecDrv_h323.dll and RecApp.exe
Callback function void handleData(int channelID, int evtType, str
uct tm *timeStamp, string sourceAddr, string destinAddr, char* buff, int buffSize, int xtraInfo);
H323 Packet Analysis interface int RDSysStart(callback _callback); //ret
urn: 1 means success, 0 means failure int RDSetChannelParams(int buffSize); //retu
rn: 1 means success, 0 means failure
26
The Interface between RecDrv_h323.dll and RecApp.exe int RDInitChannel(string IPAddr, int& channelID);
//return: 1 means success, 0 means failure int ReleaseChannel(string IPAddr) //retu
rn: 1 means success, 0 means failure int GetDrvCap(char** drvInfo)
//return the number of network interface card int StartpCap(int inum) //input the NIC number
//return: 1 means success, 0 means failure
int RDSysShutdown() //return: 1 means success, 0 means failure
27
Compare with Wireshark
FunctionAudio Monitoring and Recording System for H.323-based Internet
Phone
Wireshark
Multiple conference monitoring
Yes Yes
Silence suppression recovering
Yes Yes
Asynchronization resolution Yes Yes
VoIP protocol support Only H.323, but system can be extend
Many
State monitoring Yes No
28
Compare with Wireshark (cont.)
FunctionAudio Monitoring and Recording System for H.323-based Internet
Phone
Wireshark
Raw/Wave file generation for tracking
Yes No
Ease for post processing
Yes No
Present detailed information
Detail and easy to understand summary
information
Implicit and time-based
handshaking message
User interface miscellaneous
Specific design for recording/monitoring
Design for packet analyzing
29
Conclusion
This research implements a system that provides H.323 audio phone analysis and audio recover.
It can deal with silence suppression problem, asynchronization problem and multiple H.323 phone at the same time.
30
Future work
Extend tp SIP or some famous protocols like skype, skinny(Cisco)
Accommodate various audio codec, eg. GSM, ADPCM
Monitor and recover the mulitpoint conference
31
Demo
Other software OpenH323 Golasoft Packet Player
Single phone call Multiple phone calls
64 phone calls
32