Print

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 (Asterisk 1.4), iax.conf and sip.conf files. As you can see each extension starts with name in square brackets, like [100] 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:


There are a lot of other options you can set for your extension, you can check them in sample sip.conf file that is shipped with asterisk. Also those sample files are very well documented, so you can use it for reference.

Let’s take a look at the iax.conf . As you can see here we use the same parameters as in sip.conf, but extensions that will be defined here are using IAX technology to connect to asterisk.

Connect to asterisk console and check your extensions. If you have started asterisk before you have made changes to your files, then you have to tell asterisk that they are changed. If you have edited just one file, for example sip.conf, then you can simply type “sip reload”, as you can see asterisk re-read all the files that are SIP related. The same applies to IAX, just type “iax2 reload” and asterisk will re-read all the configuration files that are related to IAX.

On the other hand if you have edited a lot of files and you want to apply all the changes at once, you can type “reload” and hit enter, this will make asterisk to re-read all it’s configuration files at one. There is another command that makes asterisk re-read files it is called “restart”, this command is used when you want to restart your asterisk system. There are 2 ways to restart asterisk – first one  - “restart now” will make asterisk drop all current calls and do immediate restart – obviously not the way we want it, the second one “restart when convenient” makes asterisk to wait when all the calls will be finished and then restart itself, definitely a better way to go.

Lets check what asterisk knows about your extensions. The “sip show users” command will show you all SIP extensions that asterisk handles, in a similar manner “iax2 show users” will show you what asterisk know about its IAX extensions. As you can see in addition to list of extensions list asterisk present you with a wide range of information like passwords, context used and many other information.

Written by Simon Calder: hotbutteredit.com