NetBSD Problem Report #49661

From www@NetBSD.org  Thu Feb 12 19:42:58 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 55AB8A6552
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 12 Feb 2015 19:42:58 +0000 (UTC)
Message-Id: <20150212194257.1DCE1A65C5@mollari.NetBSD.org>
Date: Thu, 12 Feb 2015 19:42:57 +0000 (UTC)
From: mbowie@rocketspace.com
Reply-To: mbowie@rocketspace.com
To: gnats-bugs@NetBSD.org
Subject: comms/asterisk patch to add pgsql and snmp options
X-Send-Pr-Version: www-1.0

>Number:         49661
>Category:       pkg
>Synopsis:       comms/asterisk patch to add pgsql and snmp options
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jnemeth
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 12 19:45:00 +0000 2015
>Closed-Date:    Sun Aug 09 04:13:32 +0000 2015
>Last-Modified:  Sun Aug 09 04:13:32 +0000 2015
>Originator:     Mike Bowie
>Release:        NetBSD 6.1.5
>Organization:
RocketSpace, Inc.
>Environment:
NetBSD netbsd6-1-5-amd64.restricted.sfo5.rocketstre.am 6.1.5 NetBSD 6.1.5 (XEN3_DOMU+pf+carp) #0: Mon Oct 20 16:40:53 UTC 2014  root@netbsd6-1-5-amd64.restricted.sfo3.rocketstre.am:/usr/obj/sys/arch/amd64/compile/XEN3_DOMU+pf+carp amd64
>Description:
Adds support for including pgsql and snmp modules for Asterisk
>How-To-Repeat:
n/a
>Fix:
netbsd6-1-5-amd64$ diff -ru asterisk.orig asterisk
diff -ru asterisk.orig/Makefile asterisk/Makefile
--- asterisk.orig/Makefile      2015-02-10 14:36:03.000000000 +0000
+++ asterisk/Makefile   2015-02-12 14:05:56.000000000 +0000
@@ -4,6 +4,7 @@
 #       tarballs need to be checked

 DISTNAME=      asterisk-11.15.1
+PKGREVISION=   1
 DIST_SUBDIR=   ${PKGNAME_NOREV}
 DISTFILES=     ${DEFAULT_DISTFILES}
 EXTRACT_ONLY=  ${DISTNAME}.tar.gz
diff -ru asterisk.orig/PLIST asterisk/PLIST
--- asterisk.orig/PLIST 2014-10-15 01:04:21.000000000 +0000
+++ asterisk/PLIST      2015-02-12 14:16:19.000000000 +0000
@@ -222,6 +222,7 @@
 lib/asterisk/modules/cdr_custom.so
 lib/asterisk/modules/cdr_manager.so
 ${PLIST.unixodbc}lib/asterisk/modules/cdr_odbc.so
+${PLIST.pgsql}lib/asterisk/modules/cdr_pgsql.so
 lib/asterisk/modules/cdr_sqlite3_custom.so
 lib/asterisk/modules/cdr_syslog.so
 lib/asterisk/modules/cel_custom.so
@@ -350,6 +351,7 @@
 lib/asterisk/modules/res_rtp_multicast.so
 lib/asterisk/modules/res_security_log.so
 lib/asterisk/modules/res_smdi.so
+${PLIST.snmp}lib/asterisk/modules/res_snmp.so
 lib/asterisk/modules/res_speech.so
 lib/asterisk/modules/res_stun_monitor.so
 ${PLIST.kqueue}lib/asterisk/modules/res_timing_kqueue.so
diff -ru asterisk.orig/options.mk asterisk/options.mk
--- asterisk.orig/options.mk    2015-02-10 16:09:39.000000000 +0000
+++ asterisk/options.mk 2015-02-12 14:24:43.000000000 +0000
@@ -2,14 +2,14 @@

 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
 PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail ldap spandsp
-PKG_SUPPORTED_OPTIONS+=                jabber speex
+PKG_SUPPORTED_OPTIONS+=                jabber speex pgsql snmp
 PKG_OPTIONS_LEGACY_OPTS+=      gtk:x11
 PKG_SUGGESTED_OPTIONS=         ldap jabber speex

 .include "../../mk/bsd.options.mk"

 PLIST_VARS+=           zaptel x11 unixodbc webvmail ldap spandsp jabber
-PLIST_VARS+=           speex
+PLIST_VARS+=           speex pgsql snmp

 # Asterisk now uses DAHDI, not zaptel; not implemented yet...
 #.if !empty(PKG_OPTIONS:Mzaptel)
