Commit Graph

22223 Commits

Author SHA1 Message Date
Michael L. Young
d84e70a95c Turn off warning message when bind address is set to any.
When a bind address is set to an ANY address (udpbindport=::), a warning message
is displayed stating that "Address remapping activated in sip.conf but we're
using IPv6, which doesn't need it.  Please remove 'localnet' and/or 'externaddr'
settings."  But if one is running dual stack, we shouldn't be told to turn those
settings off.

This patch checks if the bind address is an ANY address or not.  The warning
message will now only be displayed if the bind address is NOT an ANY address and
IPv6 is being used.

Also, updated the copyright year.

(closes issue ASTERISK-19456) 
Reported by: Michael L. Young 
Tested by: Michael L. Young 
Patches: 
  chan_sip_ipv6_message.diff uploaded by Michael L. Young (license 5026)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 02:37:21 +00:00
Matthew Jordan
7a72dc706a Fix negative return handling in channel drivers
In chan_agent, while handling a channel indicate, the agent channel driver
must obtain a lock on both the agent channel, as well as the channel the
agent channel is using.  To do so, it attempts to lock the other channel
first, then unlock the agent channel which is locked prior to entry into
the indicate handler.  If this unlock fails with a negative return value,
which can occur if the object passed to agent_indicate is an invalid ao2
object or is NULL, the return value is passed directly to strerror, which
can only accept positive integer values.

In chan_dahdi, the return value of dahdi_get_index is used to directly
index into the sub-channel array.  If dahd_get_index returns a negative
value, it would use that value to index into the array, which could cause
an invalid memory access.  If dahdi_get_index returns a negative number,
we now default to SUB_REAL.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16 21:56:35 +00:00
Matthew Jordan
0da3b6c793 Fix handling of negative return code when storing voicemails in ODBC storage
When storing a voicemail message using an ODBC connection to a database, the
voicemail message is first stored on disk.  The sound file associated with
the message is read into memory before being transmitted to the database.
When this occurs, a failure in the C library's lseek function would cause a
negative value to be passed to the mmap as the size of the memory map to
create.  This would almost certainly cause the creation of the memory map to
fail, resulting in the message being lost.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16 21:37:20 +00:00
Matthew Jordan
b3a38a51c7 Check for IO stream failures in various format's truncate/seek operations
For the formats that support seek and/or truncate operations, many of
the C library calls used to determine or set the current position indicator
in the file stream were not being checked.  In some situations, if an error 
occurred, a negative value would be returned from the library call.  This
could then be interpreted inappropriately as positional data.

This patch checks the return values from these library calls before
using them in subsequent operations.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16 19:30:16 +00:00
Jonathan Rose
6afefc4eb1 Make ForkCDR e option not set end time of the newly forked CDR log
Prior to this patch, ForkCDR's e option would immediately set the end time of the forked
CDR to that of the CDR that is being terminated. This resulted in the new CDR's end time
being roughly the same as it's beginning time (which is in turn roughly the same as the
original's end time).

(closes issue ASTERISK-19164)
Reported by: Steve Davies
Patches:
	cdr_fork_end.v10.patch uploaded by Steve Davies (license 5012)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-13 15:54:01 +00:00
Jonathan Rose
680b627906 Send relative path named recordings to the meetme directory instead of sounds
Prior to this patch, no effort was made to parse the path name to determine a proper
destination for recordings of MeetMe's r option. This fixes that.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@362079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-13 15:21:20 +00:00
Kinsey Moore
7a33e9ba9d Make trunkfreq take effect when set
Previously, setting trunkfreq had no effect on initial load or on reload and
only ever used the default value.  This causes trunkfreq to be used 
appropriately on initial load and reload.

(closes issue ASTERISK-19521)
Patch-by: Jaco Kroon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12 16:18:22 +00:00
Kinsey Moore
3bb065e39a Simplify build system architecture optimization
This change to the build system rips out any usage of PROC along with
architecture-specific optimizations in favor of using -march=native where it is
supported.  This fixes broken builds on 64bit Intel systems and results in
better optimized code on systems running GCC 4.2+.

