Skip to main content

Posts

Showing posts from February, 2013

Tutorial: Running and managing asterisk phone system

Managing the Asterisk server From the asterisk source directory, if you haven’t already, set asterisk to start on boot: make config chkconfig asterisk on Then you can start asterisk with: service asterisk start or stop asterisk with: service asterisk stop or check whether it is running with: service asterisk status Using the Asterisk command line interface To connect to asterisk and establish a command line interface(CLI): asterisk -r From the CLI, you can run all sorts of useful commands. Particularly useful ones include: “ reload ” – to reload your configuration files Core commands “ core stop now ” – to shut down asterisk “ help core ” – show the help for all core commands SIP commands “sip show peers”  – to view a list of sip agents asterisk knows about “sip show users ” – show a listing of sip users Viewing logs Logs from asterisk are in /var/log/asterisk by default. Messages is the file you’ll be interested in most often. To show the la

Step by step: Configure call recording - Asterisk tutorials

This article will cover enabling asterisk to record calls. You may want this to interview people over the phone, podcast, or some other purpose. In features.conf, under: [featuremap] uncomment the line that looks like this: automixmon => *3 ; One Touch Record a.k.a. Touch MixMonitor — Make sure to set the X and/or x option in the Dial() or    Queue() app call! Then, enable the X option for Dial() in your dialplan in extensions.conf: PLEASE NOTE:  change you need to make – add the X  your dial rule make look different with me. exten => s,n,Dial(SIP/100,60) make it this instead: exten => s,n,Dial(SIP/100,60,X) The X is what tells Asterisk to allow callers to dial *3 during a call to enable or disable recording. From the asterisk console (run asterisk -r), you should see a line like this appear when the user starts a recording: – User hit ‘*3′ to record call. filename: auto-xxxxx-EXTENSION-DIALEDNUMBER When the recording ends, un

Make a basic call

