Skip to content
Commits on Source (2)
[gerrit]
defaultbranch=13
defaultbranch=16
#
# Intentional padding to ensure it is possible to point a commit
# to an alternative gerrit server/repository without breaking
......
13.23.1
\ No newline at end of file
16.1.1
\ No newline at end of file
This diff is collapsed.
......@@ -154,6 +154,7 @@
(dialog-info), QUEUE_EXISTS function, device state provider
architecture, multiparking (together with mvanbaak), meetme and
parking device states, MiniVM - the small voicemail system,
RTP improvements, RTCP enhancements, DTMF timing fixes,
many documentation updates/corrections, and many bug fixes.
oej(AT)edvina.net, http://edvina.net
......
This diff is collapsed.
......@@ -76,9 +76,6 @@ export AST_DEVMODE_STRICT # Enables shadow warnings (-Wshadow)
export _SOLINK # linker flags for all shared objects
export SOLINK # linker flags for loadable modules
export DYLINK # linker flags for shared libraries
export STATIC_BUILD # Additional cflags, set to -static
# for static builds. Probably
# should go directly to ASTLDFLAGS
#--- paths to various commands
# The makeopts include below tries to set these if they're found during
......@@ -167,20 +164,19 @@ LINKER_SYMBOL_PREFIX=
# Default install directory for DAHDI hooks.
DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d
# This Makefile previously contained a note about the ability to use .asterisk.makeopts
# from your home directory or /etc/asterisk.makeopts to set defaults for menuselect.
# These files have never worked in this branch of Asterisk. The work around is to
# manually copy the file containing defaults before running 'make menuselect':
#
# cp ${HOME}/.asterisk.makeopts menuselect.makeopts
# or
# cp /etc/asterisk.makeopts menuselect.makeopts
#
# As an alternative, menuselect/menuselect can be used by a script to enable or disable
# individual options or entire categories. To use this feature you must first
# compile menuselect using 'make menuselect.makeopts'. For information about parameters
# supported run:
# menuselect/menuselect --help
# If the file .asterisk.makeopts is present in your home directory, you can
# include all of your favorite menuselect options so that every time you download
# a new version of Asterisk, you don't have to run menuselect to set them.
# The file /etc/asterisk.makeopts will also be included but can be overridden
# by the file in your home directory.
ifeq ($(wildcard menuselect.makeopts),)
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
else
USER_MAKEOPTS=
GLOBAL_MAKEOPTS=
endif
MOD_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
......@@ -358,10 +354,10 @@ makeopts: configure
@echo "****"
@exit 1
menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps
ifeq ($(filter %menuselect,$(MAKECMDGOALS)),)
menuselect/menuselect --check-deps $@
menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
ifeq ($(filter %.menuselect,$(MAKECMDGOALS)),)
menuselect/menuselect --check-deps $@
menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
endif
$(MOD_SUBDIRS_MENUSELECT_TREE):
......@@ -950,7 +946,7 @@ config:
if [ -z "$(DESTDIR)" ] ; then \
/sbin/chkconfig --add asterisk ; \
fi ; \
elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release && echo $$ID)" ] ; then \
elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
if [ ! -f /etc/sysconfig/asterisk ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
......@@ -962,7 +958,7 @@ config:
./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
elif [ -f /etc/slackware-version ]; then \
./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release && echo $$ID)" ] ; then \
elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
......
......@@ -18,10 +18,6 @@
# Also note that we can only set one variable per rule, so we have to
# repeat the left hand side to set multiple variables.
ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
STATIC_BUILD=-static
endif
include $(ASTTOPDIR)/Makefile.rules
# If MODULE_PREFIX is defined, use it to run the standard functions to set
......@@ -52,7 +48,29 @@ LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
# is used to collect the required flags for a module... which can
# then be used any place they are required.
MOD_ASTCFLAGS=-DAST_MODULE=\"$(1)\" $(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$(value $(dep)_INCLUDE))
MOD_ASTCFLAGS=\
-DAST_MODULE=\"$(1)\" \
-DAST_MODULE_SELF_SYM=__internal_$(1)_self \
$(MENUSELECT_OPTS_$(1):%=-D%) \
$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$(value $(dep)_INCLUDE))
define MOD_ADD_SOURCE
$(1).so: $$(subst $(3),$(5),$(2))
$$(subst $(3),$(5),$(2)): _ASTCFLAGS+=$$(call MOD_ASTCFLAGS,$(1))
.$(1).moduleinfo: MODULEINFO_EXTRA_OUTPUT=" $$(addprefix $$(SUBDIR)/,$$(subst $(3),$(5),$(2)) $$(subst $(3),$(4),$(2)))"
# The use of wildcard ensures that 'make menuselect' will not fail for modules that
# require additional source downloads.
.$(1).moduleinfo: $(wildcard $(2))
clean:: clean-$(1)$(3)
clean-$(1)$(3):
rm -f $$(subst $(3),$(4),$(2)) $$(subst $(3),$(5),$(2)) $$(subst $(3),$(6),$(2)) $$(subst $(3),$(7),$(2))
endef
MOD_ADD_C=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.c,.i,.o,.gcda,.gcno))
MOD_ADD_CC=$(eval $(call MOD_ADD_SOURCE,$(1),$(2),.cc,.ii,.oo,.gcda,.gcno))
$(addsuffix .oo,$(CC_MODS)) $(addsuffix .o,$(C_MODS)): \
_ASTCFLAGS+=$(call MOD_ASTCFLAGS,$*)
......@@ -110,12 +128,12 @@ dist-clean::
rm -f *.exports
.%.moduleinfo: %.c
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.i $(SUBDIR)/$*.so$(MODULEINFO_EXTRA_OUTPUT)\">" > $@
$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $^ >> $@
echo "</member>" >> $@
.%.moduleinfo: %.cc
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.oo $(SUBDIR)/$*.so\">" > $@
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.oo $(SUBDIR)/$*.ii $(SUBDIR)/$*.so$(MODULEINFO_EXTRA_OUTPUT)\">" > $@
$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $^ >> $@
echo "</member>" >> $@
......
......@@ -20,6 +20,9 @@
# Helpful functions
# call with $(call function,...)
tolower = $(shell echo $(1) | tr '[:upper:]' '[:lower:]')
# Takes a list of MENUSELECT_CFLAG Id and returns CFLAGS to declare
# the ones which are enabled.
get_menuselect_cflags=$(patsubst %,-D%,$(filter $1,$(MENUSELECT_CFLAGS)))
.PHONY: dist-clean
......@@ -176,17 +179,17 @@ ifeq ($(GNU_LD),1)
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
endif
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
%.so: %.oo
ifeq ($(GNU_LD),1)
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
endif
$(ECHO_PREFIX) echo " [LDXX] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
$(CMD_PREFIX) $(CXX) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
%: %.o
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $^ $(CXX_LIBS) $(ASTLDFLAGS)
$(CMD_PREFIX) $(CXX) -o $@ $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $^ $(CXX_LIBS) $(ASTLDFLAGS)
dist-clean:: clean
# The Asterisk(R) Open Source PBX
```text
By Mark Spencer <markster@digium.com> and the Asterisk.org developer community.
Copyright (C) 2001-2009 Digium, Inc. and other copyright holders.
Copyright (C) 2001-2016 Digium, Inc. and other copyright holders.
```
## SECURITY
......@@ -69,7 +69,7 @@ list of new features in this version of Asterisk, see the [CHANGES] file.
Ensure that your system contains a compatible compiler and development
libraries. Asterisk requires either the GNU Compiler Collection (GCC) version
3.0 or higher, or a compiler that supports the C99 specification and some of
4.1 or higher, or a compiler that supports the C99 specification and some of
the gcc language extensions. In addition, your system needs to have the C
library headers available, and the headers and libraries for ncurses.
......
===========================================================
===
=== Information for upgrading between Asterisk versions
===
=== These files document all the changes that MUST be taken
=== into account when upgrading between the Asterisk
=== versions listed below. These changes may require that
=== you modify your configuration files, dialplan or (in
=== some cases) source code if you have your own Asterisk
=== modules or patches. These files also include advance
=== notice of any functionality that has been marked as
=== 'deprecated' and may be removed in a future release,
=== along with the suggested replacement functionality.
===
=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
=== UPGRADE-1.4.txt -- Upgrade info for 1.2 to 1.4
=== UPGRADE-1.6.txt -- Upgrade info for 1.4 to 1.6
=== UPGRADE-1.8.txt -- Upgrade info for 1.6 to 1.8
=== UPGRADE-10.txt -- Upgrade info for 1.8 to 10
=== UPGRADE-11.txt -- Upgrade info for 10 to 11
=== UPGRADE-12.txt -- Upgrade info for 11 to 12
===========================================================
General Asterisk Changes:
- The asterisk command line -I option and the asterisk.conf internal_timing
option are removed and always enabled if any timing module is loaded.
- The per console verbose level feature as previously implemented caused a
large performance penalty. The fix required some minor incompatibilities
if the new rasterisk is used to connect to an earlier version. If the new
rasterisk connects to an older Asterisk version then the root console verbose
level is always affected by the "core set verbose" command of the remote
console even though it may appear to only affect the current console. If
an older version of rasterisk connects to the new version then the
"core set verbose" command will have no effect.
- The asterisk compatibility options in asterisk.conf have been removed.
These options enabled certain backwards compatibility features for
pbx_realtime, res_agi, and app_set that made their behaviour similar to
Asterisk 1.4. Users who used these backwards compatibility settings should
update their dialplans to use ',' instead of '|' as a delimiter, and should
use the Set dialplan application instead of the MSet dialplan application.
Build System:
- Sample config files have been moved from configs/ to a subfolder of that
directory, 'samples'.
- The menuselect utility has been pulled into the Asterisk repository. As a
result, the libxml2 development library is now a required dependency for
Asterisk.
- Added a new Compiler Flag, REF_DEBUG. When enabled, reference counted
objects will emit additional debug information to the refs log file located
in the standard Asterisk log file directory. This log file is useful in
tracking down object leaks and other reference counting issues. Prior to
this version, this option was only available by modifying the source code
directly. This change also includes a new script, refcounter.py, in the
contrib folder that will process the refs log file.
Applications:
ConfBridge:
- The sound_place_into_conference sound used in Confbridge is now deprecated
and is no longer functional since it has been broken since its inception
and the fix involved using a different method to achieve the same goal. The
new method to achieve this functionality is by using sound_begin to play
a sound to the conference when waitmarked users are moved into the conference.
- Added 'Admin' header to ConfbridgeJoin, ConfbridgeLeave, ConfbridgeMute,
ConfbridgeUnmute, and ConfbridgeTalking AMI events.
ControlPlayback:
- The ControlPlayback and 'control stream file' AGI command will no longer
implicitly answer the channel. If you do not answer the channel prior to
using either this application or AGI command, you must send Progress
first.
Queue:
- Queue rules provided in queuerules.conf can no longer be named "general".
SetMusicOnHold:
- The SetMusicOnHold dialplan application was deprecated and has been removed.
Users of the application should use the CHANNEL function's musicclass
setting instead.
WaitMusicOnHold:
- The WaitMusicOnHold dialplan application was deprecated and has been
removed. Users of the application should use MusicOnHold with a duration
parameter instead.
CDR Backends:
- The cdr_sqlite module was deprecated and has been removed. Users of this
module should use the cdr_sqlite3_custom module instead.
Channel Drivers:
chan_dahdi:
- SS7 support now requires libss7 v2.0 or later.
- Added the inband_on_setup_ack compatibility option to chan_dahdi.conf to
deal with switches that don't send an inband progress indication in the
SETUP ACKNOWLEDGE message.
Default is now no.
chan_gtalk
- This module was deprecated and has been removed. Users of chan_gtalk
should use chan_motif.
chan_h323
- This module was deprecated and has been removed. Users of chan_h323
should use chan_ooh323.
chan_jingle
- This module was deprecated and has been removed. Users of chan_jingle
should use chan_motif.
chan_pjsip:
- Added a 'force_avp' option to chan_pjsip which will force the usage of
'RTP/AVP', 'RTP/AVPF', 'RTP/SAVP', or 'RTP/SAVPF' as the media transport type
in SDP offers depending on settings, even when DTLS is used for media
encryption.
- Added a 'media_use_received_transport' option to chan_pjsip which will
cause the SDP answer to use the media transport as received in the SDP
offer.
chan_sip:
- Made set SIPREFERREDBYHDR as inheritable for better chan_pjsip
interoperability.
- The SIPPEER dialplan function no longer supports using a colon as a
delimiter for parameters. The parameters for the function should be
delimited using a comma.
- The SIPCHANINFO dialplan function was deprecated and has been removed. Users
of the function should use the CHANNEL function instead.
- Added a 'force_avp' option for chan_sip. When enabled this option will
cause the media transport in the offer or answer SDP to be 'RTP/AVP',
'RTP/AVPF', 'RTP/SAVP', or 'RTP/SAVPF' even if a DTLS stream has been
configured. This option can be set to improve interoperability with WebRTC
clients that don't use the RFC defined transport for DTLS.
- The 'dtlsverify' option in chan_sip now has additional values besides
'yes' and 'no'. If 'yes' is specified both the certificate and fingerprint
will be verified. If 'no' is specified then neither the certificate or
fingerprint is verified. If 'certificate' is specified then only the
certificate is verified. If 'fingerprint' is specified then only the
fingerprint is verified.
- A 'dtlsfingerprint' option has been added to chan_sip which allows the
hash to be specified for the DTLS fingerprint placed in SDP. Supported
values are 'sha-1' and 'sha-256' with 'sha-256' being the default.
- The 'progressinband=never' option is now more zealous in the persecution of
progress messages coming from Asterisk. Channels bridged with a SIP channel
that has 'progressinband=never' set will not be able to forward their
progress indications through to the SIP device. chan_sip will now turn such
progress indications into a 180 Ringing (if a 180 has not yet been
transmitted) if 'progressinband=never'.
- The codec preference order in an SDP during an offer is slightly different
than previous releases. Prior to Asterisk 13, the preference order of
codecs used to be:
(1) Our preferred codec
(2) Our configured codecs
(3) Any non-audio joint codecs
One of the ways the new media format architecture in Asterisk 13 improves
performance is by reference counting formats, such that they can be reused
in many places without additional allocation. To not require a large
amount of locking, an instance of a format is immutable by convention.
This works well except for formats with attributes. Since a media format
with an attribute is a different object than the same format without an
attribute, we have to carry over the formats with attributes from an
inbound offer so that the correct attributes are offered in an outgoing
INVITE request. This requires some subtle tweaks to the preference order
to ensure that the media format with attributes is offered to a remote
peer, as opposed to the same media format (but without attributes) that
may be stored in the peer object.
All of this means that our offer offer list will now be:
(1) Our preferred codec
(2) Any joint codecs offered by the inbound offer
(3) All other codecs that are not the preferred codec and not a joint
codec offered by the inbound offer
chan_unistim:
- The unistim.conf 'dateformat' has changed meaning of options values to conform
values used inside Unistim protocol
- Added 'dtmf_duration' option with changing default operation to disable
receivied dtmf playback on unistim phone
Core:
Account Codes:
- accountcode behavior changed somewhat to add functional peeraccount
support. The main change is that local channels now cross accountcode
and peeraccount across the special bridge between the ;1 and ;2 channels
just like channels between normal bridges. See the CHANGES file for
more information.
ARI:
- The ARI version has been changed to 1.5.0. This is to reflect backwards
compatible changes made since 12.0.0 was released.
- Added a new ARI resource 'mailboxes' which allows the creation and
modification of mailboxes managed by external MWI. Modules res_mwi_external
and res_stasis_mailbox must be enabled to use this resource.
- Added new events for externally initiated transfers. The event
BridgeBlindTransfer is now raised when a channel initiates a blind transfer
of a bridge in the ARI controlled application to the dialplan; the
BridgeAttendedTransfer event is raised when a channel initiates an
attended transfer of a bridge in the ARI controlled application to the
dialplan.
- Channel variables may now be specified as a body parameter to the
POST /channels operation. The 'variables' key in the JSON is interpreted
as a sequence of key/value pairs that will be added to the created channel
as channel variables. Other parameters in the JSON body are treated as
query parameters of the same name.
- A bug fix in bridge creation has caused a behavioural change in how
subscriptions are created for bridges. A bridge created through ARI, does
not, by itself, have a subscription created for any particular Stasis
application. When a channel in a Stasis application joins a bridge, an
implicit event subscription is created for that bridge as well. Previously,
when a channel left such a bridge, the subscription was leaked; this allowed
for later bridge events to continue to be pushed to the subscribed
applications. That leak has been fixed; as a result, bridge events that were
delivered after a channel left the bridge are no longer delivered. An
application must subscribe to a bridge through the applications resource if
it wishes to receive all events related to a bridge.
AMI:
- The AMI version has been changed to 2.5.0. This is to reflect backwards
compatible changes made since 12.0.0 was released.
- The DialStatus field in the DialEnd event can now have additional values.
This includes ABORT, CONTINUE, and GOTO.
- The res_mwi_external_ami module can, if loaded, provide additional AMI
actions and events that convey MWI state within Asterisk. This includes
the MWIGet, MWIUpdate, and MWIDelete actions, as well as the MWIGet and
MWIGetComplete events that occur in response to an MWIGet action.
- AMI now contains a new class authorization, 'security'. This is used with
the following new events: FailedACL, InvalidAccountID, SessionLimit,
MemoryLimit, LoadAverageLimit, RequestNotAllowed, AuthMethodNotAllowed,
RequestBadFormat, SuccessfulAuth, UnexpectedAddress, ChallengeResponseFailed,
InvalidPassword, ChallengeSent, and InvalidTransport.
- Bridge related events now have two additional fields: BridgeName and
BridgeCreator. BridgeName is a descriptive name for the bridge;
BridgeCreator is the name of the entity that created the bridge. This
affects the following events: ConfbridgeStart, ConfbridgeEnd,
ConfbridgeJoin, ConfbridgeLeave, ConfbridgeRecord, ConfbridgeStopRecord,
ConfbridgeMute, ConfbridgeUnmute, ConfbridgeTalking, BlindTransfer,
AttendedTransfer, BridgeCreate, BridgeDestroy, BridgeEnter, BridgeLeave
- MixMonitor AMI actions now require users to have authorization classes.
* MixMonitor - system
* MixMonitorMute - call or system
* StopMixMonitor - call or system
- Removed the undocumented manager.conf block-sockets option. It interferes with
TCP/TLS inactivity timeouts.
- The response to the PresenceState AMI action has historically contained two
Message keys. The first of these is used as an informative message regarding
the success/failure of the action; the second contains a Presence state
specific message. Having two keys with the same unique name in an AMI
message is cumbersome for some client; hence, the Presence specific Message
has been deprecated. The message will now contain a PresenceMessage key
for the presence specific information; the Message key containing presence
information will be removed in the next major version of AMI.
- The manager.conf 'eventfilter' now takes an "extended" regular expression
instead of a "basic" one.
CDRs:
- The "endbeforehexten" setting now defaults to "yes", instead of "no".
When set to "no", yhis setting will cause a new CDR to be generated when a
channel enters into hangup logic (either the 'h' extension or a hangup
handler subroutine). In general, this is not the preferred default: this
causes extra CDRs to be generated for a channel in many common dialplans.
CLI commands:
- "core show settings" now lists the current console verbosity in addition
to the root console verbosity.
- "core set verbose" has not been able to support the by module verbose
logging levels since verbose logging levels were made per console. That
syntax is now removed and a silence option added in its place.
Logging:
- The 'verbose' setting in logger.conf still takes an optional argument,
specifying the verbosity level for each logging destination. However,
the default is now to once again follow the current root console level.
As a result, using the AMI Command action with "core set verbose" could
again set the root console verbose level and affect the verbose level
logged.
HTTP:
- Added http.conf session_inactivity timer option to close HTTP connections
that aren't doing anything.
- Added support for persistent HTTP connections. To enable persistent
HTTP connections configure the keep alive time between HTTP requests. The
keep alive time between HTTP requests is configured in http.conf with the
session_keep_alive parameter.
Realtime Configuration:
- WARNING: The database migration script that adds the 'extensions' table for
realtime had to be modified due to an error when installing for MySQL. The
'extensions' table's 'id' column was changed to be a primary key. This could
potentially cause a migration problem. If so, it may be necessary to
manually alter the affected table/column to bring it back in line with the
migration scripts.
- New columns have been added to realtime tables for 'support_path' on
ps_registrations and ps_aors and for 'path' on ps_contacts for the new
SIP Path support in chan_pjsip.
- The following new tables have been added for pjsip realtime: 'ps_systems',
'ps_globals', 'ps_tranports', 'ps_registrations'.
- The following columns were added to the 'ps_aors' realtime table:
'maximum_expiration', 'outbound_proxy', and 'support_path'.
- The following columns were added to the 'ps_contacts' realtime table:
'outbound_proxy', 'user_agent', and 'path'.
- New columns have been added to the ps_endpoints realtime table for the
'media_address', 'redirect_method' and 'set_var' options. Also the
'mwi_fromuser' column was renamed to 'mwi_from_user'. A new column
'message_context' was added to let users configure how MESSAGE requests are
routed to the dialplan.
- A new column was added to the 'ps_globals' realtime table for the 'debug'
option.
- PJSIP endpoint columns 'tos_audio' and 'tos_video' have been changed from
yes/no enumerators to string values. 'cos_audio' and 'cos_video' have been
changed from yes/no enumerators to integer values. PJSIP transport column
'tos' has been changed from a yes/no enumerator to a string value. 'cos' has
been changed from a yes/no enumerator to an integer value.
- The 'queues' and 'queue_members' realtime tables have been added to the
config Alembic scripts.
- A new set of Alembic scripts has been added for CDR tables. This will create
a 'cdr' table with the default schema that Asterisk expects.
- A new upgrade script has been added that adds a 'queue_rules' table for
app_queue. Users of app_queue can store queue rules in a database. It is
important to note that app_queue only looks for this table on module load or
module reload; for more information, see the CHANGES file.
Resources:
res_odbc:
- The compatibility setting, allow_empty_string_in_nontext, has been removed.
Empty column values will be stored as empty strings during realtime updates.
res_jabber:
- This module was deprecated and has been removed. Users of this module should
use res_xmpp instead.
res_http_websocket:
- Added a compatibility option to ari.conf, sip.conf, and pjsip.conf
'websocket_write_timeout'. When a websocket connection exists where Asterisk
writes a substantial amount of data to the connected client, and the connected
client is slow to process the received data, the socket may be disconnected.
In such cases, it may be necessary to adjust this value.
Default is 100 ms.
Scripts:
safe_asterisk:
- The safe_asterisk script was previously not installed on top of an existing
version. This caused bug-fixes in that script not to be deployed. If your
safe_asterisk script is customized, be sure to keep your changes. Custom
values for variables should be created in *.sh file(s) inside
ASTETCDIR/startup.d/. See ASTERISK-21965.
- Changed a log message in safe_asterisk and the $NOTIFY mail subject. If
you use tools to parse either of them, update your parse functions
accordingly. The changed strings are:
- "Exited on signal $EXITSIGNAL" => "Asterisk exited on signal $EXITSIGNAL."
- "Asterisk Died" => "Asterisk on $MACHINE died (sig $EXITSIGNAL)"
Utilities:
- The refcounter program has been removed in favor of the refcounter.py script
in contrib/scripts.
===========================================================
===========================================================
===========================================================
===
=== Information for upgrading between Asterisk versions
===
=== These files document all the changes that MUST be taken
=== into account when upgrading between the Asterisk
=== versions listed below. These changes may require that
=== you modify your configuration files, dialplan or (in
=== some cases) source code if you have your own Asterisk
=== modules or patches. These files also include advance
=== notice of any functionality that has been marked as
=== 'deprecated' and may be removed in a future release,
=== along with the suggested replacement functionality.
===
=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
=== UPGRADE-1.4.txt -- Upgrade info for 1.2 to 1.4
=== UPGRADE-1.6.txt -- Upgrade info for 1.4 to 1.6
=== UPGRADE-1.8.txt -- Upgrade info for 1.6 to 1.8
=== UPGRADE-10.txt -- Upgrade info for 1.8 to 10
=== UPGRADE-11.txt -- Upgrade info for 10 to 11
=== UPGRADE-12.txt -- Upgrade info for 11 to 12
=== UPGRADE-13.txt -- Upgrade info for 12 to 13
===========================================================
From 14.6.0 to 14.7.0:
Core:
- ast_app_parse_timelen now returns an error if it encounters extra characters
at the end of the string to be parsed.
From 14.4.0 to 14.5.0:
Core:
- Support for embedded modules has been removed. This has not worked in
many years. LOADABLE_MODULES menuselect option is also removed as
loadable module support is now always enabled.
From 14.3.0 to 14.4.0:
res_rtp_asterisk:
- The RTP layer of Asterisk now has support for RFC 5761: "Multiplexing RTP
Data and Control Packets on a Single Port." For the PJSIP channel driver,
chan_pjsip, you can set "rtcp_mux = yes" on a PJSIP endpoint in pjsip.conf
to enable the feature. For chan_sip you can set "rtcp_mux = yes" either
globally or on a per-peer basis in sip.conf.
New in 14.0.0
ARI:
- The policy for when to send "Dial" events has changed. Previously, "Dial"
events were sent on the calling channel's topic. However, starting in Asterisk
14, if there is no calling channel on which to send the event, the event is
instead sent on the called channel's topic. Note that for the ARI channels
resource's dial operation, this means that the "Dial" events will always be
sent on the called channel's topic.
Channel Drivers:
chan_dahdi:
- For users using the FXO port (FXS signaling) distinctive ring detection
feature, you will need to adjust the dringX count values. The count
values now only record ring end events instead of any DAHDI event. A
ring-ring-ring pattern would exceed the pattern limits and stop
Caller-ID detection.
chan_sip:
- The SIP dial string has been extended past the [!dnid] option by another
exclamation mark: [!dnid[!fromuri]. An exclamation mark in the To-URI
will now mean changes to the From-URI.
Core:
- The REF_DEBUG compiler flag is now used to enable refdebug by default.
The setting can be overridden in asterisk.conf by setting refdebug in
the options category. No recompile is required to enable/disable it.
- Modified processing of command-line options to first parse only what
is necessary to read asterisk.conf. Once asterisk.conf is fully loaded,
the remaining options are processed. The -X option now applies to
asterisk.conf only. To enable #exec for other config files you must
set execincludes=yes in asterisk.conf. Any other option set on the
command-line will now override the equivalent setting from asterisk.conf.
AMI:
- The 'ModuleCheck' Action's Version key will no longer show the module
version. The value will always be blank.
CLI:
- The 'core show file version' command has been removed. When Asterisk
moved to Git, the source control version support was removed. As a
result, the CLi command was no longer useful and was removed as well.
Logging:
- The first callid created is now 1 instead of 0. The value 0
is now reserved to represent a lack of callid.
AMI:
- The Command action now sends the output from the CLI command as a series
of Output headers for each line instead of as a block of text with the
--END COMMAND-- delimiter to match the output from other actions.
Commands that fail to execute (no such command, invalid syntax etc.) now
return an Error response instead of Success.
app_amd:
- The 'maximum_number_of_words' configuration option and parameter to the AMD
application previously did not match the documented functionality + variable
name. In Asterisk 13, a value of '3' would mean that if '3' words were detected,
the result would be detection as a 'MACHINE'. As of this version, the value
reflects the maximum words that if EXCEEDED (rather than reached), would
result in detection as a machine. This means that you should update this
value to be one higher than your previos value, if your previous value
was working well for you.
===========================================================
===========================================================
===========================================================
===
=== Information for upgrading between Asterisk versions
===
=== These files document all the changes that MUST be taken
=== into account when upgrading between the Asterisk
=== versions listed below. These changes may require that
=== you modify your configuration files, dialplan or (in
=== some cases) source code if you have your own Asterisk
=== modules or patches. These files also include advance
=== notice of any functionality that has been marked as
=== 'deprecated' and may be removed in a future release,
=== along with the suggested replacement functionality.
===
=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
=== UPGRADE-1.4.txt -- Upgrade info for 1.2 to 1.4
=== UPGRADE-1.6.txt -- Upgrade info for 1.4 to 1.6
=== UPGRADE-1.8.txt -- Upgrade info for 1.6 to 1.8
=== UPGRADE-10.txt -- Upgrade info for 1.8 to 10
=== UPGRADE-11.txt -- Upgrade info for 10 to 11
=== UPGRADE-12.txt -- Upgrade info for 11 to 12
=== UPGRADE-13.txt -- Upgrade info for 12 to 13
=== UPGRADE-14.txt -- Upgrade info for 13 to 14
===========================================================
From 15.2.0 to 15.3.0:
res_pjsip
------------------
* Users who are matching endpoints by SIP header need to reevaluate their
global "endpoint_identifier_order" option in light of the "ip" endpoint
identifier method split into the "ip" and "header" endpoint identifier
methods.
res_pjsip_endpoint_identifier_ip
------------------
* The endpoint identifier "ip" method previously recognized endpoints either
by IP address or a matching SIP header. The "ip" endpoint identifier method
is now split into the "ip" and "header" endpoint identifier methods. The
"ip" endpoint identifier method only matches by IP address and the "header"
endpoint identifier method only matches by SIP header. The split allows the
user to control the relative priority of the IP address and the SIP header
identification methods in the global "endpoint_identifier_order" option.
e.g., If you have two type=identify sections where one matches by IP address
for endpoint alice and the other matches by SIP header for endpoint bob then
you can now predict which endpoint is matched when a request comes in that
matches both.
New in 15.0.0:
Build System:
- '--with-pjproject-bundled' is now the default when running ./configure
It can be disabled with '--without-pjproject-bundled'.
Core:
- Multi-stream support has been added so a channel can have multiple
streams of the same type such as audio and video.
- The 'Data Retrieval API' has been removed. This API was not actively
maintained, was not added to new modules (such as res_pjsip), and there
exist better alternatives to acquire the same information, such as the
ARI. As a result, the 'DataGet' AMI action as well as the 'data get'
CLI command have been removed.
This diff is collapsed.
......@@ -14,15 +14,17 @@
MENUSELECT_CATEGORY=ADDONS
MENUSELECT_DESCRIPTION=Add-ons (See README-addons.txt)
H323OBJS:=ooCmdChannel.o ooLogChan.o ooUtils.o ooGkClient.o context.o \
ooDateTime.o decode.o dlist.o encode.o errmgmt.o \
memheap.o ootrace.o oochannels.o ooh245.o ooports.o \
ooq931.o ooCapability.o ooSocket.o perutil.o eventHandler.o \
ooCalls.o ooStackCmds.o ooh323.o ooh323ep.o printHandler.o \
rtctype.o ooTimer.o h323/H235-SECURITY-MESSAGESDec.o \
h323/H235-SECURITY-MESSAGESEnc.o h323/H323-MESSAGES.o h323/H323-MESSAGESDec.o \
h323/H323-MESSAGESEnc.o h323/MULTIMEDIA-SYSTEM-CONTROL.o \
h323/MULTIMEDIA-SYSTEM-CONTROLDec.o h323/MULTIMEDIA-SYSTEM-CONTROLEnc.o
OOH323C:=ooCmdChannel.c ooLogChan.c ooUtils.c ooGkClient.c context.c \
ooDateTime.c decode.c dlist.c encode.c errmgmt.c \
memheap.c ootrace.c oochannels.c ooh245.c ooports.c \
ooq931.c ooCapability.c ooSocket.c perutil.c eventHandler.c \
ooCalls.c ooStackCmds.c ooh323.c ooh323ep.c printHandler.c \
rtctype.c ooTimer.c h323/H235-SECURITY-MESSAGESDec.c \
h323/H235-SECURITY-MESSAGESEnc.c h323/H323-MESSAGES.c h323/H323-MESSAGESDec.c \
h323/H323-MESSAGESEnc.c h323/MULTIMEDIA-SYSTEM-CONTROL.c \
h323/MULTIMEDIA-SYSTEM-CONTROLDec.c h323/MULTIMEDIA-SYSTEM-CONTROLEnc.c
H323SOURCE:=$(addprefix ooh323c/src/,$(OOH323C)) ooh323cDriver.c
H323CFLAGS:=-Iooh323c/src -Iooh323c/src/h323
......@@ -57,22 +59,14 @@ endif
include $(ASTTOPDIR)/Makefile.moddir_rules
clean::
if [ -f mp3/Makefile ] ; then $(MAKE) -C mp3 clean ; fi
rm -f $(addprefix ooh323c/src/,$(H323OBJS))
ifneq ($(wildcard mp3/Makefile),)
format_mp3.so: mp3/common.o mp3/dct64_i386.o mp3/decode_ntom.o mp3/layer3.o mp3/tabinit.o mp3/interface.o
endif
chan_mobile.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
chan_ooh323.o: _ASTCFLAGS+=$(H323CFLAGS)
chan_ooh323.so: _ASTCFLAGS+=$(H323CFLAGS)
chan_ooh323.so: $(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o
$(addprefix ooh323c/src/,$(H323OBJS)) chan_ooh323.o ooh323cDriver.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,chan_ooh323)
$(call MOD_ADD_C,chan_ooh323,$(H323SOURCE))
.PHONY: check_mp3
ifneq ($(wildcard mp3/Makefile),)
$(call MOD_ADD_C,format_mp3,mp3/common.c mp3/dct64_i386.c mp3/decode_ntom.c mp3/layer3.c mp3/tabinit.c mp3/interface.c)
ifeq ($(wildcard mp3/Makefile),)
.PHONY: format_mp3.o format_mp3.so
.PHONY: check_mp3
else
.PHONY: check_mp3 format_mp3.o format_mp3.so
endif
......@@ -218,7 +218,7 @@ static int add_identifier(struct ast_channel *chan, int identifier_type, void *d
ast_log(LOG_WARNING, "Unable to lock identifiers list\n");
return -1;
} else {
i = malloc(sizeof(*i));
i = ast_malloc(sizeof(*i));
AST_LIST_TRAVERSE(headp, j, entries) {
if (j->identifier > maxidentifier) {
maxidentifier = j->identifier;
......@@ -247,7 +247,7 @@ static int del_identifier(int identifier, int identifier_type)
if ((i->identifier == identifier) &&
(i->identifier_type == identifier_type)) {
AST_LIST_REMOVE(headp, i, entries);
free(i);
ast_free(i);
found = 1;
break;
}
......
......@@ -42,8 +42,6 @@
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
......@@ -127,7 +125,9 @@ static char *handle_cli_cdr_mysql_status(struct ast_cli_entry *e, int cmd, struc
return CLI_SHOWUSAGE;
if (connected) {
char status[256], status2[100] = "";
char status[256];
char status2[100] = "";
char buf[362]; /* 256+100+" for "+NULL */
int ctime = time(NULL) - connect_time;
if (dbport)
snprintf(status, 255, "Connected to %s@%s, port %d", ast_str_buffer(dbname), ast_str_buffer(hostname), dbport);
......@@ -140,17 +140,10 @@ static char *handle_cli_cdr_mysql_status(struct ast_cli_entry *e, int cmd, struc
snprintf(status2, 99, " with username %s", ast_str_buffer(dbuser));
if (ast_str_strlen(dbtable))
snprintf(status2, 99, " using table %s", ast_str_buffer(dbtable));
if (ctime > 31536000) {
ast_cli(a->fd, "%s%s for %d years, %d days, %d hours, %d minutes, %d seconds.\n", status, status2, ctime / 31536000, (ctime % 31536000) / 86400, (ctime % 86400) / 3600, (ctime % 3600) / 60, ctime % 60);
} else if (ctime > 86400) {
ast_cli(a->fd, "%s%s for %d days, %d hours, %d minutes, %d seconds.\n", status, status2, ctime / 86400, (ctime % 86400) / 3600, (ctime % 3600) / 60, ctime % 60);
} else if (ctime > 3600) {
ast_cli(a->fd, "%s%s for %d hours, %d minutes, %d seconds.\n", status, status2, ctime / 3600, (ctime % 3600) / 60, ctime % 60);
} else if (ctime > 60) {
ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, status2, ctime / 60, ctime % 60);
} else {
ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctime);
}
snprintf(buf, sizeof(buf), "%s%s for ", status, status2);
ast_cli_print_timestr_fromseconds(a->fd, ctime, buf);
if (records == totalrecords)
ast_cli(a->fd, " Wrote %d records since last restart.\n", totalrecords);
else
......@@ -455,6 +448,140 @@ static int my_load_config_number(struct ast_config *cfg, const char *category, c
return 0;
}
/** Connect to MySQL. Initializes the connection.
*
* * Assumes the read-write lock for columns is held.
* * Caller should allocate and free cfg
* */
static int my_connect_db(struct ast_config *cfg)
{
struct ast_variable *var;
char *temp;
MYSQL_ROW row;
MYSQL_RES *result;
char sqldesc[128];
#if MYSQL_VERSION_ID >= 50013
my_bool my_bool_true = 1;
#endif
mysql_init(&mysql);
if (timeout && mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *)&timeout) != 0) {
ast_log(LOG_ERROR, "cdr_mysql: mysql_options returned (%d) %s\n", mysql_errno(&mysql), mysql_error(&mysql));
}
#if MYSQL_VERSION_ID >= 50013
/* Add option for automatic reconnection */
if (mysql_options(&mysql, MYSQL_OPT_RECONNECT, &my_bool_true) != 0) {
ast_log(LOG_ERROR, "cdr_mysql: mysql_options returned (%d) %s\n", mysql_errno(&mysql), mysql_error(&mysql));
}
#endif
if ((ssl_ca && ast_str_strlen(ssl_ca)) || (ssl_cert && ast_str_strlen(ssl_cert)) || (ssl_key && ast_str_strlen(ssl_key))) {
mysql_ssl_set(&mysql,
ssl_key ? ast_str_buffer(ssl_key) : NULL,
ssl_cert ? ast_str_buffer(ssl_cert) : NULL,
ssl_ca ? ast_str_buffer(ssl_ca) : NULL,
NULL, NULL);
}
temp = dbsock && ast_str_strlen(dbsock) ? ast_str_buffer(dbsock) : NULL;
configure_connection_charset();
if (!mysql_real_connect(&mysql, ast_str_buffer(hostname), ast_str_buffer(dbuser), ast_str_buffer(password), ast_str_buffer(dbname), dbport, temp, ssl_ca && ast_str_strlen(ssl_ca) ? CLIENT_SSL : 0)) {
ast_log(LOG_ERROR, "Failed to connect to mysql database %s on %s.\n", ast_str_buffer(dbname), ast_str_buffer(hostname));
connected = 0;
records = 0;
return AST_MODULE_LOAD_SUCCESS; /* May be reconnected later */
}
ast_debug(1, "Successfully connected to MySQL database.\n");
connected = 1;
records = 0;
connect_time = time(NULL);
/* Get table description */
snprintf(sqldesc, sizeof(sqldesc), "DESC %s", dbtable ? ast_str_buffer(dbtable) : "cdr");
if (mysql_query(&mysql, sqldesc)) {
ast_log(LOG_ERROR, "Unable to query table description!! Logging disabled.\n");
mysql_close(&mysql);
connected = 0;
return AST_MODULE_LOAD_DECLINE;
}
if (!(result = mysql_store_result(&mysql))) {
ast_log(LOG_ERROR, "Unable to query table description!! Logging disabled.\n");
mysql_close(&mysql);
connected = 0;
return AST_MODULE_LOAD_DECLINE;
}
while ((row = mysql_fetch_row(result))) {
struct column *entry;
char *cdrvar = "", *staticvalue = "";
ast_debug(1, "Got a field '%s' of type '%s'\n", row[0], row[1]);
/* Check for an alias or a static value */
for (var = ast_variable_browse(cfg, "columns"); var; var = var->next) {
if (strncmp(var->name, "alias", 5) == 0 && strcasecmp(var->value, row[0]) == 0 ) {
char *alias = ast_strdupa(var->name + 5);
cdrvar = ast_strip(alias);
ast_verb(3, "Found alias %s for column %s\n", cdrvar, row[0]);
break;
} else if (strncmp(var->name, "static", 6) == 0 && strcasecmp(var->value, row[0]) == 0) {
char *item = ast_strdupa(var->name + 6);
item = ast_strip(item);
if (item[0] == '"' && item[strlen(item) - 1] == '"') {
/* Remove surrounding quotes */
item[strlen(item) - 1] = '\0';
item++;
}
staticvalue = item;
}
}
entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(row[0]) + 1 + strlen(cdrvar) + 1 + strlen(staticvalue) + 1 + strlen(row[1]) + 1);
if (!entry) {
ast_log(LOG_ERROR, "Out of memory creating entry for column '%s'\n", row[0]);
mysql_free_result(result);
return AST_MODULE_LOAD_DECLINE;
}
entry->name = (char *)entry + sizeof(*entry);
strcpy(entry->name, row[0]);
if (!ast_strlen_zero(cdrvar)) {
entry->cdrname = entry->name + strlen(row[0]) + 1;
strcpy(entry->cdrname, cdrvar);
} else { /* Point to same place as the column name */
entry->cdrname = (char *)entry + sizeof(*entry);
}
if (!ast_strlen_zero(staticvalue)) {
entry->staticvalue = entry->cdrname + strlen(entry->cdrname) + 1;
strcpy(entry->staticvalue, staticvalue);
ast_debug(1, "staticvalue length: %d\n", (int) strlen(staticvalue) );
entry->type = entry->staticvalue + strlen(entry->staticvalue) + 1;
} else {
entry->type = entry->cdrname + strlen(entry->cdrname) + 1;
}
strcpy(entry->type, row[1]);
ast_debug(1, "Entry name '%s'\n", entry->name);
ast_debug(1, " cdrname '%s'\n", entry->cdrname);
ast_debug(1, " static '%s'\n", entry->staticvalue);
ast_debug(1, " type '%s'\n", entry->type);
AST_LIST_INSERT_TAIL(&columns, entry, list);
}
mysql_free_result(result);
return AST_MODULE_LOAD_SUCCESS;
}
static int my_load_module(int reload)
{
int res;
......@@ -465,14 +592,7 @@ static int my_load_module(int reload)
* rescan the table layout. */
struct ast_flags config_flags = { 0 };
struct column *entry;
char *temp;
struct ast_str *compat;
MYSQL_ROW row;
MYSQL_RES *result;
char sqldesc[128];
#if MYSQL_VERSION_ID >= 50013
my_bool my_bool_true = 1;
#endif
/* Cannot use a conditionally different flag, because the table layout may
* have changed, which is not detectable by config file change detection,
......@@ -569,129 +689,12 @@ static int my_load_module(int reload)
ast_debug(1, "Got DB charset of %s\n", ast_str_buffer(dbcharset));
}
mysql_init(&mysql);
if (timeout && mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *)&timeout) != 0) {
ast_log(LOG_ERROR, "cdr_mysql: mysql_options returned (%d) %s\n", mysql_errno(&mysql), mysql_error(&mysql));
}
#if MYSQL_VERSION_ID >= 50013
/* Add option for automatic reconnection */
if (mysql_options(&mysql, MYSQL_OPT_RECONNECT, &my_bool_true) != 0) {
ast_log(LOG_ERROR, "cdr_mysql: mysql_options returned (%d) %s\n", mysql_errno(&mysql), mysql_error(&mysql));
}
#endif
if ((ssl_ca && ast_str_strlen(ssl_ca)) || (ssl_cert && ast_str_strlen(ssl_cert)) || (ssl_key && ast_str_strlen(ssl_key))) {
mysql_ssl_set(&mysql,
ssl_key ? ast_str_buffer(ssl_key) : NULL,
ssl_cert ? ast_str_buffer(ssl_cert) : NULL,
ssl_ca ? ast_str_buffer(ssl_ca) : NULL,
NULL, NULL);
}
temp = dbsock && ast_str_strlen(dbsock) ? ast_str_buffer(dbsock) : NULL;
configure_connection_charset();
if (!mysql_real_connect(&mysql, ast_str_buffer(hostname), ast_str_buffer(dbuser), ast_str_buffer(password), ast_str_buffer(dbname), dbport, temp, ssl_ca && ast_str_strlen(ssl_ca) ? CLIENT_SSL : 0)) {
ast_log(LOG_ERROR, "Failed to connect to mysql database %s on %s.\n", ast_str_buffer(dbname), ast_str_buffer(hostname));
connected = 0;
records = 0;
} else {
ast_debug(1, "Successfully connected to MySQL database.\n");
connected = 1;
records = 0;
connect_time = time(NULL);
/* Get table description */
snprintf(sqldesc, sizeof(sqldesc), "DESC %s", dbtable ? ast_str_buffer(dbtable) : "cdr");
if (mysql_query(&mysql, sqldesc)) {
ast_log(LOG_ERROR, "Unable to query table description!! Logging disabled.\n");
mysql_close(&mysql);
connected = 0;
AST_RWLIST_UNLOCK(&columns);
ast_config_destroy(cfg);
free_strings();
return AST_MODULE_LOAD_DECLINE;
}
if (!(result = mysql_store_result(&mysql))) {
ast_log(LOG_ERROR, "Unable to query table description!! Logging disabled.\n");
mysql_close(&mysql);
connected = 0;
AST_RWLIST_UNLOCK(&columns);
ast_config_destroy(cfg);
free_strings();
return AST_MODULE_LOAD_DECLINE;
}
while ((row = mysql_fetch_row(result))) {
struct column *entry;
char *cdrvar = "", *staticvalue = "";
ast_debug(1, "Got a field '%s' of type '%s'\n", row[0], row[1]);
/* Check for an alias or a static value */
for (var = ast_variable_browse(cfg, "columns"); var; var = var->next) {
if (strncmp(var->name, "alias", 5) == 0 && strcasecmp(var->value, row[0]) == 0 ) {
char *alias = ast_strdupa(var->name + 5);
cdrvar = ast_strip(alias);
ast_verb(3, "Found alias %s for column %s\n", cdrvar, row[0]);
break;
} else if (strncmp(var->name, "static", 6) == 0 && strcasecmp(var->value, row[0]) == 0) {
char *item = ast_strdupa(var->name + 6);
item = ast_strip(item);
if (item[0] == '"' && item[strlen(item) - 1] == '"') {
/* Remove surrounding quotes */
item[strlen(item) - 1] = '\0';
item++;
}
staticvalue = item;
}
}
entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(row[0]) + 1 + strlen(cdrvar) + 1 + strlen(staticvalue) + 1 + strlen(row[1]) + 1);
if (!entry) {
ast_log(LOG_ERROR, "Out of memory creating entry for column '%s'\n", row[0]);
res = -1;
break;
}
entry->name = (char *)entry + sizeof(*entry);
strcpy(entry->name, row[0]);
if (!ast_strlen_zero(cdrvar)) {
entry->cdrname = entry->name + strlen(row[0]) + 1;
strcpy(entry->cdrname, cdrvar);
} else { /* Point to same place as the column name */
entry->cdrname = (char *)entry + sizeof(*entry);
}
if (!ast_strlen_zero(staticvalue)) {
entry->staticvalue = entry->cdrname + strlen(entry->cdrname) + 1;
strcpy(entry->staticvalue, staticvalue);
ast_debug(1, "staticvalue length: %d\n", (int) strlen(staticvalue) );
entry->type = entry->staticvalue + strlen(entry->staticvalue) + 1;
} else {
entry->type = entry->cdrname + strlen(entry->cdrname) + 1;
}
strcpy(entry->type, row[1]);
ast_debug(1, "Entry name '%s'\n", entry->name);
ast_debug(1, " cdrname '%s'\n", entry->cdrname);
ast_debug(1, " static '%s'\n", entry->staticvalue);
ast_debug(1, " type '%s'\n", entry->type);
AST_LIST_INSERT_TAIL(&columns, entry, list);
}
mysql_free_result(result);
}
res = my_connect_db(cfg);
AST_RWLIST_UNLOCK(&columns);
ast_config_destroy(cfg);
if (res < 0) {
if (res != AST_MODULE_LOAD_SUCCESS) {
my_unload_module(0);
return AST_MODULE_LOAD_DECLINE;
return res;
}
if (!reload) {
......@@ -739,4 +742,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "MySQL CDR Backend",
.load = load_module,
.unload = unload_module,
.reload = reload,
.requires = "cdr",
);
......@@ -42,8 +42,6 @@
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <pthread.h>
#include <signal.h>
......@@ -4818,8 +4816,8 @@ e_cleanup:
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Bluetooth Mobile Device Channel Driver",
.support_level = AST_MODULE_SUPPORT_EXTENDED,
.load = load_module,
.unload = unload_module,
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
.support_level = AST_MODULE_SUPPORT_EXTENDED,
.load = load_module,
.unload = unload_module,
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
);
......@@ -359,6 +359,7 @@ static int gDTMFCodec = 101;
static int gFAXdetect = FAXDETECT_CNG;
static int gT38Support = T38_FAXGW;
static char gGatekeeper[100];
static char gRASIP[2+8*4+7]; /* Max for IPv6 addr */
static enum RasGatekeeperMode gRasGkMode = RasNoGatekeeper;
static int gIsGateway = 0;
......@@ -590,7 +591,7 @@ static struct ooh323_pvt *ooh323_alloc(int callref, char *callToken)
pvt->call_reference = callref;
if (callToken)
pvt->callToken = strdup(callToken);
pvt->callToken = ast_strdup(callToken);
/* whether to use gk for this call */
if (gRasGkMode == RasNoGatekeeper)
......@@ -697,8 +698,8 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca
}
if (peer) {
p->username = strdup(peer->name);
p->host = strdup(peer->ip);
p->username = ast_strdup(peer->name);
p->host = ast_strdup(peer->ip);
p->port = peer->port;
/* Disable gk as we are going to call a known peer*/
/* OO_SETFLAG(p->flags, H323_DISABLEGK); */
......@@ -759,9 +760,9 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca
p->directrtp = gDirectRTP;
p->earlydirect = gEarlyDirect;
p->username = strdup(dest);
p->username = ast_strdup(dest);
p->host = strdup(dest);
p->host = ast_strdup(dest);
if (port > 0) {
p->port = port;
}
......@@ -1016,22 +1017,22 @@ static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout)
ast_mutex_lock(&p->lock);
ast_set_flag(p, H323_OUTGOING);
if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
free(p->callerid_num);
p->callerid_num = strdup(ast_channel_connected(ast)->id.number.str);
ast_free(p->callerid_num);
p->callerid_num = ast_strdup(ast_channel_connected(ast)->id.number.str);
}
if (ast_channel_connected(ast)->id.name.valid && ast_channel_connected(ast)->id.name.str) {
free(p->callerid_name);
p->callerid_name = strdup(ast_channel_connected(ast)->id.name.str);
ast_free(p->callerid_name);
p->callerid_name = ast_strdup(ast_channel_connected(ast)->id.name.str);
} else if (ast_channel_connected(ast)->id.number.valid && ast_channel_connected(ast)->id.number.str) {
free(p->callerid_name);
p->callerid_name = strdup(ast_channel_connected(ast)->id.number.str);
ast_free(p->callerid_name);
p->callerid_name = ast_strdup(ast_channel_connected(ast)->id.number.str);
} else {
ast_channel_connected(ast)->id.name.valid = 1;
free(ast_channel_connected(ast)->id.name.str);
ast_channel_connected(ast)->id.name.str = strdup(gCallerID);
free(p->callerid_name);
p->callerid_name = strdup(ast_channel_connected(ast)->id.name.str);
ast_free(ast_channel_connected(ast)->id.name.str);
ast_channel_connected(ast)->id.name.str = ast_strdup(gCallerID);
ast_free(p->callerid_name);
p->callerid_name = ast_strdup(ast_channel_connected(ast)->id.name.str);
}
/* Retrieve vars */
......@@ -1044,7 +1045,7 @@ static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout)
if ((val = pbx_builtin_getvar_helper(ast, "CALLER_H323DIALEDDIGITS"))) {
ast_copy_string(p->caller_dialedDigits, val, sizeof(p->caller_dialedDigits));
if(!p->callerid_num)
p->callerid_num = strdup(val);
p->callerid_num = ast_strdup(val);
}
if ((val = pbx_builtin_getvar_helper(ast, "CALLER_H323EMAIL"))) {
......@@ -1165,7 +1166,7 @@ static int ooh323_answer(struct ast_channel *ast)
if (p) {
ast_mutex_lock(&p->lock);
callToken = (p->callToken ? strdup(p->callToken) : NULL);
callToken = (p->callToken ? ast_strdup(p->callToken) : NULL);
if (ast_channel_state(ast) != AST_STATE_UP) {
ast_channel_lock(ast);
if (!p->alertsent) {
......@@ -1183,7 +1184,7 @@ static int ooh323_answer(struct ast_channel *ast)
ooAnswerCall(p->callToken);
}
if (callToken) {
free(callToken);
ast_free(callToken);
}
ast_mutex_unlock(&p->lock);
}
......@@ -1290,7 +1291,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
if (!p) return -1;
ast_mutex_lock(&p->lock);
callToken = (p->callToken ? strdup(p->callToken) : NULL);
callToken = (p->callToken ? ast_strdup(p->callToken) : NULL);
ast_mutex_unlock(&p->lock);
if (!callToken) {
......@@ -1456,7 +1457,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
ast_verb(0, "++++ ooh323_indicate %d on %s is %d\n", condition, callToken, res);
}
free(callToken);
ast_free(callToken);
return res;
}
......@@ -1862,25 +1863,25 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg)
if (call->remoteDisplayName) {
p->callerid_name = strdup(call->remoteDisplayName);
p->callerid_name = ast_strdup(call->remoteDisplayName);
}
if (ooCallGetCallingPartyNumber(call, number, OO_MAX_NUMBER_LENGTH) == OO_OK) {
p->callerid_num = strdup(number);
p->callerid_num = ast_strdup(number);
}
if (call->remoteAliases) {
for (alias = call->remoteAliases; alias; alias = alias->next) {
if (alias->type == T_H225AliasAddress_h323_ID) {
if (!p->callerid_name) {
p->callerid_name = strdup(alias->value);
p->callerid_name = ast_strdup(alias->value);
}
ast_copy_string(p->caller_h323id, alias->value, sizeof(p->caller_h323id));
}
else if(alias->type == T_H225AliasAddress_dialedDigits)
{
if(!p->callerid_num)
p->callerid_num = strdup(alias->value);
p->callerid_num = ast_strdup(alias->value);
ast_copy_string(p->caller_dialedDigits, alias->value,
sizeof(p->caller_dialedDigits));
}
......@@ -1921,7 +1922,7 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg)
user = find_user(p->callerid_name, call->remoteIP);
if(user && (user->incominglimit == 0 || user->inUse < user->incominglimit)) {
ast_mutex_lock(&user->lock);
p->username = strdup(user->name);
p->username = ast_strdup(user->name);
p->neighbor.user = user->mUseIP ? ast_strdup(user->mIP) :
ast_strdup(user->name);
ast_copy_string(p->context, user->context, sizeof(p->context));
......@@ -1967,7 +1968,7 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg)
ast_mutex_unlock(&user->lock);
} else {
if (!OO_TESTFLAG(p->flags,H323_DISABLEGK)) {
p->username = strdup(call->remoteIP);
p->username = ast_strdup(call->remoteIP);
p->directrtp = gDirectRTP;
p->earlydirect = gEarlyDirect;
} else {
......@@ -2320,7 +2321,7 @@ int onCallCleared(ooCallData *call)
}
ast_mutex_unlock(&userl.lock);
free(user);
ast_free(user);
}
if (gH323Debug)
......@@ -2352,13 +2353,13 @@ void ooh323_delete_peer(struct ooh323_peer *peer)
}
ast_mutex_unlock(&peerl.lock);
if(peer->h323id) free(peer->h323id);
if(peer->email) free(peer->email);
if(peer->url) free(peer->url);
if(peer->e164) free(peer->e164);
ast_free(peer->h323id);
ast_free(peer->email);
ast_free(peer->url);
ast_free(peer->e164);
ao2_cleanup(peer->cap);
free(peer);
ao2_cleanup(peer->cap);
ast_free(peer);
}
if (gH323Debug)
......@@ -2725,7 +2726,7 @@ static int ooh323_do_reload(void)
if (gRasGkMode == RasUseSpecificGatekeeper ||
gRasGkMode == RasDiscoverGatekeeper) {
ooGkClientInit(gRasGkMode, (gRasGkMode == RasUseSpecificGatekeeper) ?
gGatekeeper : 0, 0);
gGatekeeper : 0, gRASIP, 0);
ooGkClientStart(gH323ep.gkClient);
}
......@@ -2847,8 +2848,8 @@ int reload_config(int reload)
while (cur) {
prev = cur;
cur = cur->next;
free(prev->value);
free(prev);
ast_free(prev->value);
ast_free(prev);
}
gAliasList = NULL;
ooH323EpClearAllAliases();
......@@ -2868,6 +2869,7 @@ int reload_config(int reload)
gTRCLVL = OOTRCLVLERR;
gRasGkMode = RasNoGatekeeper;
gGatekeeper[0] = '\0';
gRASIP[0] = '\0';
gRTPTimeout = 60;
gNat = FALSE;
gRTDRInterval = 0;
......@@ -2963,7 +2965,7 @@ int reload_config(int reload)
ast_copy_string(gCallerID, v->value, sizeof(gCallerID));
}
pNewAlias->type = T_H225AliasAddress_h323_ID;
pNewAlias->value = strdup(v->value);
pNewAlias->value = ast_strdup(v->value);
pNewAlias->next = gAliasList;
gAliasList = pNewAlias;
pNewAlias = NULL;
......@@ -2984,7 +2986,7 @@ int reload_config(int reload)
return 1;
}
pNewAlias->type = T_H225AliasAddress_dialedDigits;
pNewAlias->value = strdup(v->value);
pNewAlias->value = ast_strdup(v->value);
pNewAlias->next = gAliasList;
gAliasList = pNewAlias;
pNewAlias = NULL;
......@@ -2999,7 +3001,7 @@ int reload_config(int reload)
return 1;
}
pNewAlias->type = T_H225AliasAddress_email_ID;
pNewAlias->value = strdup(v->value);
pNewAlias->value = ast_strdup(v->value);
pNewAlias->next = gAliasList;
gAliasList = pNewAlias;
pNewAlias = NULL;
......@@ -3028,6 +3030,9 @@ int reload_config(int reload)
gRasGkMode = RasUseSpecificGatekeeper;
ast_copy_string(gGatekeeper, v->value, sizeof(gGatekeeper));
}
} else if (!strcasecmp(v->name, "localras")) {
ast_copy_string(gRASIP, v->value, sizeof(gRASIP));
ast_verb(3, " == Setting RAS IP to %s\n", gRASIP);
} else if (!strcasecmp(v->name, "logfile")) {
ast_copy_string(gLogFile, v->value, sizeof(gLogFile));
} else if (!strcasecmp(v->name, "context")) {
......@@ -3923,9 +3928,9 @@ static int load_module(void)
/* Gatekeeper */
if (gRasGkMode == RasUseSpecificGatekeeper)
ooGkClientInit(gRasGkMode, gGatekeeper, 0);
ooGkClientInit(gRasGkMode, gGatekeeper, gRASIP, 0);
else if (gRasGkMode == RasDiscoverGatekeeper)
ooGkClientInit(gRasGkMode, 0, 0);
ooGkClientInit(gRasGkMode, 0, gRASIP, 0);
/* Register callbacks */
ooH323EpSetH323Callbacks(h323Callbacks);
......@@ -4012,7 +4017,7 @@ static void *do_monitor(void *data)
ooGkClientDestroy();
ast_verb(0, "Restart stopped gatekeeper client\n");
ooGkClientInit(gRasGkMode, (gRasGkMode == RasUseSpecificGatekeeper) ?
gGatekeeper : 0, 0);
gGatekeeper : 0, gRASIP, 0);
ooGkClientStart(gH323ep.gkClient);
}
......@@ -4144,22 +4149,22 @@ int ooh323_destroy(struct ooh323_pvt *p)
}
if (cur->username) {
free(cur->username);
ast_free(cur->username);
cur->username = 0;
}
if (cur->host) {
free(cur->host);
ast_free(cur->host);
cur->host = 0;
}
if (cur->callerid_name) {
free(cur->callerid_name);
ast_free(cur->callerid_name);
cur->callerid_name = 0;
}
if (cur->callerid_num) {
free(cur->callerid_num);
ast_free(cur->callerid_num);
cur->callerid_num = 0;
}
......@@ -4202,7 +4207,7 @@ int ooh323_destroy(struct ooh323_pvt *p)
user->inUse--;
ast_mutex_unlock(&user->lock);
}
free(cur->neighbor.user);
ast_free(cur->neighbor.user);
}
} else {
/* outgoing limit decrement here !!! */
......@@ -4232,10 +4237,10 @@ int delete_peers()
cur = cur->next;
ast_mutex_destroy(&prev->lock);
if(prev->h323id) free(prev->h323id);
if(prev->email) free(prev->email);
if(prev->url) free(prev->url);
if(prev->e164) free(prev->e164);
ast_free(prev->h323id);
ast_free(prev->email);
ast_free(prev->url);
ast_free(prev->e164);
if(prev->rtpmask) {
ast_mutex_lock(&prev->rtpmask->lock);
prev->rtpmask->inuse--;
......@@ -4243,10 +4248,10 @@ int delete_peers()
if (prev->rtpmask->inuse == 0) {
regfree(&prev->rtpmask->regex);
ast_mutex_destroy(&prev->rtpmask->lock);
free(prev->rtpmask);
ast_free(prev->rtpmask);
}
}
free(prev);
ast_free(prev);
if (cur == peerl.peers) {
break;
......@@ -4274,11 +4279,11 @@ int delete_users()
if (prev->rtpmask->inuse == 0) {
regfree(&prev->rtpmask->regex);
ast_mutex_destroy(&prev->rtpmask->lock);
free(prev->rtpmask);
ast_free(prev->rtpmask);
}
}
ao2_cleanup(prev->cap);
free(prev);
ast_free(prev);
if (cur == userl.users) {
break;
}
......@@ -4390,8 +4395,8 @@ static int unload_module(void)
while (cur) {
prev = cur;
cur = cur->next;
free(prev->value);
free(prev);
ast_free(prev->value);
ast_free(prev);
}
gAliasList = NULL;
......@@ -4555,7 +4560,7 @@ static int ooh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance
memset(&p->redirip, 0, sizeof(p->redirip));
}
callToken = (p->callToken ? strdup(p->callToken) : NULL);
callToken = (p->callToken ? ast_strdup(p->callToken) : NULL);
if (!callToken) {
if (gH323Debug) {
......@@ -4583,7 +4588,7 @@ static int ooh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance
}
ast_mutex_unlock(&p->lock);
free(callToken);
ast_free(callToken);
return 0;
}
......@@ -5236,9 +5241,10 @@ void ast_ooh323c_exit()
#endif
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Objective Systems H323 Channel",
.support_level = AST_MODULE_SUPPORT_EXTENDED,
.load = load_module,
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_CHANNEL_DRIVER
);
.support_level = AST_MODULE_SUPPORT_EXTENDED,
.load = load_module,
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
.requires = "udptl",
);
......@@ -38,7 +38,6 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/signal.h>
#include "asterisk/lock.h"
#include "asterisk/channel.h"
......
......@@ -34,8 +34,6 @@
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "mp3/mpg123.h"
#include "mp3/mpglib.h"
......