[asterisk-bugs] [JIRA] (ASTERISK-27272) res_config_pjsql, contrib: Invalid input value for enum yesno_values: "true"

Ilgiz Badamshin (JIRA) noreply at issues.asterisk.org
Tue Sep 26 04:06:08 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=238875#comment-238875 ] 

Ilgiz Badamshin commented on ASTERISK-27272:
--------------------------------------------

Sorry, mistake with sql. Used three files from github 14.6 branch: https://github.com/asterisk/asterisk/tree/14.6/contrib/realtime/postgresql

realtime show pgsql cache ps_aors:
{code}
Columns for Table Cache 'ps_aors':
Name                 Type                 Len Nullable
id                   varchar               40 NOT NULL
contact              varchar              255         
default_expiration   int4                   4         
mailboxes            varchar               80         
max_contacts         int4                   4         
minimum_expiration   int4                   4         
remove_existing      yesno_values           4         
qualify_frequency    int4                   4         
authenticate_qualify yesno_values           4         
maximum_expiration   int4                   4         
outbound_proxy       varchar               40         
support_path         yesno_values           4         
qualify_timeout      float8                 8         
voicemail_extension  varchar               40  
{code}
Generated sql for update: 
{code}
UPDATE ps_aors SET minimum_expiration = '60', default_expiration = '3600', qualify_timeout = '3.000000', mailboxes = '', support_path = 'true', voicemail_extension = '', max_contacts = '1', authenticate_qualify = 'false', contact = '', maximum_expiration = '7200', qualify_frequency = '0', remove_existing = 'true', outbound_proxy = '' WHERE id = 'alice'
{code}
Column from table: 
{code}
ALTER TABLE public.ps_aors ADD COLUMN support_path yesno_values;
{code}
And its type:
{code}
CREATE TYPE public.yesno_values AS ENUM
   ('yes',
    'no');
{code}

There also exist type "yes_no_values" with underscore. 

> res_config_pjsql, contrib: Invalid input value for enum yesno_values: "true"
> ----------------------------------------------------------------------------
>
>                 Key: ASTERISK-27272
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27272
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Contrib/General, Resources/res_config_pgsql
>    Affects Versions: 14.6.1
>            Reporter: Ilgiz Badamshin
>            Assignee: Ilgiz Badamshin
>            Severity: Minor
>
> Configured Asterisk 14.6.1 with realtime in pgsql. 
> Some columns has yesno_value enum type in database. But ARI tries insert there boolean values. So sql execution failed and data isn't saved in database:
> bq. res_config_pgsql.c: PostgreSQL RealTime: Query Failed because: ERROR: invalid input value for enum yesno_values: "true"
> Details: https://community.asterisk.org/t/troubles-with-yesno-values-enum-in-postgresql/71993
> Hi.
> I configured Asterisk 14.6.1 realtime with pgsql. Schema was created from asterisk-14.6.1/contrib/ast-db-manage/realtime/postgresql/postgresql_config.sql
> PostgresSql version: 9.5.8.
> Then I enabled ARI and try push configs by exmples from: https://wiki.asterisk.org/wiki/display/AST/ARI+Push+Configuration
> In asterisk cli i see errors:
> {noformat}
> res_config_pgsql.c: PostgreSQL RealTime: Failed to query ‘ps_aors at asterisk-db’.
> res_config_pgsql.c: PostgreSQL RealTime: Query Failed: INSERT INTO ps_aors (id, minimum_expiration, default_expiration, qualify_timeout, mailboxes, support_path, voicemail_extension, max_contacts, authenticate_qualify, contact, maximum_expiration, qualify_frequency, remove_existing, outbound_proxy) VALUES (‘alice’, ‘60’, ‘3600’, ‘3.000000’, ‘’, ‘true’, ‘’, ‘1’, ‘false’, ‘’, ‘7200’, ‘0’, ‘true’, ‘’)
> res_config_pgsql.c: PostgreSQL RealTime: Query Failed because: ERROR: invalid input value for enum yesno_values: "true"
> LINE 1: …y) VALUES (‘alice’, ‘60’, ‘3600’, ‘3.000000’, ‘’, ‘true’, ‘’…
> That happens with other tables too.
> {noformat}
> Is it bug and should be fixed by developers or I should change column type to boolean or add “true”, “false” to enum yesno_values?



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list