Review: https://reviewboard.asterisk.org/r/1852/
(closes issue ASTERISK-19462)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12 14:26:06 +00:00
Richard Mudgett
b856533029 Prevent invalid access of free'd memory if DAHDI channel during an MWI event
In the MWI processing loop, when a valid event occurs the temporary caller ID
information is deallocated.  If a new DAHDI channel is successfully created,
the event is passed up to the analog_ss_thread without error and the loop
exits.  If, however, the DAHDI channel is not created, then the caller ID
struct has been free'd, and the gains reset to their previous level.  This
will almost certainly cause an invalid access to the free'd memory, either
in subsequent calls to callerid_free or calls to callerid_feed.

* Rework the -r361705 patch to better manage the cs and mtd allocated
resources.

* Fixed use of mwimonitoractive flag to be correct if the mwi_thread()
fails to start.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-10 21:43:53 +00:00
Matthew Jordan
40beb62845 Fix crash caused by unloading or reloading of res_http_post
When unlinking itself from the registered HTTP URIs, res_http_post could
inadvertently free all URIs registered with the HTTP server.  This patch
modifies the unregister method to only free the URI that is actually
being unregistered, as opposed to all of them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-10 19:57:06 +00:00
Matthew Jordan
c359eeb9c6 Allow func_curl to exit gracefully if list allocation fails during write
If the global_curl_info data structure could not be allocated, the
datastore associated with the operation would be free'd, but the function
would not return.  This would later dereference the datastore, almost
certainly causing Asterisk to crash.  With this patch, if the data
structure is not allocated the method will return an error code, and
not attempt any further operation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 21:44:03 +00:00
Matthew Jordan
246ad9bf0d Prevent invalid access of free'd memory if DAHDI channel during an MWI event
In the MWI processing loop, when a valid event occurs the temporary caller ID
information is deallocated.  If a new DAHDI channel is successfully created, 
the event is passed up to the analog_ss_thread without error and the loop
exits.  If, however, the DAHDI channel is not created, then the caller ID
struct has been free'd, and the gains reset to their previous level.  This
will almost certainly cause an invalid access to the free'd memory, either
in subsequent calls to callerid_free or calls to callerid_feed.

This patch makes it so that we only free the caller ID structure if a
DAHDI channel is successfully created, and we bump the gains back up
if we fail to make a DAHDI channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 20:45:24 +00:00
Matthew Jordan
41f3d27d20 Change SHARED function to use a safe traversal when modifying a variable
When the SHARED function modifies a variable, it removes it from its list of
variables and reinserts the new value at the head of the list of variables.
Doing this inside a standard list traversal can be dangerous, as the
standard list traversal does not account for the list being changed.  While
the code in question should not cause a use after free violation due to its
breaking out of the loop after freeing the variable, it could lead to a
maintenance issue if the loop was modified.  This also fixes a violation
reported by a static analysis tool, which also makes this code easier to
maintain in the future. 



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 19:42:17 +00:00
Matthew Jordan
1d3ba1f2a7 Fix memory leak in res_calendar_ews when event email address node is empty
If the XML calendar data returned by a Microsoft Exchange Web Service
specifies an XML Event E-Mail Address ("EmailAddress"), and no e-mail address
is provided, a condition existed where an ast_calendar_attendee struct would
be allocated but not appended to the list of attendees.  Because of that,
the memory associated with the attendee would never be freed.  This patch
frees the memory if no e-mail address is provided.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 21:50:43 +00:00
Matthew Jordan
304af5d7cc Fix memory leak when using MeetMeAdmin 'e' option with user specified
A memory leak/reference counting leak occurs if the MeetMeAdmin 'e' command
(eject last user that joined) is used in conjunction with a specified user.
Regardless of the command being executed, if a user is specified for the
command, MeetMeAdmin will look up that user.  Because the 'e' option kicks
the last user that joined, as opposed to the one specified, the reference to
the user specified by the command would be leaked when the user variable
was assigned to the last user that joined.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 20:31:39 +00:00
Kinsey Moore
4148e51555 Add missing newlines to CLI logging
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 18:09:19 +00:00
Paul Belanger
be62cac9ee Fix typo in svn:keywords
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 16:27:30 +00:00
Paul Belanger
d521fa4af3 Fix typo in svn:keywords
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 16:24:36 +00:00
Russell Bryant
5fcb78840f Remove a few more files related to chan_usbradio and app_rpt.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 15:47:22 +00:00
Matthew Jordan
5c318b19c2 Fix a typo in the warning messages for an ignored media stream
Added a '\n' to the warning messages when we ignore a media stream due to the
port number being '0'.

