1 H.323 網網網網網網網網網網網網網網網網 The design and implementation of audio monitoring and recording system for H.323- based internet phone Advisor : Dr. Kai- Wei Ke Speaker : Wei-Ying Huang Data : 2008 06/03
1
H.323網路電話音訊監控與錄製系統之研製
The design and implementation of audio monitoring and recording system
for H.323-based internet phone
Advisor : Dr. Kai-Wei Ke
Speaker : Wei-Ying Huang
Data : 2008 06/03
2
Outline
Introduction Background Related Protocol System Framework Conclusion Future work Reference Demo
3
Introduction
VoIP has already been killer application. Requirement of audio recording system. VoIP protocol
– H.323– SIP (Session Initiation Protocol)
Transport protocol– RTP– RTCP
4
Background
H.323 H.323 related software WinPcap Codec How to Build WAVE File Silence Suppression Handle
5
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)– Gateway
7
H.323 related software
OpenH323– An open source library for development of
applications using the H.323 protocol.– Base on PWLib library.
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
WinPcap
An architecture for packet capture and network analysis for the Win32 platforms.
It is composed of– NPF (Netgroup Packet Filter )– Packet.dll– Wpcap.dll
10
Codec
RTP PT Name Type Clock rate (Hz)Audio
channelsReferences
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
11
How to Build WAVE File
WAVE file format is a subset of RIFF (Resource Interchange File Format) specification.
12
WAVE file format
BlockAlign = NumChannels * BitsPerSample / 8
ByteRate = SampleRate * NumChannels * BitsPerSample / 8
13
Silence Suppression Handle
Stop sending RTP packets during silent periods is known as "Silence Suppression“.
How to detect Silence Suppression?– RTP mark bit– RTP timestamp
16
Q.931 Header structure
Name Length(Octets) Note
Protocol Discriminator
1 Always 0x08 for ISDN
Call Reference. 1,2 or 3 The call reference field
Message Type 2 Detail
IEs (Information Elements)
various Detail
17
H.225
H.225 call signaling is used to establish H.323 call
It was derived from Q.931, but was modified to be suitable for use on a packet based network
18
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.
19
Important H.245 Message
Message Note Possible reply
Master-Slave Determination
Determines which terminal is the master.
Acknowledge, Reject, Release
Terminal Capability Set
Contains information about a terminal's capability.
Acknowledge, Reject, Release
Open Logical Channel
Transport of audio and data information.
Acknowledge, Reject, Confirm
End Session Command
Indicates the end of the H.245 session.
No other H.245 message
20
RTP Header structure
P : Padding Ex : Extension CSRC : contributing source identifiers count M : Mark
21
The Flow of packet Handle
Packet Capture
Callback function call
H.323 signal event
Finish
H323 Packet Analysis
EveHandleApp
UDP TCP
RTP analysisOther H.323 signal
analysis
Does this IP need to be recorded
TCP or UDP
Check portIs It H.323
signal
Yes Yes
Yes
Finish
No
No No
Event handle
H.323 signal handleSilence Suppression
handle
Open a thread to deal with RTP
payload decode and file handle
Silence event RTP data event
22
Environment ofNetwork
Intranet
企業內部乙太網路
PDASmart Phone
網路電話桌上型電腦網路軟體電話
Switch
無線網路電話
H323Rec_Drv
Wirless Network
IP PBX
Gate Keeper
Gate Keeper
Gate Keeper
23
H323 Packet Analysis and EveHandleApp interface
Callback function– void handleData(int channelID, int evtType, struct
tm *timeStamp, string sourceAddr, string destinAddr, char* buff, int buffSize, int xtraInfo);
H323 Packet Analysis interface– int RDSysStart(callback _callback);
//return: 1 means success, 0 means failure– int RDSysShutdown()
24
H323 Packet Analysis and EveHandleApp interface (cont.)
– int GetDrvCap() //return the number of network interface card
– int StartpCap(int inum) //input the NIC number //return: 1 means success, 0 means failure
– int RDInitChannel(string IPAddr, int& nChannelID); //return: 1 means success, 0 means failure
– int ReleaseChannel(string IPAddr) //return: 1 means success, 0 means failure
25
Conclusion
This research implements a system that provides H.323 audio phone analysis and audio recover.
It can deal with silence suppression problem and multiple H.323 phone at the same time.
26
Future work
User interface Deal with synchronization problem Test the capability when there are more
H.323 phones Extend the SIP or other protocol analysis
27
Reference
OpenH323, http://www.voxgratia.org/documents.html GunGK, http://www.gnugk.org/h323manual-zh.html Q.931, http://www.freesoft.org/CIE/Topics/126.htm http://www.protocols.com/pbook/h323.htm http://www.networksorcery.com/enp/protocol/rtp.htm http://www.voip-info.org/wiki/view/
RTP+Silence+Suppression WinPcap,http://www.winpcap.org/docs/docs_40_2/
html/main.html http://ccrma.stanford.edu/CCRMA/Courses/422/
projects/WaveFormat/
29
Q.931 Message Type
Value Name Direction
0x01 Altering Called -> Caller
0x02 Call Proceeding Called -> Caller
0x05 SETUP Caller -> Called
0x07 Connect Called -> Caller
0x45 Disconnect
0x5A Release Complete
0x62 Facility