Está en la página 1de 106

n tt nghip

LI NI U

LI NI U
Hin nay, Internet tr nn ph bin, cc cng ngh mng ngy cng hon thin, chnh nhng yu t gip cho cc dch v mi ngy cng pht trin n r em li nhiu li ch cho cuc sng ca con ngi. Mt trong nhng cng ngh ang c quan tm nht hin nay chnh l Voice Over IP (VoIP) l mt cng ngh cho php truyn thoi s dng giao thc mng IP. Vi nhng u im ni bt c v tnh nng cng nh tnh kinh t , VoIP ang thu ht c s quan tm khng ch ca cc nh khai thc, cc nh sn xut m c nhng ngi s dng c bit l cc doanh nghip. S pht trin ca cc doanh nghip ko theo nhu cu trao i thng tin trong ni b vi nhau v ni b vi bn ngoi ngy cng tng. Hu ht cc doanh nghip u xy dng mt mng LAN hay WAN cho ring mnh. Mt cu hi t ra l lm th no va gim chi ph cc cuc gi bn trong ni b ra bn ngoi PSTN va tn dng c c s h tng c sn ca mng IP? Mt trong nhng gii php c s dng trong cc doanh nghip va v nh hin nay, l s dng phn mm m ngun m Asterisk nh mt tng i IP PBX vi y chc nng ca mt PBX. Nhn thy c kh nng pht trin ca cng ngh in thoi da trn nn IP v nhu cu cn thit ca doanh nghip cng nh u th ca Asterisk, n ny nghin cu Xy dng h thng VoIP cho doanh nghip da trn phn mm m ngun m Asterisk nhm xy dng v thit k mt h thng thoi p ng trong thc t cho cc doanh nghip. Ni dung cua n ny c trnh by trong bn chng: Chng 1 Tng quan v VoIP

SVTH: Phm Anh c

Lp K Thut Vin Thng K47

n tt nghip

LI NI U

Chng 2 Kin trc mng VoIP Chng 3 Cc giao thc truyn ti v bo hiu trong VoIP Chng 4 Xy dng h thng VoIP da trn Asterisk

TP.H Ch Minh, ngy 30 thng 11 nm 2011 Sinh vin: Phm Anh c

SVTH: Phm Anh c

Lp K Thut Vin Thng K47

n tt nghip

LI NI U

MC LC DANH SCH HNH V...................................................................10 CHNG 1 TNG QUAN V VOIP..........................................13


1.1. Gii thiu tng quan VoIP....................................................................................13 1.1.1. Hnh thnh v pht trin VoIP........................................................................13 1.1.2. Cc thnh phn mng VoIP...........................................................................15 1.2. Cc kiu kt ni VoIP............................................................................................18 1.2.1. M hnh PC to PC...........................................................................................18 1.2.2. M hnh PC to Phone.....................................................................................19 1.2.3. M hnh Phone to Phone................................................................................20 1.3. c tnh ca VoIP.................................................................................................20 1.3.1. u im ca VoIP..........................................................................................20 1.3.2. Nhc im ca VoIP....................................................................................22 1.4. ng dng ca VoIP...............................................................................................22 1.4.1. Dch v thoi qua Internet..............................................................................22 1.4.2. Thoi thng minh...........................................................................................23 1.4.3. Dch v tnh cc cuc gi............................................................................23 1.4.4.Dch v Callback Web.....................................................................................24 1.4.5. Dch v Fax qua IP.........................................................................................24 1.4.6. Dch v ADC..................................................................................................24 1.5.1. Tr..................................................................................................................25

SVTH: Phm Anh c

Lp K Thut Vin Thng K47

n tt nghip

LI NI U

1.5.2. Trt .............................................................................................................26 1.5.3. Mt gi tin.....................................................................................................26 1.6. iu khin d liu trong VoIP..............................................................................27

CHNG 2 KIN TRC MNG VOIP.....................................29 CHNG 3 CC GIAO THC TRUYN TI V BO HIU TRONG VOIP....................................................................................42
3.1.1.3. Lp Internet (Internet Layer)......................................................................45 3.1.2.2. IP Datagram................................................................................................48 ......................................................................................................................................49 3.2. Giao thc RTP, RTCP v RSTP...........................................................................54 3.2.1. RTP (Real-time Transport Protocol).............................................................54

CHNG IV XY DNG H THNG VOIP DA TRN ASTERISK.........................................................................................67


4.1. Tng quan h thng Asterisk................................................................................67 4.1.1. Gii thiu chung............................................................................................67 4.1.2. Kin trc Asterisk..........................................................................................68 4.1.3. Nhng tnh nng c bn ca Asterisk...........................................................70 4.3.1.1. Asterisk l mt tng i PBX.....................................................................70 4.3.1.2. Nhng tnh nng c bn.............................................................................71 4.3.1.3. Asterisk l mt h thng phn phi cuc gi tin tin..............................73 4.3.1.4. Asterisk l mt h thng IVR (Interactive Voice Response).....................73 4.3.2. Cc m hnh trin khai h thng Asterisk.....................................................74

SVTH: Phm Anh c

Lp K Thut Vin Thng K47

n tt nghip

LI NI U

4.3.2.1. Tng i VoIP PBX....................................................................................74 4.3.2.2. Kt ni IP PBX vi PBX............................................................................75 4.3.2.3. Kt ni cc Server Asterisk........................................................................76 4.3.2.4. Cc ng dng IVR, VoiceMail, Conference Call.......................................77 4.3.2.5. Chc nng phn phi t ng ACD...........................................................78 4.3.2.6. H thng Call Center..................................................................................79 4.4. Giao thc IAX (Inter Asterisk - eXchange) trong Asterisk...............................80 4.5. Dialplan trong Asterisk.........................................................................................82 4.6. M hnh trin khai h thng Asterisk...................................................................84 4.6.1. Thit b phn cng.........................................................................................84 4.6.2. Ci t phn mm..........................................................................................85 4.6.2.1. Ci t h iu hnh Fedora 16 (Tham kho ph lc 1)............................85 4.6.2.2. Ci t Asterisk..........................................................................................85 4.6.2.3. Ci t Softphone X Lite.............................................................................86

KT LUN.........................................................................................91 LI CM N...................................................................................105
TI LIU THAM KHO..........................................................................................106

SVTH: Phm Anh c

Lp K Thut Vin Thng K47

n tt nghip

DANH MC T VIT TT

DANH MC CC T VIT TT
A. ACD ACF ACK ARJ ARP ARQ ASCCII Automatic Call Distribution Admission Confirmation Acknowledgement Admission Reject Address Resolution Protocol Admission Request American Standard Code for Information Interchange ATA C. CODEC D. DNS DRQ E. ETSI G. European Technical Standard Institute Vin tiu chun k thut chu u Domain Name Service Disengage Request Dch v tn min Yu cu gii phng Coder/Decoder Analog Telephone Adaptors Adaptor dng cho in thoi Analog T ng phn phi cuc gi Xc nhn yu cu truy nhp Xc nhn T chi truy nhp Giao thc ARP Yu cu truy nhp B k t ASCCII

n tt nghip

DANH MC T VIT TT

GW H. HTTP I. IAX IETF IP IPX IRQ ISDN ITU-T

Gateway

Hypertext Transfer Protocol

Giao thc truyn siu vn bn

Inter Asterisk eXchange Internet Engineering Task Force Internet Protocol Internetwork Protocol Exchange Information Request Integrated Services Digital Nework International Telecommunication Union Telecommunication Standardization Interactive Voice Response

Giao thc IAX trong Asterisk

Giao thc Internet Chuyn i giao thc Internetwork Yu cu thng tin Mng s a dch v Hip hi vin thng quc t Tng tc thoi

IVR L. LAN MCU N. NAT O. OSI

Local Area Network Multipoint Controller Unit

Mng ni b B iu khin a im

Network address translator

Thong dch a ch mng

Opening System Interconnection

M hnh lin kt cc h

n tt nghip

DANH MC T VIT TT

thng m P. PBX PSTN R. RAS RSVP RTP RTCP S. SIP T. TCP U. UDP V. VoIP Voice over Internet Protocol Giao thc truyn thoi qua Internet User Data Protocol Giao thc UDP Transport Control Protocol Giao thc iu khin truyn ti Session initation protocol Giao thc iu khin phin truyn Remote Access Services Resource Reservation Protocol Real Time Protocol Real-time Transport Control Protocol Dch v truy nhp t xa Giao thc RSVP Giao thc thi gian thc Giao thc iu khin truyn ti thi gian thc Private Branch eXchange Public Switched Telephone Network Tng i ni b Mng in thoi chuyn mch cng cng

n tt nghip

DANH MC T VIT TT

n tt nghip

10

DANH SCH HNH V

DANH SCH HNH V Hnh 1-1: Mng in thoi v mng Internet tch bit nhau........13 Hnh 1-2: Mng hi t.......................................................................14 Hnh 1-3: M hnh phn lp chc nng...........................................17 Hnh 1-4: M hnh PC to PC.............................................................19 Hnh 1-5: M hnh PC to Phone.......................................................19 Hnh 1-6: M hnh Phone to Phone..................................................20 Hnh 1-7: Cc mc nh gi cht lng thoi...........................25 Hnh 1-8: Qa trnh x l d liu thoi trong h thng VoIP.......28 Hnh 2-1: Cu hnh mng in thoi IP...........................................30 Hnh 2-2: M hnh mng H.323........................................................30 Hnh 2-3: Bo hiu trc tip gia cc thit b u cui..................33 Hnh 2-4: Bo Hiu nh tuyn thng qua Gatekeeper..................33 Hnh 2-5: M hnh mng SIP............................................................35 Hnh 2-6: Kt ni Proxy Server, Registration Server v User Agent...................................................................................................37 Hnh 2-7: Mng SIP s dng Gateway............................................40 Hnh 3-1: M hnh OSI v TCP/IP..................................................42 Hnh 3-2: Lp ng dng....................................................................44 Hnh 3-3: Lp vn chuyn................................................................44

n tt nghip

11

DANH SCH HNH V

Hnh 3-4: Lp internet......................................................................45 Hnh 3-5: Lp truy cp mng...........................................................46 Hnh 3-6: Cc loi a ch IP.............................................................47 Hnh 3-7: nh dng Header ca gi tin IP.....................................49 Hnh 3-8: Cu trc UDP datagram..................................................52 Hnh 3-9: Cu trc header................................................................53 Hnh 3-10: Cu trc gi tin RTP......................................................55 Hnh 3-11: Cu trc gi tin RTCP...................................................57 Hnh 3-12: Quan h ca flowspec v filterspec...............................59 Hnh 3-13: Cc lp ca b giao thc H.323.....................................61 Hnh 3-13: Tin trnh cc bn tin Q.931..........................................63 Hnh 4-1: Kin trc Asterisk.............................................................68 Hnh 4-2: Gi ni b Asterisk...........................................................71 Hnh 4-3: Tng i VoIP PBX..........................................................75 Hnh 4-4: Kt ni IP PBX vi PBX..................................................76 Hnh 4-5: Kt ni gia cc Server Asterisk.....................................77 Hnh 4-6: Asterisk vi IVR, Conference Call and VoiceMail........78 Hnh 4-7: Phn phi cuc gi ACD..................................................78 Hnh 4-8: M hnh h thng IP Call Center....................................79

n tt nghip

12

DANH SCH HNH V

Hnh 4-9: H thng s dng giao thc IAX.....................................81 Hnh 4-10: M hnh trin khai h thng Asterisk...........................85 Hnh 4-10: Cu hnh Softphone X Lite 4.........................................89

n tt nghip

13

DANH SCH HNH V

CHNG 1 TNG QUAN V VOIP


1.1. Gii thiu tng quan VoIP VoIP c vit tt bi Voice over Internet Protocol, hay cn c gi vi cc tn khc nh: Internet telephony, IP Telephony, Broadband telephony, Broadband Phone v Voice over Broadband. VoIP l mt cng ngh cho php truyn m thanh thi gian thc qua bng thng Internet v cc kt ni IP. Trong , tn hiu m thanh ( Voice signal) s c chuyn i thnh cc gi tin ( Data packets) thng qua mi trng mng Internet trong mi trng VoIP, sau c chuyn thnh thit b m thanh n thit b ngi nhn. 1.1.1. Hnh thnh v pht trin VoIP

PC

PC

PSTN

PC

PC

PC Router

WAN
Router

PC

Hnh 1-1: Mng in thoi v mng Internet tch bit nhau

n tt nghip

14

DANH SCH HNH V

Nhng nm Trc y khi m mng in thoi truyn thng PSTN v mng Internet tch bit vi nhau. Trong mng in thoi kt ni nhiu Tng i li vi nhau v mi tng i s c kt ni vi nhiu my in thoi. Cn trong mng d liu nhiu mng LAN cc b kt ni vi nhau thng qua mng Internet (Hnh 1-1). iu ny gy nn nhiu kh khn v chi ph tn km cho cc t chc v doanh nghip mun s dng c mng in thoi v mng Internet. T y tng v mt mng hi t ra i (Hnh 1-2), mt mng duy nht trong c th chia s truyn thoi, d liu. V lc ny, VoIP gy c s ch mnh m v tr thnh nn tng cho mng thoi s dng cng ngh chuyn mch gi.

PC

PC

PC

PC

PC Router

W AN
Router

PC

Hnh 1-2: Mng hi t Cng ngh VoIP bt u t nm 1995 khi cng ty VocalTel a ra mt phn mm in thoi Internet u tin chy trn my tnh c nhn ging nh in thoi PC ngy

n tt nghip

15

DANH SCH HNH V

nay s dng card m thanh, micro, loa. Phn mm ny gi l Internet Phone. Mt khuyt im khi l khng c mng di rng, do cht lng thoi km hn rt nhiu so vi in thoi thng thng lc . Tuy nhin phn mm ny tr ln ni ting nh du mt mc quan trng ca vic ra i in thoi IP. Thng 3/1996, VocalTec kt hp vi Dialogic a ra sn phm cng kt ni PSTN v Internet u tin trn th gii. Hip hi cc nh sn xut thoi qua my tnh ECTF ra i nhm a ra cc tiu chun thoi qua Internet. Hip hi bao gm 36 cc cng ty my tnh & vin thng hng u trn th gii nh AT&T, IBM, Sun Microsystems, Digital, Ericsson v.v... Vo nm 1998 theo thng k lu lng thoi IP chim xp x 1% tng lu lng thoi ca M. Cc nh sn xut thit b c gng nghin cu ra cc thit b cho php thng tin t in thoi thng thng sang PC v t in thoi sang in thoi. Vo nm 2000 mt s nh sn xut nh l Cisco v Lucent a ra thit b c kh nng nh tuyn v chuyn mch lu lng thoi do lu lng thoi IP tng ln hn 3 % tng lu lng thoi ( M). Ngy nay cc vn lin quan n cht lng dch v ca VoIP c gii quyt ng k, lu lng VoIP c ginh quyn u tin so vi cc loi lu lng khc nh d liu m bo cht lng cuc gi. Nhu cu thoi qua Internet ngy cng cao thng qua cc dch v mi v cht lng nh Yahoo, Skyle. Vo ngy 17/06/2011, mt cng ty nghin cu c tn Point Topic tuyn b rng t l tng trng ton cu ca VoIP tng 12,6 % so vi nm 2010 vi mc doanh thu ton cu l 17,3 t USD. Vi mt s nhu cu khc ngy cng tng nh IP Center, Contact Center cho ta thy tng lai y ha hn ca loi hnh dch v ny. 1.1.2. Cc thnh phn mng VoIP Mng VoIP phi c kh nng thc hin cc chc nng m mng in thoi cng cng thc hin, ngoi ra phi thc hin chc nng ca mt gateway gia mng IP v

