Presentation is loading. Please wait.

Presentation is loading. Please wait.

Asterisk Database (AstDB)

Similar presentations


Presentation on theme: "Asterisk Database (AstDB)"— Presentation transcript:

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 to the following: Family1 Key1 => value Key2 => value : Keyn => value Family2 Key2 => value

2 Asterisk Database’s Applications
Applications: DBput DBget DBdel DBdeltree Dbput Stores value in the database Dbput(family/key=${foo}) (deprecated) Set(DB(family/key)=${foo}) (new syntax) CLI Command CLI*>database put family key

3 Asterisk Database’s Applications
Dbget Retrieve a value from the database Dbget(foo=family/key) (deprecated) Set(foo=${DB(family/key)}) CLI Command CLI*>database get family key Dbdel Delete a key from the database Dbdel(family/key) CLI Command CLI*>database del

4 Asterisk Database’s Applications
Dbdeltree Delete a family or key tree from the database Dbdeltree(family/keytree)

5 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)

6 Call Forwarding An example of call forwarding: [apps] ; ; Unconditional Call Forward ; ; create call forward exten => _*21*X.,1,GotoIf($${EXTEN:-1} = #?2:3) exten => _*21*X.,2,StripLSD(1) exten => _*21*X.,3,DBput(CFIM/${CALLERIDNUM}=${EXTEN:4}) exten => _*21*X.,4,Hangup ; ; delete call forward exten => **21,1,DBdel(CFIM/${CALLERIDNUM}) exten => **21,2,Hangup ; ; delete call forward (with #) exten => **21#,1,Goto(**21,1)

7 [macro-stdexten]  ;   ; Standard extension macro (with call forwarding):   ; ${ARG1} - Extension(we could have used ${MACRO_EXTEN} here as well   ; ${ARG2} - Device(s) to ring   ;   exten => s,1,Set(temp=${DB(CFIM/${ARG1})})  exten => s,n,GotoIf(${temp}?cfim:nocfim)  exten => s,n(nocfim),NoOp  exten => s,n,Dial(${ARG2},15) ; 15sec timeout   exten => s,n,Set(temp=${DB(CFBS/${ARG1})})  exten => s,n,GotoIf(${temp}?cfbs:nocfbs)  exten => s,n(nocfbs),Busy

8 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})

9 Call Monitoring Taps into a phone call between a caller and a callee. This is possible with: ChanSpy() ZapBarge() ExtenSpy() Example While spying Dialing # cycles the volume Dialing * will stop spying and look for another channel to spy on

10 Call Monitoring ZapBarge() Listens in on a conversation on a zap channel. If a channel is not specified, it will prompt for one Example Exten => 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#

11 Call Monitoring ExtenSpy() 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

12 Call Monitoring Add the following lines in extensions.conf exten => *898,1,Answer exten => *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)

13 Call Transfer Transfer a call-in-progress to another destination. There are two types of transfers: Supervised Call Transfer Blind Call Transfer Features.conf settings: blindxfer => #1 disconnect => *0 atxfer => *2

14 Call Parking Places a call on-hold onto a specific parking location so that it can be picked up by another extension Features.conf Parkext => 700 Parkpos => Context => parkedcall Parkingtime => 45

15 Route by Caller ID exten => 123/100,1,Answer()    exten => 123/100,2,Playback(tt-weasels)    exten => 123/100,3,Voic (123)    exten => 123/100,4,Hangup()


Download ppt "Asterisk Database (AstDB)"

Similar presentations


Ads by Google