Asterisk Reference Information Version
Total Page:16
File Type:pdf, Size:1020Kb
Asterisk Reference Information Version Asterisk Development Team Asterisk.org March 29, 2008 Contents 1 Introduction 8 1.1 License Information . 8 1.1.1 Hold Music . 9 1.2 Security . 10 1.2.1 Introduction . 10 1.2.2 Network Security . 10 1.2.3 Dialplan Security . 10 1.2.4 Log Security . 11 1.3 Hardware . 11 1.3.1 Introduction . 11 1.3.2 Zaptel compatible hardware . 12 1.3.3 Non-zaptel compatible hardware . 13 1.3.4 mISDN compatible hardware . 13 1.3.5 Miscellaneous other interfaces . 14 2 Configuration 15 2.1 General Configuration Information . 15 2.1.1 Configuration Parser . 15 2.1.2 Asterisk.conf . 19 2.1.3 CLI Prompt . 21 2.1.4 Extensions . 22 2.1.5 IP Quality of Service . 24 2.1.6 MP3 Support . 27 2.1.7 ICES . 27 2.2 Database Support . 27 1 2.2.1 Realtime Database Configuration . 27 2.2.2 FreeTDS . 31 2.3 Privacy . 31 2.3.1 First of all . 31 2.3.2 Next, Fight against autodialers!! . 31 2.3.3 Next, Fight against the empty CALLERID! . 32 2.3.4 Next, use a WELCOME MENU ! . 32 2.3.5 Next: Torture Them! . 33 2.3.6 Using Call Screening . 34 2.3.7 The 'N' and 'n' options . 35 2.3.8 Recorded Introductions . 36 3 Channel Variables 39 3.1 Introduction . 39 3.2 Parameter Quoting . 39 3.3 Variables . 40 3.4 Variable Inheritance . 40 3.4.1 Example . 41 3.5 Selecting Characters from Variables . 41 3.6 Expressions . 42 3.6.1 Spaces Inside Variables Values . 42 3.6.2 Operators . 43 3.6.3 Floating Point Numbers . 45 3.6.4 Functions . 45 3.6.5 Examples . 47 3.6.6 Numbers Vs. Strings . 49 3.6.7 Conditionals . 49 3.6.8 Parse Errors . 49 3.6.9 NULL Strings . 50 3.6.10 Warning . 50 3.6.11 Incompatabilities . 50 3.6.12 Debugging Hints . 52 3.7 Asterisk standard channel variables . 53 3.7.1 Application return values . 55 3.7.2 Various application variables . 56 3.7.3 The MeetMe Conference Bridge . 56 3.7.4 The VoiceMail() application . 57 3.7.5 The VMAuthenticate() application . 57 2 3.7.6 DUNDiLookup() . 57 3.7.7 chan zap . 57 3.7.8 chan sip.......................... 58 3.7.9 chan agent . 58 3.7.10 The Dial() application . 58 3.7.11 The chanisavail() application . 59 3.7.12 Dialplan Macros . 59 3.7.13 The ChanSpy() application . 59 3.7.14 OSP . 59 4 AEL: Asterisk Extension Language 60 4.1 Introduction . 60 4.2 Asterisk in a Nutshell . 61 4.2.1 Contexts . 61 4.2.2 Extensions and priorities . 61 4.2.3 Macros . 62 4.2.4 Applications . 62 4.3 Getting Started . 63 4.4 Debugging . 63 4.5 About "aelparse" . 63 4.6 General Notes about Syntax . 64 4.7 Keywords . 65 4.8 Procedural Interface and Internals . 67 4.8.1 AEL version 2 BNF . 67 4.9 AEL Example USAGE . 70 4.9.1 Comments . 70 4.9.2 Context . 71 4.9.3 Extensions . 71 4.9.4 Includes . 72 4.9.5 #include . 73 4.9.6 Dialplan Switches . 73 4.9.7 Ignorepat . 73 4.9.8 Variables . 73 4.9.9 Local Variables . 74 4.9.10 Loops . 75 4.9.11 Conditionals . 75 4.9.12 Break, Continue, and Return . 77 4.9.13 goto, jump, and labels . 77 3 4.9.14 Macros . 79 4.10 Examples . 79 4.11 Semantic Checks . 80 4.12 Differences with the original version of AEL . 82 4.13 Hints and Bugs . 84 4.14 The Full Power of AEL . 85 5 SLA: Shared Line Appearances 86 5.1 Introduction . 86 5.2 Configuration . 86 5.2.1 Summary . 86 5.2.2 Dialplan . 86 5.2.3 Trunks . 87 5.2.4 Stations . 88 5.3 Configuration Examples . 89 5.3.1 Basic SLA . 89 5.3.2 SLA and Voicemail . 90 5.4 Call Handling . 92 5.4.1 Summary . 92 5.4.2 Station goes off hook (not ringing) . 92 5.4.3 Station goes off hook (ringing) . 92 5.4.4 Line button on a station is pressed . 93 6 Channel Drivers 94 6.1 IAX2 . 94 6.1.1 Introduction . 94 6.1.2 Why IAX2? . 94 6.1.3 Configuration . 96 6.1.4 IAX2 Jitterbuffer . 96 6.2 mISDN . 99 6.2.1 Introduction . 99 6.2.2 Features . 99 6.2.3 Fast Installation Guide . 100 6.2.4 Pre-Requisites . 100 6.2.5 Configuration . 100 6.2.6 mISDN CLI commands . 103 6.2.7 mISDN Variables . 103 6.2.8 Debugging and sending bug reports . 104 4 6.2.9 Examples . 104 6.2.10 Known Problems . 104 6.3 Local . 104 6.3.1 Introduction . 104 6.3.2 Syntax . 105 6.3.3 Purpose . 105 6.3.4 Examples . 106 6.3.5 Caveats . 106 7 Distributed Universal Number Discovery (DUNDi) 107 7.1.