Star2Billing / a2billing

A2Billing is a telecom switch and billing system capable of providing and billing a range of telecom products and services to customers such as calling card products, residential and wholesale VoIP termination, DID resale and callback services.
www.asterisk2billing.org
Other
181 stars 175 forks source link

Additional PHP 7 modifications #176

Open bbs2web opened 3 years ago

bbs2web commented 3 years ago

Changed mysql calls depreciated in PHP 7 to mysqli

Signed-off-by: bbs2web bbs2web@hotmail.com

bbs2web commented 3 years ago

The above patches fix issues with running A2Billing on PHP 7, specifically the CSV and XML export functionality which generated the following errors:

[Tue Oct 27 10:53:59.619955 2020] [php7:error] [pid 23279] [client 41.79.23.231:55804] PHP Fatal error:  Uncaught Error: Call to undefined function mysql_pconnect() in /usr/local/src/a2billing/common/lib/iam_csvdump.php:218\nStack trace:\n#0 /usr/local/src/a2billing/common/lib/iam_csvdump.php(272): iam_csvdump->_db_connect_mysql('a2billing', 'a2billing', 'secret', 'localhost')\n#1 /usr/local/src/a2billing/common/lib/iam_csvdump.php(454): iam_csvdump->_generate_csv_mysql('SELECT t1.start...', 'a2billing', 'a2billing', 'secret', 'localhost')\n#2 /usr/local/src/a2billing/admin/Public/export_csv.php(62): iam_csvdump->dump('SELECT t1.start...', 'Dump_2020-10-27', 'csv', 'a2billing', 'a2billing', 'secret', 'localhost', 'mysql')\n#3 {main}\n  thrown in /usr/local/src/a2billing/common/lib/iam_csvdump.php on line 218, referer: https://a2billing.site.local/admin/Public/call-log-customers.php?s=1&t=0&order=t1.starttime&sens=DESC&current_page=0

[Wed Oct 28 14:16:32.134663 2020] [php7:error] [pid 18627] [client 41.79.23.231:47821] PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_field_name() in /usr/local/src/a2billing/common/lib/iam_csvdump.php:396\nStack trace:\n#0 /usr/local/src/a2billing/common/lib/iam_csvdump.php(376): iam_csvdump->_generate_msqlxml(Object(mysqli_result))\n#1 /usr/local/src/a2billing/common/lib/iam_csvdump.php(462): iam_csvdump->_generate_xml_mysql('SELECT t1.start...', 'a2billing', 'a2billing', 'secret', 'localhost')\n#2 /usr/local/src/a2billing/admin/Public/export_csv.php(66): iam_csvdump->dump('SELECT t1.start...', 'Dump_2020-10-28', 'xml', 'a2billing', 'a2billing', 'secret', 'localhost', 'mysql')\n#3 {main}\n  thrown in /usr/local/src/a2billing/common/lib/iam_csvdump.php on line 396, referer: https://a2billing.site.local/admin/Public/call-log-customers.php?s=1&t=0&order=t1.starttime&sens=DESC&current_page=4&entercustomer_num=&posted=1&Period=&frommonth=&fromstatsmonth=&tomonth=&tostatsmonth=&fromday=true&fromstatsday_sday=28&fromstatsmonth_sday=2020-10&today=true&tostatsday_sday=28&tostatsmonth_sday=2020-10&dsttype=1&srctype=1&clidtype=&channel=&resulttype=min&dst=&src=&clid=&terminatecauseid=ANSWER&choose_calltype=-1&entercustomer=1&enterprovider=&entertrunk=