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

I can not create ratecards
http://forum.asterisk2billing.org/viewtopic.php?f=33&t=11233
Page 1 of 2

Author:  kychifre [ Tue Mar 03, 2015 10:27 am ]
Post subject:  I can not create ratecards

Hello forgive my English, I'm from Spain and I use an online translator.

I have a problem for several months, I can not create ratecards, created one when I get the following message

Your new ratecard Average User inserted.

Looking at the logs I see this mistake

[Tue Mar 03 11:17:04 2015] [error] [client XX.XX.XX.XX] PHP Notice: Undefined variable: cssname in /var/www/html/a2billing/common/lib/Misc.php online 324, referer: http://myurl.com/Public/A2B_entity_tari ... &section=6

I a2billing 2.0.12 php version 5.3.3 mysql version 5.5.36

I hope you can help me. A greeting.

Author:  kychifre [ Wed Mar 04, 2015 12:02 am ]
Post subject:  Re: I can not create ratecards

Hi I upgraded to version 2.1.0 a2billing and still have the same problem.

Any ideas?

Author:  bucasia [ Wed Mar 04, 2015 12:19 pm ]
Post subject:  Re: I can not create ratecards

I don't think the PHP Notice is causing any issues.

What is the exact error you get when trying to create a rate card?

Author:  kychifre [ Wed Mar 04, 2015 7:39 pm ]
Post subject:  Re: I can not create ratecards

Hello

Your new Ratecard hasn't been inserted.

Author:  kychifre [ Wed Mar 04, 2015 9:23 pm ]
Post subject:  Re: I can not create ratecards

Hello I contribute new data

I created a new database data without data, and in this way if I can create the ratecard.

Now if I restore the copy of a2billing then I can not create ratecard.

I have checked that no corrupt table is entirely correct.

Any ideas?

Author:  bucasia [ Wed Mar 04, 2015 11:41 pm ]
Post subject:  Re: I can not create ratecards

Are you sure you restored data from the same version of A2Billing? If not you should run the update scripts to update the database schema from the previous format.

Author:  kychifre [ Wed Mar 04, 2015 11:44 pm ]
Post subject:  Re: I can not create ratecards

If insurance

When I upgrade from version 2.0.16 a2billing to 2.1.0 I made upgrade scripts.

Author:  bucasia [ Thu Mar 05, 2015 8:40 am ]
Post subject:  Re: I can not create ratecards

Did you do the update scripts after restoring the data?

Author:  kychifre [ Thu Mar 05, 2015 1:13 pm ]
Post subject:  Re: I can not create ratecards

Yes

Author:  bucasia [ Thu Mar 05, 2015 1:16 pm ]
Post subject:  Re: I can not create ratecards

Unfortunately then I'm not sure. I think it means the SQL that is running to insert the rate card is failing.

The way to find out what SQL commands are running (so you can try them and see why they are failing) is like this - https://sysadminman.net/blog/2015/a2bil ... oting-6476

Author:  kychifre [ Thu Mar 05, 2015 3:17 pm ]
Post subject:  Re: I can not create ratecards

Hi thanks for the tip, do not know much about sql but it seems that any error that you think you do not see?



SELECT config_key as cfgkey, config_value as cfgvalue, config_group_title as cfggname, config_valuetype as cfgtype FROM cc_config

INSERT INTO cc_system_log (iduser, loglevel, action, description, tablename, pagename, ipaddress, data) VALUES('2','1','Page Visit','User Visited the Page','','A2B_entity_tariffplan.php','X.X.X.X','')

SELECT count(*) FROM cc_notification LEFT JOIN cc_notification_admin ON id = id_notification AND id_admin =2 WHERE viewed != 1 OR viewed IS NULL

INSERT INTO cc_tariffplan (tariffname, startingdate, expirationdate, id_trunk, dnidprefix, calleridprefix) values ('Direct', '2015-03-05 16:04:28', '2025-03-05 16:04:28', '3', 'all', 'all')

INSERT INTO cc_system_log (iduser, loglevel, action, description, tablename, pagename, ipaddress, data) VALUES('2','2','NEW RATECARD CREATED','User added a new record in database','cc_tariffplan','A2B_entity_tariffplan.php','X.X.X.X','tariffname = Direct| startingdate = 2015-03-05 16:04:28| expirationdate = 2025-03-05 16:04:28| id_trunk = 3| dnidprefix = all| calleridprefix = all')

Author:  bucasia [ Thu Mar 05, 2015 4:13 pm ]
Post subject:  Re: I can not create ratecards

I can't remember if you see SQL errors in the profiler? Maybe not.

If not you want to connect to MySQL and try running the INSERT INTO cc_tariffplan command manually.

You could try the others too, but I'm guessing it's that one that's failing ...

Author:  kychifre [ Thu Mar 05, 2015 5:56 pm ]
Post subject:  Re: I can not create ratecards

I compared the structure of the table cc_tariffplan new database (which I insert ratecards) and the database where I restored the data (and I can not insert ratecards)

In mysql console there is a column called key in the table cc_tariffplan have different values

Bad data base

--------------------+------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| iduser | int(11) | NO | UNI | 0 | |

Good database

+--------------------+------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| iduser | int(11) | NO | MUL | 0 | |


I send you this information if you can help.

Author:  kychifre [ Thu Mar 05, 2015 6:13 pm ]
Post subject:  Re: I can not create ratecards

From the mysql console if I can insert data into the table using INSERT INTO.

Then I go into a2billing and I can modify the ratecard, but from a2billing can not create the ratecard :?

Let the solution seems to be close :D

Author:  bucasia [ Thu Mar 05, 2015 7:38 pm ]
Post subject:  Re: I can not create ratecards

If the MySQL command works from the console then it's probably not that causing the issue.

Could you check that the php session folder (/var/lib/php/session on CentOS) is owned by the same use as that running Apache (ps -ef | grep httpd)

Other wise I'm not sure why it's failing.

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