[asterisk-bugs] [Asterisk 0018634]: PGSQL db update issue

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jan 21 08:38:49 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18634 
====================================================================== 
Reported By:                hydr0gen
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18634
Category:                   CDR/cdr_pgsql
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.2.16 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-01-17 09:44 CST
Last Modified:              2011-01-21 08:38 CST
====================================================================== 
Summary:                    PGSQL db update issue
Description: 
I can't reproduce error. It happend sometimes. Asterisk is trying to insert
wrong SQL code.

from Postgresql debug:
Jan 17 15:27:58 TuX postgres[26769]: [4-1] ERROR:  syntax error at or near
"VALUES" at character 329
Jan 17 15:27:58 TuX postgres[26769]: [4-2] STATEMENT:   VALUES
("calldate"'2011-01-17 15:30:03',"clid",'"759"
<759>',"src",'759',"dst",'1007',"dcontext",'local',"channel",'SIP/759-00000371',"dstchannel",'SIP/1007-00000372',"lastapp",'Dial',"lastdata",'SIP/1007,20,rtT',"duration",82,"billsec",75,"disposition",'ANSWERED',"amaflags",3,"accountcode",'759',"uniqueid",'1295278203.882')
VALUES ("calldate"'2011-01-17 15:30:03',"clid",'"759"
<759>',"src",'759',"dst",'1007',"dcontext",'local',"channel",'SIP/759-00000371',"dstchannel",'SIP/1007-00000372',"lastapp",'Dial',"lastdata",'SIP/1007,20,rtT',"duration",82,"billsec",75,"disposition",'ANSWERED',"amaflags",3,"accountcode",'759',"uniqueid",'1295278203.882')

as you can see asterisk is trying to insert wrong code, the values, witch
goes past "VALUES" consist values name.

The thing is - when it's happen asterisk core dumps. I havn't seen this
issue before i start using:

sip.conf:
limitonpeer=yes
notifyringing=yes
rtcachefriends=yes
rtupdate=yes

I'm using REALTIME SIP/Queues/MOH/VM

Today i updated from 1.6.2.15 (freebsd) to 1.6.2.16. Nothing changed.
Asterisk still sometimes core dumps.
====================================================================== 

---------------------------------------------------------------------- 
 (0130861) hydr0gen (reporter) - 2011-01-21 08:38
 https://issues.asterisk.org/view.php?id=18634#c130861 
---------------------------------------------------------------------- 
db table

CREATE TABLE "public"."system_sip" (
  "id" SERIAL, 
  "name" VARCHAR(80) DEFAULT ''::character varying NOT NULL, 
  "accountcode" VARCHAR(20), 
  "amaflags" VARCHAR(7), 
  "callgroup" VARCHAR(10), 
  "callerid" VARCHAR(80), 
  "canreinvite" VARCHAR(3) DEFAULT 'no'::character varying, 
  "context" VARCHAR(80), 
  "defaultip" VARCHAR(15), 
  "dtmfmode" VARCHAR(7), 
  "fromuser" VARCHAR(80), 
  "fromdomain" VARCHAR(80), 
  "host" VARCHAR(31) DEFAULT 'dynamic'::character varying NOT NULL, 
  "insecure" VARCHAR(4), 
  "language" VARCHAR(2), 
  "mailbox" VARCHAR(50), 
  "md5secret" VARCHAR(80), 
  "nat" VARCHAR(5) DEFAULT 'no'::character varying NOT NULL, 
  "permit" VARCHAR(95), 
  "deny" VARCHAR(95), 
  "mask" VARCHAR(95), 
  "pickupgroup" VARCHAR(10), 
  "port" VARCHAR(12) DEFAULT ''::character varying NOT NULL, 
  "qualify_old" VARCHAR(3), 
  "restrictcid" VARCHAR(1), 
  "rtptimeout" VARCHAR(3), 
  "rtpholdtimeout" VARCHAR(3), 
  "secret" VARCHAR(80), 
  "type" VARCHAR DEFAULT 'friend'::character varying NOT NULL, 
  "defaultuser" VARCHAR(100) DEFAULT ''::character varying NOT NULL, 
  "disallow" VARCHAR(100), 
  "allow" VARCHAR(100) DEFAULT 'ulaw;alaw'::character varying, 
  "musiconhold" VARCHAR(100), 
  "regseconds" BIGINT DEFAULT 0::bigint NOT NULL, 
  "ipaddr" VARCHAR(15) DEFAULT ''::character varying NOT NULL, 
  "regexten" VARCHAR(80) DEFAULT ''::character varying NOT NULL, 
  "cancallforward" VARCHAR(3) DEFAULT 'yes'::character varying, 
  "lastms" VARCHAR(80) DEFAULT (-1) NOT NULL, 
  "rtcachefriends" VARCHAR(3) DEFAULT 'yes'::character varying NOT NULL, 
  "rtupdate" VARCHAR(3) DEFAULT 'yes'::character varying NOT NULL, 
  "notifyringing" VARCHAR(3) DEFAULT 'yes'::character varying NOT NULL, 
  "useragent" TEXT, 
  "account_id" INTEGER, 
  "fullcontact" VARCHAR(255), 
  "regserver" VARCHAR(100), 
  "busy-level" INTEGER DEFAULT 1 NOT NULL, 
  "call-limit" SMALLINT DEFAULT 6 NOT NULL, 
  "username" VARCHAR(100), 
  "directmedia" VARCHAR(3) DEFAULT 'yes'::character varying NOT NULL
) WITHOUT OIDS; 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-21 08:38 hydr0gen       Note Added: 0130861                          
======================================================================




More information about the asterisk-bugs mailing list