@@ -105,3 +105,19 @@
 CONFIGURE_ARGS+=       --without-speex
 CONFIGURE_ARGS+=       --without-speexdsp
 .endif
+
+.if !empty(PKG_OPTIONS:Mpgsql)
+.include "../../mk/pgsql.buildlink3.mk"
+CONFIGURE_ARGS+=       --with-postgres
+PLIST.pgsql=           yes
+.else
+CONFIGURE_ARGS+=       --without-postgres
+.endif
+
+.if !empty(PKG_OPTIONS:Msnmp)
+.include "../../net/net-snmp/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-snmp
+PLIST.snmp=            yes
+.else
+CONFIGURE_ARGS+=       --without-snmp
+.endif

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->jnemeth
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Thu, 12 Feb 2015 23:34:59 +0000
Responsible-Changed-Why:
Over to maintainer


From: jnemeth@NetBSD.org (John Nemeth)
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/49661 (comms/asterisk patch to add pgsql and snmp options)
Date: Thu, 19 Mar 2015 23:34:25 -0700

      I'm certainly willing to consider your request.  However, I'm
 wondering why you don't just use ODBC?  I'm using that to access
 MySQL (in a variety of ways), and I find it works quite well.  It
 would also be more flexible.  I am trying to avoid a proliferation
 of options.  But, if it is something you really need, I certainly
 am willing to do stuff to encourage greater use of Asterisk on
 NetBSD.

      BTW, is it working well for you?  I've been using comms/asterisk18
 in production, but that is getting long in the tooth, and it is
 time to move forward.

From: Mike Bowie <mbowie@rocketspace.com>
To: gnats-bugs@NetBSD.org, jnemeth@NetBSD.org, gnats-admin@netbsd.org, 
 pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/49661 (comms/asterisk patch to add pgsql and snmp options)
Date: Fri, 20 Mar 2015 15:27:16 -0700

 On 3/19/15 11:15 PM, John Nemeth wrote:
 > The following reply was made to PR pkg/49661; it has been noted by GNATS.
 >
 >        I'm certainly willing to consider your request.  However, I'm
 >   wondering why you don't just use ODBC?  I'm using that to access
 >   MySQL (in a variety of ways), and I find it works quite well.  It
 >   would also be more flexible.  I am trying to avoid a proliferation
 >   of options.  But, if it is something you really need, I certainly
 >   am willing to do stuff to encourage greater use of Asterisk on
 >   NetBSD.
 >
 >        BTW, is it working well for you?  I've been using comms/asterisk18
 >   in production, but that is getting long in the tooth, and it is
 >   time to move forward.
 >
 >

 Hi John,

 Thank you for the response, and thank you for your efforts on the package.

 Interesting that you see it as keeping options slim, while on our side 
 we treat it as a reduced dependency tree, and less points of 
 configuration. I'm interested to know what drives that angle, since I've 
 previously made a point of supporting many ./configure tunables via 
 options when I write our packages internally. I tend to see it as if the 
 overarching project supports it, it's not for the handy-wrapper to pick 
 and choose what the end user should or  should not do; short of platform 
 specific limitations or incompatibilities. (Or perhaps glaring 
 bad-practices.)

 I'm not suggesting one option being superior to the other, and certainly 
 default to your judgement as the maintainer.

 As luck should have it, it sounds like we're in much the same boat as 
 you seem to be. We have a pair of 1.8 systems which have been in 
 production for going on four years now, which we're carefully preparing 
 to transition over to the current version. We'll definitely be keeping 
 the 1.8 systems near-line for a while after the transition.

 Best,

 Mike.