n tt nghip

16

DANH SCH HNH V

mng in thoi cng cng. Cc thnh phn ct li ca mt mng VoIP bao gm: thit b u cui, Gateway v VoIP Server. Thit b u cui: Hot ng trn mng TCP/IP. L mt nt cui cng trong mng in thoi IP, mt thit b u cui c th cho php mt thu bao trong mng IP thc hin cuc gi. Softphone v my tnh c nhn (PC) : bao gm 1 headphone, 1 phn mm v 1 kt ni Internet. Cc phn mm min ph ph bin nh Skype, Ekiga, GnomeMeeting, Microsoft Netmeeting, SIPSet, in thoi truyn thng vi IP adapter: s dng dch v VoIP th my in thoi thng dng phi gn vi 1 IP adapter c th kt ni vi VoIP server. Adapter l 1 thit b c t nht 1 cng RJ11 ( gn vi in thoi) , RJ45 ( gn vi ng truyn Internet hay PSTN) v 1 cng cm ngun. IP phone : l cc in thoi dng ring cho mng VoIP. Cc IP phone khng cn VoIP Adapter bi chng c tch hp sn bn trong c th kt ni trc tipvi cc VoIP server Gateway: Thit b ny gip kt ni hai mng khc nhau, l thnh phn gip chuyn i tn hiu tng t ( Analog) sang tn hiu s ( Digital) v ngc li. VoIP gateway : l cc gateway c chc nng lm cu ni gia mng in thoi cng cng ( PSTN ) v mng VoIP. VoIP GSM Gateway: l cc gateway c chc nng lm cu ni cho cc mng IP, GSM v c mng analog. VoIP Server: L my ch trung tm ca h thng VoIP. Bao gm cc chc nng chnh: Qun l, gim st cc thnh phn trong mng VoIP

n tt nghip

17

DANH SCH HNH V

Gim st v iu khin tin trnh cuc gi. nh tuyn v bo mt cho cc cuc gi VoIP 1.1.3. M hnh phn lp chc nng V mt chc nng, cng ngh VoIP c th c chia lm ba lp nh sau:

Lp ng dng dch v

Giao din m v tun theo chun


Lp iu khin cuc gi

Giao din m v tun theo chun


Lp c s h tng mng gi

Hnh 1-3: M hnh phn lp chc nng Lp c s h tng mng gi thc hin chc nng truyn ti lu lng thoi. Trong VoIP, c s h tng l cc mng IP. Giao thc truyn ti thi gian thc RTP (Realtime Transport Protocol) kt hp vi UDP v IP gip truyn ti thng tin thoi qua mng IP. RTP chy trn UDP, cn UDP hot ng trn IP hnh thnh ln c ch truyn RTP/UDP/IP trong VoIP. Trong cc mng IP, hin tng cc gi IP tht lc hoc n khng theo th t thng xuyn xy ra. C ch truyn TCP/IP khc phc vic mt gi bng c ch truyn li khng ph hp vi cc ng dng thi gian thc vn rt nhy cm vi tr. RTP vi

n tt nghip

18

DANH SCH HNH V

trng tem thi gian (timestamp) c dng bn thu nhn bit v x l cc vn nh tr, s thay tr (jitter) v s mt gi. Lp iu khin cuc gi thc hin chc nng bo hiu, nh hng cuc gi trong VoIP. S phn tch gia mt phng bo hiu v truyn ti c thc hin PSTN vi bo hiu knh chung SS7, nhng y nhn mnh mt thc t c nhiu chun bo hiu cho VoIP cng tn ti nh H323, SIP hay SGCP/MGCP (Simple Gateway Control Protocol/ Media Gateway Control Protocol). Cc giao thc bo hiu ny c th hot ng cng nhau, c ng dng ph hp vi nhng nhu cu c th ca mng. Ngoi ra lp ny cn cung cp chc nng truy nhp ti dch v bn trn cng nh cc giao din lp trnh m pht trin ng dng. Lp ng dng dch v m nhim chc nng cung cp dch v trong mng vi c dch v c tng t nh trong PSTN v dch v mi thm vo. Cc giao din m cho php cc nh cung cp phn mm c lp pht trin ra nhiu ng dng mi. c bit l cc ng dng da trn Web, cc ng dng kt hp gia thoi v d liu, cc ng dng lin quan ti thng mi in t. S phn tch lp dch v lm cho cc dch v mi c trin khai nhanh chng. Ngoi ra, cc chc nng nh qun l, nhn thc cuc gi v chuyn i a ch cng c thc hin lp ny. Do cc giao din gia cc lp l m v tun theo chun, to ra nhiu s la chn khi xy dng thit k mng. V d, ng vi lp c s h tng mng ta c th dng cc router v switch ca hng Cisco, iu khin cuc gi thc hin bng cc gatekeeper ca VocalTec v cc dch v c cung cp bi server dch v ca Netspeak. Do m hnh trn khng ch c gi tr v mt l thuyt. 1.2. Cc kiu kt ni VoIP 1.2.1. M hnh PC to PC Trong m hnh ny, mi my tnh cn c trang b mt sound card, mt microphone, mt speaker v c kt ni trc tip vi mng Internet thng qua modem

n tt nghip

19

DANH SCH HNH V

hoc card mng. Mi my tnh c cung cp mt a ch IP v hai my tnh c th trao i cc tn hiu thoi vi nhau thng qua mng Internet. Tt c cc thao tc nh ly mu tn hiu m thanh, m ho v gii m, nn v gii nn tn hiu u c my tnh thc hin. Trong m hnh ny ch c nhng my tnh ni vi cng mt mng mi c kh nng trao i thng tin vi nhau.

Internet
` `

PC
Hnh 1-4: M hnh PC to PC 1.2.2. M hnh PC to Phone

PC

M hnh PC to Phone l mt m hnh c ci tin hn so vi m hnh PC to PC. M hnh ny cho php ngi s dng my tnh c th thc hin cuc gi n mng PSTN thng thng v ngc li. Trong m hnh ny mng Internet v mng PSTN c th giao tip vi nhau bng mt thit b c bit l Gateway. y l m hnh c s dn ti vic kt hp gia mng Internet v mng PSTN cng nh cc mng GSM hay a dch v khc.

Internet

PSTN

PC
Hnh 1-5: M hnh PC to Phone

Phone

n tt nghip

20

DANH SCH HNH V

1.2.3. M hnh Phone to Phone y l m hnh m rng ca m hnh PC to Phone s dng Internet lm phng tin lin lac gia cc mng PSTN. Tt c cc mng PSTN u kt ni vi mng Internet thng qua cc gateway. Khi tin hnh cuc gi mng PSTN s kt ni n gateway gn nht. Ti gateway a ch s c chuyn i t a ch PSTN sang a ch IP c th nh tuyn cc gi tin n c mng ch. ng thi gateway ngun c nhim v chuyn i tn hiu thoi tng t thnh dng s sau m ho, nn, ng gi v gi qua mng. Mng ch cng c kt ni vi gateway v ti gateway ch, a ch li c chuyn i tr li thnh a ch PSTN v tn hiu c gii nn, gii m chuyn i ngc li thnh tn hiu tng t gi vo mng PSTN n ch.

Hnh 1-6: M hnh Phone to Phone 1.3. c tnh ca VoIP 1.3.1. u im ca VoIP Tit kim chi ph: u im ni bt nht ca VoIP l tit kim chi ph v tn dng ti nguyn mng m khng c bt c rng buc no i vi ngi s dng. Vic lin lc ng di s dng k thut VoIP tit kim c chi ph hn l s dng mng PSTN thng thng. VoIP hiu qu hn PSTN trong cc dch v mi c bit l cc dch v multimedia. u im ca VoIP khng ch l tit kim ph lin lc, s dng VoIP cn tit kim c chi ph u t v h tng mng. Chng ta c kh nng s dng mt mng s

n tt nghip

21

DANH SCH HNH V

liu duy nht phc v tt c cc loi hnh dch v nh thoi, fax v truyn s liu thay v lp t tng mng c lp. Hn na VoIP c th tch hp vi bt c loi hnh thit b thoi no, chng hn nh PC hay in thoi thng thng. VoIP c th p dng cho bt k loi hnh thoi no, chng hn nh thoi thng thng hay thoi a im cho ti in thoi c hnh hay truyn hnh hi tho. Vic chi s trang thit b v chi ph vn hnh cho c thoi v s liu c th tn dng c cho cc loi hnh d liu khc nhau, do thu hp phm vi knh thoi trn bng thng v tng dung lng truyn. Theo thng k ca IETF (Internet Engineering Task Force), trong vng 2 hay 3 nm ti dung lng truyn qua Internet s chim khong 11% th trng lin lc ng di v s chim khong 10% th trng fax trn th gii. Qun l n gin: VoIP mng li cho ngi s dng kh nng qun l d dng hn. Vic kt hp mng thoi v mng s liu c th gim bt gnh nng cho vic qun l. Ch cn phi qun l mt mng s liu thng nht thay v qun l 2 mng ring r nh trc y. i vi doanh nghip, tt c cc cuc gi ni b c th dng k thut VoIP m khng gp vn g v cht lng dch v. Cn khi cn gi ra ngoi ch cn mt s kt ni nht nh n mng PSTN thng qua cc gateway. i vi trong gia nh, p dng k thut VoIP khng h lm thay i cch s dng in thoi truyn thng (nu c th ch c th l cch bm s c di hn). S dng hiu qu: Nh bit VoIP truyn thoi qua mng Internet v s dng giao thc IP. Hin nay IP l giao thc mng c s dng rng ri nht. C rt nhiu ng dng ang c khai thc trn c s cc giao thc ca mng IP. VoIP c th kt hp s dng cc ng dng ny nng cao hiu qu s dng mng. V d c dch v khc thc Web Phone. K thut VoIP c s dng ch yu kt hp vi cc mng my tnh do c th tn dng c s pht trin ca cng ngh thng tin nng cao hiu qu s dng. Cc phn mm s h tr rt nhiu cho vic khai thc cc dch v ca mng VoIP.

n tt nghip

22

DANH SCH HNH V

Cng ngh thng tin cng pht trin th vic khai thc cng c hiu qu, s xut hin nhiu dch v mi h tr ngi s dng trong mi lnh vc. 1.3.2. Nhc im ca VoIP Bn cnh Nhng thun li ca VoIP th cn c nhng kh khn v nhc im khng th ph nhn khi trin khai mt mng in thoi IP: Cht lng dch v: Do d liu truyn trn mng kh nng mt gi hon ton c th xy ra, v vy cht lng cuc gi s thp v khng lng trc c. Ngoi ra Cc hot ng tiu tn lng ln ti nguyn mng nh Truyn File, Game online,cng nh hng n dch v VoIP. Trong mng IP l mng chuyn mch mm do ti cc nt mng tr ln nn ting vng nh hng nhiu n cht lng thoi. V vy trit ting vng l mt vn cn phi gii quyt cp bch. Vn bo mt: VoIP c th b tn cng bi virus v m nguy him khc. Cc k tn cng c th chn vic truyn thng, nghe trm v thc hin cc tn cng gi mo bng vic thao tng ID v lm hng dch v. 1.4. ng dng ca VoIP 1.4.1. Dch v thoi qua Internet in thoi Internet khng cn ch l cng ngh cho gii s dng my tnh m cho c ngi s dng in thoi quay s vo gateway. Dch v ny c mt s nh khai thc ln cung cp v cht lng thoi khng thua km cht lng ca mng thoi thng thng, c bit l trn cc tuyn quc t. Mc d vn cn mt s vn v s tng thch ca cc gateway, cc vn ny s sm c gii quyt khi tiu chun H.323 ca ITU c s dng rng ri. Sut t khi cc my tnh bt u kt ni vi nhau, vn cc mng tch hp lun l mi quan tm ca mi ngi. Mng my tnh pht trin bn cnh mng in thoi. Cc mng my tnh v mng in thoi song song tn ti

n tt nghip

23

DANH SCH HNH V

ngaytrong cng mt c cu, gia cc c cu khc nhau v trong mng rng WAN.Cng ngh thoi IP khng ngay lp tc e do n mng in thoi ton cu m n s dn thay th thoi chuyn mch knh truyn thng. Sau y l mt vi ng dng tiu biu ca dch v thoi Internet. 1.4.2. Thoi thng minh H thng in thoi ngy cng tr nn hu hiu: r, ph bin, d s dng, c ng. Tuy nhin n ch c 12 phm iu khin. Trong nhng nm gn y, ngi ta c gng to ra thoi thng minh, u tin l cc thoi bn, sau l n cc server. Nhng mi c gng u tht bi do tn ti cc h thng c sn. Internet s thay i iu ny. K t khi Internet ph khp ton cu, n c s dng tng thm tnh thng minh cho mng in thoi ton cu. Gia mng my tnh v mng in thoi tn ti mt mi lin h. Internet cung cp cch gim st v iu khin cc cuc thoi mt cch tin li hn. Chng ta c th thy c kh nng kim sot v iu khin cc cuc thoi thng qua mng Internet. 1.4.3. Dch v tnh cc cuc gi Thoi qua Internet gip nh khai thc c kh nng cung cp dch v tnh cc cho b gi n cc khch hng nc ngoi cng ging nh khch hng trong nc. thc hin c iu ny, khch hng ch cn PC vi h iu hnh Windows9x, a ch kt ni Internet (tc 28,8Kbps hoc nhanh hn), v chng trnh phn mm chuyn i, chng hn nh Quicknet's Technologies Internet PhoneJACK. Thay v gi qua mng in thoi truyn thng, khch hng c th gi qua Internet bng vic s dng chng trnh phn mm chng hn nh Internet Phone ca Vocaltec hoc Netmeeting ca Microsoft. Vi cc chng trnh phn mm ny, khch hng c th gi cng ging nh vic h gi qua mng PSTN. Bng vic s dng chng trnh chng hn Internet PhoneJACK. Ngi gi c th nh tuyn cc cuc gi ny ti cc nh vn hnh, ti cc

n tt nghip

24

DANH SCH HNH V

dch v t ng tr li, ti cc ACD. Trong thc t, h thng in thoi qua Internet v h thng in thoi truyn thng l hon ton nh nhau. 1.4.4.Dch v Callback Web "WorldWide Web" lm cuc cch mng trong cch giao dch vi khch hng ca cc doanh nghip. Vi tt c cc tim nng ca web, in thoi vn l mt phng tin kinh doanh quan trng trong nhiu nc. in thoi web hay "bm s" (click to dial) cho php cc nh doanh nghip c th a thm cc phm bm ln trang web kt ni ti h thng in thoi ca h. Dch v bm s l cch d nht v an ton nht a thm cc knh trc tip t trang web ca bn vo h thng in thoi. 1.4.5. Dch v Fax qua IP Nu gi nhiu fax t PC, c bit l gi ra nc ngoi th vic s dng dch v Internet faxing s gip tit kim c tin v c knh thoi. Dch v ny s chuyn trc tip t PC qua kt ni Internet. Khi s dng dch v thoi v fax qua Internet, c hai vn c bn: - Nhng ngi s dng dch v thoi qua Internet cn c chng trnh phn mm chng hn Quicknet's Internet PhoneJACK. Cu hnh ny cung cp cho ngi s dng kh nng s dng thoi qua Internet thay cho s dng in thoi bn truyn thng. - Kt ni mt gateway thoi qua Internet vi h thng in thoi hin hnh. Cu hnh ny cung cp dch v thoi qua Internet ging nh vic m rng h thng in thoi hin hnh. 1.4.6. Dch v ADC Gateway call center vi cng ngh thoi qua Internet cho php cc nh kim duyt trang Web vi cc PC trang b multimedia kt ni c vi b phn phi cc cuc

