asterisk2billing.org
http://forum.asterisk2billing.org/

A2Billing 1.4.2 and PHP 5.3.x problem
http://forum.asterisk2billing.org/viewtopic.php?f=21&t=6101
Page 1 of 1

Author:  koki [ Thu Aug 27, 2009 10:09 pm ]
Post subject:  A2Billing 1.4.2 and PHP 5.3.x problem

Hi all,

UPDATE: I will delete some of my previous post since it is no more accurate. Bellow is update of how you can upgrade to 5.2.x using CentOS testing repositories.

I just had some bad experience with the before mentioned version of PHP 5.3x and decided to share it.

Now about the problem.

Installation of PHP and MYSQL always goes well until we come to the point of using a2billing.php. The script just dies with the following lines:

Code:
    -- Executing [551140041001@a2billing:1] Answer("SIP/1834454-0888d7b0", "") in new stack
    -- Executing [551140041001@a2billing:2] DeadAGI("SIP/1834454-0888d7b0", "a2billing.php|1") in new stack
[Aug 27 17:47:13] WARNING[5197]: res_agi.c:2203 deadagi_exec: Running DeadAGI on a live channel will cause problems, please use AGI
    -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
PHP Parse error:  syntax error, unexpected T_GOTO, expecting T_STRING in /var/lib/asterisk/agi-bin/lib/phpagi/phpagi.php on line 1227
    -- AGI Script a2billing.php completed, returning 0
    -- Executing [551140041001@a2billing:3] Hangup("SIP/1834454-0888d7b0", "") in new stack
  == Spawn extension (a2billing, 551140041001, 3) exited non-zero on 'SIP/1834454-0888d7b0'


There is a PHP parse error and a search on GOOGLE shows that some commands ( like GOTO ) are somehow protected or may not be used anymore as before..I am not a programmer so I have no idea what this means. I just know that A2Billing wont work with PHP 5.3

Here are some instructions on how to install php 5.2.10 from Remi's repositories. I am just testing it and it seems to be working without issues.
Commands bellow are to be executed line by line from SSH and used with YUM manager that is part of Fedora, RedHat and CentOS distributions

First you have to remove your existing php

Code:
yum remove php


then execute the command bellow to see if there is still something from php * package
Code:
rpm -qa | grep php


If somethng shows up execute the command
Code:
yum remove php-*


and test again with
Code:
rpm -qa | grep php

IF all is clean proceed to the installation of php5.2.x bellow.

First we need to enable CentOS repositories.

Code:
nano /etc/yum.repos.d/centos-test.repo


copy and paste the following lines

Code:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/5/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

Better to set "enabled=0" (disabled) and use this repo only when we need it.

Press Ctrl+x then y and Enter to save the file.


You are good to go. Execute the following command to use CentOS testing repo and install php 5.2.x
Code:
yum --enablerepo=c5-testing install php


Greets,

Koki

Author:  varnar [ Fri Aug 19, 2011 2:18 pm ]
Post subject:  Re: A2Billing 1.4.2 and PHP 5.3.x problem

I have found another solution
Just change function name 'goto' to '_goto' in phpagi.php

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/