Asterisk migration from 1.2.13 to 1.4.10. Edited to Asterisk (it’s a bug’s life after reverting to 1.2.26)

To the end the asterisk installation was a bit disappointing as I lost a lot of time for a stupid issue.

I started optimistic with a:

apt-get install asterisk

and then with the migration/merging of the configuration files. My configuration was as following: IAX clients connecting to asterisk which forwards calls to a sip box connected to a phone line. On the old server everything worked ok but on the new server, even if the logs are almost identical it seems like the dtmf signal did not get passed correctly to the sip box as the phone did not dial the proper number. The log showed something similar to:

[Jan  7 13:33:11] VERBOSE[7785] logger.c:     -- Called 1002
[Jan  7 13:33:11] VERBOSE[7785] logger.c:     -- SIP/1002-081b4a80 answered IAX2/ioper00-1
[Jan  7 13:33:11] VERBOSE[7785] logger.c:     -- Sending DTMF 'w0214108658' to the called party.

where 1002 is the sip box

[1002]
type=friend
username=1002@10.50.0.1
callerid="1002"
secret=xxxxxxx
host=dynamic
dtmfmode=inband
deny=0.0.0.0/0.0.0.0
permit=10.50.0.121/255.255.255.255

The only problem I could think of was dtmf related so I enabled sip debugging

asterisk -rx sip set debug

and finally there was something different. On the old machine:

Found description format PCMU for ID 0Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x4 (ulaw)/video=0x0 (nothing), combined - 0x4 (ulaw)Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)

and on the new machine

Found description format PCMU for ID 0Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x4 (ulaw)/video=0x0 (nothing), combined - 0x4 (ulaw)Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)

I think I lost a few good hours trying various codec combinations, auto, inband of rfc8633 dtmf modes both on the sip box and asterisk. After that much time I realized it was a futile effort and I took the last version of asterisk.

apt-get remove --purge asteriskapt-get autoremove --purgeapt-get install libncurses5-devtar xvfz asterisk-1.4.17.tar.gzcd asterisk-1.4.17./configuregroupadd asteriskuseradd asterisk -g asterisk -Gasterisk,dialout,audio -d /var/lib/asterisk -s /bin/falsechown -R asterisk:asterisk /var/run/asterisk/chown -R asterisk:asterisk /var/lib/asterisk/chown -R asterisk:asterisk /var/log/asterisk/chown -R asterisk:asterisk /etc/asteriskchown -R asterisk:asterisk /var/spool/asterisk/

I had kept the /etc/init.d/asterisk from the ubuntu package and now everything worked perfectly without any change in configuration. Talking about futility. It’s a bit sad that until now I’ve compiled so much from sources instead of using the distribution packages: asterisk and all the http://www.len.ro/work/tools/gutsy-on-a-ubuntu-server/qmail stuff.

I also had to install some perl and agi modules in order to avoid something like

install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at (eval 3) line 3.Perhaps the DBD::Pg perl module hasn't been fully installed,or perhaps the capitalisation of 'Pg' isn't right.Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql.

for my agi script customizations with the cdr database stored in postgresql

apt-get install libasterisk-agi-perl libpg-perl libclass-dbi-pg-perl

Edit on 22.01.2008

After a while I found out that not even 1.4.17 was working properly. After various trials I managed to change the dtmfmode to auto in sip.conf and to RFC2833 on the SIP box. This solved the problem for a while but then the machine started to die 1,2 times a day. Since it’s a remote machine I found it very hard to find the cause as it was completely not-responsive. 2-3 trips to the machine location and enabling all possible debug in asterisk lead me to:

[Jan 21 20:21:24] NOTICE[10584] chan_iax2.c: Out of idle IAX2 threads for I/O, pausing

which lead me to these bugs:

Finally I did the only possible thing. I reverted to the last version in the 1.2 branch which is 1.2.26. Now after reverting all config files and the SIP box configuration it seems to work.
There is nothing I can say but: stick to your working asterisk version because it’s a bug’s life.