n tt nghip

25

DANH SCH HNH V

gi t ng (ACD). Mt u im ca thoi IP l kh nng kt hp c thoi v d liu trn cng mt knh. 1.5. Vn cht lng trong VoIP i hi c bn nht ca h thng VoIP l phi c cht lng thoi gn tng ng vi cht lng thoi trong mng PSTN. Cht lng thoi c chia thnh cc cp khc nhau.

Hnh 1-7: Cc mc nh gi cht lng thoi Vic nh gi cht lng thoi cn mang tnh ch quan nhng cng c mt s tham s c dng nh gi cht lng thoi. Ba tham s chnh quyt nh cht lng thoi l: 1.5.1. Tr Tr l mt nhn t nh hng nhiu n cht lng thoi. Thi gian tr ln lm gim cht lng thoi rt nhiu. Mi h thng truyn thng ch cho php mt gii hn tr nht nh. Khi thi gian tr trong h thng vt qu 400ms th cht lng cuc lin

n tt nghip

26

DANH SCH HNH V

lc l khng chp nhn c. Thi gian tr c th chp nhn c nm trong khong t 200ms n 400ms. Mun t c cht lng cuc gi tt th thi gian tr yu cu khng qu 200ms. Thi gian tr c phn chia thnh hai loi l thi gian tr c nh (nh thi gian tr truyn dn) v tr bin i (nh thi gian tr do xp hng i router). Yu cu gim tr l rt cn thit trong h thng VoIP c th nng cao cht lng dch v. 1.5.2. Trt Trt l s chnh lch v thi gian n ca cc gi trong mng gy ra do s chnh lch thi gian truyn dn ca cc gi thoi theo cc ng khc nhau t ngun n ch. c th ti to ting ni mt cch chnh xc trung thc th bn thu cn phi loi b trt. Phng php c s dng loi b trt hin ang c s dng l dng b m (buffer). Cc gi sau khi nhn s c lu trong b m v s c x l ln lt. Dng b m s trnh c nhng thi gian tr ln ca cc gi tin. Nhng b li th b m lm tng thm thi gian tr trong h thng. Thi gian trt cng ln th dung lng ca b m cng cng phi ln. Nhng b m cng ln th thi gian tr gy ra cng ln. Do vy vic tnh ton dung lng ca b m thch hp i vi tng h thng l rt cn thit sao cho trnh c trt m thi gian tr khng lm gim cht lng ca h thng. 1.5.3. Mt gi tin Mng Internet khng th m bo rng tt c cc gi tin u c chuyn giao hoc chuyn giao ng th t. Cc gi tin c th b mt trong trng hp mng b qu ti, nghn mng hoc do ng kt ni khng m bo. yu cu t l mt gi l nh hn 10%. Do hn ch ca thi gian tr nn cc giao thc truyn bo m khng thch hp gii quyt vn ny. duy tr cht lng thoi mc chp nhn c mc d khng th trnh khi cc nguyn nhn bt thng trong mng, mt s k thut c a ra. l k thut thay th cc gi tin mt bng nhng khong im lng. Ngi ta cng gim

n tt nghip

27

DANH SCH HNH V

s lng cc gi truyn qua mng bng k thut nn tn hiu. S dng b phn pht hin tch cc thoi, khi hai bn khng tch cc thoi th khng trao i thng tin v pht tp m d chu (theo cc nghin cu th thi gian tch cc thoi ch chim t 30% n 40% thi gian tin hnh cuc gi) v s dng phng php ny lm tng hiu qu s dng knh truyn. Ngoi ra cn nng cao tin cy ca ng truyn nh tng tc knh truyn tng dung lng h thng thit b truyn dn. 1.6. iu khin d liu trong VoIP VoIP truyn tn hiu ging ni thng qua mi trng mng d liu (IP based network). Do vy, trc ht ging ni s phi c chuyn i t tn hiu tng t (Analog) thnh cc dy bit k thut s v c ng gi thnh cc Packet sau c truyn ti qua mng IP network v cui cng s c chuyn li thnh tn hiu m thanh n ngi nghe. Tin trnh hot ng ca VoIP thng qua 2 bc:

Call Setup : trong qu trnh ny, ngi gi s phi xc nh v tr ( thng qua a

ch ca ngi nhn) v yu cu mt kt ni lin lc vi ngi nhn. Khi a ch ngi nhn c xc nh l tn ti trn cc proxy server th cc proxy server gia 2 ngi s thit lp mt cuc kt ni cho qu trnh trao i d liu thoi

Voice data processing : Tn hiu ging ni s c chuyn i sang tn hiu s

ri c nn li nhm tit kim ng truyn sau s c m ha (tnh nng b sung nhm trnh cc b phn tch mng - Sniffer ). Cc mu thoi c m ha s c chn vo cc gi d liu c vn chuyn trn mng. Giao thc dng cho cc gi thoi ny l RTP. Mt gi tin RTP c mo u cha d liu cn thit cho vic bin dch li cc gi tin sang tn hiu thoi thit b ngi nghe. Cc gi tin thoi c truyn i bi giao thc UDP. thit b cui bn nhn, tin trnh c thc hin ngc li. Qu trnh ny c din ra lin tc trong qu trnh ca mt cuc hi thoi VoIP.

n tt nghip

28

DANH SCH HNH V

Endpoint Chuyn i Analog - Digital Chuyn i Digital - Analog

Endpoint

Nn d liu thoi

Gii nn d liu thoi

RTP INTERNET UDP Packet

RTP

UDP Packet

Hnh 1-8: Qa trnh x l d liu thoi trong h thng VoIP

n tt nghip

29

DANH SCH HNH V

CHNG 2 KIN TRC MNG VOIP


2.2. Tng quan v thit b Cu hnh chun ca mng in thoi IP c th bao gm cc phn t sau: Thit b u cui kt ni vi mng IP. Thit b u cui kt ni vi mng chuyn mch knh Mng truy nhp IP. Mng ng trc IP. Mng in thoi truyn mch knh. Gateway. Gatekeeper.

Trong cc cu hnh mng khc nhau c th Thm hoc bt cc phn t trn.

T e le ho ne p

PC

Gatekeeper

PSTN
T e le h o n e p

G a te w a y

G a te w a y

T e le p ho ne
PST N

T e le p h o ne IP

T e le p ho ne IP
R o uter

T e le p ho ne

IP P B X

PC

PC

M ng L A N ni PC b

n tt nghip

30

DANH SCH HNH V

Hnh 2-1: Cu hnh mng in thoi IP 2.2. Chc nng cc thit b mng VoIP Hin nay tn ti hai chun ca h thng VoIP l H.323 v SIP tng ng vi h thng mng ca chng. 2.2.1. Cc thnh phn trong mng H.323

Hnh 2-2: M hnh mng H.323 2.2.1.1. Thit b u cui Thit b u cui c ni vi mng s dng mt giao din truy nhp. Mt thit b u cui cho php mt thu bao trong mng IP thc hin cuc gi ti thu bao khc trong mng SCN. Cc cuc gi s nm trong s gim st ca GK m thu bao ng k. Mt thit b u cui c th bao gm cc chc nng sau: Chc nng u cui H.225: thu v nhn cc bn tin H.225.

n tt nghip

31

DANH SCH HNH V

Chc nng u cui H.245: thu v nhn cc bn tin H.245. Bo mt knh truyn ti: bo m tnh bo mt ca thng tin ca knh truyn ti vi thit b u cui.

Bo mt knh bo hiu: bo m tnh bo mt ca knh bo hiu kt ni vi thit b u cui.

Chc nng xc nhn: thit lp c im nhn dng khch hng, thit b v phn t mng.

Chc nng qun l: giao tip vi h thng qun l mng. Chc nng ghi cc bn tin s dng: xc nh v ghi li cc thng tin v s kin v ti nguyn.

Chc nng bo co cc bn tin s dng: bo co cc bn tin s dng c ghi ra thit b ngoi vi.

2.2.1.2. Gatekeeper Mt min H.323 trn c s mng IP l tp hp tt c cc u cui c gn vi mt a ch. Mi min c qun tr bi mt Gatekeeper duy nht, gim st mi hot ng trong min . y l thnh phn tu chn trong h thng VoIP theo chun H.323. Tuy nhin nu c mt Gatekeeper trong mng th cc u cui v cc Gateway phi hot ng theo cc dch v ca Gatekeeper . H.323 nh ngha c nhng tnh cht bt buc phi c cho Gatekeeper v nhng c tnh tu chn: Cc chc nng ti thiu ca Gatekeeper gm c: phin dch a ch, iu khin cho php truy nhp, iu khin di thng, qun l min dch v. Chc nng phin dch a ch: Gatekeeper s thc hin chuyn i a ch URI (Dng tn gi hay a ch hp th) ca mt u cui hay Gateway sang a ch

n tt nghip

32

DANH SCH HNH V

truyn dn (a ch IP). Vic chuyn i c thc hin bng cch s dng bn i chiu a ch c truy nhp thng xuyn bi cc bn tin ng k. Chc nng iu khin cho php truy nhp: Gatekeeper cho php mt truy nhp mng LAN bng cch s dng cc bn tin H.225 l ARQ/ACF/ARJ. Vic iu khin ny da trn s cho php cuc gi, bng thng hoc mt vi thng s khc do nh sn xut quy nh. N c th l chc nng rng, c ngha l chp nhn mi yu cu truy nhp ca u cui. Chc nng iu khin di thng: Gatekeeper h tr cc bn tin BRQ/BRJ/BCF cho vic qun l bng thng. N c th l chc nng rng, c ngha l chp nhn mi s thay i bng thng. Gatekeeper c th hn ch mt s cc u cui H.323 cng mt lc s dng mng. Thng qua vic s dng knh bo hiu H.225, Gatekeeper c th loi b cc cuc gi t mt u cui do s hn ch bng thng. Chc nng qun l min dch v: min dch v y l tp hp tt c cc phn t H.323 gm thit b u cui, gateway, MCU c ng k hot ng vi Gatekeeper thc hin lin lc gia cc phn t trong min dch v hay t dch v ny sang dch v khc. Cc chc nng tu chn ca Gatekeeper gm: iu khin bo hiu cuc gi, cp php cho cuc gi v qun l cuc gi. iu khin bo hiu cuc gi: Gatekeeper c th la chn hai phng thc iu khin bo hiu cuc gi l: hon thnh bo hiu cuc gi vi cc u cui v x l bo hiu cuc gi chnh bn thn n, hoc Gatekeeper c th ra lnh cho cc u cui kt ni mt knh bo hiu cuc gi hng ti nhau. Theo phng thc ny th Gatekeeper khng phi gim st bo hiu trn knh H.225.

n tt nghip

33

DANH SCH HNH V

Qun l cuc gi: Gatekeeper c th lp danh sch tt c cc cuc gi H.323 hng i ang thc hin ch th rng mt u cui b gi ang bn v cung cp thng tin cho chc nng qun l bng thng. Gatekeeper hot ng hai ch :
-

Ch trc tip: Gatekeeper ch c nhim v cung cp a ch ch m khng tham gia vo cc vic nh tuyn cc bn tin bo hiu. y l hnh thc bo hiu trc tip gia cc thit b u cui m khng thng qua Gatekeeper

Gatekeeper
1 ARQ 2 ACF/ARJ 3 Setup 4 ARQ 5 ACF/ARJ 6 Connect 1 5

2 3 6

Endpoint 1

Endpoint 2

Hnh 2-3: Bo hiu trc tip gia cc thit b u cui Ch nh tuyn qua Gatekeeper: Gatekeeper l thnh phn trung gian, nh tuyn mi bn tin bo hiu trong mng H.323.

1 ARQ 2 ACF/ARJ 3 Setup 4 Setup 5 ARQ 6 ACF/ARJ 7 Connect 8 Connect

Gatekeeper
1 2 3 8 4 5 6 7

Endpoint 1

Endpoint 2

Hnh 2-4: Bo Hiu nh tuyn thng qua Gatekeeper

n tt nghip

34

DANH SCH HNH V

2.2.1.3. Khi iu khin a im Khi iu khin a im (MCU) c s dng khi mt cuc gi hi ngh hay hi ngh cn gi nhiu kt ni hot ng. Do c mt s hu hn cc kt ni ng thi nn cc MCU gim st s tho thun gia cc u cui v s kim tra mi u cui v tnh nng m chng c th cung cp cho cuc gi hi ngh. Cc MCU gm hai phn: b iu khin a im v b x l a im. B iu khin a im c trch nhim trong vic tho thun v quyt nh kh nng ca cc u cui. Trong khi , b x l a im c s dng x l a phng tin, cc lung trong sut qu trnh ca mt hi ngh hoc mt cuc gi a im. 2.2.1.4. Gateway Gateway l phn t khng nht thit phi c trong mt giao tip ca cc phn t H.323, n ng vai tr lm phn t cu ni v ch tham gia vo cuc gi khi c s chuyn tip t mng H.323 (LAN hoc Internet) sang mng phi H.323 (nh PSTN). Gateway tc hin mt s chc nng nh: Chuyn i gia cc dng khung truyn dn. Chuyn i gia cc th tc giao tip. Chuyn i gia cc dng m ho khc nhau ca cc lung tn hiu hnh nh cng nh m thanh. Thc hin vic thit lp v xo cuc gi c pha mng LAN cng nh mng chuyn mch knh. 2.2.1.5. Mng truy nhp IP Mng truy nhp IP cho php thit b u cui, gateway, gatekeeper truy nhp vo mng IP thng qua c s h tng mng sn c. Mt vi loi giao din chun truy nhp IP c s dng trong cu hnh chun ca mng VoIP l:

n tt nghip

35

DANH SCH HNH V

Truy nhp PSTN Truy nhp ISDN Truy nhp LAN Truy nhp cp, xDSL Truy cp GSM

2.2.2. Cc thnh phn trong mng SIP

Hnh 2-5: M hnh mng SIP 2.2.2.1. SIP User Agent Cc thit b u cui c gi l SIP User Agent (UA). UA l mt ng dng khi to, nhn v kt thc cuc gi. . Trong phn ln cc trng hp UA l con ngi

n tt nghip

36

DANH SCH HNH V

nhng cng c th l mt giao thc, nh trong trng hp UA l mt Gateway. Mt UA phi c kh nng thit lp phin truyn thng vi mt UA khc. Mt UA phi duy tr trng thi trong cc cuc gi m n khi to hoc cuc gi m n ang tham gia. Tp hp trng thi cuc gi bao gm cc trng mo u nh l nhn cc b v nhn t xa, Call-ID, s th t cc b v t xa, thng tin nh tuyn v bt k thng tin cn thit no cho truyn thng. Thng tin ny c s dng lu tr thng tin hi thoi v m bo tin cy bng vic pht li thng ip. Mt UA bao gm c mt ng dng Client v ng dng Server. Hai phn l UAC v UAS. UAC khi tao yu cu trong khi UAS pht ra cc p ng cho cc yu cu. Trong mt phin lm vic UA lun lun thc hin c hai chc nng trn. UA phi c h tr giao thc SDP cho vic m t truyn thng. Mt User Agent phi hiu c bt k m rng no c thm vo trong trng mo u ca thng ip yu cu. Mt UA phi c qung b kh nng v c trng trong bt k yu cu no c gi i. iu ny cho php UA khc c th hc c thng tin ca n m khng cn phi gi thng tin hi. V d cc phng php thm thng tin qung b vo thng ip yu cu l m rng trng mo u ALLOW v SUPPORTED v thng tin chnh c ghi trng ACCEPT 2.2.2.2. SIP Server SIP servers l cc ng dng m n chp nhn cc SIP yu cu v p ng n chng. Khng nn quy SIP server vi mt User Agent server hoc client-server. Mt SIP server l mt kiu khc bit ca thc th. Bi v SIP server cung cp cc dch v v chc nng vi UA, chng s h tr c TCP,TLS v UDP truyn ti. a. Proxy Server

