Manually Updating Asterisk

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
For anyone that would like to try updating asterisk the usual disclaimers apply (YOU SHOULD NOT BE DOING THIS ON A PRODUCTION BOX) but this should hopefully do the trick. Make sure FreePBX is up to date before you start.

If anything goes wrong, it should be fairly simple to roll back to the older versions as they are kept and renamed.

Thanks go to kenn10 and jroper.

Obviously once new versions come out you will have to change the url's and file names, I've put them in there to make it clear how it needs to be. Most likely I'll update my box with every new version and update the file names in this post.

Code:
First, get the current tarball files:
1)  cd /usr/src
2)  wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.6.tar.gz
3) wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.0.tar.gz
4) wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.2.1.1+2.2.1.1.tar.gz
5) wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz

Now move the directories to make room for the new ones:
6) mv asterisk asterisk.old
7) mv asterisk-addons asterisk-addons.old
8) mv libpri libpri.old
9) mv zaptel zaptel.old (if you have zaptel still)
10) mv dahdi dahdi.old

Now expand the tarballs:
11) tar -xvf asterisk-1.6.2.6.tar.gz
12) tar -xvf asterisk-addons-1.6.2.0.tar.gz
13) tar -xvf dahdi-linux-complete-2.2.1.1+2.2.1.1.tar.gz
14) tar -xvf libpri-1.4.10.2.tar.gz

The steps above create new directories for asterisk, libri, etc., which are named something like asterisk-1.6.2.2.

Rename directories to standard directories:
15) mv asterisk-1.6.2.6 asterisk
16) mv asterisk-addons-1.6.2.0 asterisk-addons
17) mv dahdi-linux-complete-2.2.1.1+2.2.1.1 dahdi
18) mv libpri-1.4.10.2 libpri


Now build in each of your new directories in this order:

cd /usr/src/libpri
make clean
make 
make install

cd /usr/src


cd /usr/src/dahdi
make all
make install
make config

cd /usr/src

service dahdi start


cd /usr/src/asterisk
make clean
./configure
make menuselect

# your now at a menu screen, use tab select whichever sounds/additional sounds/MOH you might want, save and exit.


make
make install


cd /usr/src/asterisk-addons
make clean
./configure
make menuselect

# save and exit

make
make install

When you've done that for libpri, dahdi, asterisk, addons etc., then do a:

shutdown -r now

to reboot the system.  (I prefer this to just doing an amportal restart to insure everything is cleared out.)
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

make menuselect <-- after this your at a menu screen, use tab and save and exit.

You will need to select the additional sound files, and it may be a good idea to select a few other sound files and MOH files while you are there, to reduce transcoding.
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
Hi

You will need to select the additional sound files, and it may be a good idea to select a few other sound files and MOH files while you are there, to reduce transcoding.

So any time you want to add something or even take something out of it like sounds, you'd just

cd /usr/src/asterisk
make clean
./configure
make menuselect

#pick what you want

make
make install

So if I have this right the asterisk folder is a collection of files and instructions, the first part simply puts you in the right folder to work, gets the files ready and opens the config screen. You choose what you need, then it makes a version of asterisk and corresponding files before installing them elsewhere in the system.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

yes, that's pretty much it, although in some cases, where you have added say some underlying dependencies to the the OS, you may have to start with make distclean, then make clean etc etc.

Joe
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
Dahdi issue

Hi,

Many many thanks for putting this together.

I am encountering an issue at the stage of updating dahdi.

I do:

cd /usr/src/dahdi
make all

# so far so good

make install

# I get a messsage after this saying "DAHDI installed successfully. If you have not done so before, install the package dahdi-tools."

make config

# I then get an error message saying "make: *** No rule to make target 'Config'. Stop"


Any advice on how to proceed would be much appreciated.

thanks
jbh
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,779
Reaction score
2,192
Are you in the dahdi directory?

Try ./make config
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
I tried, but just got this:


root@pbx:/usr/src/dahdi $ ./make config
-bash: ./make: No such file or directory
 

dswartz

Guru
Joined
Feb 17, 2009
Messages
1,056
Reaction score
0
Yeah, I don't see a 'make' in /usr/src/dahdi on my system either. Kenn, typo?
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
If I just plough on, it looks like it's all worked ok ...