From: "John Nemeth" <jnemeth@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49661 CVS commit: pkgsrc/comms/asterisk
Date: Sun, 9 Aug 2015 04:07:13 +0000

 Module Name:	pkgsrc
 Committed By:	jnemeth
 Date:		Sun Aug  9 04:07:13 UTC 2015

 Modified Files:
 	pkgsrc/comms/asterisk: Makefile PLIST distinfo options.mk
 	pkgsrc/comms/asterisk/patches: patch-Makefile
 	    patch-include_asterisk_utils.h patch-res_res__xmpp.c
 Added Files:
 	pkgsrc/comms/asterisk/patches: patch-res_Makefile

 Log Message:
 Update to Asterisk 11.19.0: this is mainly a bug fix release with
 minor features

 pkgsrc changes:
 - new version of core sounds
 - add options for SNMP and PostgreSQL from Mike Bowie in PR/49661
   and by popular demand
 - add back support for menuselect personalization as that's how I was
   doing menuselect non-interactively
   - XXX need to look at a better way of doing this
 - disable PJSIP for now as it doesn't work well on NetBSD from Mike Bowie

 Since I added an option for PostgreSQL I also looked at adding an
 option for directly using MySQL.  Turns out that all the MySQL
 modules are in the addons directory and are marked as being
 deprecated.  So I didn't bother.  While investigating this, I also
 noted that all the pgsql modules are marked as "extended" support.
 This basically means that it is supported by the community, but
 there is no one person listed as being responsible who would take
 the lead for maintaining them.  This basically means that they are
 unsupported / low priority.  See
 https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States .
 Also with the pgsql modules, there is no way to do a database query
 from the dialplan.  Thus it is recommended to use the unixodbc
 option as the modules are supported and offer the most functionality.

 -----

 The Asterisk Development Team has announced the release of Asterisk 11.19.0.

 The release of Asterisk 11.19.0 resolves several issues reported by the
 community and would have not been possible without your participation.
 Thank you!

 The following are the issues resolved in this release:

 Bugs fixed in this release:
 -----------------------------------
  * ASTERISK-25250 - chan_sip - Despite the channel being answered,
       caller on a call established via Local channel continues to hear
       ringback (Reported by Etienne Lessard)
  * ASTERISK-25247 - choppy audio when spying on a g722 channel,
       chan_sip or chan_pjsip (Reported by hristo)
  * ASTERISK-24853 - Documentation claims chan_sip outbound
       registrations support WS or WSS as valid transports (not true)
       (Reported by PSDK)
  * ASTERISK-25257 - [patch]channels/sig_pri.h -> sig_pri_span ->
       force_restart_unavailable_chans in wrong scope (Reported by
       Patric Marschall)
  * ASTERISK-25103 - Roundup - investigate Asterisk DTLS crashes
       (Reported by Rusty Newton)
  * ASTERISK-22805 - res_rtp_asterisk: Crash when calling
       BIO_ctrl_pending in dtls_srtp_check_pending when dialed by JSSIP
       (Reported by Dmitry Burilov)
  * ASTERISK-24550 - res_rtp_asterisk: Crash in
       ast_rtp_on_ice_complete during DTLS handshake (Reported by
       Osaulenko Alexander)
  * ASTERISK-24651 - [patch] Fix race condition in DTLS (Reported by
       Badalian Vyacheslav)
  * ASTERISK-24832 - [patch]DTLS-crashes within openssl  (Reported
       by Stefan Engström)
  * ASTERISK-25127 - DTLS crashes following "Unable to cancel
       schedule ID" in dtls_srtp_check_pending (Reported by Dade
       Brandon)
  * ASTERISK-25213 - [patch]Possibility of deadlock in chan_sip
       INVITE early Replace code (Reported by Walter Doekes)
  * ASTERISK-25220 - [patch]Closing of fd -1 in chan_mgcp.c
       (Reported by Walter Doekes)
  * ASTERISK-25219 - [patch]Source and destination overlap in memcpy
       in rtp_engine.c (Reported by Walter Doekes)
  * ASTERISK-25212 - [patch]Segfault when using DEBUG_FD_LEAKS
       (Reported by Walter Doekes)
  * ASTERISK-19277 - [patch]endlessly repeating error: "poll failed:
       Bad file descriptor" (Reported by Barry Chern)
  * ASTERISK-25202 - Hints extension state broken between 13.3.2 and
       13.4 (Reported by cervajs)
  * ASTERISK-25154 - [patch]fromtag may need to be updated after
       successful call dialog match (Reported by Damian Ivereigh)
  * ASTERISK-25139 - Malicious transfer sequence locks up Asterisk
       (Reported by Gregory Massel)
  * ASTERISK-25094 - PBX core: Investigate thread safety issues
       (Reported by Corey Farrell)
  * ASTERISK-22559 - gcc 4.6 and higher supports weakref attribute
       but asterisk doesn't detect it. (Reported by ibercom)
  * ASTERISK-24717 - ASAN: global-buffer-overflow codec_{ilbc | gsm
       | adpcm | ipc10} (Reported by Badalian Vyacheslav)
  * ASTERISK-25100 - asterisk coredump if host has an IPv6 address
       that end with ::80 (Reported by Mark Petersen)

 Improvements made in this release:
 -----------------------------------
  * ASTERISK-25040 - pbx: Improve performance of reloads by making
       hint destruction more performant (Reported by Matt Jordan)

 For a full list of changes in this release, please see the ChangeLog:

 http://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-11.19.0

 Thank you for your continued support of Asterisk!

 -----

 The Asterisk Development Team has announced the release of Asterisk 11.18.0.

 The release of Asterisk 11.18.0 resolves several issues reported by the
 community and would have not been possible without your participation.
 Thank you!

 The following are the issues resolved in this release:

 Bugs fixed in this release:
 -----------------------------------
  * ASTERISK-25112 - Logger: Configuration settings are not reset to
       default during reload. (Reported by Corey Farrell)
  * ASTERISK-24887 - [patch]tags in a=crypto lines do not accept 2
       or more digits (Reported by Makoto Dei)
  * ASTERISK-24944 - main/audiohook.c change prevents G722 call
       recording (Reported by Ronald Raikes)
  * ASTERISK-25083 - Message.c: Message channel becomes saturated
       with frames leading to spammy log messages (Reported by Jonathan
       Rose)
  * ASTERISK-25041 - [patch]Broken column type checking in
       res_config_mysql addon (Reported by Alexandre Fournier)
  * ASTERISK-21893 - Segfault after call hangup, in
       ast_channel_hangupcause_set, at channel_internal_api.c (Reported
       by Alexandr Gordeev)
  * ASTERISK-25074 - Regression: Recent clang-related change broke
       cross compiling of Asterisk (Reported by Sebastian Kemper)
  * ASTERISK-25042 - asterisk.conf options override command-line
       options. (Reported by Corey Farrell)
  * ASTERISK-24442 - Outgoing call files don't work properly when
       set in the future (Reported by tootai)
  * ASTERISK-25034 - chan_dahdi: Some telco switches occasionally
       ignore ISDN RESTART requests. (Reported by Richard Mudgett)
  * ASTERISK-25038 - Queue log "EXITWITHTIMEOUT" does not always
       contain waiting time (Reported by Etienne Lessard)
  * ASTERISK-22708 - res_odbc.conf negative_connection_cache option
       not respected, failover between DSNs doesn't work (Reported by
       JoshE)
  * ASTERISK-25028 - Build System: Unneeded defines in
       asterisk/buildopts.h (Reported by Corey Farrell)
  * ASTERISK-19608 - Asterisk-1.8.x  starts rejecting calls with
       cause code 44 after some time. (Reported by Denis Alberto
       Martinez)
  * ASTERISK-24976 - cdr_odbc not include new columns added on 1.8
       (Reported by Rodrigo Ramirez Norambuena)
  * ASTERISK-25022 - Memory leak setting up DTLS/SRTP calls
       (Reported by Steve Davies)
  * ASTERISK-22790 - check_modem_rate() may return incorrect rate
       for V.27 (Reported by not here)
  * ASTERISK-23231 - Since 405693 If we have res_fax.conf file set
       to minrate=2400, then res_fax refuse to load (Reported by David
       Brillert)
  * ASTERISK-24955 - res_fax: v.27ter support baud rate of 2400,
       which is disallowed in res_fax's check_modem_rate (Reported by
       Matt Jordan)
  * ASTERISK-24916 - Increasing memory usage when multiple reinvite
       during call (Reported by Christophe Osuna)
  * ASTERISK-19538 - Asterisk segfaults on sippeers realtime
       redundancy (Reported by Alex)
  * ASTERISK-24749 - ConfBridge: Wrong language on playing
       conf-hasjoin and conf-hasleft when played to bridge (Reported by
       Philippe Bolduc)
  * ASTERISK-24991 - Check for ao2_alloc failure in
       __ast_channel_internal_alloc (Reported by Corey Farrell)
  * ASTERISK-24895 - After hangup on the side of the ISDN network no
       HangupRequest event comes for the dahdi channel. (Reported by
       Andrew Zherdin)
  * ASTERISK-24774 - Segfault in ast_context_destroy with
       extensions.ael and extensions.conf (Reported by Corey Farrell)
  * ASTERISK-24975 - Enabling 'DEBUG_THREADLOCALS' Causes the Build
       to Fail (Reported by Ashley Sanders)
  * ASTERISK-24959 - [patch]CLI command cdr show pgsql status
       (Reported by Rodrigo Ramirez Norambuena)
  * ASTERISK-24954 - Git migration: Asterisk version numbers are
       incompatible with the Test Suite (Reported by Matt Jordan)
  * ASTERISK-21777 - Asterisk tries to transcode video instead of
       audio (Reported by Nick Ruggles)
  * ASTERISK-24380 - core: Native formats are set to h264 with
       certain audio/video codec configuration, resulting in path
       translation WARNINGs (Reported by Matt Jordan)
  * ASTERISK-22352 - [patch] IAX2 custom qualify timer is not taken
       into account (Reported by Frederic Van Espen)
  * ASTERISK-24894 - [patch] iax2_poke_noanswer expiration timer too
       short (Reported by Y Ateya)
  * ASTERISK-23319 - Segmentation fault in queue_exec at app_queue.c
       (Reported by Vadim)
  * ASTERISK-24847 - [security] [patch] tcptls: certificate CN NULL
       byte prefix bug (Reported by Matt Jordan)
  * ASTERISK-21211 - chan_iax2 - unprotected access of
       iaxs[peer->callno] potentially results in segfault (Reported by
       Jaco Kroon)
  * ASTERISK-18032 - [patch] - IPv6 and IPv4 NAT not working
       (Reported by Christoph Timm)
  * ASTERISK-24942 - Voicemail API: message is deleted when
       destination mailbox is at maxmsg (Reported by Scott Griepentrog)
  * ASTERISK-24932 - Asterisk 13.x does not build with GCC 5.0
       (Reported by Jeffrey C. Ollie)
  * ASTERISK-21854 - Long Asterisk-version strings display
       improperly in the 'Connected to ...' line upon remote console
       connection (Reported by klaus3000)
  * ASTERISK-24155 - [patch]Non-portable and non-reliable recursion
       detection in ast_malloc (Reported by Timo Teräs)
  * ASTERISK-24142 - CCSS: crash during shutdown due to device
       lookup in destroyed container (Reported by David Brillert)
  * ASTERISK-24683 - Crash in PBX ast_hashtab_lookup_internal during
       core restart now (Reported by Peter Katzmann)
  * ASTERISK-24805 - [patch] - ASAN: Race condition
       (heap-use-after-free) on asterisk closing (Reported by Badalian
       Vyacheslav)
  * ASTERISK-24881 - ast_register_atexit should only be used when
       absolutely needed (Reported by Corey Farrell)
  * ASTERISK-24864 - app_confbridge: file playback blocks dtmf
       (Reported by Kevin Harwell)
  * ASTERISK-14233 - [patch] Buddies are always auto-registered when
       processing the roster (Reported by Simon Arlott)
  * ASTERISK-24780 - [patch] - Buddies are always auto-registered
       when processing the roster (Reported by Simon Arlott)

 Improvements made in this release:
 -----------------------------------
  * ASTERISK-24744 - Swedish Core Voice prompts (Reported by Tove
       Hjelm)
  * ASTERISK-25043 - [patch] Avoiding ERR_remove_state in OpenSSL
       (Reported by Alexander Traud)
  * ASTERISK-24917 - [patch] clang compilation warnings (Reported by
       Diederik de Groot)
  * ASTERISK-25040 - pbx: Improve performance of reloads by making
       hint destruction more performant (Reported by Matt Jordan)
  * ASTERISK-24965 - cel_pgsql - log_error string references CDR
       instead of CEL (Reported by Rodrigo Ramirez Norambuena)

 For a full list of changes in this release, please see the ChangeLog:

 http://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-11.18.0

 Thank you for your continued support of Asterisk!


 To generate a diff of this commit:
 cvs rdiff -u -r1.124 -r1.125 pkgsrc/comms/asterisk/Makefile
 cvs rdiff -u -r1.9 -r1.10 pkgsrc/comms/asterisk/PLIST
 cvs rdiff -u -r1.73 -r1.74 pkgsrc/comms/asterisk/distinfo
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/comms/asterisk/options.mk
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/comms/asterisk/patches/patch-Makefile \
     pkgsrc/comms/asterisk/patches/patch-include_asterisk_utils.h \
     pkgsrc/comms/asterisk/patches/patch-res_res__xmpp.c
 cvs rdiff -u -r0 -r1.1 pkgsrc/comms/asterisk/patches/patch-res_Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jnemeth@NetBSD.org
State-Changed-When: Sun, 09 Aug 2015 04:13:32 +0000
State-Changed-Why:
Modified version of patches applied.  Thanks for the PR!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.