Home arrow Asterisk arrow Asterisk/astguiclient install from scratch_v.2.0.3

Language Translator

Hacking Zone

Hacking Tools
Attacking

Configure Windows

Windows Configuration

Novels

Mix Novels

Human Personality

Body Language
Asterisk/astguiclient install from scratch_v.2.0.3 PDF Print E-mail
Written by Hemanshu Patel   
Wednesday, 17 October 2007
Article Index
Asterisk/astguiclient install from scratch_v.2.0.3
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8


PHASE 5: CONFIGURING ASTERISK AND YOUR SIP PHONES

In this phase we will configure the telco lines, the SIP phones, the extensions, meetme(conference calling) rooms, dialplan extensions and the voicemail boxes. After this phase your Asterisk system should be able to place and receive calls to and from the SIP phones you have installed over the telco lines you've hooked up. There are several things that we will not be showing how to do because Asterisk is extremely flexible and has so many different ways of being configured, that if we were to try to explain them all in this document it would be 99% asterisk configuration and be 20,000 lines long, and that would just be a barrier for those who just want to get it set up. The "Wiki" and the mailing list are two very good resources for finding answers if you run into problems configuring your system, here are links to them: The Wiki: http://www.voip-info.org/tiki-index.php The Lists: http://www.asterisk.org/index.php?menu=support

I need to note that it is possible to install Asterisk and use astGUIclient applications with no Zaptel(Digium) cards installed, but it is not recommended even if you are not going to use Zap trunks for your inbound-outbound calls with no real Zap devices, you would need to use a dummy timer(zt_dummy) based on you USB ports to get meetme conference rooms working properly and you may have other issues along the way. We would at least recommend getting a X100 or X101 board from Digium or a clone manufacturer so there is a dedicated hardware timer in place on your system.

SUBPHASE 5.0: setting up your Asterisk configuration files

1. edit zaptel.conf

- vi /etc/zaptel.conf

There are many examples inside of the zaptel.conf file that is generated with the "make samples" command that we issued at the end of the last phase. There are many different parameters for the different telco line possibilities, because we are installing a T1 that is NON-PRI-isdn B8ZS ExtendedSuperframe(ESF) E&M Wink start and 24 channels, we will use the following settings for zaptel.conf:

span=1,1,0,esf,b8zs

e&m=1-24

loadzone = us

defaultzone=us

FOR A PRI YOU WOULD USE SOMETHING LIKE THIS:

span=2,2,0,esf,b8zs

bchan=25-47

dchan=48

2. edit zapata.conf

- vi /etc/asterisk/zapata.conf

There are also many examples of how to configure zapata.conf online. we decided to separate our T1 into two line groups to keep some incoming calls from being busy if we filled up all of our lines. Here's what we used(you can set echocancel=no if you are using PRIs):

[channels]

group=1

language=en

signalling=em_w

usecallerid=yes

callerid=asreceived

context=default

echocancel=64

echocancelwhenbridged=yes

rxgain=1.0

txgain=1.0

channel => 1-2

group=2

language=en

signalling=em_w

usecallerid=yes

callerid=asreceived

context=default

echocancel=64

echocancelwhenbridged=yes

rxgain=1.0

txgain=1.0

channel => 3-24

FOR A PRI YOU WOULD USE SOMETHING LIKE THIS:

group=3

language=en

signalling=pri_net

usecallerid=yes

callerid=asreceived

callprogress=no

busydetect=no

context=default

echocancel=64

echocancelwhenbridged=yes

rxgain=1.0

txgain=1.0

channel => 25-47

3. edit sip.conf

- vi /etc/asterisk/sip.conf

