How do you setup asterisk?

What are the standard asterisk ports?
Standard SIP Port: UDP 5060
Standard Media Port Range: UDP 10000-20000
IAX2 Standard Port: UDP 4569
What the typical layout of a asterisk based infrastructure?

Where do you create phone extensions?
sip.conf
How can you create a phone extension?
[extension]
type=friend
secret=[password]
disallow=all
allow=alaw
host=dynamic
context=[extension-context]
qualify=yes

Where do you create extension contexts?
extensions.conf
What does sip reload do?
reloads the sip.conf file
How do you reload all configuration files?
reload
Where do you create voicemails?
voicemail.conf
How do you create a simple voicemail?
[exten] => [password],[name],[email]
e.g.
[internal-vm]
101 => 123456,John Doe,john-email@gmail.com
Then add in sip.conf:
mailbox=101@internal-vm

How do you set a dialplan to go to a voicemail?
exten => 1,1,Answer
exten => 1,n,NoOp(This-is-a-sample-context)
exten => 1,n,Voicemail(101@internal-vm)
exten => 1,n,Hangup()
How do you set a dialplan to dial a number?
exten => 101,1,Answer
exten => 101,n,NoOp(internal-phone-call)
exten => 101,n,Dial([protocol]/[trunk]/[number], [call-time], [options]);
exten => 101,n,Hangup()
Note: You can exclude a trunk if it is an internal call
Why after the following dial plan does the call not go to voicemail after answer?
exten => 101,1,Answer
exten => 101,n,NoOp(internal-phone-call)
exten => 101,n,Dial(SIP/101,12,r);
exten => 101,n,Hangup()
Because the ‘g’ option was not specified, without the ‘g’ option, when an answered call is hungup the dial plan execution wont continue
What are the default standard extensions?
Why do you need to register with a SIP trunk?
You need to register so that the trunk provider knows where to route calls to when an inbound call comes in
Where do you place register strings?
In the general context within sip.conf
What does the underscore mean in an asterisk dialplan?
It tell asterisk that the extension contains pattern matching characters
e.g.
_1XX will match 101, 102, 103, 115 etc…
Note: Extension dial plan with literal values will be given priority over pattern matching ones
What is the ${EXTEN} variable?
It is the value of the extension that was dialed
What is the difference between the type user, friend and peer?
What are the asterisk pattern matching characters?
What are the different config files?

What is FastAGI?
Technically speaking, FastAGI is different in the following context: when Asterisk executes an AGI script via FastAGI, the resources required for the AGI script to run are consumed by a completely different process, and not Asterisk. In addition, the communications that were previously based on internal STDIN/STDOUT communications are now based on a TCP socket. This means that your AGI script, now actually an AGI server, can be operated and maintained on a completely different server, enabling you to separate the application logic from the Asterisk dialplan logic.
How do you see all AGI commands?
‘agi show’
What are blocking applications?
Blocking applications include the following: Dial, MeetMe, MusicOnHold, Playback (when dealing with long playbacks), Monitor, ChanSpy, and other applications that have an unknown execution duration.