[asterisk-bugs] [JIRA] (ASTERISK-24992) cdr_adaptive_odbc: Check the column in table is nulleable

Joshua Colp (JIRA) noreply at issues.asterisk.org
Wed Dec 20 06:25:08 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua Colp updated ASTERISK-24992:
-----------------------------------

    Assignee:     (was: Rodrigo Ramirez Norambuena)

> cdr_adaptive_odbc: Check the column in table is nulleable
> ---------------------------------------------------------
>
>                 Key: ASTERISK-24992
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24992
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: CDR/cdr_adaptive_odbc
>    Affects Versions: 13.3.2
>            Reporter: Rodrigo Ramirez Norambuena
>            Severity: Minor
>         Attachments: ASTERISK-24992-13-2.diff, ASTERISK-24992-13.diff
>
>
> In related by documentation, example https://wiki.asterisk.org/wiki/display/AST/PostgreSQL+CDR+Backend the columns for PostgreSQL is all NOT NULL. 
> If call the any value in cdr is NULL the record is not saved.
> Example test:
> If create a call by console dial
> {code}
> *CLI> module unload cdr_adaptive_odbc.so
>  Unloading cdr_adaptive_odbc.so
>   == Unregistered 'Adaptive ODBC' CDR backend
> Unloaded cdr_adaptive_odbc.so
> *CLI> module load cdr_adaptive_odbc.so
>   == Parsing '/etc/asterisk/cdr_adaptive_odbc.conf': Found
> Loaded cdr_adaptive_odbc.so
> *CLI>     -- Found adaptive CDR table cdr at asterisk.
>     -- Found alias start for column calldate in cdr at asterisk
>        > Found calldate column with type 93 with len 19, octetlen 19, and numlen (0,0)
>        > Found clid column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found src column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found dst column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found dcontext column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found channel column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found dstchannel column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found lastapp column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found lastdata column with type 12 with len 80, octetlen 255, and numlen (0,0)
>        > Found duration column with type 4 with len 10, octetlen 10, and numlen (0,10)
>        > Found billsec column with type 4 with len 10, octetlen 10, and numlen (0,10)
>        > Found disposition column with type 12 with len 45, octetlen 255, and numlen (0,0)
>        > Found amaflags column with type 4 with len 10, octetlen 10, and numlen (0,10)
>        > Found accountcode column with type 12 with len 20, octetlen 255, and numlen (0,0)
>        > Found uniqueid column with type 12 with len 150, octetlen 255, and numlen (0,0)
>        > Found userfield column with type 12 with len 255, octetlen 255, and numlen (0,0)
>  Loaded cdr_adaptive_odbc.so => (Adaptive ODBC CDR backend)
> *CLI> console dial 700 at parkedcalls
> *CLI> [Apr 21 03:33:24] WARNING[30461]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
> [Apr 21 03:33:24] NOTICE[30461]: console_video.c:137 console_video_start: voice only, console video support not present
>     -- Executing [700 at parkedcalls:1] Park("Console/dsp", "") in new stack
>   << Console call has been answered >> 
>     -- Parking 'Console/dsp' in 'default' at space 701
>     -- Channel Console/dsp joined 'holding_bridge' parking-bridge <bb295d4a-bc50-494a-bcdf-60b1ddd0ead0>
> [Apr 21 03:33:24] WARNING[2857][C-00000007]: chan_oss.c:786 oss_indicate: Don't know how to display condition 26 on Console/dsp
>     -- <Console/dsp> Playing 'digits/7.gsm' (language 'en')
> *CLI> [Apr 21 03:33:25] WARNING[2857][C-00000007]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
>     -- <Console/dsp> Playing 'digits/0.gsm' (language 'en')
> hangup [Apr 21 03:33:26] WARNING[2857][C-00000007]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
> request     -- <Console/dsp> Playing 'digits/1.gsm' (language 'en')
> Usage: channel request hangup <channel>|<all>
>        Request that a channel be hung up. The hangup takes effect
>        the next time the driver reads or writes from the channel.
>        If 'all' is specified instead of a channel name, all channels
>        will see the hangup request.
> *CLI>     -- Started music on hold, class 'default', on channel 'Console/dsp'
> [Apr 21 03:33:27] WARNING[2857][C-00000007]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
> hangup request[Apr 21 03:33:28] WARNING[2857][C-00000007]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
>  Console/dsp [Apr 21 03:33:29] WARNING[2857][C-00000007]: chan_oss.c:495 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
> Requested Hangup on channel 'Console/dsp'
> *CLI>     -- Stopped music on hold on Console/dsp
>     -- Channel Console/dsp left 'holding_bridge' parking-bridge <bb295d4a-bc50-494a-bcdf-60b1ddd0ead0>
>   == Spawn extension (parkedcalls, 700, 1) exited non-zero on 'Console/dsp'
>   << Hangup on console >> 
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:649 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: ERROR:  el valor null para la columna «src» viola la restricción not null;
> Error while executing the query (109)
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:661 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:765 ast_odbc_sanity_check: Connection is down attempting to reconnect...
> [Apr 21 03:33:29] NOTICE[30476]: res_odbc.c:1531 odbc_obj_connect: Connecting asterisk
> [Apr 21 03:33:29] NOTICE[30476]: res_odbc.c:1563 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:649 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: HY000: ERROR:  el valor null para la columna «src» viola la restricción not null;
> Error while executing the query (109)
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:661 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
> [Apr 21 03:33:29] WARNING[30476]: res_odbc.c:765 ast_odbc_sanity_check: Connection is down attempting to reconnect...
> [Apr 21 03:33:29] NOTICE[30476]: res_odbc.c:1531 odbc_obj_connect: Connecting asterisk
> [Apr 21 03:33:29] NOTICE[30476]: res_odbc.c:1563 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]
> [Apr 21 03:33:29] WARNING[30476]: cdr_adaptive_odbc.c:752 odbc_log: cdr_adaptive_odbc: Insert failed on 'asterisk:cdr'.  CDR failed: INSERT INTO cdr (calldate,clid,dst,dcontext,channel,lastapp,lastdata,duration,billsec,disposition,amaflags,uniqueid) VALUES ({ ts '2015-04-21 03:33:24' },'"" <>','700','parkedcalls','Console/dsp','Park','default:701',5,5,'ANSWERED',3,'1429598004.6')
> {code}



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



More information about the asterisk-bugs mailing list