FreePBX Internals - Astricon 2008 - Print_Lindheimer - Asterisk-ES
FreePBX Internals - Astricon 2008 - Print_Lindheimer - Asterisk-ES
FreePBX Internals - Astricon 2008 - Print_Lindheimer - Asterisk-ES
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>FreePBX</strong> ® <strong>Internals</strong><br />
<strong>Astricon</strong>, <strong>2008</strong> Glendale, AZ<br />
by<br />
Philippe <strong>Lindheimer</strong><br />
<strong>FreePBX</strong> Project Leader<br />
http://freepbx.org
The <strong>FreePBX</strong> Project<br />
Open Source<br />
<br />
GPLv2<br />
Installed Base<br />
<br />
<br />
<br />
<br />
Estimated 250,000 Installed Base<br />
Estimated growth of thousands per month<br />
~3M Downloads<br />
100,000 Visits/Month (400,000 Page Views)<br />
Proven Stability with Mature Release History<br />
10/14/2004 – 1.1 (AMP)<br />
03/17/2006 – 2.0 (<strong>FreePBX</strong>)<br />
05/16/2006 – 2.1<br />
01/05/2007 – 2.2<br />
08/25/2007 – 2.3<br />
02/10/<strong>2008</strong> – 2.4<br />
09/19/<strong>2008</strong> – 2.5
The <strong>FreePBX</strong> Project<br />
>>Who’s Using <strong>FreePBX</strong><br />
<br />
<br />
<br />
<br />
Many others (some have come and gone)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
+ =<br />
Adminparadise<br />
<strong>Asterisk</strong> Suite<br />
Centris<br />
CentPBX<br />
Converged Interaction<br />
EasyVoxBox<br />
<strong>ES</strong>CAUX net. PBX<br />
Generic User Management System<br />
kasterx<br />
Miruna <strong>Asterisk</strong> System<br />
Pound Team PBX<br />
ST-PBX Live<br />
VoizEdge<br />
More …
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Goals<br />
Goals<br />
<br />
<br />
<br />
<br />
<br />
<br />
Overall – Get a high level orientation around core concepts in the<br />
<strong>FreePBX</strong> dialplan<br />
Understand how <strong>FreePBX</strong> implements “extensions”<br />
Devices and Users, different then classic <strong>Asterisk</strong> text book<br />
examples and simple dialplans<br />
Understand the high level layout of the <strong>FreePBX</strong> extensions.conf<br />
Understand how <strong>FreePBX</strong> dials out to “trunks”<br />
Understand which macros and AGI scripts are used for internal and<br />
outbound dialing, and their general purpose<br />
Understand how to connect your custom dialplans into <strong>FreePBX</strong> to be<br />
used in the GUI, and how to register your custom “extensions/feature<br />
codes”
Text Book View of Extension<br />
<br />
<br />
SIP Section == Extension Number<br />
Calling SIP Extension == Dial(SIP/${EXTEN})
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Devices and Users<br />
Important <strong>FreePBX</strong> Terms<br />
<br />
<br />
<br />
<br />
User<br />
A User on the system that can be called<br />
The User number is how you dial them<br />
User = Extension (usually)<br />
Device<br />
A <strong>FreePBX</strong> Object<br />
Links a User to a Physical Endpoint<br />
Fixed – Permanently Assigned<br />
Adhoc – Users can login/out of device<br />
Extension<br />
User + Device<br />
User<br />
Endpoint or Phone<br />
The “phone” that is associated with a <strong>FreePBX</strong> Device<br />
Device
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Devices and Users<br />
Understanding Users / Devices<br />
<br />
Interactions when a phone makes a call<br />
internal extension (User) initiating a call<br />
<br />
Interactions when a call is made to an extension (User)<br />
call directed to internal phones
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Devices and Users<br />
AMPUSER/210<br />
Device Initiates Call<br />
DEVICE/216<br />
SIP/216<br />
216
<strong>FreePBX</strong> <strong>Internals</strong><br />
>> Devices and Users<br />
macro-user-callerid<br />
Call this first<br />
Determines Internal, External and Masquerading CIDs<br />
Determines Language requirements for the user<br />
[CallerID !(always)== The Caller] (${AMPUSER} is true identity)<br />
Important when implementing Feature Codes
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Devices and Users<br />
AMPUSER/210<br />
Call Made to User<br />
DEVICE/210<br />
DEVICE/216<br />
SIP/210<br />
SIP/216<br />
210<br />
216
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Internal Dialing key components<br />
Key Macros/AGI Scripts<br />
macro-user-callerid<br />
macro-exten-vm<br />
dialparties.agi + macro-dial<br />
macro-vm<br />
Important AstDB Objects<br />
AMPUSER<br />
DEVICE
Text Book View of Outbound Dialing<br />
<br />
<br />
Streamlined call to Dial() command<br />
No differentiation in CID handling
<strong>FreePBX</strong> View of Inbound/Outbound<br />
>> extensions.conf simplified<br />
<br />
<br />
<br />
<br />
<br />
[globals]<br />
Trunks<br />
[from-pstn]<br />
Inbound routes<br />
Security separation<br />
[from-internal]<br />
Internal extensions<br />
Internal features<br />
[outbound-allroutes]<br />
Outbound Trunk Access<br />
[from-trunk--]<br />
Inbound Trunks (optional)<br />
Used for channel counting
Outbound Dialing<br />
>>key macros/AGI scripts<br />
<br />
<br />
<br />
<br />
macro-user-callerid<br />
macro-dialout-trunk<br />
Variations:<br />
macro-dialout-enum<br />
macro-dialout-dundi<br />
macro-outbound-callerid<br />
fixlocalprefix (AGI Script)<br />
<br />
macro-dialout-trunk-predial-hook<br />
this is yours!
Outbound Dialing<br />
>>CallerID<br />
CallerID Handling<br />
Originated Call From User<br />
or<br />
Forwarded Call (CF, Follow-Me, etc.)<br />
Yes<br />
No<br />
Use<br />
Emergency<br />
CID<br />
Use<br />
Internal<br />
CID<br />
Emergency<br />
CID<br />
Yes<br />
Yes<br />
No<br />
Emergency<br />
Route<br />
No<br />
Intra-<br />
Company<br />
Internal<br />
Caller<br />
Never<br />
Overide<br />
CID<br />
CID<br />
Set<br />
Yes<br />
Yes<br />
No<br />
Trunk<br />
CID<br />
Set<br />
Use Trunk<br />
CID<br />
Use Forwarded<br />
CID<br />
No<br />
If CallerID(name) == “hidden” (“hidden” )<br />
SetCallerPres(prohib_passed_screen)<br />
No<br />
Use<br />
Outboundcid<br />
Yes<br />
Outbound<br />
CID<br />
Trunk<br />
CID<br />
Yes<br />
Use Trunk<br />
CID<br />
Use<br />
Trunk<br />
CID<br />
Yes<br />
No<br />
Trunk<br />
CID<br />
No<br />
Use Extension<br />
(Undefined Results)<br />
No<br />
No CID Transmitted
<strong>FreePBX</strong> GUI Integration<br />
>>Extension Registry<br />
Custom Apps Registry<br />
<br />
<br />
Register You Custom extensions<br />
Example: Custom WakeUp Call<br />
exten => *62,1,Answer()<br />
exten => *62,n,Macro(user-callerid)<br />
exten => *62,n,AGI(wakeup.php)<br />
exten => *62,n,Hangup()<br />
<br />
Tell <strong>FreePBX</strong><br />
Extension Registry
<strong>FreePBX</strong> GUI Integration<br />
>>Destination Registry<br />
Custom Destination Registry<br />
<br />
<br />
<br />
Register your custom destinations<br />
Example: Custom Callback<br />
[custom-callback]<br />
exten => h,1,Hangup()<br />
exten => hang,1,Playback(vm-goodbye)<br />
exten => hang,n,Hangup()<br />
exten => i,1,Playback(conf-errormenu)<br />
exten => i,n,Goto(s,inval)<br />
exten => s,1,GotoIf($[${DIALSTATUS} = ANSWER]ans)<br />
exten => s,n,Answer()<br />
exten => s,n,Wait(2)<br />
exten => s,n(ans),SetVar(LOOPED=1)<br />
Tell <strong>FreePBX</strong> Destination Registry:<br />
z
<strong>FreePBX</strong> <strong>Internals</strong><br />
>>Summary<br />
<br />
<br />
<br />
<br />
<strong>FreePBX</strong> implements its “extensions” as a combination of<br />
Devices and Users<br />
Your dialplan should always call macro-user-callerid to<br />
determine the real identity of the calling device<br />
<strong>FreePBX</strong> uses a handful of key macros when accessing trunks<br />
to decipher a user and the appropriate callerid to be used as<br />
well as to further manipulate dialed digits on each trunk<br />
It’s easy to connect custom dialplans and destinations used in<br />
call flows through the <strong>FreePBX</strong> Custom Extension and<br />
Destination Registry
Where to Learn More<br />
>>Open Telephony Training Seminar<br />
Open Telephony Training Seminar<br />
Where: Digium Headquaters<br />
Huntsville, AL<br />
When: Oct 7-10 TH<br />
More Info: training@freepbx.org<br />
1-877-480-9533<br />
http://freepbx.org/open-telephony-training-seminar<br />
Learn About:<br />
Components of <strong>Asterisk</strong> and <strong>FreePBX</strong> and how they fit together, and <strong>FreePBX</strong> Internal,<br />
troubleshooting and integration with custom <strong>Asterisk</strong> dialplans.<br />
PSTN Integration, Trunks, Troubleshooting with the PSTN, IP Phones and lots more.<br />
Successful Marketing, positioning, competition, selling, sales cycle and techniques to<br />
differentiate your offerings in the small and medium business PBX space.<br />
Past attendees are saying:<br />
“Great seminar - worth the money and, more important, the time!" – Calvin W.<br />
“Extremely well prepared and presented!” – Ronald C.<br />
“The OTTS was a valuable injection of information regarding the vibrant and dynamic<br />
<strong>Asterisk</strong> ecosphere; it should be attended yearly by anyone trying to keep abreast of<br />
this area.” Ron B.