![Page 1: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/1.jpg)
Asterisk Database (AstDB)
Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar to the following:
Family1Key1 => valueKey2 => value::Keyn => valueFamily2Key1 => valueKey2 => value
![Page 2: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/2.jpg)
Asterisk Database’s Applications
Applications:DBputDBgetDBdelDBdeltree
DbputStores value in the databaseDbput(family/key=${foo}) (deprecated)Set(DB(family/key)=${foo}) (new syntax)CLI CommandCLI*>database put family key
![Page 3: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/3.jpg)
Asterisk Database’s Applications
DbgetRetrieve a value from the databaseDbget(foo=family/key) (deprecated)Set(foo=${DB(family/key)})CLI CommandCLI*>database get family keyDbdelDelete a key from the databaseDbdel(family/key)CLI CommandCLI*>database del
![Page 4: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/4.jpg)
Asterisk Database’s Applications
DbdeltreeDelete a family or key tree from the databaseDbdeltree(family/keytree)
![Page 5: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/5.jpg)
Call Forwarding
Forward the incoming call to some other number, or forward the incoming call to some other number in case of busy or unavailable
Two types of abbreviations are used:
Call Forward IMdiate (CFIM) Call Forward on BuSy (CFBS)
![Page 6: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/6.jpg)
Fowarding[forward-test]
exten => *21*,1,PlayBack(thanks)exten => *21*,2,read(for)exten => *21*,3,Set(DB(CFIM/${CALLERID(num)})=${for})
exten => 801,1,Macro(callforward,${EXTEN})[macro-callforward]
exten => s,1,Set(temp=${DB(CFIM/${ARG1})})exten => s,n,GotoIf(${temp}?cfim:nocfim)exten => s,n(cfim),Dial(SIP/${temp})exten => s,n,hangup;Unconditional forward exten => s,n(nocfim),Dial(SIP/${ARG1})
![Page 7: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/7.jpg)
Call Monitoring
Taps into a phone call between a caller and a callee. This is possible with:
ChanSpy()ZapBarge()ExtenSpy()
ChanSpy()ExampleWhile spying Dialing # cycles the volumeDialing * will stop spying and look for another channel to spy
on
![Page 8: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/8.jpg)
Call MonitoringZapBarge()Listens in on a conversation on a zap channel. If a channel is
not specified, it will prompt for one
ExampleExten => 8159,1,ZapBarge()Exten => 8159,2,Hangup()
If you dial 8159, you are asked which line you want to listen on; for zap/1-1 you will press 1# and for zap/25-1 you will press 25#
![Page 9: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/9.jpg)
Call MonitoringExtenSpy()Listen in on a channel, and also whisper into it if necessary
Example[snoop]
exten => _555/705,1,ExtenSpy(|v(4))
[705] exten => 705,1, dail(IAX2/trunk_3) include => snoop
![Page 10: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/10.jpg)
Call MonitoringAdd the following lines in extensions.conf exten => *898,1,Answerexten => *898,2,Wait(1)exten => *898,3,Goto(spy,s,1)exten => *898,4,Hangup [spy] exten => s,1,BackGround(please-enter-the)exten => s,n,BackGround(extension)exten => s,n,Set(TIMEOUT(digit)=5)exten => s,n,Set(TIMEOUT(response)=10)exten => s,n,WaitExten(10)exten => _XXXX,1,ChanSpy(SIP/${EXTEN}|q)
![Page 11: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/11.jpg)
Call TransferTransfer a call-in-progress to another destination. There are
two types of transfers:
Supervised Call TransferBlind Call Transfer
Features.conf settings:
blindxfer => #1disconnect => *0atxfer => *2
![Page 12: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/12.jpg)
Call ParkingPlaces a call on-hold onto a specific parking location so that it
can be picked up by another extension
Features.confParkext => 700Parkpos => 701-720Context => parkedcallParkingtime => 45
![Page 13: Asterisk Database (AstDB) Database data are grouped in families and identified with a key that is unique within the family. AstDB’s structure is similar](https://reader035.vdocument.in/reader035/viewer/2022062516/56649e3b5503460f94b2d21f/html5/thumbnails/13.jpg)
Route by Caller IDexten => 123/100,1,Answer()
exten => 123/100,2,Playback(tt-weasels) exten => 123/100,3,Voicemail(123) exten => 123/100,4,Hangup()