Commit Graph

22737 Commits

Author SHA1 Message Date
Matthew Jordan
834f3215a9 pbx: Handle a completely empty dialplan during a context merge
It is highly unlikely, but - at least in Asterisk 12 - theoretically possible
to load Asterisk with no dialplan whatsoever. If that occurs, and some other
module (that is not a pbx module) attempts to merge its contexts into the
dialplan, the existing merge routine will crash. This is because it is not
insane, and rightly believes that you provided some sort of dialplan,
somewhere.

This patch will gracefully merge the contexts in such a case. Note that this
is highly unlikely to occur in 1.8/11, as features will most likely provide
some dialplan via parking. However, in Asterisk 12, parking is now provided
by res_parking, and hence may create its dialplan later.

(closes issue ASTERISK-23297)
Reported by: CJ Oster

Review: https://reviewboard.asterisk.org/r/3222


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@408200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-16 03:14:52 +00:00
Scott Griepentrog
e0bed661dd pbx: ast_custom_function_unregister resource leak
In pbx.c ast_custom_function_unregister(), a list
of escalations being removed from the list wasn't
being free'd creating a leak. This patch corrects
that by freeing the records.

Review: https://reviewboard.asterisk.org/r/3213/
Reported by: Corey Farrell
Patches:
     acf_escalating_leak.patch uploaded by coreyfarrell (license 5909)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@408142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 21:52:33 +00:00
Walter Doekes
b78a146975 buildsystem: Don't force main to depend on everything else.
Directory 'main' only needs to depend on embedded modules. If no
module embedding is selected, the dependency is dropped.

Review: https://reviewboard.asterisk.org/r/3212/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@408083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 13:25:24 +00:00
Rusty Newton
f0f80e418b configs/agents.conf.sample - Remove example for non-functional "goodbye" parameter
The "goodbye" parameter is not implemented in the source code, it does nothing.

(closes issue SWP-6518)
Reported By: Steve Pitts


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@408020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-14 01:22:46 +00:00
Walter Doekes
f6aed66f77 res_config_pgsql: Fix ast_update2_realtime calls.
Fix so multiple updates from a single call works (add missing ',').
Remove bogus ast_free's that weren't supposed to be there.
Moved a few spaces for readability.

Review: https://reviewboard.asterisk.org/r/3194/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-10 16:33:21 +00:00
Tzafrir Cohen
8ee947ed5e chan_dahdi: handle DAHDI_EVENT_REMOVED on a pri D-Channel
When a DAHDI device is removed at run-time it sends the event
DAHDI_EVENT_REMOVED on each channel. This is intended to signal the
userspace program to close the respective file handle, as the driver of
the device will need all of them closed to properly clean-up.

This event has long since been handled in chan_dahdi (chan_zap at the
time). However the event that is sent on a D-Channel of a "PRI" (ISDN)
span simply gets ignored.

This commit adds handling for closing the file descriptor (and shutting
down the span, while we're at it).

It also adds a CLI command 'pri destroy span <N>' to destroy the span
and its DAHDI channels.

Backported from trunk/12.

Review: https://reviewboard.asterisk.org/r/726/
........

Merged revisions 394552 394567 from http://svn.asterisk.org/svn/asterisk/trunk


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-09 15:34:53 +00:00
Richard Mudgett
414d336f45 chan_iax2: Add some more iaxs[] NULL checks to a routine already full of them.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 20:42:26 +00:00
Richard Mudgett
6e6a7f2af0 chan_iax2: Block unnecessary control frames to/from the wire.
Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later)
results in an unexpected call disconnect.  The problem happens because
newer values in the enum ast_control_frame_type are not consistent between
the branch versions of Asterisk.

For example:
1) v1.4 calls v1.8 (or later) using IAX2

2) v1.8 answers and sends a connected line update control frame.  (on v1.8
AST_CONTROL_CONNECTED_LINE = 22)

3) v1.4 receives the control frame as an end-of-q (on v1.4
AST_CONTROL_END_OF_Q = 22)

4) v1.4 disconnects the call once the receive queue becomes empty.