(closes issue ASTERISK-19646)
Reported by: Badalian Vyacheslav


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 14:01:03 +00:00
Kinsey Moore
ab87db4419 Remove unnecessary error message in app_dial.c
The error message for failure to stop autoservice after a gosub or macro call
during a dial was removed for macro while Asterisk 1.4 was still being actively
developed. The corresponding gosub error message was never removed.

(closes issue ASTERISK-19551)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 13:30:40 +00:00
Jonathan Rose
3560b4a9b5 Fix MusicOnHold in MeetMe so that it always uses the class if it's been defined
There were a few instances of restarting music on hold in meetme that would cause
Asterisk to revert to the default class of music on hold for no adequate reason.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-05 16:36:27 +00:00
Jonathan Rose
78e9a8e5f0 Fix some stuff involving calls to memcpy and memset
The important parts of the patch were already applied through other updates.

(closes issue ASTERISK-19445)
Reported by: Makoto Dei
Patches:
	memset-memcpy-length.patch uploaded by Makoto Dei (license 5027)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 19:52:05 +00:00
Jonathan Rose
04756101e0 Make 'help devstate change' display properly (get rid of excess comma)
(closes issue ASTERISK-19444)
Reported by: Makoto Dei
Patches:
	devstate-change-usage-truncate.patch uploaded by Makoto Dei (license 5027)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 19:18:31 +00:00
Jonathan Rose
ed76cdda72 Replace GNU old-style field designator extensions to fix clang warnings
(issue ASTERISK-19540)
Reported by: Makoto Dei
Patches:
	clang-gnu-designator.patch uploaded by Makoto Dei (license 5027)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 16:29:18 +00:00
Jonathan Rose
abd7fa4476 Make the MeetMeAdmin N command (mute all nonadmins) not mute admins
(Closes Issue ASTERISK-19335)
Reported by: Johan Wilfer
Review: https://reviewboard.asterisk.org/r/1843/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 13:26:45 +00:00
Kinsey Moore
b1152d145f Fix the display of documentation for Transfer
This came up while fixing documentation generation for many other cases where
the argument separator was not being displayed properly.  Now that it is
displayed properly, it shows up in the wrong place for Transfer since the '/'
is only required if Tech is present.

(related to issue ASTERISK-18168)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-03 20:08:10 +00:00
Kinsey Moore
063aa93c46 Stop sending out RTCP if RTP is inactive
This change prevents Asterisk from sending RTCP receiver reports during a
remote bridge since it is no longer receiving media and should not be
reporting anything.

(related to ASTERISK-19366)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-02 22:18:17 +00:00
Richard Mudgett
1df90a2cf1 Fix logger deadlock on Asterisk shutdown.
The logger_thread() had an exit path that failed to release the logmsgs
list lock.

* Make logger_thread() exit path unlock the logmsgs list lock.

* Made ast_log() not queue any messages to the logmsgs list if the
close_logger_thread flag is set.

