Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2019 14:27:31 +0000 (UTC)
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r514158 - in head/net/asterisk13: . files
Message-ID:  <201910091427.x99ERVfg095970@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: madpilot
Date: Wed Oct  9 14:27:30 2019
New Revision: 514158
URL: https://svnweb.freebsd.org/changeset/ports/514158

Log:
  Fix CDR with PostgreSQL 12
  
  PR:		241116
  Submitted by:	cmt
  MFH:		2019Q4

Added:
  head/net/asterisk13/files/patch-cdr_cdr__pgsql.c   (contents, props changed)
Modified:
  head/net/asterisk13/Makefile

Modified: head/net/asterisk13/Makefile
==============================================================================
--- head/net/asterisk13/Makefile	Wed Oct  9 14:14:17 2019	(r514157)
+++ head/net/asterisk13/Makefile	Wed Oct  9 14:27:30 2019	(r514158)
@@ -2,6 +2,7 @@
 
 PORTNAME=	asterisk
 PORTVERSION=	13.28.1
+PORTRREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	https://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729
 MASTER_SITE_SUBDIR=	asterisk/ \

Added: head/net/asterisk13/files/patch-cdr_cdr__pgsql.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/asterisk13/files/patch-cdr_cdr__pgsql.c	Wed Oct  9 14:27:30 2019	(r514158)
@@ -0,0 +1,11 @@
+--- cdr/cdr_pgsql.c.orig	2019-10-06 21:08:37 UTC
++++ cdr/cdr_pgsql.c
+@@ -707,7 +707,7 @@ static int config_module(int reload)
+ 			schemaname = ast_alloca(strlen(tmp_schemaname) * 2 + 1);
+ 			PQescapeStringConn(conn, schemaname, tmp_schemaname, strlen(tmp_schemaname), NULL);
+ 
+-			snprintf(sqlcmd, sizeof(sqlcmd), "SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum",
++			snprintf(sqlcmd, sizeof(sqlcmd), "SELECT a.attname, t.typname, a.attlen, a.attnotnull, pg_catalog.pg_get_expr(d.adbin, d.adrelid) adsrc, a.atttypmod FROM (((pg_catalog.pg_class c INNER JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace AND c.relname = '%s' AND n.nspname = %s%s%s) INNER JOIN pg_catalog.pg_attribute a ON (NOT a.attisdropped) AND a.attnum > 0 AND a.attrelid = c.oid) INNER JOIN pg_catalog.pg_type t ON t.oid = a.atttypid) LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum ORDER BY n.nspname, c.relname, attnum",
+ 				tablename,
+ 				ast_strlen_zero(schemaname) ? "" : "'", ast_strlen_zero(schemaname) ? "current_schema()" : schemaname, ast_strlen_zero(schemaname) ? "" : "'");
+ 		} else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910091427.x99ERVfg095970>