PBX in a Flash Version 1.4 Daemon Status
********************************************************************
* Asterisk * ONLINE * Dahdi * ONLINE * MySQL * ONLINE *
* SSH * ONLINE * Apache * ONLINE * Iptables * ONLINE *
* Fail2ban * ONLINE * IP Connect* ONLINE * Ip6tables * ONLINE *
* BlueTooth * ONLINE * Hidd * ONLINE * NTPD * ONLINE *
* Sendmail * ONLINE * Samba * OFFLINE * Webmin * ONLINE *
* Ethernet0 * ONLINE * Ethernet1 * N/A * Wlan0 * N/A *
********************************************************************
* Running Asterisk Version : Asterisk 1.6.2.2
* Asterisk Source Version : 1.6.2.2
* Dahdi Source Version : 2.2.1
* Libpri Source Version : 1.4.10.2
* Addons Source Version : 1.6.2.0
********************************************************************
pbx.local on 192.168.10.20 - eth0
CentOS release 5.2 (Final) :32 Bit Kernel: 2.6.18-92.1.22.el5
root@pbx:~ $
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
I must have done something badly wrong

I tried a reinstall, with the latest beta, and doing a yum update of Centos before downloading the payload.

Updated to Asterisk 1.6.2.2

Found I could not then register a phone to the server (bad authorisation).

amportal restart caused asterisk to go into a continuous restarting loop.

I guess the bleeding edge requires some caution ...
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,779
Reaction score
2,192
Pay Close Attention To Dahdi Versions!!!

The whole dahdi mess is probably because I had the wrong link to the download for dahdi. It should be dahd linux complete 2.2.1+2.2.1. I've posted the link to it below. I have the Dahdi Linux Complete 2.2.1+2.2.1 version
Link:
HTML:
http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.2.1+2.2.1.tar.gz
and I definitely had to do a "make" and a "make install" in the dahdi directory.

Here are the instructions in the README file of the Dahdi 2.2.1+2.2.1. It is probably what we all need when upgrading:
Code:
This is a simple-to-install 'complete' DAHDI kit for Linux users. It
is designed to be a drop-in replacement for users used to building
Zaptel 1.2 or 1.4 for their system without specifying any special
build options, file locations, or anything else. If you need to
influence the build or installation process in any way outside the
defaults, you will need to use the installation steps specific to the
dahdi-linux and dahdi-tools packages separately (both of which are
located in subdirectories of the dahdi-complete package).

To install this package, execute these commands:

Step 1)

$ make all

This will build the dahdi-linux kernel modules for your
currently-running Linux kernel, and the dahdi-tools userspace tools.

Step 2)

$ make install

You will need to run this step as root (or via sudo or some
equivalent), to install the kernel modules and userspace tools on your
system.

Step 3 (optional))

$ make config

Again you will need to run this step as root or equivalent; this step
is only needed if you want to install the sample DAHDI configuration
files and init script and have not previously installed them.
Code:
[FONT=Courier New]            PBX in a Flash Version 1.6 Daemon Status
********************************************************************
* Asterisk  * ONLINE  * Dahdi     * ONLINE  * MySQL      * ONLINE  *
* SSH       * ONLINE  * Apache    * ONLINE  * Iptables   * ONLINE  *
* Fail2ban  * ONLINE  * IP Connect* ONLINE  * Ip6tables  * ONLINE  *
* BlueTooth * ONLINE  * Hidd      * ONLINE  * NTPD       * ONLINE  *
* Sendmail  * ONLINE  * Samba     * ONLINE  * Webmin     * ONLINE  *
* Ethernet0 * ONLINE  * Ethernet1 *   N/A   * Wlan0      *   N/A   *
********************************************************************
* Running Asterisk Version : Asterisk 1.6.2.3-rc2
* Asterisk Source Version  : 1.6.2.3-rc2
* Dahdi Source Version     : 2.2.1+2.2.1
* Libpri Source Version    : 1.4.10.2
* Addons Source Version    : 1.6.2.0
********************************************************************
pbx.local on 192.168.1.251 - eth0
CentOS release 5.4 (Final) :32 Bit Kernel: 2.6.18-164.11.1.el5
********************************************************************
 For help on PBX commands than you can run type help-pbx           *
********************************************************************
[/FONT]
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
I don't know I'd this is a factor or off topic, but I find my downloads of PIAF 1.6 beta ISO fail the Linux mediacheck. I tried a feww downloads, making sure MD5 check sums were ok and burning CDs on different machines. Each time 1.6 fails the check, whereas no problem with any of the earlier versions. I decided to ignore the warning ... But I've no idea why this is occurring only with this version.
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
Kenn I've updated the dahdi bits, I think I've got it right but if you could cast a eye over the relative bits.