sip.conf Rename the sip.conf file (Location: /etc/asterisk/sip.conf) to sip_old.conf for example. Create a new sip.conf empty file and insert the following lines into the file: [general] context = incoming ; Default context for incoming calls allowguest = no ; Allow or reject guest calls (default is yes, this can also be set to 'osp' bindport = 5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr = 0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup = yes ; Enable DNS SRV lookups on outbound calls disallow = all ; First disallow all codecs allow = ulaw ; Allow codecs in order of preference allow = alaw allow = gsm dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. canreinvite=no nat=yes //////////////////////////////// Create SIP account [100] type=friend context=incoming defaultuser=100 secret=100 host=dynamic callerid="Phone1" [101] type=friend con

Build a simple call - Dialplan

The dialplan is truly the heart of any  Asterisk system , as it defines how Asterisk handles inbound and outbound calls. In a nutshell, it consists of a list of instructions or steps that Asterisk will follow. Unlike traditional phone systems, Asterisk’s dialplan is fully customizable. To successfully set up your own Asterisk system, you will need to understand the dialplan. The dialplan is specified in the file called extensions.conf (Location: /etc/asterisk/extensions.conf). A dialplan has four main concepts: contexts extensions priorities applications  Contexts Dialplans are divided into sections called contexts. The name of the context is placed inside square brackets ([ ]). The context for internal calls looks like this: [internal]  Extensions An extension is simply a named set of actions. Asterisk will perform each action in sequence. The syntax for an extension is the word exten, followed by an arrow formed by the equals sign and the greater-than sign, lik

Install A2Billing Asterisk

Install FreePBX Set up MySQL service mysqld start mysqladmin create asteriskcdrdb; mysql asteriskcdrdb < SQL/cdr_mysql_table.sql; GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ‘passw0rd’; flush privileges; exit; # Asterisk Settings for a2billing nano /etc/asterisk/cdr_mysql.conf [global] hostname = localhost dbname=asteriskcdrdb password = passw0rd user = asterisk userfield=1 loguniqueid=yes ;port=3306 ;sock=/tmp/mysql.sock nano /etc/asterisk/res_mysql.conf [a2billing] dbhost = localhost dbname = a2billing dbuser = root dbpass = dbport = 3306 dbsock = /var/lib/mysql/mysql.sock # A2Billing Installation cd /usr/src mkdir a2billing cd a2billing wget –no-check-certificate  http://nodeload.github.com/Star2Billing/a2billing/tarball/v1-current tar zxf v1-current cd Star2Billing-a2billing-* mv * .. cd .. rm -rf Star2Billing-a2billing-* ln -s /usr/src/a2billing/a2billing.conf /etc/a2billing.conf chmod 777 /e

Step by step Install FreePBX

# Step 1: Download package and create database cd /usr/src wget  http://asteriskvoipsystem.org/downloads/freepbx-2.8.1.tar.gz tar zxf freepbx-2.8.1.tar.gz cd freepbx-2.8.1 mysqladmin create asterisk mysqladmin create asteriskcdrdb mysql asterisk < SQL/newinstall.sql mysql asteriskcdrdb < SQL/cdr_mysql_table.sql mysql GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY ‘changepassword’; GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY ‘changepassword’; flush privileges; \q pear channel-update pear.php.net pear install DB MDB2 MDB2#mysql mkdir -p /var/lib/asterisk/run #Fix Asterisk Music On Hold ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3 # Step 2: Install FreePBX  cd /usr/src/freepbx-2.8.1 ./install_amp setenforce 0 #Username asterisk Password changepassword #Change httpd apache user to asterisk chmod 777 /etc/amportal.conf cd /var/lib/asterisk chown -R asterisk:asterisk * chmod -R 777

Configuration of Asterisk system

First, the major configuration files that need to be modified are in /etc/asterisk. Each file that ends in .conf is a configuration file, which sets parameters for some specific part of Asterisk. --> The configuration we do in this chapter won’t be particularly useful on its own, but it will be a kernel to build on. We’re going to touch on the following files: zaptel.conf Here, we’ll do low-level configuration for the hardware interface. We’ll set up one FXO channel and one FXS channel. This configures the driver for the Linux kernel. zapata.conf In this file, we’ll configure Asterisk’s interface to the hardware. This file contains a slightly higher-level configuration of the hardware in the Asterisk user-level process. extensions.conf The dialplans we create will be extremely primitive, but they will prove that the system is working. sip.conf This is where we’ll configure the SIP protocol. iax.conf This is where we’ll configure incoming and outgoing IAX ch

How to Install Asterisk on Centos

What Packages Do I Need? Most Asterisk configurations are composed of three main packages : the main Asterisk program (asterisk), the Zapata telephony drivers (zaptel), and the PRI libraries (libpri). If you plan on a pure VoIP network, the only real requirement is the asterisk package, but we recommend installing all three packages. Step-by-step install Asterisk system: Step 1: Obtaining Asterisk Source Files The commands we issue to download version to /usr/src: # cd /usr/src/ #  wget   http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-1.6.2.6.tar.gz #  wget   http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-addons-1.6.2.1.tar.gz #  wget   http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-sounds-1.2.1.tar.gz #  wget   http://downloads.asterisk.org/pub/telephony/zaptel/releases/zaptel-1.4.12.tar.gz If you plan to use PRI cards(eg. TE110P, TE406P) you need to download  LIBPRI. If you do want to u

Setup DID number (Incoming route) - FreePBX tutorials

You can make calls to regular telephone number via your trunk, and you need to setup a DID (Direct Inward Dial) number to receive calls from people dialing a regular phone number. Setup inbound route in FreePBX Click on Connectivity => Inbound Routes and add incoming route. Enter your DID number in the “DID Number” box. Registered this number with your phone service provider. Set the destination of the call to the extension you setup in part2 (Setup extension) . Then click submit Remember  always click “Apply Configuration Changes” and give it a go. http://asteriskvoipsystem.org/setup-did-number-incoming-route-freepbx-tutorials/

Setup external calls (Outbound Route) - FreePBX tutorials

Before going to this step, you have completed Part 1 ( Setup SIP trunk ) and Part2 ( Setup an extension ) We have configured our trunk and our extension and now we need to tell FreePBX using that trunk when someone dials a number. To do that, you need to create an Outbound Routes Creating an outbound route Choose tab Connectivity => Outbound Routes   Create a name for route, using whatever name you want. i had used "ext-calls"   Then select the trunk you had created, my siptrunk was name "voip", so i picked it. After that, click submit changes. http://asteriskvoipsystem.org/setup-external-calls-freepbx-tutorials/

Setting up an extension - Tutorials FreePBX

We have got our trunk setup and now we need an extension so we can make a test call via the trunk. For testing I’m going to be using x-lite.  A free sip softphone for Windows and Linux. You can download it free in here: Windows Linux Adding an extension in FreePBX First we need to click on Applications and then click on “Submit” to add a “Generic Sip Device” Next we need to get a basic extension First enter a “User Extension” –100 Next enter a “Display Name” – I used the same as above but you could enter a real persons name or whatever you want.    Now see below, at device options and enter a secret. This is the password for the extension    Finally click on “Submit” and then we need to click on the orange “Apply Configuration Changes” for the extension to take effect     Configuring X-lite  You can see it here We probably can’t the outside world just yet as we need an Outbound Route. That will be in the next article http://asteriskvoipsystem.org/setting