How to configure Asterisk with iCall

This quick tutorial will talk you through installing Asterisk, setting up iCall as a gateway, and configuring outbound and inbound services. For the purposes of this walk through, we'll assume that you're using a Linux-based system. For Windows, FreeBSD, or OSX - all instructions other than the basic installation process are identical.

Getting Asterisk

To download the latest version of Asterisk, visit http://www.asterisk.org/downloads and select the branch you'd like to use (the differences between 1.4 and 1.6 is outside of the scope of this tutorial, however, either one will function fine with our service).
# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.1.9.tar.gz # tar zxvf asterisk-1.6.1.9.tar.gz # cd asterisk-1.6.1.9 # ./configure # make # make install # make samples
Asterisk should now be installed in.

Adding the iCall gateways

Now that we have the system installed, we need to setup the iCall gateways. First, make sure that your system IP address has been added to your account in the control panel. To do this, login to the Customer Center and go to the "SIP Settings" page.
Next, edit the file in /etc/asteriskl/ called sip.conf. Sample Asterisk configuration files are located on the "SIP Settings" page of the control panel. Generally, you will use something similar to:
[icall_domestic] type=friend host=sbc01-car.dal.us.icall.net context=icall_in disallow=all allow=ulaw allow=alaw allow=gsm insecure=very canreinvite=no qualify=no [icall_international] type=friend host=gw01-car.dal.us.icall.net context=icall_in disallow=all allow=ulaw allow=alaw allow=gsm insecure=very canreinvite=no qualify=no

Setting up an inbound number

Asterisk handles incoming messages in the extensions.conf configuration file. Open /etc/asterisk/extensions.conf and add the following:
[icall_in] exten => 2125551212,1,Answer() exten => 2125551212,n,Echo()
The above will simply answer calls to 2125551212 received from iCall, and echo back exactly what the caller says.

Outbound dialing

In the same file, extensions.conf, you need to configure your outbound calling. You will need to add these lines to the context that your registered users or customers will be placing calls from. Be very careful not to put this in a publicly accessible or default context or anyone can make calls via your iCall account.
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@icall_domestic) exten => _NXXNXXXXXX,1,Dial(SIP/${EXTEN}@icall_domestic) exten => 011_.,1,Dial(SIP/${EXTEN}@icall_international)
The dialplan above tells Asterisk to bridge any calls starting with "011" to iCall's international call gateway. Any calls that are 10-digit numbers, with or without a beginning "1", will be sent to the domestic gateway. Note that there are some 10-digit international destinations, so it's up to you to filter those out seperately as needed.

Running Asterisk

To run Asterisk, simply type:
# /usr/sbin/asterisk
You'll probably want to install an init.d script to manage startup and shutdown, and run Asterisk in the background. In thecontrib/init.d folder of the Asterisk source there are sample script you can use.

Comments

Popular posts from this blog

PHPMixBill V5 mikrotik Billing Solutions

How to install Asterisk and A2billing on Ubuntu Server 12.04LTS

odbcinst: SQLGetPrivateProfileString failed with