Section 1 Flashcards

1
Q

How do you setup asterisk?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the standard asterisk ports?

A

Standard SIP Port: UDP 5060

Standard Media Port Range: UDP 10000-20000

IAX2 Standard Port: UDP 4569

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What the typical layout of a asterisk based infrastructure?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where do you create phone extensions?

A

sip.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you create a phone extension?

A

[extension]
type=friend
secret=[password]
disallow=all
allow=alaw
host=dynamic
context=[extension-context]
qualify=yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where do you create extension contexts?

A

extensions.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does sip reload do?

A

reloads the sip.conf file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you reload all configuration files?

A

reload

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where do you create voicemails?

A

voicemail.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you create a simple voicemail?

A

[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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you set a dialplan to go to a voicemail?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you set a dialplan to dial a number?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

Because the ‘g’ option was not specified, without the ‘g’ option, when an answered call is hungup the dial plan execution wont continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the default standard extensions?

A
  • s: Start. Used primarily for dialplans that enter a context with no other extension information. Think of a non DID phone line, call comes in, and we may only know that the line is ringing and nothing else. Even if you knew callerid, you have to still have a place to start. You can also think about s as a place to place part of the dialplan that you don’t want callers to get back to unless they have passed through other functions.
  • t: Timeout. Used for when calls have been inactive after a prompt was played. Also used to hang up a line that has been idle.
  • T: AbsoluteTimeout. Used for calls that have been hung up due to an AbsoluteTimeout() being reached. For example useful to play a notification with Playback().
  • h: Hangup. Used to clean up a call. Could be used to play a goodbye message before hanging up. Also seemingly used by the calling card people to record end of call for billing purposes. h won’t run if the call is parked. More…
  • i: Used when dialling an unknown extension in a context or unknown input in an IVR menu
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why do you need to register with a SIP trunk?

A

You need to register so that the trunk provider knows where to route calls to when an inbound call comes in

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where do you place register strings?

A

In the general context within sip.conf

17
Q

What does the underscore mean in an asterisk dialplan?

A

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

18
Q

What is the ${EXTEN} variable?

A

It is the value of the extension that was dialed

19
Q

What is the difference between the type user, friend and peer?

A
  • peer: A SIP entity to which Asterisk sends calls (a SIP provider for example). If you want a user (extension) to have multiple phones, define an extension that calls two SIP peers. The peer authenticates at registration.
  • user: A SIP entity which places calls through Asterisk (A phone which can place calls only). Users authenticate to reach services with their context.
  • friend: An entity which is both a user and a peer. This make sense for most desk handsets and other devices. Asterisk will create two objects, one peer and one user, with the same name.
20
Q

What are the asterisk pattern matching characters?

A
  • X matches any digit from 0-9
  • Z matches any digit from 1-9
  • N matches any digit from 2-9
  • [1237-9] matches any digit or letter in the brackets
  • [a-z] matches any lower case letter
  • [A-Z] matches any UPPER case letter
  • . wildcard, matches one or more characters
  • ! wildcard, matches zero or more characters immediately
21
Q

What are the different config files?

A
22
Q

What is FastAGI?

A

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.

23
Q

How do you see all AGI commands?

A

‘agi show’

24
Q

What are blocking applications?

A

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.

25
Q

What is an AGI script?

A

An AGI script is an external script that asterisk executes to perform an atomic operation, this could be checking if a number should be called, doing something based on the status of a call etc….

An AGI script should terminate as fast as possible and return back to asterisk, this is due to performance, e.g. if asterisk handles hundreds of calls and each call invoking an external script, then the longer the scripts are running the more resources are being used

AGI is analogous to CGI in Apache. AGI provides an interface between the Asterisk dialplan and an external program that wants to manipulate a channel in the dialplan. In general, the interface is synchronous - actions taken on a channel from an AGI block and do not return until the action is completed.

26
Q

What is AMI?

A

Asterisk Manager Interface provides a mechanism to control where channels execute in the dialplan. Unlike AGI, AMI is an asynchronous, event driven interface. For the most part, AMI does not provide mechanisms to control channel execution - rather, it provides information about the state of the channels and controls about where the channels are executing.

27
Q

What is ARI?

A

While AMI is good at call control and AGI is good at allowing a remote process to execute dialplan applications, neither of these APIs was designed to let a developer build their own custom communications application. ARI is an asynchronous API that allows developers to build communications applications by exposing the raw primitive objects in Asterisk - channels, bridges, endpoints, media, etc. - through an intuitive REST interface. The state of the objects being controlled by the user are conveyed via JSON events over a WebSocket.

ARI consists of three different pieces that are - for all intents and purposes - interrelated and used together. They are:

  1. A RESTful interface that a client uses to control resources in Asterisk.
  2. A WebSocket that conveys events in JSON about the resources in Asterisk to the client.
  3. The Stasis dialplan application that hands over control of a channel from Asterisk to the client.

“ARI is not about telling a channel to execute the VoiceMail dialplan application or redirecting a channel in the dialplan to VoiceMail.

It is about letting you build your own VoiceMail application.”

28
Q

What is the Statis application?

A

It is used in conjuction with ARI, it starts an external ARI application which is used to create a telephony based application based on an organisations needs

29
Q

Where do you configure queues?

A

In queues.conf

30
Q

What is state hinting?

A

It allows a device to tell asterisk what state it is in, this is useful in queue scenarios, where you don’t want to call a member of a queue if they are in a call

Extension state is the state of an Asterisk extension, as opposed to the direct state of a device or a user.

31
Q

Where is state hinting defined?

A

It is defined in sip.conf and the ‘hint’ priority is used

You need to also set ‘callcounter=yes’ on an asterisk device to enable state hinting for that particular device