[Home]

Summary:ASTERISK-27515: prune_on_boot field missing in ps_contact table
Reporter:Sunny (simplesunny)Labels:
Date Opened:2017-12-21 07:14:04.000-0600Date Closed:2018-01-04 05:23:57.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:13.18.4 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:After upgrading to Asterisk 13.18.4, when somebody is trying to register ast box 13.18.4 is throwing warning

res_config_odbc.c:120 custom_prepare: SQL Prepare failed! [INSERT INTO ps_contacts (id, via_addr, qualify_timeout, call_id, reg_server, prune_on_boot, path, endpoint, via_port, authenticate_qualify, uri, qualify_frequency, user_agent, expiration_time, outbound_proxy) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]

Although I have updated the DB schema using the included the SQL files in the package and still prune_on_boot field missing (I am using mysql)

So please alter the query for ps_contact table in 13.18.4 package
Comments:By: Asterisk Team (asteriskteam) 2017-12-21 07:14:06.224-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: George Joseph (gjoseph) 2017-12-21 09:12:53.861-0600

I'm guessing you used the sql files in contrib/realtime/mysql?
When I run this on an existing database...
{noformat}
$ mysql --force -p -u asterisk asterisk < mysql_config.sql
{noformat}
I get a bunch of errors for the items that already exist but it does upgrade the ps_contacts table to add prune_on_boot.

Can you provide the exact command you used and the output?


By: Sunny (simplesunny) 2017-12-28 04:40:03.977-0600

Hi George,

Sorry for the delay in response.

Yes, I am using sql file only and I opened that file and found there is no query of alter of ps_contact adding column prune_on_boot.

I just copied all the commands and run directly on mysql script tab

By: Joshua C. Colp (jcolp) 2018-01-02 05:25:39.564-0600

I just opened the mysql_config.sql file from 13.18.4 and there is indeed an alter:

{noformat}
-- Running upgrade 164abbd708c -> f3d1c5d38b56

ALTER TABLE ps_contacts ADD COLUMN prune_on_boot ENUM('yes','no');

UPDATE alembic_version SET version_num='f3d1c5d38b56' WHERE alembic_version.version_num = '164abbd708c';
{noformat}

Are you sure you copied the entire thing? Did the comments cause it to skip stuff? Did it error out for some reason?

By: Sunny (simplesunny) 2018-01-04 03:29:10.671-0600

Hi Josh,

I had upgraded the Asterisk to 13.18.4 and had 2 files of mysql_config.sql and by mistake I used the old sql file, really sorry it was my mistake.

And in a new file alter command is there and it is perfect.

Thanks