This Article Licensed Under GFDL
Okay i'll try to make this mini-howto as simple as possible, It will be like a kick start for anyone interested in Asterisk
We will start by downloading and compiling asterisk:-
Downloading:
You can get asterisk binaries from your GNU/Linux distribution repository or from Asterisk Official website
- we will need Asterisk-X.X.XX the main asterisk package
- we will need Asterisk-Addon-X.X.XXwhich has some adds on for asterisk
- we will need Asterisk-sounds-X.X.XXwhich has some asterisk sounds we can use
- we will need Zaptel-X.X.XX which has the zap card drivers and modules which we will use for the analog interface and for the timing in asterisk
- we will need libpri-X.X.XX which also good to be in hand for supporting T1/E1/J1 interfaces (optional)
Compiling:
Before we start we need to install some requirements I always install the headers and the development packages for mysql , postgresql and openssl in case I wanted to use any of this features with asterisk later on also asterisk require the kernel source, kernel headers, bison and libnewt then we will start by extracting and compiling:
libpri-X.X.XX
tar zxvf libpri-X.X.XX.tar.gz cd libpri-X.X.XX make su - make install
zaptel-X.X.XX
tar zxvf zaptel-X.X.XX cd zaptel-X.X.XX make su - make install
asterisk package
tar zxvf asterisk-x.x.xx.tar.gz cd asterisk-x.x.xx make su - make install make samples
asterisk-addon package
tar zxvf asterisk-addon-X.X.XX.tar.gz cd asterisk-addon-X.X.XX make su - make install
asterisk sounds
tar zxvf asterisk-sound-X.X.XX.tar.gz cd asterisk-sound-X.X.XX su - make installand You are done with asterisk compiling..
now let us talk about some basics
- asterisk configurations exists at /etc/asterisk/
- asterisk sounds exists at /var/lib/asterisk/sounds
- asterisk music on hold files at /var/lib/asterisk/mohmp3/
- asterisk voicemail files and others at /var/spool/asterisk/
- asterisk applications, codecs and channels at /usr/lib/asterisk/modules/
important files:-
- sip.conf it contain the sip server options , sip registrar and the sip users
- iax.conf it contain the iax server options , iax registrar and the iax users
- extensions.conf it contain the dialplain which we call asterisk heart
- modules.conf it contain which module not to be loaded or loaded
- voicmail.conf it contain the voicemail options
- logger.conf it contain the logger options
[general] ; here we will define the general options bindaddr = 0.0.0.0 ; so the SIP server will be listing on all the interfaces bindport = 5060 ; default SIP portand now we will need to create 2 SIP account for our softphones
[1001] ; the peer/user username=1001 ; the username for authentication secret=123 ; the password type=friend ; what kind of user is he ? peer,user,friend context=test ; context is one of the key words it's where the incoming and outgoing calls from this user should go host=dynamic ; if the user don't have static IP address or he moving alot with his softphone nat=yes ; if user behind the NAT or no canreinvite=no ; this is important it define if the media path for the call should be directed between the end points or it should go via the asterisk server callerid=sherif nagy <1001> ; this will override the caller ID that is sent out from the softphoneand almost the same configurations will be for the 2nd user
[1002] username=1002 secret=123 type=friend context=test host=dynamic nat=yes canreinvite=no callerid=DarKnesS_WolF <1002>now the heart of this call the dialplan in extensions.conf
[general] [test] ; the test context exten => 1001,1,Dial(SIP/1001) ; when someone dial 1001 should dial 1001 using SIP protocol exten => 1002,2,Dial(SIP/1002) ; when someone dial 1002 should dial 1002 using SIP protocolnow the easy part the softphone ... there is lots of softphones for both GNU/Linux and windows you can use xlite and adjust the username / authentication for each users the domain / sip server is the asterisk IP server and the password is the user password
Directory Search
Directory it's a very useful asterisk application, most of time when you call a company and don't know the extension number for the person you are looking for you have to wait and get help from the operator to reach this person. but if this company has a company directory in there asterisk PBX this will make your life much more easy ..
In more simple words, the directory is a extension numbers searching tool. so you press like * and you go the directory and then you will have to enter the 1st 3 letters of the first or last name of the person you are looking for, and this application will take care of looking UP the extension number for you
Okay so let us get technical a little bit more, how the directory application works. it gets all the information needed from the last place you will ever think about ! the voicemail.conf . Ok how does the voicemail.conf look like ?
NOTE This is only for the directory sittings you can have more options like attache your voice message to email and so on
[general] ;where the general configurations belongs [context] ;context name extension number => password,user namewhere
- extension number ; user phone number
- password ; the voicemail password
- username ; the user real email
[general] [test] 1001 => 0007,sherif nagythen how the directory command look like ?
Directory(vm-context[|dial-context[|options]])where
- directory ; the directory command
- vm-context ; the voicemail context we want to search into
- dial-context ; " i never used it " the extension context " dialplan" the command will search into after the user search
- options ; the "f" option it force the directory to look for the person FIRST name, by default the command search but the person last name
exten => *,1,Directory(test|f) ; * the number/key to reach the directory , test is the voicemail context , and it'll use looking by first name
so now someone will be calling want to get to me but he don't know my extension number so he will dial * then he will get a message saying Something like this : " welcome to the directory please enter the 1st three letters of the person first name.
- the caller will enter "s-h-e" from phone keypad. and now there is 2 alternatives:-
- the caller will listen to s-h-e-r-i-f-space-n-a-g-y every letter in the name is separated , this will be with the asterisk default voice system.
- any asterisk user can record his name , busy , unavailable message using the asterisk voicemailmain application and in this case the caller will listen to sherif nagy with my voice that i record.
- then after this asterisk will say something like " is that the person you are looking for ? if yes press 1 if no press * to find the next search results "
how dose the search work ?
each number in the phone keypad contain 3 letters so for example if your are looking for sherif you will type the 1st 3 letters which are "s-h-e" so you will click on 743 which can be any combination of PQES as 1st letter , GHI as 2nd letter and DEF as 3rd letter, so the directory will start to look using this input you may find P-H-F which a person you don't want so you click * , and so on until you find the person you are looking for.
i think that pretty much all about directory searching ..and we are done ;-) later on i hope this howto become more advanced but this is just a start
!
No comments ? no updates ? what the how to is perfect ? any body tested ? or I am singing arabic songs in wounderland ?
peace
Live Free Or Die Trying...
GPG Key ID:0x6FD809F4