On the Net

|Main Blog|Yearning|  

Words of God


About Linux News and OpenSource




and below are my posts....


Wednesday, July 12, 2006

First encounter with Asterisk Free PBX

Yesterday I started to try to install and Configure asterisk. Well, I dont have any digium fxs or fxo hardware yet so I'm toying with SIP Softphones. But before that, I manually installed asterisk on my already running Centos box, after installing some depedencies, I got it working. I installed it from CVS so that I have the latest version.

After reading some site that has lots of asterisk configuration sample, I manage to have a working SIP Softphone with the use of SJPhone. I did not made with Xlite with the same config, I dunno yet why it happend. On Xlite, when trying to call the registered prefix, it'll just sat call not allowed while on SJPhone, it allows even to its own number. Below are my sip.conf and extensions.conf with voicemail.conf.

/etc/asterisk/sip.conf


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[general]
disallow=gsm
allow=ulaw
port = 5060 ; Port to bind to
bindaddr = 172.16.0.253 ; IP_Address to bind to
;context = from-sip ; Default for incoming calls
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;---- My SIP Phone at my Desktop ----------;
[x1000]
type=friend
username=x1000
secret=1000
host=dynamic
defaultip=172.16.0.37
canreinvite=no
disallow=all
allow=all
context=testing
allow=ulaw
allow=alaw
;regexten=1000
nat=no
;
;;;;;;;;;; SIP Phone USer at other Desktop ;;;;;;;;;;
[x2000]
type=friend
username=x2000
secret=2000
host=dynamic
defaultip=172.16.0.30
canreinvite=no
disallow=all
allow=all
context=testing
allow=ulaw
allow=alaw
nat=no
;
;
;;; Entry for FXS Gateway - it has 4 FXS Ports but only configured 1 port
[4001]
type=friend
context=testing
secret=antek
host=dynamic
defaultip=172.16.0.254
nat=no
canreinvite=yes
dtmfmode=info
disallow=all
allow=ulaw
allow=g723.1
allow=g729
;
;---------- FXO VoIP Gateway Entry -------------
;By the entries below, the 4FXO antek Gateway will be able to call
;SIP users above.. by dialing the pstn number connected on its port
;then after a dial tone received, if for example 1000 has been dialed, x1000 SIP
;Phone will ring... in general, all numbers that has been set at extensions.conf
;should ring...
;
[3000]
type=friend
;username=3000
;secret=3000
host=dynamic
defaultip=172.16.0.252
canreinvite=no
disallow=all
allow=all
context=testing
allow=ulaw
allow=alaw
;regexten=2000
nat=no
;musicclass=classical
regexten=3000
;


/etc/asterisk/extensions.conf


;I'd just append the entries below to the sample
;extensions.conf file of asterisk 1.2
[testing]
;
exten => 1000,1,Dial(SIP/x1000, 10)
exten => 1000,2,VoiceMail(10001@testing, 10)
exten => 1000,3,PlayBack(vm-goodbye)
exten => 1000,4,HangUp()
exten => 999,1,VoiceMailMain(10001@testing)
;
exten => 3000,1,Dial(SIP/3000)
;exten => 3000,2,VoiceMail(10001@testing, 10)
;exten => 1000,3,PlayBack(vm-goodbye)
;exten => 1000,4,HangUp()
;exten => 999,1,VoiceMailMain(10001@testing)
;
exten => 2000,1,Dial(SIP/x2000) ;;//for user x2000
;
exten => 4001,1,Dial(SIP/4001)
;when dialing 4001, analog phone connected at the said antek fxs gateway should ring
;assuming properly configured..


and the voicemail.conf
/etc/asterisk/voicemail.conf


[testing]

x1000 => 1000, x1000, email@mymail.com

;the voicemail.conf is already an existing file, so I just added the above entry at the last line
;of this file



Ok, by default, the antek gateway has been set to H323, so VoIP protocol needs to be changed to SIP so it will be able to communicate with the asterisk SIP protocol. You can access the gateway via http or telnet for the configuration changes... here are some basics via http.

-
The model of the used gateway above.
-

-
SIP Configuration portion.. entries should match on the /etc/asterisk/sip.conf
-

-
Voice Processing control should be like that above... but you can actually used those other codecs since they are also being supported by asterisk.

For now, the config works fine, but still have so many features to discover..

0 Comments:

Post a Comment

<< Home