(issue ASTERISK-19463)
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-30 21:26:47 +00:00
Mark Michelson
82fbd4a401 Fix potential race condition during call pickup.
Prior to this patch, a connected line update was queued during
call pickup and then an answer frame was queued. The original
caller would presumably then have his connected line updated
and then the call would be answered.

In actuality, the answer frame was not how the call ended up
being answered. Rather, an odd section in app_dial that checks
if the called channel's state is up.

The result is that the order of the connected line update and
the answer were variable. In most cases, this wasn't actually
a bad thing. However, if the 'I' option was passed to dial, the
connected line update would be inhibited.

The fix is to queued the connected line after the answer frame is
queued. This way the race in app_dial is between two
conditions resulting in an answer. This way the connected line
update occurs after the answer every time.

(closes issue ASTERISK-19183)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
    Mark Michelson
Patches:
    ASTERISK-19183.patch uploaded by Mark Michelson (license 5049)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 23:32:35 +00:00
Mark Michelson
58565827e6 Improve accuracy of identifying information sent in dialog-info SIP NOTIFY requests.
This change makes use of connected party information in addition to caller ID in order
to populate local and remote XML elements in the dialog-info NOTIFYs.

(closes issue ASTERISK-16735)
Reported by: Maciej Krajewski
Tested by: Maciej Krajewski
Patches:
    local_remote_hint2.diff uploaded by Mark Michelson (license 5049)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 23:04:05 +00:00
Terry Wilson
d58fe85724 Destroy configs when they are no longer used
https://reviewboard.asterisk.org/r/1834/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-28 19:06:03 +00:00
Mark Michelson
390e8c1f73 Make a debug message regarding subscription changes more accurate.
I was getting confused during some testing why Asterisk was saying that
a subscription was being added when it was clearly being removed. This
fixes that confusion.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-27 16:59:34 +00:00
Jonathan Rose
fe267f5925 Updates config with bootstrap where I changed configure.ac in r360488
(issue ASTERISK-17842)
Reported by: Bryon Clark


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-27 14:32:40 +00:00
Jonathan Rose
aa74e83c19 Fix BETTER_BACKTRACES library detection for Fedora/RedHat/CentOS
(closes ASTERISK-17842)
Reported by: Bryon Clark
Patches:
	20110512__issue19278.diff.txt uploaded by Tilghman Lesher (license 5003)
	configure_bfd_with_dl_and_iberty.patch uploaded by Bryon Clark (license 6157)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-26 19:35:31 +00:00
Paul Belanger
165789485e Update CHANGES for r360471
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-26 18:37:59 +00:00
Paul Belanger
bcf902419e Fix Asterisk version typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-26 18:32:54 +00:00
Paul Belanger
df02086396 Increase verbosity level for ast_verb messages
While this does not fix the issue of the CLI being flooded by 'doing
dnsmgr_lookup' messages, increasing the verbosity level above 5 should help
minimize it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-26 18:25:45 +00:00
Russell Bryant
e068e29190 func_curl: Fix leak of an ast_str in error handling code path.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 23:46:16 +00:00
Russell Bryant
dea36a06bb app_page: Fix a memory leak on every Page().
dial_list is a dynamically allocated array that is allocated at the beginning
of Page() based on how many devices will be dialed.  This was never being freed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 03:07:48 +00:00
Russell Bryant
093121050f app_jack: fix datastore memory leak in error handling path.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 03:01:20 +00:00
Russell Bryant
2b2c5f27fc Rebuild parsers.
This is needed to include the last fix to main/ast_expr2.y.  The changes look
much bigger as this regeneration of the code was done with newer versions of
flex and bison.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 02:34:39 +00:00
Russell Bryant
17cd5abb22 expression parser: Fix (theoretical) memory leak.
Fix a memory leak that is very unlikely to actually happen.  If a malloc()
succeeded, but the following strdup() failed, the memory from the original
malloc() would be leaked.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 02:33:36 +00:00
Richard Mudgett
c04afdbc70 Make number not available presentation also set screening to network provided.
Q.951 indicates that when the presentation indicator is "Number not
available due to interworking" for a number then the screening indicator
field should be "Network provided".

