Asterisk IP PBX Learning Tutorials - Part 6

Here is video number 5: Using Contexts and Dial Plans - Part 2

Contexts and dialplan Part 2

Ok, moving to next context which is called “incoming-calls-wildcard”. Lets imagine situation when you have, say, hundreds of extensions, and writing rules for each one of them can take really much time. In this case wildcards are coming to save us.

Lets take a look at single rule with 2 steps in “incoming-calls-wildcard” context, as you can see I have changed last digit of dialled extension to capital “X”, which is any number from 1 to 9 and 0. But you also have to tell asterisk that this rule contains wildcard, you do it with putting subscribe sign in the beginning. But how can we tell asterisk what to dial when we have wildcards in our rules? We use built-in variables, one of them is ${EXTEN}. This is the way all variables are referenced in asterisk – dollar sign, opening curly bracket, variable name and closing curly bracket. [Read more →]

Asterisk IP PBX Learning Tutorials - Part 5

This video provides a further explanation: Using Contexts and Dial Plans - Part 1

Contexts and dialplan Part 1

This video will get you introduced to concept of dialplan in asterisk.

The dialplan is a set of instructions in asterisk specific language that tells the system what to do with the call. Dialplan is stored in extension.conf file, so lets open this file and begin.

Dialplan is divided into contexts, and as you can see each context starts with square brackets, just like  extensions, and can have any name. However there are 2 names that are reserved ”general” and “globals”, in “general section” you define general settings of dialplan and in “globals” section you define some global variables that will be used in your dialplan, as an example here TRUNK is a global variable that you can use in your further dialplan, and each occurrence of TRUNK will be replaced with its values which is Zap/G2. [Read more →]

Asterisk IP PBX Learning Tutorials - Part 4

Let’s review the extension configuration in the 3rd video: Asterisk Video Tutorials - Using Extensions with Asterisk
Extension

In this video I will show you one of the main principle of asterisk, those are extensions.

As I have showed you before, all asterisk’s configuration files are lying in /etc/asterisk directory. The files we are interested now are sip.conf and iax.conf.

An extension in asterisk is a user that is able to connect and use the system to place or receive calls, use voicemail and other features of asterisk. In order to define asterisk extension we should edit users.conf file. As you can see each extension starts with name in square brackets, like [205] here, next come some definition on what that extension is, its credentails and some asterisk specific options you have to setup. Let’s talk about each of this option:

- username is the username that this extension will use for registering with asterisk. Usually you will want to leave it same as name, which 205 in this case. The difference between name and username is that asterisk will use name to refer to extension through dialplan, but username is used to register with it. Leaving both of them the same will not make a mess out of your dialplan. [Read more →]

Asterisk IP PBX Learning Tutorials - Part 3

Ready for the next video? Here it is: Asterisk Video Tutorials - Running Asterisk

Running asterisk:

In this video I will show you how to run asterisk and where asterisk’s files are located.

There are 2 ways to run asterisk, in foreground and in background. Running in background is how asterisk runs almost all the time, while running in foreground is mainly used to debug some startup problems. Lets start with foreground mode.

In order to run asterisk in foreground mode you have to type asterisk -vc. As you can see asterisk is starting now, showing what modules it is loading and what configuration files are read. In order to stop asterisk you have to type “stop now” command. We have used 2 switches for asterisk when starting, that is -v which stands for verbose and -c which is for “console”, meaning you will be connected to asterisk console as soon as asterisk will run. You can use any number of -v’s to get even more verbose. Lets try to start asterisk with 3 -v’s [Read more →]

Asterisk IP PBX Learning Tutorials - Part 2

So, let’s get started with the first video: Asterisk Video Tutorials - Installing Asterisk

Build and Install:

In this video I will show you how to install and configure asterisk.

Asterisk is an opensource software, that means you can download and use it for free
In order to download asterisk you have to go to asterisk web site, that is www.asterisk.org, and click on downloads link

As you can see, there are 2 versions available, one is version 1.4, which is a stable one and other is version 1.6 which is unstable. We will go with stable one. There are 3 more packages for asterisk, that is zaptel and libpri which are used to make asterisk communicate with telco hardware and addons which includes various addons for asterisk. But for now we will download only asterisk. [Read more →]