Sorry I knew there was a typo there but chose the wrong direction as being the fix, not using dahdi myself so it made no odds.
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,779
Reaction score
2,192
Kenn I've updated the dahdi bits, I think I've got it right but if you could cast a eye over the relative bits.

Sorry I knew there was a typo there but chose the wrong direction as being the fix, not using dahdi myself so it made no odds.

It looks right to me now. I still want to know if someone can use the FreePBX backup from a 1.4 system and restore it under 1.6 and still have it work. I haven't had time to try it on my lab system.
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
Still having problems

I tried installing again, starting from a new ISO created using Joe Roper's WonderScript which all went without a hitch. I then followed the instructions to upgrade to Asterisk 1.6.2.2, etc, which all seemed to go smoothly with no error messages this time.

The status screen looked ok:

PBX in a Flash Version 1.6 Daemon Status
********************************************************************
* Asterisk * ONLINE * Dahdi * ONLINE * MySQL * ONLINE *
* SSH * ONLINE * Apache * ONLINE * Iptables * ONLINE *
* Fail2ban * ONLINE * IP Connect* ONLINE * Ip6tables * ONLINE *
* BlueTooth * ONLINE * Hidd * ONLINE * NTPD * ONLINE *
* Sendmail * ONLINE * Samba * OFFLINE * Webmin * ONLINE *
* Ethernet0 * ONLINE * Ethernet1 * N/A * Wlan0 * N/A *
********************************************************************
* Running Asterisk Version : Asterisk 1.6.2.2
* Asterisk Source Version : 1.6.2.2
* Dahdi Source Version : 2.2.1+2.2.1
* Libpri Source Version : 1.4.10.2
* Addons Source Version : 1.6.2.0
********************************************************************
pbx.local on 192.168.10.101 - eth0
CentOS release 5.4 (Final) :32 Bit Kernel: 2.6.18-164.11.1.el5
********************************************************************
For help on PBX commands than you can run type help-pbx *
********************************************************************
root@pbx:~ $


However I find two issues:

When I create an extension in FreePBX, the extension does not really seem to exist until I do a reboot of the system (shutdown -r now)

What I mean is that if I use:

asterisk -vr
sip show peers

then the extension does not show up as a peer, until I do a reboot. This is not the behaviour normally seen. A phone cannot register as the newly created extension until the system is rebooted - instead it gets an authentication error.

The other issue I still see is that if I now do an amportal restart, I get this:


root@pbx:~ $ amportal restart



STOPPING ASTERISK
/usr/sbin/safe_asterisk: line 146: 3874 Segmentation fault (core dumped) nice -n $PRIORITY ${ASTSBINDIR}/asterisk -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
Asterisk ended with exit status 139
Asterisk exited on signal EXITSTATUS-128.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
Asterisk Stopped

STOPPING FOP SERVER
FOP Server Stopped
SETTING FILE PERMISSIONS
Permissions OK

STARTING ASTERISK
Asterisk is already running

STARTING FOP SERVER
FOP Server Started
root@pbx:~ $ mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.
mpg123: no process killed
Asterisk ended with exit status 1
Asterisk died with code 1.
cat: /var/run/asterisk.pid: No such file or directory
Automatically restarting Asterisk.

...and so on ad infinitum.
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
Confirmed where the problems lie

I just did another test install to confirm that everything works fine if I use the JR WonderScript-ed ISO with the normal PIAF 1.6.1.10 payload, and this works fine with none of the issues observed when Asterisk was manually updated.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

Glad to hear it worked for you, a fresh install is usually the safer way.

There are some changes from memory that have to be done in asterisk.conf.

Joe
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
Hi

There are some changes from memory that have to be done in asterisk.conf.

Joe

Hi Joe,

To clarify: I meant the install with the 1.6.1.10 payload worked fine with the CentOS 5.4 ISO made with your script.

However, updating manually to Asterisk 1.6.2.2, etc still seems to be the cause of the two problems I've encountered.

Could some changes in asterisk.conf solve these do you think? If so, and if you were able to recall what they are, that would be marvellous....
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,779
Reaction score
2,192
What sort of PC are you running this on? I guess I'm lucky my Dell SC440 dual-core Pentium isn't giving me this kind of grief!

The bleeding edge is painful most of the time.
 

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
It's just an old Compaq EVO D510 that I use for testing on. Low spec, but doesn't complain normally.
 

Members online

Forum statistics

Threads
25,812
Messages
167,763
Members
19,241
Latest member
bellabos
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top