n tt nghip

37

DANH SCH HNH V

Mt SIP proxy server nhn mt yu cu SIP t mt User agent hoc mt proxy khc v hnh ng trn nhn danh ca User agent trong chuyn tip hoc p ng cho yu cu. Mt proxy khng phi l B2BUA v n ch cho php chnh sa cc yu cu v chp nhn cc p ng thit lp cc qui tc. Cc qui tc ny th duy tr theo khong cch end-to-end ca tn hiu SIP trong khi vn cn cho php cc Proxy server thc hin cc dch v v chc nng vi User agent.

Hnh 2-6: Kt ni Proxy Server, Registration Server v User Agent

Mt Proxy server phi c truy xut n cc c s d liu hoc v tr cc dch v gip n trong qu trnh x l cc yu cu. Giao thc SIP th khng xc nh giao din gia proxy v v tr dch v. Proxy c th s dng nhiu kiu c s d liu trong qu trnh x l cc yu cu. C s d liu c th cha ng k cho SIP, cc thng tin hin hu, v nhiu kiu khc ca thng tin v ni m user c ch nh. Mt Proxy server khc bit vi mt user agent hoc gateway ba im sau:

n tt nghip

38

DANH SCH HNH V

Mt Proxy server khng a ra cc request, n ch p ng cc request t mt user agent (CANCEL request l mt ngoi l trong qui tc ny).

Mt proxy server khng c kh nng v media. Mt proxy server th khng phn tch cc thng ip, m ch da vo cc header field. Mt Proxy server c hai trng thi l Stateless hoc Stateful. Mt Stateless Proxy

server x l mi SIP request hoc response cn c vo ni dung thng ip. Mt thng ip c phn tch, x l v chuyn tip hoc p ng, m khng c thng tin c lu tr hoc khng c thng tin i thoi c lu tr. Mt Stateless khng bao gi truyn li mt bn tin v khng s dng bt k mt SIP timer no. Mt Stateful Proxy server gi li mt phn ca yu cu v p ng nhn c trong qu kh v s dng thng tin x l cho cc yu cu v p ng trong tng lai. Mt Stateful Proxy server bt u tnh gi khi pht mt yu cu. Nu trong thi gian quy nh m khng nhn c p ng th Stateful proxy s thc hin truyn li v t vn m bo giao dch ca cc User agent. Trong thc t Stateful Proxy server c s dng ph bin trong cc mng SIP.

b. Redirect Server Redirect Server l mt loi SIP Server ch dng response m khng chuyn tip cac thng ip. Mt Redirect server ging nh l mt Proxy server n c th cc thng tin ca ngi s dng trong mt c s d liu nh l thng tin v v tr ca mt User. c. Registration Server Registration Server l server nhn bn tin SIP REGISTER yu cu v cp nht thng tin t bn tin request vo location database nm trong Location Server.

n tt nghip

39

DANH SCH HNH V

Mt Registration server c bit nh l mt Registrar, chp nhn cc yu cu ca SIP REGISTER, tt c cc yu cu nhn mt p ng : 501 Not Implemented. Thng tin lin quan t yu cu lm cho cc SIP server c sn bn trong ging Administrator Domain, chng hn nh cc proxy v Redirect server. Trong mt yu cu resistration, trng TO cha tn ca ti nguyn bt u registed, v trng Contact cha a ch khc hoc tn hiu. Registration server to ra mt lin kt tm gia Address Of Record (AOR) URI trong TO v thit b URI trong Contact Courier. Registration server thng yu cu cc User agent ng k xc thc, v vy cc cuc gi i vo khng b chim ot bi cc user khng c xc thc. Ph thuc vo s hin din ca cc trng, REGISTER request c th c s dng bi mt user agent ly li mt danh sch ca cc registration hin thi, lm sch tt c registrations, hoc thm vo mt registration URI. bo v registration, TLS phi c s dng nh HTTP Digest khng cung cp nhu cu bo v ton vn. d. Location Server Location Server lm nhim v lu thng tin trng thi hin ti ca ngi dng trong mng SIP. 2.2.2.3. SIP Gateway SIP Gateway l mt ng dng m n cho php giao thc bo hiu SIP i t mng SIP sang cc mng khc. Trong giao thc SIP, Gateway l mt loi User Agent c bit, y n hot ng vi t cch l mt giao thc. Mt Gateway kt thc ng bo hiu v c th kt thc ng truyn thng. V d t mng SIP qua mng H.323, Gateway kt thc ng bo hiu SIP v chuyn sang ng bo hiu cho H323, nhng SIP user agent v thit b u cui ca H.323 c th trao i RTP trc tip vi nhau m khng cn ti Gateway

n tt nghip

40

DANH SCH HNH V

Trng hp t mng SIP sang mng PSTN gateway kt thc c hai ng bo hiu v truyn thng. SIP c th c chuyn i vo trong hoc nh hng ln nhau, cc giao thc PSTN ph bin nh l ISDN, ISDN User Part (ISUP) v giao thc bo hiu trong knh khc (CAS). Mt gateway PSTN chuyn i c lung truyn thng RTP trong mng IP thnh mt chun in thoi trung k. Vic chuyn i tn hiu bo hiu v truyn thng cho php gi n v i t mng PSTN s dng SIP.
Black phones

SIP Gatewate Black phones

PSTN SIP Network


SIP/PSTN Gateway

PBX

Black phones