here is where we will edit the configuration of our SIP compatible phone devices. As stated at the beginning, we will be setting up a Grandstream Budgetone 102 phone and a Sipura SPA-2000 adapter with two analog phones connected(each with it's own extension). Here are the settings we used to set each of them up:

[general]

port = 5060

bindaddr = 0.0.0.0

context = default

; register SIP account on remote machine if using SIP trunks

; register => testSIPtrunk: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it :5060

;

; setup account for SIP trunking:

; [SIPtrunk]

; disallow=all

; allow=ulaw

; allow=alaw

; type=friend

; username=testSIPtrunk

; secret=test

; host=10.10.10.16

; dtmfmode=inband

; qualify=1000

[gs102]

disallow=all

allow=ulaw

allow=alaw

type=friend

username=gs102

secret=test

host=dynamic

dtmfmode=inband

defaultip=10.10.10.16

qualify=1000

mailbox=102

[spa2000]

disallow=all

allow=ulaw

allow=alaw

type=friend

username=spa2000

secret=test

host=dynamic

dtmfmode=inband

defaultip=10.10.10.17

qualify=1000

mailbox=2000

[spa2001]

disallow=all

allow=ulaw

allow=alaw

type=friend

username=spa2001

secret=test

host=dynamic

dtmfmode=inband

defaultip=10.10.10.17

qualify=1000

mailbox=2001

4. edit meetme.conf

- vi /etc/asterisk/meetme.conf

This is known as the conference calling configuration file. We are just going to add two conferences(one without a pin number and one with a pin number required for entry):

[rooms]

conf => 8600

conf => 8601,1234

5. edit iax.conf (only to do IAX trunks, not required)

- vi /etc/asterisk/iax.conf

This is the IAX configuration file, below is a very simple config for having two Asterisk servers connect natively to each other, if you will be using this, make sure to add the optional lines included after the extensions.conf section. Also, there is an account setup here for a firefly IAX softphone to use.(details on that later) * IMPORTANT NOTE * if you plan to use IAX2 trunks for VICIDIAL outbound dialing you must register with the remote IAX2 server through the iax.conf file, not just in the Dial or TRUNK line of the extensions.conf dialplan.

[general]

bindport=4569

iaxcompat=yes

bandwidth=high

allow=all

allow=gsm ; Always allow GSM, it's cool :)

jitterbuffer=no

tos=lowdelay

register => ASTtest1: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it :4569

[ASTtest2]

type=friend

accountcode=IAXtrunk2

context=default

auth=plaintext

host=dynamic

permit=0.0.0.0/0.0.0.0

secret=test

disallow=all

allow=ulaw

qualify=yes

[firefly01]

type=friend

accountcode=firefly01

context=default

auth=plaintext

host=dynamic

permit=0.0.0.0/0.0.0.0

secret=test

disallow=all

allow=gsm

qualify=yes

##### EXAMPLE - This is a config example for setting up Binfone service(http://www.binfone.com)

NOTE: The "1112223333" is your iax username. When you signup, Binfone creates a default IAX username for you, (a 5 digit number, usually, starting with a 1). This works for most customers. Folks that want inbound then also sign up for DIDs, each of which has its own IAX username. (Which is the 10 digit DID). Each username has its own password which is managed through their web interface.

NOTE: If you will be using the G729 codec through binfone there is now a dedicated G729 gateway that only handles G729 calls. Please use this address to register to if you plan on using G729 as your codec: iax-g729.binfone.com

iax.conf:

[general]

register => 1112223333: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

[1112223333]

auth=md5

type=friend

username=1112223333

secret=PASSWORD

host=iax.binfone.com

context=incoming-IAX-context-in-extensions.conf

extensions.conf:

[global]

TRUNKBINFONE=IAX2/1112223333: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ; IAX trunk interface

[default]

exten => _91NXXNXXXXXX,1,AGI(AGI(agi://127.0.0.1:4577/call_log)

exten => _91NXXNXXXXXX,2,Dial(${TRUNKIAX}/${EXTEN},55,o)

exten => _91NXXNXXXXXX,3,Hangup

[incoming]

exten => 1112223333,1,AGI(AGI(agi://127.0.0.1:4577/call_log)

exten => 1112223333,2,Dial(sip/gs102,55,o)

exten => 1112223333,3,Hangup

dnsmgr.conf: # It is very helpful to enable dnsmgr

[general]

enable=yes ; enable creation of managed DNS lookups

refreshinterval=300 ; refresh managed DNS lookups every seconds

##### END EXAMPLE

6. edit voicemail.conf

- vi /etc/asterisk/voicemail.conf

This is where we set up the voicemail boxes for the extensions that

we have set up:

[general]

format=wav49|gsm|wav

serveremail=asterisk

attach=yes

skipms=3000

maxsilence=10

silencethreshold=128

maxlogins=3

[zonemessages]

eastern=America/New_York|'vm-received' Q 'digits/at' IMp

central=America/Chicago|'vm-received' Q 'digits/at' IMp

central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'

[default]

102 => 102,Grandstream Mailbox,root@localhost

2000 => 2000,Sipura Mailbox 1

2001 => 2001,Sipura Mailbox 2

3001 => 3001,Firefly Mailbox 1

7. edit manager.conf

- vi /etc/asterisk/manager.conf

This is where we set up remote logins to the asterisk manager interface, to allow sending of Action commands from remote connections to the Asterisk server, this will be important for the astguiclient applications so let's set that up now:

[general]

enabled = yes

port = 5038

bindaddr = 0.0.0.0

[cron]

secret = 1234

read = system,call,log,verbose,command,agent,user

write = system,call,log,verbose,command,agent,user

[updatecron]

secret = 1234

read = command

write = command

[listencron]

secret = 1234

read = system,call,log,verbose,command,agent,user

write = command

[sendcron]

secret = 1234

read = command

write = system,call,log,verbose,command,agent,user

8. edit logger.conf

- vi /etc/asterisk/logger.conf

This file determines the messages that are logged to the console and the /var/log/asterisk/messages file. We usually turn on full logging to the messages file to more easily diagnose any problems that we may run into, the problem with this is that is does produce very large files, so be warned:

[logfiles]

console => notice,warning,error

messages => notice,warning,error,debug,verbose

9. edit extensions.conf

- vi /etc/asterisk/extensions.conf

This is known as the dialplan. Since we are installing a Long-Distance T1 with one 800 number on it, we will need to put that 800 number in the plan, as well as how to dial out through the T1 lines and we will need to add an entry for each of the phones that we have just set up in the sip.conf file. There are many examples both in the sample file and online for what to put in your dialplan, here is the simplified dialplan that we are using:

######------ START extensions.conf example ------######

[general]

static=yes

writeprotect=no

[globals]

CONSOLE=Console/dsp ; Console interface for demo

TRUNK=Zap/g1 ; Trunk interface

TRUNKX=Zap/g2 ; 2nd trunk interface

TRUNKIAX=IAX2/ASTtest1: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it :4569 ; IAX trunk interface

[default]

; Extension 8600 + 8601 conference rooms

exten => 8600,1,Meetme,8600

exten => 8601,1,Meetme,8601

; Extension 102 - Grandstream hardphone

exten => 102,1,Playback,transfer|skip ; "Please hold while..."

exten => 102,2,Dial,sip/gs102|20|to ; Ring, 20 secs max

exten => 102,3,Voicemail,u102 ; Send to voicemail...

; Extension 2000 Sipura line 1

exten => 2000,1,Dial,sip/spa2000|30|to ; Ring, 30 secs max

exten => 2000,2,Voicemail,u2000 ; Send to voicemail...

; Extension 2001 Sipura line 2

exten => 2001,1,Dial,sip/spa2001|30|to ; Ring, 30 secs max

exten => 2001,2,Voicemail,u2001 ; Send to voicemail...

; Extension 2020 rings both sipura lines

exten => 2001,1,Dial,sip/spa2000&sip/spa2001|30|to ; Ring, 30 secs max

exten => 2001,2,Voicemail,u2000 ; Send to voicemail...

; Extension 301 rings the firefly softphone

exten => 301,1,Dial,(IAX2/firefly01@firefly01/s)

exten => 301,2,Hangup

; Extension 3429 - Inbound 800 number (1-800-555-3429)

exten => _**3429,1,Ringing

exten => _**3429,2,Answer

exten => _**3429,3,Dial,sip/spa2000&sip/spa2001|30|to ; Ring, 30 secs max

exten => _**3429,4,Voicemail,u2000 ; Send to voicemail...

; Extension 3429 - with ANI [callerID]

exten => _*NXXNXXXXXX*3429,1,Ringing

exten => _*NXXNXXXXXX*3429,2,Answer

exten => _*NXXNXXXXXX*3429,3,Dial,sip/spa2000&sip/spa2001|30|to ; Ring, 30

secs max

exten => _*NXXNXXXXXX*3429,4,Voicemail,u2000 ; Send to voicemail...

; dial a long distance outbound number to the UK

exten => _901144XXXXXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},55,tTo)

exten => _901144XXXXXXXXXX,2,Hangup

; dial a long distance outbound number to Australia

exten => _901161XXXXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},,tTo)

exten => _901161XXXXXXXXX,2,Hangup

; dial an 800 outbound number

exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1},,tTo)