Several things are done by this patch to fix the problem and attempt to
prevent it from happening again in the future:

* Added a warning at the definition of enum ast_control_frame_type about
how to add new control frame values.

* Made block sending and receiving control frames that have no reason to
go over the wire.

* Extended the connectedline iax.conf parameter to also include the
redirecting information updates.

* Updated the connectedline iax.conf parameter documentation to include a
notice that the parameter must be "no" when the peer is an Asterisk v1.4
instance.

(closes issue AST-1302)

Review: https://reviewboard.asterisk.org/r/3174/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 17:16:42 +00:00
Tzafrir Cohen
8878f38742 indications.conf: add stutter tone; end properly
* If the "stutter" (voicemail indication) tone is indeed a stutter tone,
  and it ends with a constant tone, make sure that it is the dial tone.
  This was done for India (in), Mexico (mx) and the Philippines (ph).
* If no "stutter" tone exists for a country, provide one. This was done for
  Spain (es), Malaysia (my) and Venezuela (ve).

Review: https://reviewboard.asterisk.org/r/3158/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 12:59:04 +00:00
Rusty Newton
c31d664b0a formats/format_wav: enhancing log message "Not a wav file" to be clear on what is supported
Modifying the log message to be more specific as to what is supported. Specifically it seems format_wav supports only PCM encoded versions with a lower-case '.wav' extension.

(closes issues ASTERISK-22310)
Reported by: Jim Credland
Review: https://reviewboard.asterisk.org/r/3188/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-05 22:58:08 +00:00
Kinsey Moore
d824987e9d Logger: Fix handling of absolute paths
This fixes path handling for log files so that an extra / is not
appended to the file path when the path is absolute (begins with /).
This would previously result in different but functionally equivalent
paths in the output of 'logger show channels'.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-05 20:30:53 +00:00
Richard Mudgett
d1b9b7fc77 devicestate: Make ast_devstate_changed_literal() return value and doxygen consistent.
Nothing actually cares about the value anyway.

(closes issue ASTERISK-23178)
Reported by: Jonathan Rose


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 19:48:02 +00:00
Richard Mudgett
d06ec403aa tcptls.c: Made TLS handle a certificate chain file.
Thanks to Guillaume Martres for doing the necessary research to validate
the change.