* Made ast_party_id_presentation() return AST_PRES_NUMBER_NOT_AVAILABLE
when the presentation is "Number not available due to interworking".  This
fix makes Asterisk consistent and it also makes it consistent with earlier
branches as far as this presentation value is concerned.

* Made pri_to_ast_presentation() and ast_to_pri_presentation() conversions
handle the "Number not available due to interworking" case better in
sig_pri.c.  This change is possible because the minimum required libpri
version (v1.4.11) has the necessary defines in libpri.h.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 00:35:25 +00:00
Richard Mudgett
f9246f83c9 Add missing initialization of update_redirecting in chan_sip.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-23 22:47:05 +00:00
Jonathan Rose
94b6251ea2 Update install_prereq script to include missing GSM library for debian amd move SQLite3.
(closes issue ASTERISK-19367)
Reported by: Andrew Latham
Patches:
	debian_install_prereq.diff uploaded by Andrew Latham (license 5985)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-21 14:51:14 +00:00
Tzafrir Cohen
00dc354511 Also detect gmime 2.6
Also detect gmime version 2.6 (Michael Biebl)

Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen@xorcom.com>

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-21 13:19:41 +00:00
Matthew Jordan
cfdc12387b Ensure Asterisk sends a BYE when pending on the final response to a re-INVITE
When Asterisk detects a hangup and cannot send a BYE due to a pending
INVITE, it sets the pendingbye flag and waits for the final response to that
INVITE.  When the response is received, it transmits the BYE.  If, however,
that INVITE request is a pending re-INVITE, it needs to first send a CANCEL
request to terminate the pending re-INVITE.  In that circumstance, Asterisk
was, in some scenarios, clearing the pendingbye flag after processing the
CANCEL request and not checking for a pending BYE when receiving the final
487 response to the INVITE.

This patch ensures that if the pendingbye flag is set, it is honored
regardless of the nature of the INVITE request currently in flight.

(closes issue ASTERISK-19365)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
  bugASTERISK-19365_2012_03_08.patch uploaded by mjordan (license 6283)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-21 13:19:21 +00:00
Kinsey Moore
a25e2ad59c Prevent Echo() from relaying control, null, and modem frames
Echo()'s description states that it echoes audio, video, and DTMF except for #
while it actually echoes any frame that it receives other than DTMF #.  This
was causing frame storms in the test suite in some circumstances where Echo()
was attached to both ends of a pair of local channels and control frames
were being periodically generated.  Echo()'s behavior and description have
been modifed so that it only echoes media and non-# DTMF frames.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 20:32:55 +00:00
Richard Mudgett
8dc6345d0f Allow AMI action callback to be reentrant.
Fix AMI module reload deadlock regression from ASTERISK-18479 when it
tried to fix the race between calling an AMI action callback and
unregistering that action.  Refixes ASTERISK-13784 broken by
ASTERISK-17785 change.

Locking the ao2 object guaranteed that there were no active callbacks that
mattered when ast_manager_unregister() was called.  Unfortunately, this
causes the deadlock situation.  The patch stops locking the ao2 object to
allow multiple threads to invoke the callback re-entrantly.  There is no
way to guarantee a module unload will not crash because of an active
callback.  The code attempts to minimize the chance with the registered
flag and the maximum 5 second delay before ast_manager_unregister()
returns.

The trunk version of the patch changes the API to fix the race condition
correctly to prevent the module code from unloading from memory while an
action callback is active.

* Don't hold the lock while calling the AMI action callback.

(closes issue ASTERISK-19487)
Reported by: Philippe Lindheimer

Review: https://reviewboard.asterisk.org/r/1818/
Review: https://reviewboard.asterisk.org/r/1820/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@359979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 17:21:16 +00:00