exten => _91800NXXXXXX,2,Hangup

exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1},,tTo)

exten => _91888NXXXXXX,2,Hangup

exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1},,tTo)

exten => _91877NXXXXXX,2,Hangup

exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1},,tTo)

exten => _91866NXXXXXX,2,Hangup

; dial a local 727 outbound number with area code

exten => _9727NXXXXXX,1,Dial(${TRUNK}/1${EXTEN:1},,tTo)

exten => _9727NXXXXXX,2,Hangup

; dial a local 813 outbound number with area code

exten => _9813NXXXXXX,1,Dial(${TRUNK}/${EXTEN:1},,tTo)

exten => _9813NXXXXXX,2,Hangup

; dial a long distance outbound number

exten => _91NXXNXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},,tTo)

exten => _91NXXNXXXXXX,2,Hangup

; dial a local outbound number (modified because of only LD T1)

exten => _9NXXXXXX,1,Dial(${TRUNK}/1727${EXTEN:1},,tTo)

exten => _9NXXXXXX,2,Hangup

; barge monitoring extension

exten => 8159,1,ZapBarge

exten => 8159,2,Hangup

; # timeout invalid rules

exten => #,1,Playback(invalid) ; "Thanks for trying the demo"

exten => #,2,Hangup ; Hang them up.