ISDN phone SIP/H.323 Gateway SIP enabled PC SIP Phone ` H.323 enabled PC

H.323 Network

H.323 phone

Hnh 2-7: Mng SIP s dng Gateway Trong mt vi trng hp Gateway truyn thng MG v Gateway iu khin MGC tch ri nhau. Mt gateway iu khin MGC trong vi trng hp c gi l Agent bi b n qun l giao thc iu khin cuc gi trong khi MG qun l kt ni truyn thng. Trong trng hp tch ri ny th trong sut i vi SIP v cc giao thc c s dng tch ri mt gateway khng c tm hiu trong lun vn ny.

n tt nghip

41

DANH SCH HNH V

trong mt vng a l rng ln. Nhng Gateway khng h tr ng k cho cc User. Mt giao thc khng phi giao thc SIP c th c s dng cc Proxy thng tin khng chnh xc v gateway v gip nh tuyn. Mt giao thc c ngh l TRIP, giao thc ny cho php mt vng lin kt trong bng nh tuyn ca gateway c pht trin. Ngoi ra cn giao thc TGREP cho php Gateway ng k vi Proxy server trong cng mt min.

n tt nghip

42

DANH SCH HNH V

CHNG 3 CC GIAO THC TRUYN TI V BO HIU TRONG VOIP

3.1. Giao thc TCP/IP 3.1.1. Gii thiu b giao thc TCP/IP TCP/IP l mt b giao thc m c xy dng cho mng Internet m tin thn ca n l mng ARPnet ca b quc phng M. Do y l mt giao thc m, nn n cho php bt k mt u cui no s dng b giao thc ny u c th c kt ni vo mng Internet. Chnh iu ny to nn s bng n ca Internet ton cu trong thi gian gn y. Trong b giao thc ny, hai giao thc c s dng ch yu l giao thc truyn ti tin cy TCP (Transmission Control Protocol) v IP (Internet Procol). Chng cng lm vic vi nhau cung cp phng tin truyn thng lin mng.
OI S Ap a n p lic tio P s n tio re e ta n S s io es n Ta s o t r np r
TP C UP D S T MP

TPP C /I Ap a n p lic tio


FP T
TL E E NT

DS N

Ntw rk e o

IC P M

IG P M

In r e te n t
AP R RR AP

DtaL k a in P y ic l hs a

Ntw r A c s e ok c es

Hnh 3-1: M hnh OSI v TCP/IP

n tt nghip

43

DANH SCH HNH V

3.1.1.1. Lp ng dng (Application Layer) Lp ng dng l giao din gia ngi dng v mng Internet, lp ng dng s dng cc dch v lp TCP/IP kim sot cc giao thc lp cao, biu din thng tin, m ha v iu khin hi thoi. TCP/IP c cc giao thc h tr cc ng dng sau: File Transfer Protocol (FTP): l giao thc truyn tp tin, n s dng TCP truyn cc tp tin gia cc h thng c h tr FTP. Trivial File Transfer Protocol (TFTP): l giao thc truyn tp tin dng UDP (User Data Protocol). TFTP c dng trn router truyn cc file cu hnh v cc Cisco IOS image v truyn cc file gia cc h thng h tr TFTP. Hot ng nhanh hn FTP trong mi trng n nh. Network File System (NFS): l b giao thc cho php truy sut file n cc thit b lu tr xa nh mt a cng qua mng. Simple Mail Transfer Protocol (SMTP): qun l hot ng truyn e-mail qua mng my tnh. Terminal Emulation (Telnet): cung cp kh nng truy nhp t xa vo my tnh khc. N cho php mt user ng nhp vo mt internet host v thc thi cc lnh. Simple Network Management Protocol (SNMP): l giao thc cung cp phng php gim st v iu khin cc thit b mng v qun l cc cu hnh, thu thp thng k, bo mt. Domain Name System (DNS): l mt h thng trn internet thng dch tn ca cc min v cc node mng c qung co cng khai sang a ch IP.

n tt nghip

44

DANH SCH HNH V

Hnh 3-2: Lp ng dng 3.1.1.2. Lp vn chuyn (Transport Layer) Lp vn chuyn cung ng dch v vn chuyn t host ngun n host ch, n thit lp cu ni gia cc u cui ca mng. Giao thc vn chuyn phn chia v ti thit lp d liu ca cc ng dng lp trn thnh lung d liu ging nhau gia cc u cui. iu khin end-to-end c cung cp bi ca s trt v tnh tin cy trong cc s tun t v bo nhn l nhim v then cht ca lp vn chuyn khi dung TCP. Lp ny chy trn nh ca lp Internet v bao gm hai giao thc l TCP v UDP. TCP l mt kiu phng thc hng kt ni cho php cung cp cc dch v tin cy cn UDP s dng phng thc hng khng kt ni cung cp cc dch v km tin cy hn.

Hnh 3-3: Lp vn chuyn

n tt nghip

45

DANH SCH HNH V

3.1.1.3. Lp Internet (Internet Layer) Mc ch ca lp Internet l chn ng i tt nht xuyn qua mng chuyn tip cc gi tin t ngun ti ch. Mi gi tin cha a ch ch v IP s dng thng tin ny truyn gi tin ti ch ca n. Giao thc IP c chy trn tt c cc my ch (Host) cng nh trong tt c cc thit b nh tuyn (Router). Lp IP l lp kt ni phi hng ngha l mng khng cn thit lp bt k mt ng dn no n ch trc khi gi tin c truyn qua mng n ch. Do vy, mi gi n ch vi mi ng ti u khc nhau v IP khng m bo th t n ch ca cc gi tin. Cc giao thc hot ng ti lp internet : IP cung cp kt ni phi hng (connectionless) ngha l khng quan tm n ni dung gi tin nhng tm ng dn cho gi ti ch. ICMP (Internet Control Message Protocol) em n kh nng iu khin v chuyn thng ip. ARP (Address Resolution Protocol) xc nh a ch MAC khi bit a ch IP RARP (Reverse Address Resolution Protocol) xc nh a ch IP khi bit trc a ch MAC

Hnh 3-4: Lp internet 3.1.1.4. Lp truy cp mng (Network Access Layer)

n tt nghip

46

DANH SCH HNH V

Lp truy nhp mng lin quan n tt c cc ch gi IP cn thc s to ra mt lin kt vt l n mi trng truyn ca mng. Cc chc nng ca lp truy nhp bao gm nh x a ch IP sang a ch vt l v ng gi (encapsulation) cc gi IP thnh cc frame. Cn c vo dng phn cng v giao tip mng, lp truy nhp s xc lp kt ni vi ng truyn vt l ca mng, phng tin truyn dn m bo s truyn dn an ton cc khung thng tin trn bt k mt phng tin truyn dn no nh Ethernet, ATM, token-ring, frame-relay,

Hnh 3-5: Lp truy cp mng 3.1.2. Hot ng ca mng IP 3.1.2.1. a ch IP a ch IP l a ch lp mng, c s dng nh danh cc my trm (HOST) trong lin mng. a ch IP c di 32 bt i vi IPv4 v 128 bt vi IPv6. N c th c biu th di dng thp phn, bt phn, thp lc phn v nh phn. C hai cch cp pht a ch IP ph thuc vo cch thc ta kt ni mng. Nu mng ca ta kt ni vo mng Internet, a ch mng c xc nhn bi NIC (Network Information Center). Nu mng ca ta khng kt ni vi Internet, ngi qun tr mng s cp pht a ch IP cho mng ny.

n tt nghip

47

DANH SCH HNH V

V c bn, khun dng a ch IP gm hai phn: Network Number v Host Number nh hnh v:

Trong , phn Network Number l a ch mng cn Host Number l a ch cc my trm lm vic trong mng . a ch IP l 32 bt l rt t do vy m rng kh nng nh a ch cho mng IP v v nhu cu s dng c rt nhiu quy m mng khc nhau, nn ngi ta chia cc i ch IP thnh 5 lp k hiu l A, B, C, D v E c cu trc nh sau:

Hnh 3-6: Cc loi a ch IP Lp A: c xc nh bng bt u tin trong byte th nht l 0 v dng cc bt cn li ca byte ny nh danh mng. Cc a ch lp A dung octet u tin ghi a ch mng, ba octet cn li cung cp a ch host. Do , n cho php nh danh ti 126 mng, vi 16 triu my trm trong mi mng. Lp B (/16): c xc nh bng hai bt u tin nhn gi tr 10, v s dng byte th nht v th hai cho nh danh mng. N cho php nh danh 16.384 mng vi ti a 65.535 my trm trn mi mng.

n tt nghip

48

DANH SCH HNH V

Lp C (/24): c xc nh bng ba bt u tin l 110 v dng ba byte u nh danh mng. N cho php nh danh ti 2.097.150 mng vi ti a 254 my trm trong mi my trm trong mi mng. Do , n c s dng trong cc mng c quy m nh. Lp D: c to ra multicasting cho a ch IP. Mt a ch multicast l mt a ch mng duy nht hng dn cc gi n mt nhm cc a ch IP. Do mt my trm c th truyn lung s liu n nhiu ch mt cch ng thi. a ch lp D c xc nh bng bn bt u tin l 1110, n c dng gi cc IP datagram ti mt nhm cc host trn mt mng. Tt c cc s ln hn 233 trong trng u l thuc nhm D. Lp E: c xc nh bng nm bt u tin l 11110, c d phng cho tng lai. Vi phng thc nh a ch IP nh trn, s lng mng v s my ti a trong mi lp mng l c nh. Do , s ny sinh vn l c cc a ch khng c s dng trong mng ca mt doanh nghip, trong khi mt doanh nghip khc li khng c a ch mng dng. Do tit kim a ch mng, trong nhiu trng hp mt mng c th c chia thnh nhiu mng con (subnet). Khi , c th a thm cc vng subnetID nh danh cho cc mng con. Vng subnetID ny c ly t vng hostID ca cc lp A, B v C. 3.1.2.2. IP Datagram

n tt nghip

49

DANH SCH HNH V

Hnh 3-7: nh dng Header ca gi tin IP Cc gi IP bao gm d liu t lp trn v thm vo mt IP header gm cc thnh phn sau : Version : ch ra phin bn hin hnh ca IP ang c dung gm 4 bit. Nu trng ny khc vi phin bn IP ca thit b nhn th n s t chi cc gi ny. Header length : ch ra chiu di header theo cc t 32 bit. y l tng chiu di ca tt c thng tin header. Type of version : ch ra tm quan trng c gn bi mt giao thc lp trn, bao gm 8 bit Total length : ch ra ton b gi tnh theo byte, bao gm d liu v header, c 16 bit Identification : cha mt s nguyn nh danh cho datagram hin hnh, gm 16 bit. y l ch s tun t. Flag : bao gm 3 bit bit th nht c th gi tr zero, bit th hai c ngha l ng phn mnh na cn bt cui cng c ngha l tip tc phn mnh.

n tt nghip

50

DANH SCH HNH V

Fragment offset : c dung ghp cc mnh datagram li vi nhau, c 13 bit. Field ny cho php field trc kt thc ti ranh gii 16 bit.

Time to live : Ch ra s bc nhy m mt gi c th i qua. Con s ny s gim i mt mi khi gi i qua mt router. Khi b m t ti 0 gi ny s b loi. y l gii php nhm ngn chn tnh trng lp vng v hn ca gi no .

Protocol : Ch ra giao thc lp trn TCP hay UDP, tip nhn cc gi n khi cng on x l IP hon tt, gm 8 bit.

Header checksum : Gip m bo ton vn IP header, c 16 bit. Source address : ch ra a ch IP ngun ca node truyn datagram, gm 32 bit. Destination address : ch ra a ch IP ch ca node nhn, c 32 bit. Option : cho IP h tr cc ty chn khc nhau, v d nh bo mt, c chiu di thay i.

3.1.2.3. nh tuyn IP nh tuyn l mt tin trnh thc hin vic tm kim mt ng i tt nht t mt thit b ti mt thit b khc. Thit b chnh thc hin vic ny l router .

Mt router c chc nng duy tr v cp nht bng nh tuyn khi c s thay i v cu trc vt l mng - topology (thc hin bi giao thc nh tuyn). Khi mt gi tin n router th router phi s dng bng nh tuyn quyt nh gi gi tin n u t a gi tin ra cng tng ng. Router l thit b lp mng (lp 3) s dng mt hay nhiu tham s nh tuyn quyt nh ng i tt nht cho gi tin ty theo giao thc nh tuyn m n s dng. nh tuyn trn Internet c thc hin da trn cc bng nh tuyn (Routing table) c lu ti cc trm (Host) hay trn cc thit b nh tuyn (Router). Thng tin trong cc bng nh tuyn c cp nht t ng hoc do ngi dng cp nht.

n tt nghip

51

DANH SCH HNH V

Hot ng nh tuyn bao gm hai hot ng c bn sau: Qun tr c s d liu nh tuyn theo bng nh tuyn. Thut ton nh tuyn.

3.1.3. Giao thc TCP/UDP 3.1.3.1. Giao thc TCP (Transport Control Protocol) TCP l giao thc iu khin truyn dn c tin cy cao c thit k phc v vic lin lc gia hai host v ch h tr phng thc truyn unicasting. Trong ng dng truyn thoi VoIP, giao thc TCP c s dng lm giao thc truyn bo hiu ch khng phc v vic truyn cc tn hiu thoi. L do v header ca TCP ln v v m bo tnh chnh xc cao ca ng truyn nn giao thc TCP gy ra thi gian tr ln nh hng n cht lng cc ng dng thi gian thc. V m bo tnh chnh xc v th t nn giao thc TCP c ng dng truyn bo hiu. Giao thc TCP thc hin cc tnh nng chnh nh sau: Thit lp lin kt: Khi hai thc th TCP mun trao i d liu vi nhau cn phi thit lp mt lin kt logic gia chng. Lin kt c thit lp phi c m bo v tnh chnh xc v tin cy, khi lin kt khng cn tin cy th lin kt s b hu b v thit lp li. Khi hon tt vic truyn thng cc lin kt s c gii phng. thc hin vic thit lp lin kt cc modul TCP s dng mt c ch c bit gi l bt tay ba chiu (three way handshake). Bo m tnh chnh xc: Giao thc TCP cung cp cc tham s kim tra cng nh sa l sequence number, ACK (Acknowledge) v checksum. Cc segment c nh s hiu tun t do vy d dng loi b cc segment b thu c nhiu ln hoc cc segment khng t yu cu. Cc segment sau khi thu c s c kim tra nh trng checksum. Nu chng c thu ng th s pht li tn hiu ACK khng nh.

n tt nghip

52

DANH SCH HNH V

Nu segment b thu li, segment s b loi b v n s c pht li. Nh ACK m cc segment li hay b mt s c pht li bo m c tnh chnh xc ca d liu. Ngoi ra giao thc TCP cn cung cp mt s chc nng iu khin lung v iu khin tc nghn (flow control v congestion control) cho php kim sot v trnh c s tc nghn trn mng. 3.1.3.2. Giao thc UDP (User Data Protocol) UDP l mt trong hai giao thc truyn d liu c s dng trn c s ca giao thc IP. Cc n v d liu c trao i l cc UDP datagram. Giao thc UDP l giao th khng c lin kt v khng c cc c ch m bo tin cy. Giao thc UDP khng cung cp cc c ch kim tra, truyn li cng nh cc c ch phn hi kim sot tc lung d liu. Do cc UDP datagram c th b thu c nhiu ln hoc thu khng ng. Tuy vy UDP cng cung cp cc c ch qun l s hiu cng phn bit gia nhiu chng trnh c chy trn cng mt my tnh. Hn na cu trc ca UDP datagarm n gin nn thi gian tr truyn dn cng nh thi gian x l cng ngn hn do tc truyn s nhanh hn. Cc chng trnh da vo giao thc UDP thng c s dng trong phm vi hp (local environment) hn l trong phm vi rng nh Internet. Cu trc UDP datagram: Source Massage UDP Data Destination Port Checksum

Hnh 3-8: Cu trc UDP datagram Trong :

n tt nghip

53

DANH SCH HNH V

Source Port (16 bit): s hiu cng ca trm ngun. Destination Port (16 bit): s hiu cng ca trm ch. Message Length (16 bit): ch r di phn UDP datagram (tnh theo byte) bao gm c phn header v phn data. di nh nht ca UDP datagram l 8 byte khi ch c phn header.

Checksum (16 bit): m kim sot li.

Cu trc tiu gi ca UDP Trng UDP checksum khng ch c tnh ring cho UDP datagram. tnh ton phn checksum UDP xy dng mt header gi v header gi ny khng c truyn i cng UDP datagram. Ban u phn checksum c gn bng khng sau cng ln lt mi ln 16 bit vo . Phn checksum c tnh bao gm header gi, UDP header v datagram. Mc ch ca vic s dng header gi l xc nhn UDP datagram c truyn ng ch. Cha kho hiu header gi l ch nhn ra c a ch ch v giao thc c s dng ti ch. Cn UDP header n thun ch ch r s hiu cng c s dng. xc nhn a ch ch, bn pht tnh checksum bao gm c phn a ch IP v UDP datagram. Ti ch cui cng, chng trnh s xc nhn phn checksum s dng a ch IP thu c trong phn IP header. Nu ng th c ngha l datagram tm n ng ch nh sn bao gm c giao thc c s dng. Cu trc header gi c trnh by nh hnh v: Source IP Address Destination IP Address Zero Protocol UDP Length

Hnh 3-9: Cu trc header Trong :

n tt nghip

54

DANH SCH HNH V

Source IP address (32 bit): a ch IP ca trm ngun. Destination IP address (32 bit): a ch IP ca trm ch. Zero (8 bit): ch r giao thc c s dng trm ch (17 l dnh cho UDP). UDP length (16 bit): di ca UDP datagram khng k pseudo header. kim tra checksum, pha thu khi phc tham s ny t IP header.

3.2. Giao thc RTP, RTCP v RSTP 3.2.1. RTP (Real-time Transport Protocol) RTP l mt giao thc da trn giao thc IP to ra cc h tr truyn ti cc d liu yu cu thi gian thc (Audio, video,...) vi cc yu cu: Lin tc: Cc gi tin phi c sp xp theo ng th t khi chng n bn nhn, cc gi n c th khng theo th t v nu gi tin b mt th bn nhn phi d tm hay b li s mt cc gi tin ny. S ng b trong cc phng thc truyn thng: Cc khong lng c trit v nn li gim thiu bng thng cn thit, tuy nhin khi n bn nhn, thi gian gia cc khong lng ny phi c khi phc mt cch chnh xc. S ng b gia cc phng thc truyn thng: C th tn hiu thoi s dngmt phng thc truyn thng trong khi tn hiu video li s dng mt phngthc truyn thng khc, cc tn hiu ting v hnh phi c ng b mt cchchnh xc, gi l s ng b ting - hnh. S nhn din phng thc truyn ti: Trong Internet, thng thng cn thay i s m ho cho phng thc truyn ti (payload) trn hnh trnh truyn hiuchnh thay i rng bng thng sn sng hoc kh nng cho ngi dngmi kt ni vo nhm. Mt vi c ch cn c s dng nhn din s m ho cho mi gi n.

n tt nghip

55

DANH SCH HNH V

Cu trc gi tin RTP:

VER

P X CC

M PT

Sequence Number

Timestamp Synchronysation source (SSCR) identifier Contributing source (CCRC) identifier (optional) Extension header (optional)

Hnh 3-10: Cu trc gi tin RTP Trong : Version (2 bit): ch r version ca RTP hin ti ang c ci t. Padding (1 bit): c vai tr nh bit c c s dng nh du khi c mt s byte c chn vo trong gi. Extension (1 bit): cng c vai tr nh mt bit c c s dng nh du khi c header m rng tip theo header c nh. CSRC count (4 bit): ch r s lng ca CSRC (contributing source) c trong RTP header. Marker (1 bit): c vai tr nh mt bit c, trng thi ca n c ph thuc vo trng payload type. Payload Type (7 bit): ch r loi thng tin c cha trong cc gi. Serquence Number (16 bit): cung cp s th t ca cc gi. Time-stamp (32 bit): l tham s nh du thi im byte u tin c ly mu trong gi RTP.

n tt nghip

56

DANH SCH HNH V

Syschronisation source (SSRC) identifier: s nhn dng ngun ca gi d liu. Nu ng dng mun truyn d liu c nhiu dng khc nhau trong cng mt thi im (v d l tn hiu audio v video) th s c nhng phin truyn ring cho mi dng d liu. Sau ng dng s tp hp cc gi tin c cng nhn dng SSRC. S nhn dng ny c gn mt cch ngu nhin.

Contribute source (CSRC) identifer ( di thay i): v d ti mt im ch no m nhng tn hiu audio n ch cn trn li vi nhau th gi tr CSRC s l tp hp tt c cc gi tr SSRC ca cc ngun m gi tn hiu n im ch . Trng CSRC c th cha ti a l 15 s nhn dng ngun SSRC.

Extension header ( di thay i): cha cc thng tin thm ca gi RTP. RTP thc hin vic qun l v thi gian truyn d liu v nhn dng d liu c

truyn. Nhng RTP khng cung cp bt c mt c ch no m bo thi gian truyn v cng khng cung cp bt c mt c ch no gim st cht lng dch v. S gim st v m bo v thi gian truyn dn cng nh cht lng dch v c thc hin nh hai giao thc RTCP v RSVP. 3.2.2. RTCP (Real-time Transport Control Protocol) Mc d RTP l mt giao thc c lp nhng thng c h tr bi giao thc RTCP. RTCP tr v ngun cc thng tin v s truyn thng v cc thnh phn ch. Giao thc iu khin ny cho php gi v cc thng s v bn thu v t thch nghi vi bn pht cho ph hp vi bn pht. Mi ngi tham gia mt phin truyn RTP phi gi nh k cc gi RTCP ti tt c nhng ngi khc cng tham gia phin truyn. Tu theo mc ch m RTCP thc hin 4 chc nng: RTCP cung cp mt s phn hi cht lng ca d liu. Cc thng tin gip cho ng dng thc hin chc nng iu khin lung v qun l tc nghn.

n tt nghip

57

DANH SCH HNH V

RTCP cung cp s nhn dng m c s dng tp hp cc kiu d liu khc nhau (v d audio v video). iu ny l cn thit v kh nng ny khng c RTP cung cp.

Nh vic nh k gi cc gi tin RTCP m mi phin truyn c th theo di c s ngi tham gia. RTP khng th s dng c cho mc ch ny khi mt ai khng gi d liu m ch nhn t nhng ngi khc.

Cui cng l mt chc nng la chn cho php c thm thng tin v nhng ngi tham gia vo phin truyn. Tu thuc vo giao thc RTP c s dng cho loi d liu no m RTCP cung

cp cc thng bo iu khin khc nhau. C 4 loi thng bo iu khin chnh c giao thc RTCP cung cp l: Sender report (SR): thng bo ny cha cc thng tin thng k lin quan n kt qu truyn nh t l tn hao, s gi d liu b mt, khong tr. Cc thng bo ny pht ra t pha pht trong mt phin truyn thng. Receiver report (RR): thng bo ny cha cc thng tin thng k lin quan n kt qu nhn gia cc im cui. Cc thng bo ny c pht ra t pha thu trong mt phin truyn thng. Source description (SDES): thng bo bao gm cc thng s m t ngun nh tn, v tr,... Application (APP): thng bo cho php truyn cc d liu ng dng.

Cu trc gi tin RTCP: VER P Report Conunter Report Hnh 3-11: Cu trc gi tin RTCP Packet Type Length

n tt nghip

58

DANH SCH HNH V

Trong : Version (2 bit): ch r version ca giao thc RTP hin ti ang ci t. Hin ti cc giao thc RTP ang c s dng l version 2. Padding (1 bit): c chc nng nh mt bit c ch r xem trong gi c cc byte c chn thm hay khng. Report counter (5 bit): ch r s thng bo cha trong gi (mi ngun c mt thng bo). Packet type (8 bit): xc nh loi thng bo ca gi (SR hoc RR hoc APP). Length (16 bit): ch r di ca gi. Report ( di thay i): cha cc thng bo chi tit.

3.2.3. RSVP (Resource Reservation Protocol) Giao thc RSVP c s dng nh mt giao thc bo hiu h tr cho RTP. Mc ch ca RSVP l cung cp mt c ch m bo bng thng cho cc hot ng ca cc ng dng. RSVP gi tham s cht lng dch v QoS kt hp vi cc d liu thi gian thc c truyn trn mng TCP/IP. H tr giao thc RTP, giao thc RSVP c th gii quyt cc li xy ra trn ng truyn m bo cc tham s cht lng. Tht vy, giao thc RTP ch h tr vic truyn thng im im v khng qun l cc tham s lin kt trn mng. RSVP khng nhng tc ng my pht, my thu m cn tc ng trn c cc router trong mng. RSVP thit lp v duy tr kt ni duy nht cho mt lung d liu, xc lp mt h thng qun l th t cc gi v to modun iu khin qun l cc ngun ti nguyn ca cc nt mng khc nhau. RSVP a ra mt m hnh ti u lin kt cc d liu t mt ngun ti nhiu ch. RSVP ng vai tr qun l mt cch lp cc host ch t thch nghi cc tham s cht lng gia kh nng cung cp v nhu cu p ng.

n tt nghip

59

DANH SCH HNH V

Vic dnh ring cc ti nguyn c yu cu bi bn thu bng cch pht mt yu cu cht lng di dng mt bn tin RSVP tng thch vi nhu cu ca chng. Thc t s dng RSVP nhm m bo cht lng trong vic truyn tin. m bo ng truyn thng sut cc im cui phi hot ng ch kt ni. My thu phi thng xuyn gi cc bn tin RSVP n cc router m bo thng sut ng truyn. RSVP hot ng trn c s x l cc gi tin theo mt yu cu cht lng dch v QoS. Hai thnh phn chnh thc hin chc nng ny l flowspec v filterspec. Flowspec c chc nng kim tra lung d liu c truyn nh mt yu cu dch v ca cc ng dng m kt qu l a ra mt yu cu v cht lng dch v QoS. Flowspec a ra mt yu cu cht lng dch v cn filterspec c nhim v lc b cc gi tin m khng m bo yu cu v cht lng dch v, nhng gi ny s c cung cp mt phng thc truyn tt nht c th p ng yu cu cht lng dch v. Mi quan h ca flowspec v filterspec c m t trn hnh v.

Hnh 3-12: Quan h ca flowspec v filterspec 3.3. Cc giao thc iu khin v bo hiu trong VoIP 3.3.1. H.323 3.3.1.1. Gii thiu H.323

n tt nghip

60

DANH SCH HNH V

Khi cp n thoi IP, tiu chun quc t thng c cp n l H.323. Giao thc H.323 l chun do ITU-T SG16 pht trin cho php truyn thng a phng tin qua cc h thng da trn mng chuyn mch gi, v d nh Internet. N c ITUT ban hnh ln u tin vo nm 1996 v gn y nht l nm 1998. H.323 l chun ring cho cc thnh phn mng, cc giao thc v cc th tc cung cp dch v thng tin a phng tin nh : audio thi gian thc, video v thng tin d liu qua cc mng chuyn mch gi, bao gm cc mng da trn giao thc IP. Tp giao thc H.323 c thit k hot ng trn tng vn chuyn ca cc mng c s. H.323 l mt chun giao thc bo hiu ca h thng VoIP. Chun H.323 bao gm bo hiu, iu khin cuc gi, truyn, iu khin a phng tin v iu khin bng thng cho hi ngh im - im v a im. Chun H.323 bao gm cc giao thc c lit k trong bng: Bng : Cc giao thc ca chun H.323 c im Bo hiu cuc gi iu khin phng tin B m ha m thanh B m ha hnh nh Chia s d liu Truyn ti phng tin H.225 H.245 G.711;G.722;G.723.1;G.728;G.729 H.261; H.263 T.120 RTP/RTCP Giao Thc

3.3.1.2. B giao thc H.323 B giao thc H.323 bao gm mt tp hp cc giao thc h tr tip nhn, thit lp, trng thi, kt thc, lung a phng tin v cc thng ip cuc gi trong h thng

n tt nghip

61

DANH SCH HNH V

H.323. Nhng giao thc ny c h tr cc c ch phn pht gi tin tin cy v khng tin cy trn mng d liu.

H.245

H.225 Call Control TCP IP RAS

Audio/video streams RTCP UDP RTP

Data / physical layers Hnh 3-13: Cc lp ca b giao thc H.323 Hu ht cc h thng H.323 thc thi s dng giao thc TCP nh l c ch vn chuyn bo hiu. H.323 version 2 s dng giao thc vn chuyn UDP. ng thi cc chun mi ang c nghin cu s mt c ch UDP ng tin cy khc to ra cc phng thc bo hiu khc. B giao thc H.323 c chia ra thnh ba phn iu khin chnh: Bo hiu RAS (Registration, Admissions, and Status) cung cp iu khin trc cuc gi trong mng H.323. Bo hiu iu khin cuc gi c s dng kt ni, duy tr, v ngt kt ni cuc gi gia cc im u cui. Vn chuyn v iu khin truyn thng cung cp knh H.323 tin cy m cc knh mang cc thng ip iu khin truyn thng. a. Bo hiu RAS

n tt nghip

62

DANH SCH HNH V

Cung cp cc th tc iu khin tin cuc gi trong mng H.323 c GK. Knh bo hiu RAS c thit lp gia cc u cui v cc GK trc cc knh khc. N c lp vi knh bo hiu cuc gi v knh iu khin H.245. Cc bn tin RAS c truyn qua mng thng qua kt ni UDP, thc hin vic ng k, cho php, thay i bng thng, trng thi v cc th tc hu b cuc gi. Bo hiu RAS gm nhng qu trnh sau: -

Tm GateKeeper. ng k : ng k l mt qu trnh cho php GW, cc u cui v MCU tham gia vo mt vng v bo cho GK bit a ch truyn vn v a ch b danh ca n.

nh v u cui Cho php, thay i bng thng, trng thi v hu quan h

b. Bo hiu iu khin cuc gi H.225 Trong mng H.323, th tc bo hiu cuc gi c da trn khuyn ngh H.225 ca ITU. Khuyn ngh ny ch r cch s dng v tr gip ca cc bn tin bo hiu Q.931. Sau khi khi to thit lp cuc gi. Cc bn tin iu khin cuc gi v cc bn tin gi cho knh bo hiu cuc gi tn ti (keepalive) c chuyn ti cc cng.
CALLER PARITY

CALLER

CALL SETUP

CALL PROCEEDING

ALERTING

CONNECT

n tt nghip

63

DANH SCH HNH V

Hnh 3-13: Tin trnh cc bn tin Q.931 Cc bn tin Q.931 thng c s dng trong mng H.323: Setup: c gi t thc th ch gi thit lp kt ni ti thc th H.323 b gi Call Proceeding: ch th rng th tc thit lp cuc gi c khi to. Alerting: ch th rng chung bn ch bt u rung. Connect: thng bo rng bn b gi tr li cuc gi. Release Complete: ch th rng cuc gi ang b gii phng. Facility: y l mt bn tin Q.932 dng yu cu hoc phc p cc dch v b sung. N cng c dng cnh bo rng mt cuc gi s c nh tuyn trc tip hay thng qua GK. c. Giao thc H.245 H.245 l giao thc iu khin cuc gi trong kin trc truyn thng a phng tin H.323 dng trao i cc bn tin H.245 gia cc H.323 Endpoint. Cc bn tin H.245 c truyn i trn knh iu khin H.245. H.245 cung cp cc chc nng nh:
-

Trao i kh nng im cui. Quyt nh ch t. ng m cc knh logic. Cc iu khin cuc gi

3.3.2. SIP 3.3.2.1. nh ngha Giao thc khi to phin SIP (Session Initiation Protocol) l mt giao thc iu khin v c chun ha bi IETF. Nhim v ca n l thit lp, hiu chnh v xa cc phin lm vic gia ngi dng. Cc phin lm vic cng c th l hi ngh a

n tt nghip

64

DANH SCH HNH V

phng tin, thoi Internet v cc ng dng truyn m thanh, hnh nh, d liu. SIP c s dng kt hp vi cc chun giao thc IETF khc nh l SAP, SDP v MGCP (MEGACO) cung cp mt lnh vc rng hn cho cc dch v VoIP. Cu trc ca SIP tng t vi cu trc ca HTTP (giao thc client-server). N bao gm cc yu cu c gi n t ngi s dng SIP client n SIP server. Server x l cc yu cu v p ng n client. Mt thng ip yu cu, cng vi cc thng ip p ng to nn s thc thi SIP. 3.3.2.2. Cc bn tin trong giao thc SIP v phn hi
-

INVITE: ch th rng thu bao hoc dch v c mi tham gia vo mt phin. N bao gm mt m t phin v i vi cc cuc gi song cng th bn ch gi ch th phng thc truyn thng (media) trong bn tin ny. Theo phng php n gin ny cc bn c th xc nh c cc kh nng ca bn kia v bt u mt phin hi thoi.

ACK: Nhng yu cu ny tng ng vi mt yu cu INVITE. Chng l s xc nhn cui cng t mt h thng cui v chm dt mt giao dch c khi to bi INVITE.

OPTIONS: Bn tin ny cho php truy vn v tp hp cc kh nng ca user agent v Network server. Tuy nhin yu cu ny khng c dng thit lp phin.

BYE: Bn ch gi vb gi s dng yu cu ny gii phng cuc gi. Trc khi thc s gii phng cuc gi, user agent gi yu cu ny ti Server cnh bo rng n mun gii phng phin lm vic.

CANCEL: Yu cu ny cho php User agent v Network server xo b bt k mt yu cu no ang thi hnh.

REGISTER: Yu cu ny c client dng ng k thng tin vi SIP server.

Cc bn tin p ng

n tt nghip

65

DANH SCH HNH V

1xx (Informational) Phn hi tm thi, cho bit nhn c yu cu, tip tc qu trnh yu cu.

2xx (Successful) Thng bo nhn c y , hiu v chp nhn. 3xx (Redirection) Thng bo cn c cc bn tin khc hon thnh yu cu. 4xx (Request Failure) Thng bo yu cu cha cu trc sai hoc khng c p ng server.

5xx (Server Failure) Thng bo server khng th p ng c yu cu c cu trc hp l.

6xx (Global Failure) Thng bo yu cu khng th x l c bt c server no.

3.3.4. Giao thc SGCP (Simple Gateway Control Protocol) Giao thc ny cho php cc thnh phn iu khin cuc gi c th iu khin kt ni gia trung k, cc thit b u cui vi cc gateway. Cc thnh phn iu khin c gi l Call Agent. SGCP c s dng thit lp, duy tr v gii phng cc cuc gi qua mng IP. Call Agent thc hin cc chc nng bo hiu cuc gi v gateway thc hin chc nng truyn tn hiu m thanh. SGCP cung cp nm lnh iu khin chnh nh sau: Notification Request: yu cu gateway pht cc tn hiu nhc t my v cc tn hiu quay s DTMF. Notify: gateway s dng lnh ny thng bo vi Call Agent v cc tn hiu c pht hin trn. Create Connection: Call Agent yu cu khi to kt ni gia cc u lin lc trong gateway.

n tt nghip

66

DANH SCH HNH V

Modify Connection: Call Agent dng lnh ny thay i cc thng s v kt ni thit lp. Lnh ny cng c th dng iu khin lung cho cc gi tin RTP i t gateway ny sang gateway khc.

Delete Connection: Call Agent s dng lnh ny gii phng cc kt ni thit lp. Nm lnh trn y iu khin gateway v thng bo cho call agent v cc s kin

xy ra. Mi lnh hay yu cu bao gm cc thng s c th cn thit thc thi cc phin lm vic. 3.3.5. Giao thc MGCP (Media Gateway Control Protocol) Giao thc MGCP cho php iu khin cc gateway thng qua cc thnh phn iu khin nm bn ngoi mng. MGCP s dng m hnh kt ni tng t nh SGCP da trn cc kt ni c bn gia thit b u cui v gateway. Cc kt ni c th l kt ni im-im hoc kt ni a im. Ngoi chc nng iu khin nh SGCP, MGCP cn cung cp thm cc chc nng sau: Endpoint Configuration: Call Agent dng lnh ny yu cu gateway xc nh kiu m ho ph ng dy kt ni n thit b u cui. AuditEndpoint v AuditConnection: Call Agent dng lnh ny kim tra trng thi v s kt ni mt thit b u cui. RestartIn-Progress: Gateway dng lnh ny thng bo vi Call Agent khi no cc thit b u cui ngng s dng dch v v khi no quay li s dng dch v.

n tt nghip

67

DANH SCH HNH V

CHNG IV XY DNG H THNG VOIP DA TRN ASTERISK


4.1. Tng quan h thng Asterisk 4.1.1. Gii thiu chung Asterisk l h thng chuyn mch mm, l phn mm ngun m c vit bng ngn ng C chy trn h iu hnh linux thc hin tt c cc tnh nng ca tng i PBX (Private Branch eXchange) v hn th na. Asterisk ra i vo nm 1999 bi mt chng trai sinh nm 1977 tn l Mark Spencer, Anh ta vit phn mm ny ban u khng ngoi mc ch h tr cho cng ty ca mnh trong vic lin lc m thoi h tr cng ng ngi s dng v pht trin Linux. Asterisk l mt phn mm mang tnh cch mng, tin cy, v min ph nhm bin mt PC r tin thng thng chy Linux thnh mt h thng in thoi doanh nghip mnh m. Asterisk l mt b cng c m ngun m cho cc ng dng thoi v l mt server x l cuc gi y chc nng.

n tt nghip

68

DANH SCH HNH V

Asterisk c xem nh l mt tng i PBX v c thm nhiu tnh nng mi. Ngoi nhng tnh nng ca mt tng i PBX thng thng, Asterisk cn c th kt hp c chuyn mch TDM v chuyn mch VoIP. Asterisk bt u c pht trin trn GNU/Linux nn x86 (Intel), nhng gi y n c th bin dch v chy trn OpenBSD, FreeBSD, Mac Os X v Microsoft Windows. Asterisk l mt h thng chuyn mch tch hp, va l cng ngh truyn thng TDM va l chuyn mch VoIP. N giao tip vi in thoi Analog thng thng, in thoi VoIP, ngoi ra cn c th giao tip vi mng PSTN v cc nh cung cp VoIP khc. 4.1.2. Kin trc Asterisk

Hnh 4-1: Kin trc Asterisk

n tt nghip

69

DANH SCH HNH V

Asterisk h tr mi kh nng c th c ca cng ngh telephony. Cng ngh ny gm c VoIP, SIP, H.323, IAX v MGCP (cho in thoi v gateway). Asterisk c th hp tc hot ng vi hu ht cc thit b thoi tiu chun v cc phn cng kt ni vi Asterisk th c gi khng cao. Asterisk h tr cng ngh in thoi truyn thng nh ISDN PRI v sng mang T bao gm c T1 hay E1. Cc ng dng thoi bao gm gi in, hi tho, voicemail, tr li t ng v nhiu ng dng khc na. Asterisk c mt s chc nng chnh ng vai tr quan trng trong h thng chuyn mch cuc gi. Khi khi ng h thng Asterisk th chc nng Dynamic Module Loader thc hin np driver ca thit b, np cc knh giao tip, cc format, codecs v cc ng dng lin quan, ng thi cc hm API cng c lin kt np vo h thng. Sau h thng PBX Switching Core ca Asterisk chuyn sang trng thi sn sng hot ng chuyn mch cuc gi, cc cuc gi c chuyn mch tu vo k hoch quay s (Dialplan ) c thc hin cu hnh trong file extension.conf. Chc nng Application Launcher rung chung thu bao, quay s, nh hng cuc gi, kt ni vi hp th thoi Scheduler and I/O Manager m nhim cc ng dng nng cao, cc chc nng c pht trin bi cng ng pht trin Asterisk. Codec Translator xc nhn cc knh nn d liu ng vi cc chun khc nhau c th kt hp lin lc c vi nhau. Tt c cc cuc gi nh hng qua h thng Asterisk u thng qua cc giao tip nh SIP, Zaptel, IAX. Nn h thng Asterisk phi m trch nhim v lin kt cc giao tip khc nhau x l cuc gi. H thng cng bao gm 4 chc nng API chnh: Codec translator API: cc hm m nhim thc thi v gii nn cc chun khc nhau nh G711, GMS, G729

n tt nghip

70

DANH SCH HNH V

Asterisk Channel API : Giao tip vi cc knh lin lc khc nhau, y l u mi cho vic kt ni cc cuc gi tng thch vi nhiu chun khc nhau nh SIP, IAX, H323. Zaptel

Asterisk file format API : Asterisk tng thch vi vic x l cc loi file c nh dng khc nhau nh Mp3, wav, gsm

Asterisk Aplication API : Bao gm tt c cc ng dng c thc thi trong h thng Asterisk nh voicemail, callerID

Ngoi ra, Asterisk cn c th vin Asterisk Gateway Interface (AGI, tng t nh CGI) - c ch kch hot ng dng bn ngoi, cho php vit kch bn phc tp vi mt s ngn ng nh PHP hay Perl. Ni chung, kh nng vit cc ng dng ty bin rt ln.
4.1.3. Nhng tnh nng c bn ca Asterisk 4.3.1.1. Asterisk l mt tng i PBX Asterisk c xem nh l mt tng i ni b v cho php kt ni hai hay nhiu in thoi ni b vi nhau, v thng kt ni ra bn ngoi bng mt hay nhiu ng dy in thoi. iu ny thng c hiu qu v mt chi ph hn so vi vic thu mt ng dy in thoi cho mi in thoi c nhu cu trong mt doanh nghip. Cuc gi station-to-station: Tng t nh mt PBX, Asterisk cho php thc hin cc cuc gi gia cc thu bao trong ni b bng cch quay s trc tip.

n tt nghip

71

DANH SCH HNH V

PBX
Fax Machines

PSTN
Terminal

Telephone

Hnh 4-2: Gi ni b Asterisk Line trucking: Asterisk c php hot ng vi ng trung k. Mc ch n gin nht ca ng trung k l nhm chia s nhiu ng dy in thoi. Cc ng dy in ny c dng kt ni n tng i PSTN nhng cng c th c dng kt ni n mt h thng in thoi khc. Nhng kt ni ny c th l mt hay nhiu ng trung k tng t hay nhiu ng kt ni s vi dung lng ln nhm cho php p ng nhiu cuc gi ng thi. 4.3.1.2. Nhng tnh nng c bn Conference call: cc cuc gi hi ngh c thit lp cho php ngi nhn cuc gi tham gia thng xuyn sut cuc gi hoc c th c thit lp ngi nhn cuc gi ch c php nghe m khng c php ni. Voicemail: y l tnh nng cho php h thng nhn cc thng ip tin nhn thoi, mi u cui c khai bo trong Asterisk cho php khai bo thm chc nng hp th thoi. Mi khi s in thoi bn th h thng s nh hng trc tip cc cuc gi ti hp th thoi tng ng khai bo trc. Call Forwarding: y l chc nng thng c s dng trong h thng Asterisk. Chc nng ny cho php chuyn mt cuc gi n mt hay nhiu s in thoi c

n tt nghip

72

DANH SCH HNH V

nh trc. Mt s trng hp cn chuyn cuc gi nh: chuyn cuc gi khi bn, chuyn cuc gi khi khng tr li, chuyn cuc gi tc thi. Caller ID: chc nng ny rt hu dng khi mun bit thng tin thu bao gi n nhm ngn chn nhng cuc gi khng mong mun. Time and Date: Vo tng thi gian c th cuc gi s nh hng n mt s in thoi hay mt chc nng c th khc. V d trong cng ty gim c mun ch cho php nhn vin s dng my in thoi trong gi hnh chnh, cn ngoi gi th s hn ch hay khng cho php gi ra bn ngoi. Privacy Manager: Khi mt ngi ch doanh nghip trin khai Asterisk cho h thng in thoi ca cng ty mnh nhng li khng mun nhn vin trong cng ty gi i ra ngoi tr chuyn vi bn b, khi Asterisk cung cp mt tnh nng tin dng l ch cho php s in thoi c lp trnh, c php gi n nhng s my c nh no thi, cn nhng s khng c trong danh sch nh sn s khng thc hin cuc gi c. Call Detail Records: Asterisk gi li cc d liu chi tit cuc gi y . Chng ta c th cha thng tin ny trong mt tp tin, hoc tt hn l c mt database lu tr v tra cu cho hiu qu. Da vo thng tin ny chng ta c th gim st lu lng thoi ca h thng Asterisk t chng ta c th so snh cc d liu ny vi ha n m cng ty in thoi gi n. Call Recording: Asterisk cung cp cho chng ta mt chc nng ghi m cc cuc gi thng qua PBX. Da vo nh gi cht lng cuc gi nhm ci tin cht lng v em n s hi lng cho khch hng cng nh kh nng gip trong cc trng hp c lin quan n php lut.

n tt nghip

73

DANH SCH HNH V

Blacklist: Blacklist cng ging nh Privacy Manager nhng c mt s khc bit l nhng my in thoi nm trong danh sch s khng gi c n my ca bn (s dng trong tnh trng hay b quy ri in thoi).

4.3.1.3. Asterisk l mt h thng phn phi cuc gi tin tin Asterisk c th nhn mt cuc thoi, xem xt c tnh ca cuc gi, v thc hin nh tuyn da trn c s . Chng ta c th yu cu ngi gi b sung thng tin bng cch n phm ch tone, t Asterisk s a ra nhng cnh tng ng vi phm nhn DTFM m ngi gi nhp vo. Mt khi chng ta nh tuyn cuc gi, chng ta c th gi yu cu n mt extension n, mt nhm extension, hp th thoi, hoc ngay c mt nhm in thoi vin. Bn cnh chng ta cn c th s dng cc hng i phc v khch hng mt cch hiu qu hn na. S gii hn c bao nhiu cuc gi trong hng i (call queue) c quyt nh ch bi phn cng chng ta s dng. 4.3.1.4. Asterisk l mt h thng IVR (Interactive Voice Response) Chng ta c th s dng Asterisk thc hin chc nng tng tc thoi (IVR) nhm cung cp dch v 24/24 v gim bt gnh nng cho nhn vin bng cch pht cc file c thu m, c mt on vn bn hay l vn truy vn thng tin t database. Chc nng ny thng c dng trong ngn hng hay th trng chng khon nhm tm hiu cc thng tin v ti khon cng nh gi tr cc loi c phiu. V d nh khi gi n ngn hng, ta s c nghe cc on ghi m khc nhau v a ra yu cu bng cch nhn phm. Gi s nh ban u bn c nghe li cho v sau c yu cu nhp s ti khon cng nh cc thng tin c nhn hay cc thng tin chng thc. Trong trng hp bn mun tm hiu thng tin c nhn th h thng s truy cp vo database ca bn p ng cc yu cu nh l: phin giao dch sau cng hay s d ti khon,..

n tt nghip

74

DANH SCH HNH V

4.3.2. Cc m hnh trin khai h thng Asterisk Asterisk thc hin c rt nhiu ng cnh ng dng khc nhau ty vo nhu cu s dng, di y l nhng ng cnh thng c s dng trong thc t trin khai h thng Asterisk. 4.3.2.1. Tng i VoIP PBX y l h thng chuyn mch VoIP c xy dng phc v cc cng ty c nhu cu thc hin trn nn tng mng ni b trin khai. Thay v lp t mt h thng PBX cho nhu cu lin lc ni b th nn lp t h thng IP-PBX, iu ny s lm gim chi ph ng k. H thng c th lin lc vi mng PSTN qua giao tip TDM . H thng IP PBX bao gm m hoc nhiu in thoi chun SIP, in thoi VoIP, mt my ch IP PBX v c th ty chn thm mt VoIP Gateway. Cc my SIP client c th l in thoi dng phn mm hay phn cng s tin hnh ng k vi my ch IP PBX v khi chng mun thc hin cuc gi th s yu cu my IP PBX thit lp kt ni. My IP PBX c mt danh sch tt c in thoi, ngi dng v a ch SIP tng ng ca h v do vy c kh nng kt ni cuc gi trong mng hay nh hng cuc gi ra bn ngoi thng qua thit b VoIP gateway hay mt nh cung cp dch v VoIP khc. Vi chc nng chuyn mch ca mt tng i IP PBX, vic thc hin chuyn mch cuc gi gia cc my in thoi ni b vi nhau v chuyn cuc gi vi cc my in thoi bn ngoi thng qua ng trung k. Ngoi ra cn c nhiu tnh nng s dng cho nhiu mc ch khc nhau ca khch hng, cc tnh nng nh tng tc thoi (IVRInteractive Voice Response), Voicemail, phn phi cuc gi t ng (ACD- Automatic Call Distribution). Asterisk c th chy trn c nhiu h iu hnh Unix khc nhau nh Linux, Mac OS X, OpenBSD, FreeBSD, Sun Solarisv cung cp nhiu tin ch v cc tnh nng mi ca mt tng i IP PBX. Kin trc Asterisk c thit k rt linh ng, h tr nhiu giao thc VoIP khc nhau. Ta c th xem Asterisk l mt Gateway kt ni gia mng PSTN vi mng IP, c chc nng chuyn i tng thch gia cc

n tt nghip

75

DANH SCH HNH V

giao thc v m ho ca cc mng khc nhau. Sau cng Asterisk cn l mt h thng Call center vi cc tnh nng linh ng v mm do.
Analog phone Softphone on computer

ATAs

Asterisk PBX

IP Phone

IP Phone

Hnh 4-3: Tng i VoIP PBX Ngoi ra, IP PBX Asterisk cn c kh nng m rng cc s ni b, khng ch gii hn trong mt mng LAN m c th kt ni rng ri ra bn ngoi thng qua Internet hoc VPN (Vitual Private Network). Nh vy vi IP PBX Asterisk, khi nim mng ni b khng cn l mng LAN m l mng ni b ca mt IP PBX khng phn bit v tr a l, cc s ni b c th nm ti nhiu v tr khc nhau v c th lin lc ni b min ph vi nhau. y l mt trong nhng u im quan trng ca Asterisk gip tit kim chi ph in thoi ni b gia cc vn phng vi nhau. 4.3.2.2. Kt ni IP PBX vi PBX Mt ng cnh t ra l khi cng ty trang b h thng PBX, by gi cn trang b thm p ng nhu cu lin lc trong cng ty sao cho vi chi ph thp nht, gii php thc hin l trang b h thng asterisk v kt ni vi h thng PBX ang tn ti

n tt nghip

76

DANH SCH HNH V

qua lung E1. Ngoi ra tng kh nng lin lc vi mng PSTN v VoIP khc, cng ty c th thc hin kt ni vi nh cung cp dch v VoIP.
Softphone on computer

IP Phone

Analog phone WAN or Internet

Softphone on computer

Telco

ATAs

Asterisk PBX

IP Phone

IP Phone

Hnh 4-4: Kt ni IP PBX vi PBX 4.3.2.3. Kt ni cc Server Asterisk Phng php ny ng dng rt hiu qu cho cc cng ty nm ri rc cc v tr a l khc nhau nhm gim chi ph ng di. V d cng ty m c tr s t ti nc M v cc chi nhnh t ti Vit Nam vi cc a im Tp H Ch Minh v H Ni. Thng qua mng WAN ca cng ty cc cuc gi ni b gia cc v tr khc nhau s lm gim chi ph ng k.

n tt nghip

77

DANH SCH HNH V

H N I

T . H CH M P INH

W N or Internet A
N WY R E O K

P S T N

Hnh 4-5: Kt ni gia cc Server Asterisk 4.3.2.4. Cc ng dng IVR, VoiceMail, Conference Call ng dng thc hin cc kt ni h thng PSTN vi tng i PBX trin khai cc ng dng nh tng tc thoi IVR. Mt v d cho ng dng tng tc thoi l cho bit kt qu s s hay kim tra cc cuc gi ging dch v 19001260 vy. ng dng VoiceMail thu nhn nhng tin nhn thoi t pha thu bao ging nh chc nng hp th thoi ca Bu in Thnh ph trin khai. Cn chc nng in thoi hi ngh thit lp cho nhiu my in thoi cng ni chuyn vi nhau.

n tt nghip

78

DANH SCH HNH V

Telco

Asterisk PBX IVR Server Conference Server VoiceMail


Hnh 4-6: Asterisk vi IVR, Conference Call and VoiceMail 4.3.2.5. Chc nng phn phi t ng ACD

Call Queue

ACD Ringall , RoundRobin , LeastRecent , Priority

Agent 1 Agent 2

Agent n

Hnh 4-7: Phn phi cuc gi ACD

n tt nghip

79

DANH SCH HNH V

H thng phn phi cuc gi t ng ACD l h thng tip nhn cc cuc gi t bn ngoi a vo h thng hng i, sau chuyn n nhn vin tr li theo nhng chin lc thch hp, iu ny s lm cho vic tr li cc cuc gi linh hot v hiu qu. Trong lc cc thu bao gi n s c a n hng i v ti y thu bao c th nghe nhc ch hoc c gii thiu cc thng tin v cng ty. Mc tiu chnh ca h thng ACD nhm phc v khch hng gi n c h tr k thut, tm hiu thng tin hay trao i mua bn mt cch tt nht. 4.3.2.6. H thng Call Center

Hnh 4-8: M hnh h thng IP Call Center Call Center l khi nim ch dch v trung tm chm sc khch hng (CSKH) qua in thoi. Dch v Call Center v ang ha hn tr thnh mt lnh vc hot ng kinh doanh y tim nng ti Vit Nam, trong bi cnh hi nhp kinh t vi th gii. Call Center c s dng trong cc trng hp phi giao dch trc tuyn vi ng o khch hng cng mt lc. Call Center ang dn tr thnh mt cng c hu hiu ca doanh nghip trong vic chm sc khch hng, thc y hot ng kinh doanh, nng cao tnh cnh tranh ca doanh nghip trong bi cnh hi nhp vi th gii.

n tt nghip

80

DANH SCH HNH V

Cc tnh nng c bn ca mt Call Center bao gm: nhn, phn phi cuc gi n, qun l cuc gi v cung cp thng tin t ng. 4.4. Giao thc IAX (Inter Asterisk - eXchange) trong Asterisk Trong thng tin thoi truyn thng ta c hai giao thc bo hiu ph bin l: h thng bo hiu knh chung (CCS) v h thng bo hiu knh ring (CAS). i vi VoIP ta cng c rt nhiu giao thc khc nhau nh H.323 hay MGCP, nhng giao thc ph bin v thng dng hn c l SIP (Session Initiation Protocol). Ngoi ra i vi Asterisk cn c mt giao thc bo hiu ring bit l IAX (Inter Asterisk eXchange), giao thc ny c to ra bi chnh tc gi ca Asterisk. Tuy nhin giao thc ny l c trng i vi Asterisk nn cha ph bin nh SIP. Khng cn nhiu thit lp phc tp, d trin khai v tng thch cao chnh l im ni bt nht ca giao thc IAX. Giao thc ny s dng lu lng bng thng dnh cho tn hiu, m thanh thuc loi thp v h tr NAT trong sut (Network Address Translation transparency). Bn cnh , IAX d m rng cho s pht trin v sau. Tng quan IAX IAX l mt giao thc bo hiu v truyn media theo m hnh peer-to-peer, tng t nh SIP nhng khng s dng giao thc RTP truyn media m IAX s truyn thoi trn cng mt ng vi bo hiu, thay vo IAX s dng giao thc UDP (User Datagram Protocol) trn mt port duy nht truyn v nhn c tn hiu bo hiu v media nn dng t overhead hn RTP. c s dng nhm mc ch tit kim bng thng cho bo hiu v media, bn cnh l tnh nng trong sut vi NAT.

n tt nghip

81

DANH SCH HNH V

Hnh 4-9: H thng s dng giao thc IAX IAX c th truyn cng lc nhiu cuc gi trn mt ng duy nht. Chng hn nh khi kt hp vi chun nn G.729 th IAX c th cho php n 103 cuc gi c gi i trn ng truyn 1Mb. Bn cnh , IAX s dng d liu di dng cc bit nh phn nn tn hiu truyn i c tr thp hn so vi cc giao thc khc dng bng m ASCII. Ngoi ra IAX thng xuyn s dng c ch Ping-Pong nhn bit c thit b no khng cn hot ng na. Vic dng 4 byte lm header v s dng bng thng thp gip mi ngi ch n giao thc ny nhiu hn. Nu c nhiu cuc gi n cng ch, tnh nng IAX trunking s lm gim s qu ti bng cch ni d liu t nhiu knh thnh mt gi tin, do khng nhng s lng gi tin truyn i c gim bt m s lng header cng gim, nh vy m c th tit kim n 80% bng thng. Khc bit gia IAX v SIP

n tt nghip

82

DANH SCH HNH V

Cc thnh phn thng tin trong IAX c m ha theo bit nh phn thay v m ha ASCII. Kch thc ca gi bo hiu IAX nh hn nhiu so vi giao thc SIP, nhng khng phi l vn cn quan tm tr khi c mt s lng ln cc client ng k thng xuyn. Ni chung, IAX2 hiu qu hn trong vic m ha, gii m v xc nh thng tin. Tuy nhin rt kh ng dng IAX vo thc t xem n tng thch nh th no vi nhng cng ngh khc bi v c qu t ti liu ni v chng. Ch s dng duy nht mt ng truyn media v bo hiu nn IAX cho php n c nh hng NAT trong sut v ch s dng mt port duy nht nn d dng trong vic qun l. V vy khng bao gi c tnh hung cuc gi c thit lp m khng th chuyn tn hiu m thanh (ngoi tr vn khng bng thng). SIP tun theo chun IETF, trong khi IAX ch mi c mt vi ti liu mi xut bn nn tiu chun ca n vn cha c cng nhn. IAX cho php mt u cui kim tra tnh hp l ca s in thoi quay bit vic quay s hon tt cha hay vn cn dang d. iu ny khng c h tr trong giao thc SIP. Tm li, IAX l giao thc dnh cho VoIP mi nht vi nhiu u im hp dn nh: ti thiu s dng bng thng, trong sut vi NAT v hiu qu vi c ch trung k. 4.5. Dialplan trong Asterisk Dialplan l tri tim ca h thng asterisk. Dialplan cho bit cc cuc gi s c x l nh th no qua h thng asterisk. Dialplan bao gm tp hp cc dng lnh hay cc ng dng theo mt trnh t no m h thng phi thc hin p ng nhu cu chuyn mch cuc gi. hiu r v cu hnh thnh cng h thng asterisk th iu kin tin quyt l phi bit nh th no dialplan hot ng.

n tt nghip

83

DANH SCH HNH V

Dialplan l cng vic thit lp cho hot ng ca h thng nh nh hng cc cuc gi vo v ra h thng, l mt danh sch cc bc hay cc lnh lin tc nhau thc hin mt tc v no m h thng phi thc hin theo. Khc bit vi cc h thng in thoi truyn thng tt c cc cng vic cu hnh h thng u l t pha ngi s dng. H thng chng ta c hon chnh tt hay khng ph thuc rt nhiu vo vic chng ta hiu r vo dialplan hay khng. Dialplan c cu hnh qua tp tin extension.conf, lin quan n vic cu hnh dialplan c nhng khi nim cn nm l: Extentions: in thoi ni b. Priorities: Th t thc hin. Applications: Cc ng dng. Contexts: Cc ng cnh. Dialplan l mt tp gm nhiu extention, khi mt cuc gi tng ng vi extention no th ng dng cho cuc gi s c thc hin. extention c th n gin vi mt ch danh c th nh 101, softphone1 hay l mt chui so mu c thc hin nh 9xxx. V d: exten=>101,1,dial(sip/softphone1,20) exten=>101,2,hangup() exten=> ging nhau cho mi dng thc hin trong dialplan, 101 l s in thoi m thu bao quay hay cn gi l s ni b(extention), cn cc con s 1 v 2 l cc priorites tc l th t thc hin cc lnh. Khi thu bao quay s 101 th chung my in thoi ip sip softphone1 nu trong vng 20 giy m thu bao khng nhc my th kt thc cuc gi.

n tt nghip

84

DANH SCH HNH V

Extension l thnh phn m asterisk thc hin theo, c kch hot khi c cuc gi vo extension chnh l con s m thu bao cn gi. Trong mi ng cnh s c th c nhiu extension. Extenstion chnh l ht nhn h thng xc nh cuc gi cn thc hin. 4.6. M hnh trin khai h thng Asterisk Mc ch: Thc hin th nghim truyn thoi qua mi trng IP. Lm quen vi vic cu hnh h thng thc t.

Quy m h thng: Do hn ch v thit b v thi gian nn quy m ca h thng l nh v n gin, ch yu nhm mc ch nghin cu cc tnh nng ca mt h thng VoIP. 4.6.1. Thit b phn cng Cc thit b trin khai h thng Asterisk c kt ni theo m hnh sau:

In rn t te e

M DM OE

S ftp o e o hn 11 0

S ftp o e o hn 12 0

A te k s ris PX B

n tt nghip

85

DANH SCH HNH V

Hnh 4-10: M hnh trin khai h thng Asterisk Trong : Asterisk PBX: l mt my tnh c ci phn mm tng i Asterisk trn h iu hnh Linux Fedora vi cu hnh ti thiu: CPU: 1.3 GHz RAM: 400 MB cng: 5 G Hai my tnh c ci t Softphone X Lite 4 vi cc extention l 101 v 102. Modem kt ni Internet.

4.6.2. Ci t phn mm. Cc phn mm y bao gm: H iu hnh Fedora 16: ci t trn Computer1 dng lm Server Asterisk. AsteriskNOW 1.7.1 Softphone: X Lite 4.

4.6.2.1. Ci t h iu hnh Fedora 16 (Tham kho ph lc 1) 4.6.2.2. Ci t Asterisk c mt Asterisk Server, thc hin ci t cc gi phn mm sau: Libpri Zaptel Asterisk

Qu trnh ci t c th tham kho thm ph lc 2. Sau khi ci t xong Fedora 16 v Asterisk, ta c mt Asterisk Server.

n tt nghip

86

DANH SCH HNH V

4.6.2.3. Ci t Softphone X Lite X-lite l mt phn mm softphone thng dng, vi y tnh nng ca mt in thoi IP. X-lite s dng giao thc Sip. Ti gi phn mm X-lite v v thc hin ci t nh mt phn mm bnh thng. Giao din ca softphone X-lite: 4.6.3. Cu hnh h thng 4.6.3.1. Cu hnh Asterisk PBX Mt s tp tin quan trng nht cha cc thng s cu hnh ca h thng Asterisk l extensions.conf , sip.conf, ixa.conf Tp tin sip.conf hay ixa.conf cha thng tin v cc extension s dng giao thc sip hay IAX. Tp tin extensions.conf cha cc thng tin v cc Dialplan m ta xy dng cho h thng. cu hnh cho mt h thng Asterisk hot ng, trc tin ta s phi nh ngha cc extension, sau xy dng cc Dialplan thch hp cho cc extension kt ni c vi nhau v kt ni vi cc thu bao ngoi mng Internet. Trong th nghim ny ta s nh ngha cc extension sau: [softphone1] dng cho Softphone th nht. [softphone2] dng cho Softphone th hai.

Cc extension: [softphone1] type=friend host=dynamic

n tt nghip

87

DANH SCH HNH V

secret=123123 call-limit=2 disallow=all allow=ulaw allow=alaw allow=g723.1 allow=g729 allow=gsm context=local_phone [softphone2] type=friend host=dynamic secret=123123 call-limit=2 disallow=all allow=ulaw allow=alaw allow=g723.1 allow=g729 allow=gsm context=local_phone

n tt nghip

88

DANH SCH HNH V

Cc Dialplan: [local_phone] exten => 101,1,Dial(SIP/softphone1) exten => phone1,1,Dial(SIP/softphone1) exten => 102,1,Dial(SIP/softphone2) exten => phone2,1,Dial(SIP/softphone2) 4.6.3.2. Cu hnh Softphone S dng la chn Setting cu hnh softphone X-lite vi mt trong hai extension softphone1 hoc softphone2.

n tt nghip

89

DANH SCH HNH V

Hnh 4-10: Cu hnh Softphone X Lite 4

n tt nghip

90

DANH SCH HNH V

4.6.4. Thc hin kt ni Sau khi xy dng c h thng Asterisk v cu hnh h thng c th hot ng, ta tin hnh nhng th nghim u tin trn h thng. Tin hnh quay s t mt softphone trong mng n mt softphone khc. Dng tng i Asterisk PBX qun l kt ni Kt qu t c l kt ni thnh cng, 2 Softphone c th m thoi bnh thng.

n tt nghip

91

DANH SCH HNH V

KT LUN
Vi quy m mt n tt nghip, n Xy dng h thng VoIP cho doanh nghip da trn phn mm m ngun m Asterisk gii quyt c cc vn sau: a ra cc khi nim tng quan v VoIP Tm hiu su v kin trc mng VoIP Tm hiu v cc giao thc truyn ti v bo hiu c s dng trong VoIP Xy dng thnh cng m hnh VoIP da trn Asterisk, gip hiu su hn v VoIP v c ci nhn thc t v mt m hnh VoIP.

n tt nghip

92

DANH SCH HNH V

PH LC 1: CI T FEDORA 16
Thc hin khi ng t a ci Fedora 16, giao din ci t s nh hnh di:

C th mt mt vi pht kim tra a ci Fedora 16. Chn Skip b qua vic kim tra ny.

n tt nghip

93

DANH SCH HNH V

Mn hnh cho ca Fedora 16 xut hin, nhn Next tip tc ci t.

Chn ngn ng ci t:

n tt nghip

94

DANH SCH HNH V

Chn chun bn phm, nn chn l English

n tt nghip

95

DANH SCH HNH V

Nu ci t Fedora trn mt my tnh mi, cha ci bt c h iu hnh no khc th s chn yes format ton b cng v ci duy nht h iu hnh Fedora 16 nn my tnh.

Tip tc s l qu trnh lp cc phn vng dnh cho vic ci t Fedora 16.

n tt nghip

96

DANH SCH HNH V

Tip n l qu trnh ci t a ch IP, chp nhn la chn mc nh , nhn Next tip tc:

n tt nghip

97

DANH SCH HNH V

Chn mi gi

n tt nghip

98

DANH SCH HNH V

Thit lp mt khu gc cho Fedora 16

Tip theo l bc chn cc gi ci, chn nhng gi cn thit tu vo mc ch s dng, y c th ci t my tnh tr thnh Asterisk Server, ta nn chn 2 la chn l Web Server v Software Development.

n tt nghip

99

DANH SCH HNH V

Nhn Next bt u qu trnh ci t

n tt nghip V
Qu trnh ci t bt u

100

DANH SCH HNH

n tt nghip V

101

DANH SCH HNH

Qu trnh ci t kt thc, khi ng li h thng hon tt vic ci t.

n tt nghip V

102

DANH SCH HNH

PH LC 2: CI T ASTERISK
Cc bc ci t sau y c thc hin vi mt my tnh c kt ni Internet. Trc khi ci t Asterisk, ta phi kim tra nhn Kernel ca h iu hnh ta nh ci Asterisk ln bng lnh: uname - a Kt qu c th trng nh sau: Linux luser 2.6.17-1.2142_EL #1 Tue Jul 11 22:41:14 EDT 2006 i686 i686 i386 GNU/Linux Ch phin bn nhn Kernel tip theo sau y ta ci t Kernel source. Thc hin ci t Kernel source bng lnh: yum install Qu trnh ci t din ra trong mt vi pht. Tip theo ta kim tra cc th vin cn thit cho vic ci t Asterisk, bao gm: bison bison-devel ncurses ncurses-devel zlib zlib-devel openssl openssl-devel gnutls-devel

n tt nghip V
gcc gcc-c++ Thc hin kim tra bng cc lnh sau: rpm -q bison rpm -q bison-devel rpm -q ncurses rpm -q ncurses-devel rpm -q zlib rpm -q zlib-devel rpm -q openssl rpm -q openssl-devel rpm -q gnutls-devel rpm -q gcc rpm -q gcc-c++

103

DANH SCH HNH

Nu th vic no cha c ci t, ta thc hin ci t bng lnh: yum install bison yum install bison-devel yum install ncurses yum install ncurses-devel yum install zlib yum install zlib-devel yum install openssl yum install openssl-devel yum install gnutls-devel yum install gcc yum install gcc-c++

n tt nghip V

104

DANH SCH HNH

Sau khi chc chn rng cc th vin c ci t, ta tin hnh vic ci t Asterisk. Ci t gi Libpri: chuyn n th mc cha gi Libpri sau khi gii nn make make install Ci t gi Zaptel: chuyn n th mc cha gi Zaptel sau khi gii nn make make install Ci t Asterisk: chuyn n th mc cha gi Asterisk sau khi gii nn ./configure make make install make samples Sau khi ci t cc gi xong, kim tra, ta vo ca s terminal ca Fedora Core 5, thc hin lnh: asterisk -vvvvvr reload Qu trnh ci t Asterisk kt thc.

n tt nghip V

105

DANH SCH HNH

LI CM N
Trc ht, em xin gi li cm n chn thnh v su sc ti thy, Tin s V Trng Sn trc tip hng dn v ch bo tn tnh trong sut qu trnh lm n ny. Xin chn thnh cm n cc thy c gio trng i Hc Giao Thng Vn Ti c s 2, cc thy c khoa in in t ht lng dy bo v gip em trong nhng nm hc i Hc, gip em c nhng kin thc v kinh nghim qu bu trong cuc sng v tng lai. Em xin gi li cm n ti qu Cng ty Hpt, c bit l anh Trn Thanh Hng cn b k thut cng ty Hpt - gip em trong sut qu trnh thc tp tt nghip v to iu kin cho em c tip cn vi thit b thc t cng nh s liu em hon thnh n ny. Cui cng, em xin cm n gia nh v bn b gip v ng vin em trong sut qu trnh lm n. Do hn ch v thi gian, kin thc thc t cng nh kh nng dch thut nn ti khng trnh khi nhng sai st. V vy, rt mong nhn c kin ng gp qu bu ca cc Thy v cc bn sinh vin n c hon thin hn. Xin chn thnh cm n!

n tt nghip V
TI LIU THAM KHO

106

DANH SCH HNH

1. Paul Mahler, Asterisk and IP TAsterisk and IP Telephone, Published

2004
2. Jonathan Davidson, Sames Perter, Manoj Bhratia, Satish Kalididi, Sudipto

Mukherjee, Voice over IP Fundamentals, 2nd Edison, Cisco Press, 2006


3. David Lovell, IP Telephony, Cisco Press, 2011 4. "Voice over Internet Protocol", Anixter Inc., 2001. 5. Bi Xun Hnh, n tt nghip: Nghin cu cng ngh truyn thoi

qua Internet s dng giao thc TCP/IP, i hc Quc gia H Ni, 2005
6. Vn Dng, n tt nghip: Nghin cu v mng VoIP, K thut

vin thng K45, 2009.


7. Website: http://www.voip.com.vn 8. Website: http://www.vntelecom.org