Passing an ast_str pointer by value that then calls
ast_str_set(), ast_str_set_va(), ast_str_append(), or
ast_str_append_va() can result in the pointer originally
passed by value being invalidated if the ast_str had
to be reallocated.
This fixes places in the code that do this. Only the
example in ccss.c could result in pointer invalidation
though since the other cases use a stack-allocated ast_str
and cannot be reallocated.
I've also updated the doxygen in strings.h to include
notes about potential misuse of the functions mentioned
previously.
Review: https://reviewboard.asterisk.org/r/2161
........
Merged revisions 375025 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 375026 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 375027 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Update and extend the configuration_file group and enable linking to the application. Update title that was left behind many years ago.
(issue ASTERISK-20259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Add app_skel.c as an example in app.c and fix some formating for the "Dial Privacy scripts" so it actually shows up in the Doxygen output.
(issue ASTERISK-20259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If a format name was not found by ast_getformatbyname, a NULL pointer
would be passed into ast_format_rate and immediately dereferenced.
This ensures that a valid pointer is used since the structure is
already allocated on the stack.
(closes issue DPH-523)
Reported-by: Steve Pitts
........
Merged revisions 374932 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Party A calls Party B
Party B puts Party A on hold.
Party B calls a queue.
Ringing queue member D sees Party B identification.
Party B transfers Party A to the queue.
Queue member D does not get a connected line update for Party A.
Queue member D answers the call and still sees Party B information.
However, if Party A later transfers the call to Party C then queue member
D gets a connected line update for Party C.
* Made pass connected line updates from the caller to queue members while
the queue members are ringing.
(closes issue AST-1017)
Reported by: Thomas Arimont
(closes issue ABE-2886)
Reported by: Thomas Arimont
Tested by: rmudgett
........
Merged revisions 374801 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
........
Merged revisions 374802 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 374803 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 374804 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Thank's to Neil Tallim (flan)'s tireless testing, issue reporting, and patches
it became clear that app_confbridge had some complex logic in how it handled
interactions between marked, waitmarked, and unmarked users. In particular,
there were some areas in which the interactions between the users resulted
in inconsistent behavior, and app_confbridge was missing logic in how to handle
some corner cases. Some areas included:
* Poor handling of mixing unmarked and waitmarked users
* Inconsistencies in how MOH and muting was applied to various users
* Handling of various announcements for different user profile options
flan's patches seem to fix the various issues, but highlighted how hard the
code could be to maintain. In an attempt to make things easier to maintain and
to more fully enumerate the various cases that exist, this patch breaks up the
logic into a state machine-like setup.
Please note that the various state transitioned are documented on the Asterisk
wiki:
https://wiki.asterisk.org/wiki/display/AST/Confbridge+state+changes
Review: //https://reviewboard.asterisk.org/r/2072/
Note that for the following issues, mjordan uploaded the patch, although it
was written by twilson. Any contributor license discrepency is due to that.
(closes issue ASTERISK-19562)
Reported by: flan
Tested by: flan, mjordan, jrose
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-19726)
Reported by: flan
Tested by: flan
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-20181)
Reported by: Jonathan White
Tested by: Jonathan White
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
........
Merged revisions 374652 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 374657 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Greenlight in #asterisk brought up that he was receiving an error message "Could
not create persistent member string, out of space" when running app_queue in
Asterisk 10. dump_queue_members() made an assumption that 8K would be enough to
store the generated string, but with queues that have large member lists this is
not always the case. This patch removes the limitation and uses ast_str instead
of a fixed sized buffer.
The complicating factor comes from the fact that ast_db_get requires a buffer
and buffer size argument, which doesn't let us pull back more than what we pass
in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
copy of the value from astdb.
As an aside, I did some testing on the maximum size of data that we can store in
the BDB library we distribute and was able to store a 10MB string and retrieve
it with no problems, so I feel this is a safe patch.
Review: https://reviewboard.asterisk.org/r/2136/
........
Merged revisions 374108 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 374135 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 374150 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* The following dialplan applications now recognize 'W' to pause sending
DTMF for one second in addition to the previously existing 'w' that paused
sending DTMF for half a second. Dial, ExternalIVR, and SendDTMF.
* The chan_dahdi analog port dialing and deferred DTMF dialing for PRI now
distinguishes between 'w' and 'W'. The 'w' pauses dialing for half a
second. The 'W' pauses dialing for one second.
* Created dahdi_dial_str() in chan_dahdi that eliminated a lot of
duplicated dialing code and diagnostic messages for the channel driver.
(closes issue ASTERISK-20039)
Reported by: Jeremiah Gowdy
Patches:
jgowdy-wait-6-22-2012.diff (license #5621) patch uploaded by Jeremiah Gowdy
Expanded patch to add support in chan_dahdi.
Tested by: rmudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds an optional header to the PlayDTMF AMI action, Duration.
It allows the duration of the DTMF digit to be played on the channel to be
specified in milliseconds.
(closes issue ASTERISK-18172)
Reported by: Renato dos Santos
patches:
send-dtmf.patch uploaded by Renato dos Santos (license #6267)
Modified slightly for this commit for Asterisk 12.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Currently, if there are modifications to mailboxes that Asterisk is
not aware of, the user needs to add "pollmailboxes" to their mailbox
configuration, which repeatedly polls the subscribed mailboxes for
changes. This results in a lot of extra work for the CPU. This patch
introduces the AMI command VoicemailRefresh which permits external
applications to trigger the refresh themselves. The refresh can apply
to a specified mailbox only, an entire context, or all configured
mailboxes. Even a refresh performed on every mailbox would not consume
as much CPU as the pollmailboxes option, given that pollmailboxes runs
continuously and this only runs on demand.
(closes issue ASTERISK-17206)
(closes issue ASTERISK-19908)
Reported-by: Jeff Hutchins
Reported-by: Tilghman Lesher
Patch-by: Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Fix previously untested senarios;
1). On queue initialisation set queue_avail devstate to INUSE.
Previously was unavailable, which indicated an agent was available.
2). When removing members, if there are no other members available, set queue_avail to INUSE.
Previously, if a member interface had become 'unavailable', they were never going to be removed, particularly when persistant queues is enabled.
3). When adding a member, check that they are available, if they are set queue_avail to NOT_INUSE.
Previously on reloaded, members may have been 'unavailable'.
4). When pausing or unpausing a member, set appropriate queue availability.
alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis
Review: https://reviewboard.asterisk.org/r/2129/
........
Merged revisions 373804 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change
(issue ASTERISK-20259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style. Some missing txt file links are removed but their content or essense will be included in some later updates. A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.
Further updates coming.
(issue ASTERISK-20259)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When using the 'e' or 'E' option to MeetMe the configured conference bridges are loaded and examined to see
if any are empty. If no conference bridges are empty the caller is prompted to enter the number of one.
This operation left around a pointer to the last created conference bridge still containing participants.
When the caller that was not able to find any empty conference bridge hung up this pointer was disposed of
and the reference count of the conference bridge decremented. If there was only a single participant in the
conference bridge it was ultimately destroyed prematurely.
(closes issue AST-994)
Reported by: John Bigelow
........
Merged revisions 373242 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 373245 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 373246 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Alec's patch in r373188 added the ability to subscribe to a hint for when
Queue members are available. This patch modifies the check that determines
when a Queue member is available by refactoring the availability checks in
num_available_members into a shared function is_member_available. This
should now handle the ringinuse option, as well as device state values
other than AST_DEVICE_NOT_INUSE.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* ASTERISK-20383
Missing named call pickup group features:
CHANNEL(callgroup) - Need CHANNEL(namedcallgroup)
CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup)
Pickup() - Needs to also select from named pickup groups.
* ASTERISK-20384
Using the pickupexten, the pickup channel selection could fail even though
there was a call it could have picked up. In a call pickup race when
there are multiple calls to pickup and two extensions try to pickup a
call, it is conceivable that the loser will not pick up any call even
though it could have picked up the next oldest matching call.
Regression because of the named call pickup group feature.
* See ASTERISK-20386 for the implementation improvements. These are the
changes in channel.c and channel.h.
* Fixed some locking issues in CHANNEL().
(closes issue ASTERISK-20383)
Reported by: rmudgett
(closes issue ASTERISK-20384)
Reported by: rmudgett
(closes issue ASTERISK-20386)
Reported by: rmudgett
Tested by: rmudgett
Review: https://reviewboard.asterisk.org/r/2112/
........
Merged revisions 373220 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Sets INUSE when no free agents, NOT_INUSE when an agent is free.
modifes handle_statechange() scan members loop to scan for a free agent
and updates the Queue:queuename_avial devstate.
Previously exited early if the member was found in the queue.
Now Exits later when both a member was found, and a free agent was found.
alecdavis (license 585)
Reported by: Alec Davis
Tested by: alecdavis
Review: https://reviewboard.asterisk.org/r/2121/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The AMI action VoicemailUsersList VoicemailUserEntry event headers
ServerEmail and MailCommand did not report the global values if they were
not overridden. The VoicemailUserEntry event header ServerEmail was not
populated with the global value if the voicemail user did not override it.
The VoicemailUserEntry event header MailCommand was never populated with a
value.
* Removed unused struct ast_vm_user member mailcmd[].
(closes issue AST-973)
Reported by: John Bigelow
Tested by: rmudgett
........
Merged revisions 372620 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372621 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372622 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When MiniVM sends an e-mail and it has the volgain option set, it will spawn
sox in a separate process to handle the manipulation of the sound file. In
doing so, it creates a temporary file. There are two problems here:
1) The file descriptor returned from mkstemp is leaked
2) The finalfilename character pointer points to a buffer that loses scope
once volgain processing is finished.
Note that in r316265, Russell fixed some gcc warnings by using the return
value of the mkstemp call. A warning was placed in minivm that the file
descriptor was going to be leaked. This patch reverts that change, as it
handles the leak and 'uses' the file descriptor returned from mkstemp.
(closes issue ASTERISK-17133)
Reported by: Tzafrir Cohen
patches:
minivm_18501_demo.diff uploaded by Tzafrir Cohen (license #5035)
........
Merged revisions 372554 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372555 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372556 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The Status: header in a QueueMemberStatus event (and other QueueMember* events)
is the numeric value of the device state corresponding to that Queue Member.
As those values are not exactly obvious, listing them in the documentation is
useful.
Matt Riddell reported this indirectly through the wiki page.
(closes issue ASTERISK-20243)
Reported by: Matt Riddell
........
Merged revisions 372531 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When parsing a 'number' defined in followme.conf, FollowMe previously parsed
the number in the configuration file into a buffer with a length of 90
characters. This can artificially limit some parallel dial scenarios. This
patch allows for numbers of any length to be defined in the configuration
file.
Note that Clod Patry originally wrote a patch to fix this problem and received
a Ship It! on the JIRA issue. The patch originally expanded the buffer to 256
characters. Instead, the patch being committed duplicates the string in the
config file on the stack before parsing it for consumption by the application.
(closes issue ASTERISK-16879)
Reported by: Clod Patry
Tested by: mjordan
patches:
followme_no_limit.diff uploaded by Clod Patry (license #5138)
Slightly modified for this commit.
........
Merged revisions 372390 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372391 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372392 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This work comes courtesy of Pedro Kiefer (License #6407)
The work was posted to review board by Kaloyan Kovachev (License #5506)
(closes issue ASTERISK-16668)
Reported by Grant Crawshay
(closes issue ASTERISK-16694)
Reported by Fred van Lieshout
(closes issue ASTERISK-18417)
Reported by Kostas Liakakis
(closes issue ASTERISK-19435)
Reported by Deon George
(closes issue ASTERISK-20157)
Reported by Pedro Kiefer
(closes issue ASTERISK-20158)
Reported by Pedro Kiefer
(closes issue ASTERISK-20224)
Reported by Pedro Kiefer
Review: https://reviewboard.asterisk.org/r/2075
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes two memory leaks:
1. When find_user is called with NULL as its first parameter, the voicemail
user returned is allocated on the heap. The inboxcount2 function uses
find_user in such a fashion when counting new messages, and fails to free
the resulting voicemail user object.
2. When populate_defaults is called on a voicemail user, it wipes whatever
flags have been set on the object by copying over the global flags object.
If the VM_ALLOCED flag was ste on the voicemail user prior to doing so,
that flag is removed. This leaks the voicemail user when free_user is later
called.
(closes issue ASTERISK-19155)
Reported by: Filip Jenicek
patches:
asterisk.patch2 uploaded by Filip Jenicek (license 6277)
Patch slightly modified for this commit.
Review: https://reviewboard.asterisk.org/r/2096
........
Merged revisions 372268 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372288 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372289 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to this patch, if pause or unpause was issued on an interface
without specifying a specific queue, a PAUSEALL or UNPAUSEALL event
would be logged in the queue log even if that interface wasn't a
member of any queues. This patch changes it so that these events are
only logged when at least one member of any queue exists for that
interface.
(closes issue AST-946)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2079/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When app_queue is unloaded, the queues container has its refcount
decremented, potentially to 0. Then the taskprocessor responsible
for handling device state changes is unreferenced. If the
taskprocessor happens to be just about to run its task, then it
will create and destroy an iterator on the queues container.
This can cause the refcount on the queues container to increase to
1 and then back to 0. Going back to 0 a second time results in
double frees.
This failure was seen periodically in the testsuite when Asterisk
would shut down.
........
Merged revisions 372089 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372090 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372091 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Queue member status would not always get updated properly when the member
was called, thus resulting in the member getting multiple calls. With this
change, we update the member's status at the time of calling, and we also
check to make sure the member is still available to take the call before
placing an outbound call.
(closes issue ASTERISK-16115)
reported by nik600
Patches:
app_queue.c-svn-r370418.patch uploaded by Italo Rossi (license #6409)
........
Merged revisions 372048 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 372049 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 372050 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes numerous doxygen warnings across Asterisk. It also updates
the makefile to regenerate the doxygen configuration on the local system
before running doxygen to help prevent warnings/errors on the local system.
Much thanks to Andrew for tackling one of the Asterisk janitor projects!
(issue ASTERISK-20259)
Reported by: Andrew Latham
Patches:
doxygen_partial.diff uploaded by Andrew Latham (license 5985)
make_progdocs.diff uploaded by Andrew Latham (license 5985)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If a static queue had realtime members, then there could be a potential
for those realtime members not to be properly deleted from memory.
If the queue's members were loaded from realtime and then all the
members were deleted from the backend, then the queue would still
think these members existed. The reason was that there was a short-
circuit in code such that if there were no members found in the
backend, then the queue would not be updated to reflect this.
Note that this only affected static queues with realtime members.
Realtime queues with realtime members were unaffected by this issue.
(closes issue ASTERISK-19793)
reported by Marcus Haas
........
Merged revisions 371306 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 371313 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 371324 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371325 65c4cc65-6c06-0410-ace0-fbb531ad65f3