exten => t,1,Goto(#,1) ; If they take too long, give up

exten => i,1,Playback(invalid) ; "That's not valid, try again"

; Give voicemail at extension 8500

exten => 8500,1,VoicemailMain

exten => 8500,2,Goto(s,6)

; ASTERISK AGENTS LOGINS FOR QUEUES (NOT part of VICIDIAL)

; the following assumes phone agent login and exten are 3 digits and the same

; also assumes that 3-digit login is present in agents.conf and queueus.conf

;Agent Logout then stay onhook, DIAL 54 + 3-digit ID

exten => _54XXX,1,AgentCallbackLogin(||)

; the following are used to login and logout of Asterisk Queues from phone

;Agent Login then stay offhook on the phone, DIAL 55 + 3-digit ID

exten => _55XXX,1,AgentLogin(${EXTEN:1})

;Agent Login then stay onhook, phones will ring, DIAL 56 + 3-digit ID

exten => _56XXX,1,AgentCallbackLogin(||${EXTEN:1}@default)

######------ END extensions.conf example ------######

### OPTIONAL IAX trunk extensions entries for long distance dialing over IAX

exten => _91NXXNXXXXXX,1,AGI(AGI(agi://127.0.0.1:4577/call_log)

exten => _91NXXNXXXXXX,2,Dial(${TRUNKIAX}/${EXTEN},55,o)

exten => _91NXXNXXXXXX,3,Hangup

### OPTIONAL SIP trunk extensions entries for long distance dialing over SIP

exten => _91NXXNXXXXXX,1,AGI(AGI(agi://127.0.0.1:4577/call_log)

exten => _91NXXNXXXXXX,2,Dial(sip/${EXTEN}@SIPtrunk,55,o)

exten => _91NXXNXXXXXX,3,Hangup

### OPTIONAL IAX Load Balance extens to allow for Overflow and Balanced VDAD

### In this setup, the serverIP is the prefix followed by agent conf_exten

### FOR MORE INFORMATION, READ THE LOAD_BALANCING.txt DOCUMENT

### server 1 extens:

exten => _010*010*010*016*8600XXX,1,Dial(${TRUNKIAX2}/${EXTEN:16},55,o)

### server 2 extens:

exten => _010*010*010*015*8600XXX,1,Dial(${TRUNKIAX1}/${EXTEN:16},55,o)

10. edit dnsmgr.conf: # It is very helpful to enable dnsmgr

[general]

enable=yes ; enable creation of managed DNS lookups

refreshinterval=300 ; refresh managed DNS lookups every seconds

11. Now that you have configured Asterisk, it is time to try to start it for the first time.

- First make sure that your T1 line(or other telco line) is connected to the digium card.

- next type the following at the command prompt: "ztcfg -vvvvvv"
- you should see a confirmation that the Zaptel device has loaded

- now you can launch asteris with the following command:

"asterisk -vvvvvvvvvvvvgc"

- you should see a lot of messages scroll by and at the end you should be given a CLI> prompt if everything loaded OK. To get out of Asterisk you can type "stop now". Now that you are sure it is running you can either run it in a separate terminal window or use the start_asterisk_boot.pl that you will install with astguiclient to start Asterisk.

SUBPHASE 5.1: setting up your SIP phones

You will need to follow the instructions for the phones that you are using with your system, but here's the way to set up a Grandstream 102 and a Sipura SPA-2000

1. Here are basic instructions for setting up a Grandstream BT 102:

- On the phone plug it in to power only at first and follow these instructions:

- wait for the phone to boot up and press the MENU button

- go through the menu screens with the menu key and the up/down arrow keys to move from setting to setting. We are setting the following values:

- DHCP OFF

- IP Addr: 010.010.010.016

- Subnet: 255.255.000.000

- router: 010.010.010.001

- dnS: 010.010.010.001

- tftp: we leave this blank for now

- menu 7 we change the codec to G-711u

- now wait 10 seconds and unplug the power and plug it back in

- you can also plug the network cable into the LAN port on the phone

- at this time you can go to your workstation and open a new web browser

- go to http://10.10.10.16/ the password is "admin"

- here is where you will enter in the configuration details for the

phone to register with the Asterisk server

- SIP server: 10.10.10.15

- SIP user ID: gs102

- Authenticate ID: gs102

- Password: test

- Name: gs102

- Voice Mail UserID: 102

- Send DTMF: in-audio

- NTP Server: tick.mit.edu

- then click update, click review changes, and click reboot

- your phone should now be able to register with the Asterisk server. If you still have your console screen up you should see a registration message appear telling you that gs102 has registered.

2. Here are the basic instructions for setting up a Sipura SPA-2000 analog adapter with 2 lines.

- Plug power and two analog phones into the adapter.

- pick up the phone plugged into line1 and press **** to enter admin menu

- press 101# then 0# to disable DHCP

- press 111# then 10*10*10*17# to change the IP address

- press 121# then 255*255*0*0# to change the subnet mask

- press 131# then 10*10*10*1# to change the default gateway

- hang up the phone, unplug the power, plug in the network cable and plug in the power cable

- now you can go the the admin website: http://10.10.10.17/admin/advanced

- you will need to make these setting changes:

- click on the "Line 1" tab at the top and change the following values:

- Proxy: 10.10.10.15

- Display Name: spa2000

- userID: spa2000

- password: test

- authID: spa2000

- change the dialplan to the following:

(*xx|xxx|xxxx|xxxxx|xxxxxx|xxxxxxx|xxxxxxxx|xxxxxxxxxxx|xxxxxxxxxxxx|xxxxxxxxxxxxxxx|xxxxxxxxxxxxxxxx.)

- then click the "submit all changes" button at the bottom of the page and your first phone line should work now

- to register the second line, simply click on the "Line 2" tab and go through the above steps except use spa2001 instead of spa2000 for the use IDs

3. Now both of your phone devices are set up and you can try making phone calls between the three phones

SUBPHASE 5.2: setting up an IAX2 phone

This is optinal and we won't go into too much detail about this, but currently there are several IAX hard and softphones on the market and more are coming every month. Follow the instructions with the IAX phone you have chosen and follow the steps below:

1. Add an entry into your iax.conf file like below if you have not already

[firefly01]

type=friend

accountcode=firefly01

context=default

auth=plaintext

host=dynamic

permit=0.0.0.0/0.0.0.0

secret=test

qualify=yes

2. Add an entry into your extensions.conf file like below if it is not in there

; Extension 3001 rings IAX phone

exten => 301,1,Dial(IAX2/firefly01@firefly01/s)

exten => 301,2,Voicemail,u301 ; Send to voicemail...

3. Download Firefly 3rd party, or IDEfisk for Windows or Linux:

- http://www.virbiage.com/firefly/download/firefly-thirdparty.exe

MIRRORS:

- http://mirror.isp.net.au/ftp/pub/firefly/firefly-thirdparty.exe

- http://www.freedomphones.net/files/firefly-thirdparty.exe

IDEFISK:

- http://www.asteriskguru.com/idefisk/

- Install the application

- Launch Firefly Softphone

- click the "I wish to connect to a 3rd party network" button

- Enter in network name: Asterisk

- Select IAX2 as the protocol

- enter in your server address: "10.10.10.15" in our case

- enter login and pass: "firefly01" and "test" for in our case

- click OK and you should be logged in and can place calls

SUBPHASE 5.3: setting up a Zap phone

This is optinal and we won't go into too much detail about this either, there are a few ways to use Zap devices as phones on your Asterisk system: Zaptel phone cards, Channel Banks going through Zaptel T1 card, outside line call coming in going through Zaptel line card. There isn't much to do but set your Zaptel config files up and put entries into your extensions.conf file:

1. Add an entry into your extensions.conf file like below

; Extension 4001 rings Zap phone

exten => 4001,1,Dial,Zap/1|30| ; ring Zap device 1

exten => 4001,2,Voicemail,u4001 ; Send to voicemail...



 
< Prev   Next >
Your Ad Here

Donate us!!

Enter Amount:

RSS socialnet

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits