Asterisk: The Dialplan

From AstBillWiki

Jump to: navigation, search

monletod The dialplan is truly the heart of Asterisk and AstBill, as it defines how Asterisk handles inbound and outbound calls. In a nutshell, it consists of a list of instructions or steps that Asterisk and AstBill will follow. Unlike traditional phone systems, Asterisk’s dialplan is fully customizable. To successfully set up your own AstBill system, you will need to understand the dialplan.

When using AstBill the Asterisk Dialplan is very simplified. AstBill do must of the processing in the MySQL database using a simple Perl Agi scrip and MySQL Stored Procedures for maximum perfomance under heavely load.

This is an example Dialplan for Asterisk and AstBill:

; [astartelecom-iax]
; 
; exten => _0[0-9].,1,AGI(agiastar.agi,00${EXTEN}|${CALLERIDNUM})
; The parameter ${CALLERIDNUM} is used when using ANI/CLI for authentication
; It makes ${CALLERIDNUM} = accountcode. This is used in some Asterisk / SER implementations
; exten => _0[0-9].,1,AGI(agiastar.agi,${EXTEN})
; exten => _0[0-9].,2,GotoIf($["${BILLSTATUS}" = "NOCREDIT"]?20)
; exten => _0[0-9].,3,GotoIf($["${BILLSTATUS}" = "NOACCOUNT"]?20)
; exten => _0[0-9].,4,GotoIf($["${BILLSTATUS}" = "INVALID"]?30)
; exten => _0[0-9].,5,Dial(${DIALSTRING})
; 
; exten => _0[0-9].,20,Playback(beep)  
; exten => _0[0-9].,21,Playback(not-enough-credit)   ; Tells them they do not have enough money
; exten => _0[0-9].,22,Hangup
; 
; exten => _0[0-9].,30,Playback(beep)  
; exten => _0[0-9].,31,Playback(that-is-not-rec-phn-num)             ; "That is not a recognized phone  ; number."
; exten => _0[0-9].,32,Hangup
Personal tools