(closes issue ASTERISK-17727)
Reported by: LN
Patches:
      use_certificate_chain.patch (license #5864) patch uploaded by st
      documente_certificate_chain.patch (license #6576) patch uploaded by Guillaume Martres


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 17:50:04 +00:00
Joshua Colp
3e1ec590f3 res_clialiases: Fix crash when reloading and re-aliasing an alias that is in use.
The code assumed that unregistering the alias would always succeed while in
practice this is not actually true. A common case is the "reload" command itself.
If the cli_aliases.conf configuration file was changed and reload executed the
command would fail to unregister and ultimately point to freed memory.

The reload process now checks whether unregistering succeeded or not and if not
the old CLI alias is retained.

(closes issue ASTERISK-19773)
Reported by: Joel Vandal

(closes issue ASTERISK-22757)
Reported by: Gareth Blades


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 02:19:22 +00:00
Corey Farrell
36771d3004 app_stack: protect against missing parameters to STACK_PEEK and LOCAL_PEEK
STACK_PEEK requires 2 parameters and LOCAL_PEEK requires 1 parameter.  This
protects against situations where those parameters are blank or missing by
logging an error and returning.

(closes issue ASTERISK-23220)
Reported by: James Sharp


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-01 00:22:52 +00:00
Matthew Jordan
c5e4585565 app_dial: Allow macro/gosub pre-bridge execution to occur on priorities
The parsing for the destination of the macro/gosub uses the '^' character to
separate out context, extension, and priority. However, the logic for the
macro/gosub execution was written such that it would only do the actual
macro/gosub jump if a '^' character existed. This doesn't apply when the
macro/gosub jump occurs in a priority/priority label. This patch changes
the logic so that the parsing still occurs, but the jump will occur even
for priorities/priority labels.

(issue ASTERISK-23164)

Review: https://reviewboard.asterisk.org/r/3154


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@407041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-31 23:18:17 +00:00
Corey Farrell
ea65e4d44c res_rtp_asterisk & udptl: fix port selection to work with SELinux restrictions
ast_bind to a port reserved for another program by SELinux causes
errno == EACCES.  This caused random failures when binding rtp or
udptl sockets.  Treat EACCES as a non-fatal error, try next port.

(closes issue ASTERISK-23134)
Reported by: Corey Farrell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-30 20:26:52 +00:00
Russell Bryant
f82e6e93c5 queues.conf.sample Fix documented default for persistentmembers
Closes issue ASTERISK-22662


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-29 00:36:38 +00:00
Kevin Harwell
88794101a9 cdr_radius, cel_radius: build agains libfreeradius-client
Asterisk's RADIUS module currently build against libradiusclient-ng, but this
project has been superseeded by libfreeradius-client. The API is 99% compatible
except that the header name has changed, the library name has changed, and
the configuration file location has changed.

(closes issue ASTERISK-22980)
Reported by: Jeremy Lainé
Patches:
     freeradius-client.patch uploaded by sharky (license 6561)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-28 23:02:38 +00:00
Scott Griepentrog
9ab9f6e6b4 rtp_engine: improved handling of get_rtp_info failure
In ast_rtp_instance_make_compatible(), after a failure of
channel tech call get_rtp_info() to return peer_instance,
the null pointer would be passed to ao2_ref, producing an
error that looked like a refernce counting problem but is
not.  This patch corrects that and adds helpful LOG_ERROR
messages to indicate which failure path occurred.

(issue AST-1276)
Review: https://reviewboard.asterisk.org/r/3156/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-28 16:36:46 +00:00
Russell Bryant
bfd09ecfd4 Allow nested #includes in extconfig.conf
extconfig.conf was hard-coded to not allow nested includes for some reason.
The code has been this way since a patch was merged for ASTERISK-3333 (revision
4889), which was a significant update to this code ("Merge config updates").

I can't figure out any good reason why this should be limited.  This patch just
removes the limit and uses the default nesting depth limit.

Closes issue ASTERISK-17837

Review: https://reviewboard.asterisk.org/r/3159/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-27 20:34:31 +00:00
Russell Bryant
270775ce52 Protect ast_filestream object when on a channel
The ast_filestream object gets tacked on to a channel via
chan->timingdata.  It's a reference counted object, but the reference
count isn't used when putting it on a channel.  It's theoretically
possible for another thread to interfere with the channel while it's
unlocked and cause the filestream to get destroyed.

Use the astobj2 reference count to make sure that as long as this code
path is holding on the ast_filestream and passing it into the file.c
playback code, that it knows it's valid.

Bug reported by Leif Madsen.

Review: https://reviewboard.asterisk.org/r/3135/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-27 01:07:07 +00:00
Richard Mudgett
45b6991b92 tcptls.c: Add missing cleanup on off nominal path.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-26 22:59:35 +00:00
Richard Mudgett
56d694e261 CEL: Protect data structures during reload and shutdown.
The CEL data structures need to be protected during a configuration reload
and shutdown.  Asterisk crashed during a shutdown because CEL events were
still in flight and the CEL data structures were already destroyed.

* Protected the appset and linkedids ao2 containers using the reload_lock.

* Added NULL checks before use of the appset and linkedids ao2 containers
in case the CEL module is already shutdown.

* Fixed overloading of the linkedids held objects reference count.  During
shutdown any held objects would be leaked.

* Fixed memory leak of linkedids held objects if the LINKEDID_END is not
being tracked.  The objects in the linkedids container were not removed if
the LINKEDID_END event is not used.

* Added access protection to the appset container during the CLI "cel show
status" command.

* Made CEL config reload not set defaults if the cel.conf file is invalid.

(closes issue AST-1253)
Reported by: Guenther Kelleter

Review: https://reviewboard.asterisk.org/r/3127/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-24 22:56:09 +00:00
Jonathan Rose
8c63b6d468 res_config_pgsql: Fix a memory leak and use RAII_VAR for cleanup when practical
Review: https://reviewboard.asterisk.org/r/3141/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-24 20:57:50 +00:00
Richard Mudgett
f623b1f1cb manager: Register atexit shutdown routine only once.
* Made register atexit shutdown routine only once in __init_manager().

* Fixed some initial load failure conditions in __init_manager().

* Made reset options to defaults on reload when the reload will actually
happen.

* Fixed the order of unreferencing a session object in session_destroy().

* Removed unnecessary container traversals of the white/black filters
during session_destructor() and manager_free_user().

* ast_free() does not need a NULL check before calling.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-24 20:56:05 +00:00
Scott Griepentrog
16c2728634 pbx.c: Pre-initialize timezone to avoid crash on destroy
In ast_build_timing, initialize the timezone value to NULL
in order to avoid deferencing an uninitialized value later
when calling ast_destroy_timing.  The timezone value could
be uninitialized if ast_build_timing were to fail due to a
zero length time string.

(closes issue ASTERISK-22861)
Reported by: Sebastian Murray-Roberts
Review: https://reviewboard.asterisk.org/r/3134/
Patches:
     ast_build_timing-initialize-timezone.patch uploaded by coreyfarrell (license 5909)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 22:16:47 +00:00
Kinsey Moore
1dd94a2e19 chan_sip: Decline image streams on unsupported transports
This change allows chan_sip to decline individual image streams over
unsupported transports in the SDP of the 200 response. Previously,
an image stream offer with RTP/AVP as the transport would cause
chan_sip to respond with a 488.

(closes issue ASTERISK-22988)
Reported by: adomjan
Original patch by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 18:27:19 +00:00
Walter Doekes
b4023b47d1 manager: Clarify eventfilter documentation. Textual changes only.
Review: https://reviewboard.asterisk.org/r/3133/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21 20:54:19 +00:00
Kinsey Moore
4d70fa4750 chan_mgcp: Enforce locking for oseq
This restricts direct usage of global oseq so that all accesses are
locked and threads are not racing to get oseq values that they did not
claim.

This also fixes a build error in res_pktccops under dev mode.

(closes issue ASTERISK-23100)
Reported by: adomjan
Patch by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21 19:58:48 +00:00
Richard Mudgett
f7fe7d533f chan_dahdi/PRI: Suppress CONNECTED_LINE updates when nothing in the udpate is valid.
* Also simplified some subddress handling code.

(closes issue ASTERISK-23008)
Reported by: Michael Cargile


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-20 21:58:48 +00:00
Rusty Newton
66cce0927e Documentation: doc fixes across various parts of the code for ASTERISK issues 23061,23028,23046,23027
Fixes typos of "transfered" instead of "transferred" in various code. Fixes incorrect gosub param help text for app_queue.
Fixes Asterisk man pages containing unquoted minus signs. Adds note about the "textsupport" option in sip.conf.sample.

(issue ASTERISK-23061)
(issue ASTERISK-23028)
(issue ASTERISK-23046)
(issue ASTERISK-23027)
(closes issue ASTERISK-23061)
(closes issue ASTERISK-23028)
(closes issue ASTERISK-23046)
(closes issue ASTERISK-23027)
Reported by: Eugene, Jeremy Laine, Denis Pantsyrev
Patches:
 transferred.patch uploaded by Jeremy Laine (license 6561)
 hyphen.patch uploaded by Jeremy Laine (license 6561)
 sip.conf.sample.patch uploaded by Eugene (license 6360)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-17 15:39:23 +00:00
Kevin Harwell
d4e353d6bf res_fax: check_modem_rate() returned incorrect rate for V.27
Added some text to UPGRADES.txt about the V.27 mode rate changes in r405656.

(issue ASTERISK-22790)
Reported by: Paolo Compagnini






git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-16 18:52:35 +00:00
Kevin Harwell
affe507d5b res_fax: check_modem_rate() returned incorrect rate for V.27
According to the new standard for V.27 and V.32 they are able to transmit
at a bit rate of 4,800 or 9,600.  The check_mode_rate function needed to be
updated to reflect this.  Also, because of this change the default 'minrate'
value was updated to be 4800.

(closes issue ASTERISK-22790)
Reported by: Paolo Compagnini
Patches:
     res_fax.txt uploaded by looserouting (license 6548)






git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-16 17:27:05 +00:00
Joshua Colp
855fd98528 cel_manager: Don't crash if configuration file is invalid.
The cel_manager module did not properly handle the case where the
configuration file was invalid. The module will now output a warning
message and disable itself if this occurs.

Reported by: Bryan Walters


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-15 16:34:45 +00:00
Scott Griepentrog
097acbdd2c chan_sip: No BYE message sent after INVITE with Replaces
Setting channel state DOWN is an unnecessary step that was
only being done in handle_invite_replaces().  This changes
that by removing the call and reducing locking.

(closes issue ASTERISK-23010)
Reported by: Ryan Tilton
Review: https://reviewboard.asterisk.org/r/3116/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 18:35:13 +00:00
Scott Griepentrog
e2cf92fd96 chan_sip: fix Local From tag on outbound register regression
In ASTERISK-12117, an improvement to insure consistant local from tags
on outbound registrations resulted in an undesirable behavior - caused
by leftover unexpired sip_pvt dialogs (with the previous cseq number),
resulting in many uncessary REGISTER requests.  Instead of significant
rework of transmit_register(), this change deletes the dialogs after a
200 OK response indiciating a successful registration, keeping the old
dialogs from interfering with normal operation.

(closes issue ASTERISK-22946)
Reported by: Stephan Eisvogel
Review: https://reviewboard.asterisk.org/r/3109/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 18:11:03 +00:00
Matthew Jordan
ad821983f8 chan_sip: Hangup transferer/transferee when transfer to Parking fails
When performing a SIP transfer to a Park extension, if the Park fails, chan_sip
will currently not hang up either the transferer or the transfer target. This
results in the channels being orphaned with no thread to service frames,
resulting in stuck channels.

This patch immediately hangs up the two channels if a Park fails.

(closes issue ASTERISK-22834)
Reported by: rsw686

(closes issue ASTERISK-23047)
Reported by: Tommy Thompson

Review: https://reviewboard.asterisk.org/r/3107


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 15:31:08 +00:00
Walter Doekes
9461c4fb5e "Minimun" typo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-09 14:11:29 +00:00
Kinsey Moore
5c4d3ace5b pbx_lua: Add support for Lua 5.2
This adds support for Lua 5.2 in pbx_lua which is available on newer
operating systems.

(closes issue ASTERISK-23011)
Review: https://reviewboard.asterisk.org/r/3075/
Reported by: George Joseph
Patch by: George Joseph


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-08 16:00:22 +00:00
Kinsey Moore
bef76bb243 UPGRADE: Add a note about non-functionality
Add a note that the "retry on 403 response to REGISTER" for chan_sip is
non-functional in the versions in which it was first introduced.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-08 15:40:25 +00:00
Kinsey Moore
745c1a623e Add the missing part of r400140
When the patch to add retry-on-forbidden-response was committed, part
of the patch for chan_sip was not committed which caused the feature to
be entirely nonfunctional. This corrects the code in question.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-07 19:49:27 +00:00
Scott Griepentrog
c9e8f7f0e1 func_strings: fix for memmove patch test
In r404674 the AST_TEST_DEFINE(test_REPLACE) test was added
that made use of a function that doesn't exist in 1.8. This
fixes that by reverting to directly accessing chan varshead.

Reported by: Tzafrir Cohen
(issue ASTERISK-22910)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-06 17:31:31 +00:00
Tzafrir Cohen
475f63b1bd asterisk.c: supress live_dangerously warning on rasterisk
Even since the fixes of AST-2013-007, Asterisk prints the following
warning on startup if the user decided to live dangerously:

  Privilege escalation protection disabled!
  See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.

This message is intended for the logs and interactive startup. No need
for it to appear on a remote console. This commit removes it from there.

(closes issue ASTERISK-23084)
Review: https://reviewboard.asterisk.org/r/3101/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03 22:06:02 +00:00
Kevin Harwell
41f764afa3 cel_pgsql: module not correctly reloading
Upon reload the module unconditionally "unloaded" the module (freeing memory
and setting pointers to NULL) and then when attempting a "load" if the config
file had not changed then nothing would be reinitialized.

By moving the "unload" to occur conditionally (reload only) after an attempted
configuration load, but before module "loading" alleviates the issue. The module
now loads/unloads/reloads correctly.

(closes issue ASTERISK-22871)
Reported by: Matteo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03 21:57:11 +00:00
Kevin Harwell
b3094e976a chan_dahdi: dahdi show channels slices PRI channel dnid on output
dahdi show channels output slices the callerid (which is dnid copied over on
PRI channels). If the channel naming structures look like:

 'DAHDI/i1/1408409XXXX-6'

then the output slices 1408409XXXX down to 1408409XXX. This patch just opens
it up to 15 chars so you can see the whole thing.

(closes issue ASTERISK-22918)
Reported by: outtolunc
Patches:
     svn_chan_dahdi.c.format12_15.diff.txt uploaded by outtolunc (license 5198)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03 18:55:11 +00:00
Kevin Harwell
dcccd11b2e chan_unistim.c, app_meetme: compiler warnings
Fixed a couple of compiler warnings (errors in 'dev-mode') given by gcc
version 4.8.1. The one in app_meetme involved the 'sizeof-pointer-memaccess'
(see: http://gcc.gnu.org/gcc-4.8/porting_to.html) warning. The one in
chan_unistim was issuing an array out of bounds message. Fixed both so
they would no longer issue warnings and can compile again in 'dev-mode'.

Review: https://reviewboard.asterisk.org/r/3098/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-03 18:18:22 +00:00
Scott Griepentrog
3a3bcc56ee func_strings: use memmove to prevent overlapping memory on strcpy
When calling REPLACE() with an empty replace-char argument, strcpy
is used to overwrite the the matching <find-char>.  However as the
src and dest arguments to strcpy must not overlap, it causes other
parts of the string to be overwritten with adjacent characters and
the result is mangled.  Patch replaces call to strcpy with memmove
and adds a test suite case for REPLACE.

(closes issue ASTERISK-22910)
Reported by: Gareth Palmer
Review: https://reviewboard.asterisk.org/r/3083/
Patches:
    func_strings.patch uploaded by Gareth Palmer (license 5169)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-02 19:32:20 +00:00
Kevin Harwell
62930af4b2 cel_pgsql: deadlock on unload and core_event_dispatcher
A deadlock can happen between a thread unloading or reloading the cel_pgsql
module and the core_event_dispatcher taskprocessor thread. Description of
what is happening:

Thread 1 (for example, a netconsole thread):

    a "module reload cel_pgsql" is launched
    the thread enter the "my_unload_module" function (cel_pgsql.c)
    the thread acquire the write lock on psql_columns
    the thread enter the "ast_event_unsubscribe" function (event.c)
    the thread try to acquire the write lock on ast_event_subs[sub->type]

Thread 2 (core_event_dispatcher taskprocessor thread):

    the taskprocessor pop a CEL event
    the thread enter the "handle_event" function (event.c)
    the thread acquire the read lock on ast_event_subs[sub->type]
    the thread callback the "pgsql_log" function (cel_pgsql.c), since it's a subscriber of CEL events
    the thread try to acquire a read lock on psql_columns

(closes issue ASTERISK-22854)
Reported by: Etienne Lessard
Patches:
     cel_pgsql_fix_deadlock_event.patch uploaded by hexanol (license 6394)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-31 21:25:06 +00:00
Scott Griepentrog
0acd8ba992 say.c: correct time for polish
In ast_say_date_with_format_pl(), change ast_say_number() to
use tm_sec instead of tm_mn.

(closes issue ASTERISK-22856)
Reported by: Robert Mordec
Review: https://reviewboard.asterisk.org/r/3082/
Patches:
     say.c.patch uploaded by veilen (license 6555)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@404456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-20 21:12:44 +00:00