This was essentially duplicated functionality where normal channels used
AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used
AST_FLAG_ANSWERED_ELSEWHERE. This removes the flag and converts that usage
into AST_CAUSE_ANSWERED_ELSEWHER usage.
Review: https://reviewboard.asterisk.org/r/1944
(closes issue ASTERISK-19865)
Patch-by: Birger Harzenetter
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Revision 351130 broke corect HANGUPCAUSE setting
for the 404 case in chan_sip. Other cases were also
potentially broken. This patch fixes the relaying
of causes to be what they used to be.
(closes issue ASTERISK-19914)
Reported by Pavel Troller
Tested by Walter Doekes (via a reviewboard test to be committed later)
Patches:
chan_sip.diff uploaded by Pavel Troller (license #6302)
........
Merged revisions 368498 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 368499 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.
Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.
Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.
chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.
Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.
Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Asterisk should not accept SDP offers that contain unknown RTP profiles (for
audio/video streams) or unknown top-level media types. When it does, it answers
with an SDP that does not match the offer properly, and this will nearly
always result in a broken call. This patch causes such offers to be rejected.
Review: https://reviewboard.asterisk.org/r/1811/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* 'Unsupported media type' is only reported when that is in fact the case,
not when a supported media type is included in an 'm' line that has an
invalid format.
* All warning messages related to parsing 'm' lines now include the 'm' line contents.
* (minor bugfix) newline added to port-number-zero warning messages.
* Warning messages improved to use RFC-specified terminology for various items.
* Warnings for offers that include more than one port for a single media type now
include the media type.
Review: https://reviewboard.asterisk.org/r/1811/
........
Merged revisions 368218 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 368267 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When Asterisk servers are set up back-to-back, and
direct media is to be used betweeen endpoints, it is
fairly common for the two Asterisk servers to send
direct media reinvites to each other simultaneously.
This results in 491s and ACKs being exchanged between
the servers. While the media eventually gets set up
properly, the problem is that there can be a noticeable
delay for the streams to stabilize.
This patch adds a new directmedia option called "outgoing".
With this set, an immediate direct media reinvite will only
be sent if the call direction is outgoing. For incoming
dialogs, an immediate direct media reinvite will not be sent,
but further "reactionary" direct media reinvites may be sent.
Review: https://reviewboard.asterisk.org/r/1954
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When a skinny session is unregistered, the corresponding device pointer is set
to NULL in the channel private data. If the client was not in the on-hook state
at the time the connection was closed, the device pointer can later be
dereferened if a message or channel event attempts to use a line's pointer to
said device.
The patches prevent this from occurring by checking the line's pointer in
message handlers and channel callbacks that can fire after an unregistration
attempt.
(closes issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Damien Wedhorn
Patches:
AST-2012-008-1.8.diff uploaded by mjordan (license 6283)
AST-2012-008-10.diff uploaded by mjordan (licesen 6283)
........
Merged revisions 367844 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Made schedule_delivery() set the received frame f->data.ptr to NULL if
the datalen is zero.
* Fix queue_signalling() memcpy() size error.
* Made queue_signalling() not use C++ keyword variable names.
(closes issue ASTERISK-19597)
Reported by: mgrobecker
Patches:
jira_asterisk_19597_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett, Michael L. Young
........
Merged revisions 367781 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 367782 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The pvt_sip allowtransfer was not being set to that of the peer's setting.
Therefore, the global allowtransfer setting was being used instead which would
lead to calls not being transfered if the global setting was set to 'no' despite
the setting on the peer being 'yes' and vice versa, calls would be allowed to
transfer even if the peer's setting was 'no' but the global setting was 'yes'.
(Closes issue ASTERISK-19856)
Reported by: Jacek
Tested by: Michael L. Young, Jacek
Patches:
issue-asterisk-19856-branch10-v3.diff uploaded by
Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/1923/
........
Merged revisions 367730 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 367731 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When remotely bridging calls with directmedia, Asterisk would check
the address of the peers/users holding directmedia ACLs (set via
directmediapermit/directmediadeny) instead of the bridged peer. This
is similar to r366547, but trunk specific and involves changes to
the rtpengine instead of just chan_sip.
(closes issue AST-876)
review: https://reviewboard.asterisk.org/r/1924/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Previously, MWI logic utilized a counter called 'lastmsgssent' to know whether
or not MWI NOTIFY requests had been sent to a specific peer. When MWI
notifications were changed to use the internal event framework, this value was
no longer needed for its original purpose. Hence, it was no longer updated
with the new/old message counts for a peer. The value was previously removed
for Asterisk 10; however, since it was still present in Asterisk 1.8 and still
useful for reporting purposes, it was decided to re-add the value.
This patch re-adds the 'LastMsgsSent' field in the response to an AMI/CLI 'sip
show peer [peer]' command, and makes it so that the value of lastmsgssent is
updated appropriately. The value should now display the new/old message counts
for a particular peer.
(closes issue ASTERISK-17866)
Reported by: Steve Davies
patches by:
ast-17866-rb1272.patch (License #5041 by irroot)
Modified slightly for this commit
Review: https://reviewboard.asterisk.org/r/1939
........
Merged revisions 367362 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 367369 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change accommodates two methods by which calls can be directed to
a user's voicemail.
* Incoming calls can be redirected to any user's voicemail.
* Established calls can be blind transferred to any user's voicemail.
Digium phones indicate the desire to direct a call to voicemail by using
a Diversion header with a reason parameter of "send_to_vm".
This patch adds the "send_to_vm" reason as a valid redirecting reason. In
addition, chan_sip.c has been modified to update redirecting information
on the transferred channel by reading a Diversion header on a REFER request.
(closes issue AST-871)
Reported by Malcolm Davenport
Review: https://reviewboard.asterisk.org/r/1925
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This addresses core findings 4 and 6.
Moises Silva helped me by stating that a break could be
safely added to the case where it is added in chan_dahdi.c
In say.c, I have added a comment indicating that static analysis
complains but that it is currently unknown if this is correct.
This fixes all core findings of this type.
(closes issue ASTERISK-19662)
reported by Matthew Jordan
........
Merged revisions 367027 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 367028 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
SSL_CTX structures were allocated but never freed. This was a bigger
issue for clients than servers since new SSL_CTX structures could be
allocated for each connection. Servers, on the other hand, typically
set up a single SSL_CTX for their lifetime.
This is solved in two ways:
1. In __ssl_setup(), if a tcptls_cfg has an ssl_ctx on it, it is
freed so that a new one can take its place.
2. A companion to ast_ssl_setup() called ast_ssl_teardown() has
been added so that servers can properly free their SSL_CTXs.
(issue ASTERISK-19278)
........
Merged revisions 367002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 367003 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds to what was fixed in r366880. Specifically, it addresses the
following:
* chan_sip: dispose of an allocated frame in off nominal code paths in
sip_rtp_read
* func_odbc: when disposing of an allocated resultset, ensure that any rows
that were appended to that resultset are also disposed of
* cli: free the created return string buffer in another off nominal code
path
* chan_dahdi: free a frame that was allocated by the dsp layer if we choose
not to process that frame
(issue ASTERISK-19665)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1922/
........
Merged revisions 366944 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366948 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool. A brief summary of the changes:
* app_minivm: free ast_str objects on off nominal paths
* app_page: free the ast_dial object if the requested channel technology
cannot be appended to the dialing structure
* app_queue: if a penalty rule failed to match any existing rule list
names, the created rule would not be inserted and its memory
would be leaked
* app_read: dispose of the created silence detector in the presence of
off nominal circumstances
* app_voicemail: dispose of an allocated unique ID field for MWI event
un-subscribe requests in off nominal paths; dispose of
configuration objects when using the secret.conf option
* chan_dahdi: dispose of the allocated frame produced by ast_dsp_process
* chan_iax2: properly unref peer in CLI command "iax2 unregister"
* chan_sip: dispose of the allocated frame produced by sip_rtp_read's
call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup: properly deref ao2 object grhead in nominal path of
dialgroup_read
* func_odbc: free resultset in off nominal paths of odbc_read
* cli: free match_list in off nominal paths of CLI match completion
* config: free comment_buffer/list_buffer when configuration file load
is unchanged; free the same buffers any time they were
created and config files were processed
* data: free XML nodes in various places
* enum: free context buffer in off nominal paths
* features: free ast_call_feature in off nominal paths of applicationmap
config processing
* netsock2: users of ast_sockaddr_resolve pass in an ast_sockaddr struct
that is allocated by the method. Failures in
ast_sockaddr_resolve could result in the users of the method
not knowing whether or not the buffer was allocated. The
method will now not allocate the ast_sockaddr struct if it
will return failure.
* pbx: cleanup hash table traversals in off nominal paths; free
ignore pattern buffer if it already exists for the specified
context
* xmldoc: cleanup various nodes when we no longer need them
* main/editline: various cleanup of pointers not being freed before being
assigned to other memory, cleanup along off nominal paths
* menuselect/mxml: cleanup of value buffer for an attribute when that attribute
did not specify a value
* res_calendar*: responses are allocated via the various *_request method
returns and should not be allocated in the various
write_event methods; ensure attendee buffer is freed if no
data exists in the parsed node; ensure that calendar objects
are de-ref'd appropriately
* res_jabber: free buffer in off nominal path
* res_musiconhold: close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
the rtp object
* res_srtp: if we fail to create the session in libsrtp, destroy the
temporary ast_srtp object
(issue ASTERISK-19665)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1922
........
Merged revisions 366880 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366881 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Introduced with r366842, a function call made only with TEST_FRAMEWORK enabled
was missing an argument since the function arguments were changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch improves the handling of call id logging significantly with regard
to transfers and adding APIs to better handle specific aspects of logging.
Also, changes have been made to chan_sip in order to better handle the creation
of callids and to enable the monitor thread to bind itself to a particular
call id when a dialog is determined to be related to a callid. It then unbinds
itself before returning to normal monitoring.
review: https://reviewboard.asterisk.org/r/1886/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch fixes two problems pointed out by a static analysis tool.
* In chan_dahdi, when an event is handled the index of the sub channel is first
obtained. In very off nominal cases, the method that determines the index
can return a negative value. In the event handling code, whether or not
the index returned is valid was being checked after that value was used to
index into an array. This patch makes it so the value is checked before
any indexing is done.
* In res_calendar_ews, sizeof was being passed a pointer instead of the struct to
determine the amount of memory to allocate.
(issue ASTERISK-19651)
Reported by: Matt Jordan
(closes issue ASTERISK-19671)
Reported by: Matt Jordan
........
Merged revisions 366740 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366741 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When ast_call() operates on a local channel, it copies a lot of things
from the local;1 channel to the local;2 channel. This includes among
other things, channel variables and party id information.
Other reasons it was a bad idea to run predial on the local;2 channel:
1) The channel has not been completely setup. The ast_call() completes
the setup.
2) The local;2 caller and connected line party information is opposite to
any other channels predial runs on. (And it hasn't been setup yet.)
* Partially back out -r366183 by removing the chan_local implementation of
the struct ast_channel_tech.pre_call callback.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.
This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.
Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
To make a long story short, reinvite glares were broken
because Asterisk would invert the To and From headers
when ACKing a 491 response.
The reason was because the initreq of the dialog was being
changed to the incoming glared reinvite instead of being
set to the outgoing glared reinvite. This change has three
parts
* In handle_incoming, we never will reject an ACK because it
has a to-tag present, even if we think the request may be out
of dialog.
* In handle_request_invite, we do not change the initreq when
receiving a reinvite to which we will respond with a 491.
* In handle_request_invite, several superflous settings up
pendinginvite have been removed since this is dones automatically
by transmit_response_reliable
Review: https://reviewboard.asterisk.org/r/1911
........
Merged revisions 366389 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366390 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Before this patch, the predial routine executes on the ;1 channel of a
local channel pair. Executing predial on the ;1 channel of a local
channel pair is of limited utility. Any channel variables set by the
predial routine executing on the ;1 channel will not be available when the
local channel executes dialplan on the ;2 channel.
* Create ast_pre_call() and an associated pre_call() technology callback
to handle running the predial routine. If a channel technology does not
provide the callback, the predial routine is simply run on the channel.
Review: https://reviewboard.asterisk.org/r/1903/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved. Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.
(Closes issue ASTERISK-19650)
........
Merged revisions 366167 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 366168 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
chan_sip was coded under the assumption that a SIP dialog with an owner channel
will always be destroyed after the owner channel has been hung up.
However, there are situations where the SIP dialog can time out and auto destruct
before the corresponding channel has hung up. A typical example of this would be
if the 'h' extension in the dialplan takes a long time to complete. In such cases,
__sip_autodestruct() would complain about the dialog being auto destroyed with
an owner channel still in place. The problem is that even once the owner channel
was hung up, the sip_pvt would still be linked in its ao2_container because nothing
would ever unlink it.
The fix for this is that if __sip_autodestruct() is called for a sip_pvt that still
has an owner channel in place, the destruction is rescheduled for 10 seconds in the
future. This will continue until the owner channel is finally hung up.
(closes issue ASTERISK-19425)
reported by David Cunningham
Patches:
ASTERISK-19425.patch uploaded by Mark Michelson (License #5049)
(closes issue ASTERISK-19455)
reported by Dean Vesvuio
Tested by Dean Vesvuio
........
Merged revisions 365896 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 365898 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This uses the calling channel's caller ID and connected line information
to populate the remote and local identities in the dialog-info NOTIFY when
an extension is ringing.
There is a bit of an oddity here, and that is that we seed the remote target
with the To header of the outbound call rather than the from header. This
is because it was reported that seeding with the from header caused hints
to be broken with certain SNOM devices. A comment has been added to the code
to explain this.
(closes issue ASTERISK-16735)
reported by Maciej Krajewski
patches:
local_remote_hint2.diff uploaded by Mark Michelson (license #5049)
16735_tweak1.diff uploaded by Mark Michelson (license #5049)
Tested by Niccolo Belli
........
Merged revisions 365574 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 365575 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Most of the changes here are trivial NULL checks. There are a couple
optimizations to remove the need to check for NULL and outboundproxy parsing
in chan_sip.c was rewritten to avoid use of strtok. Additionally, a bug was
found and fixed with the parsing of outboundproxy when "outboundproxy=," was
set.
(Closes issue ASTERISK-19654)
........
Merged revisions 365398 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 365399 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Made chan_local.c:check_bridge() check the return value of
ast_channel_masquerade(). In long chains of local channels, the
masquerade occasionally fails to get setup because there is another
masquerade already setup on an adjacent local channel in the chain.
* Made the outgoing local channel (the ;2 channel) flush one voice or
video frame per optimization attempt.
* Made sure that the outgoing local channel also does not have any frames
in its queue before the masquerade.
* Made do the masquerade immediately to minimize the chance that the
outgoing channel queue does not get any new frames added and thus
unconditionally flushed.
* Made block indication -1 (Stop tones) event when the local channel is
going to optimize itself out. When the call is answered, a chain of local
channels pass down a -1 indication for each bridge. This blizzard of -1
events really slows down the optimization process.
(closes issue ASTERISK-16711)
Reported by: Alec Davis
Tested by: rmudgett, Alec Davis
Review: https://reviewboard.asterisk.org/r/1894/
........
Merged revisions 365313 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 365320 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
........
r365006 | twilson | 2012-05-02 10:49:03 -0500 (Wed, 02 May 2012) | 12 lines
Fix a CEL LINKEDID_END race and local channel linkedids
This patch has the ;2 channel inherit the linkedid of the ;1 channel and fixes
the race condition by no longer scanning the channel list for "other" channels
with the same linkedid. Instead, cel.c has an ao2 container of linkedid strings
and uses the refcount of the string as a counter of how many channels with the
linkedid exist. Not only does this eliminate the race condition, but it also
allows us to look up the linkedid by the hashed key instead of traversing the
entire channel list.
Review: https://reviewboard.asterisk.org/r/1895/
........
r365068 | twilson | 2012-05-02 12:02:39 -0500 (Wed, 02 May 2012) | 11 lines
Don't leak a ref if out of memory and can't link the linkedid
If the ao2_link fails, we are most likely out of memory and bad things
are going to happen. Before those bad things happen, make sure to clean
up the linkedid references.
This patch also adds a comment explaining why linkedid can't be passed
to both local channel allocations and combines two ao2_ref calls into 1.
Review: https://reviewboard.asterisk.org/r/1895/
........
Merged revisions 365006,365068 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 365083 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The reason I'm removing this is that Coverity reported a STRAY_SEMICOLON
issue here. Since the function has been unused for so long, I just elected
to remove it altogether.
(closes issue ASTERISK-19660)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Revision 360862 was intended to improve identities sent in dialog-info
NOTIFY requests. Some users reported that hint became broken once this
was done. It's not clear exactly what part of the patch has caused this
regression, but broken hints are bad.
For now, this revision is being reverted so that the next releases of
Asterisk do not have bad behavior in them. The original reported issue
will have to be fixed differently in the next version of Asterisk.
(issue ASTERISK-16735)
........
Merged revisions 364706 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 364707 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If enabled using the keepalive option in sip.conf a small packet will be sent
at a regular interval to keep the NAT mapping open. This is lightweight as the
remote side does not need to parse and handle a SIP message.
(closes issue AST-783)
Review: https://reviewboard.asterisk.org/r/1756/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Unref the SIP pvt stored in the refer structure as soon as it is no longer
needed so that the pvt and associated file descriptors can be freed sooner.
This change makes a reference decrement unnecessary in code that handles SIP
BYE/Also transfers which should not touch the reference anyway.
(Closes issue ASTERISK-19579)
Reported by: Maciej Krajewski
Tested by: Maciej Krajewski
........
Merged revisions 364258 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 364259 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
As a continuation of the patch in r356604, which allowed for the
reloading of SRTP keys in re-INVITE transfer scenarios, this patch
addresses the more common case where a new key is requested within
the context of a current SIP dialog. This can occur, for example, when
certain phones request a SIP hold.
Previously, once a dialog was associated with an SRTP object, any
subsequent attempt to process crypto keys in any SDP offer - either
the current one or a new offer in a new SIP request - were ignored. This
patch changes this behavior to only ignore subsequent crypto keys within
the current SDP offer, but allows future SDP offers to change the keys.
(issue ASTERISK-19253)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Review: https://reviewboard.asteriskorg/r/1885/
........
Merged revisions 364203 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 364204 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The reference held for SIP blind transfers using the Replaces header in an
INVITE was never freed on success and also failed to be freed in some error
conditions. This caused a file descriptor leak since the RTP structures in use
at the time of the transfer were never freed. This reference leak and another
relating to subscriptions in the same code path have now been corrected.
(closes issue ASTERISK-19579)
........
Merged revisions 363986 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 363987 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Some switches may not handle the call-deflection/call-rerouting message if
the call is disconnected too soon after being sent. Asteisk was not
waiting for any reply before disconnecting the call.
* Added a 5 second delay before disconnecting the call to wait for a
potential response if the peer does not disconnect first.
(closes issue ASTERISK-19708)
Reported by: mehdi Shirazi
Patches:
jira_asterisk_19708_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett
........
Merged revisions 363730 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 363734 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Some ISDN switches occasionally fail to send a RESTART ACKNOWLEDGE in
response to a RESTART request.
* Made the second SETUP received after sending a RESTART request clear the
channel resetting state as if the peer had sent the expected RESTART
ACKNOWLEDGE before continuing to process the SETUP. The peer may not be
sending the expected RESTART ACKNOWLEDGE.
(issue ASTERISK-19608)
(issue AST-844)
(issue AST-815)
Patches:
jira_ast_815_v1.8.patch (license #5621) patch uploaded by rmudgett (modified)
........
Merged revisions 363687 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 363688 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If Asterisk receives a SIP UPDATE request after a call has been terminated and
the channel has been destroyed but before the SIP dialog has been destroyed, a
condition exists where a connected line update would be attempted on a
non-existing channel. This would cause Asterisk to crash. The patch resolves
this by first ensuring that the SIP dialog has an owning channel before
attempting a connected line update. If an UPDATE request is received and no
channel is associated with the dialog, a 481 response is sent.
(closes issue ASTERISK-19770)
Reported by: Thomas Arimont
Tested by: Matt Jordan
Patches:
ASTERISK-19278-2012-04-16.diff uploaded by Matt Jordan (license 6283)
........
Merged revisions 363106 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 363107 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When handling a keypad button message event, the received digit is placed into
a fixed length buffer that acts as a queue. When a new message event is
received, the length of that buffer is not checked before placing the new digit
on the end of the queue. The situation exists where sufficient keypad button
message events would occur that would cause the buffer to be overrun. This
patch explicitly checks that there is sufficient room in the buffer before
appending a new digit.
(closes issue ASTERISK-19592)
Reported by: Russell Bryant
........
Merged revisions 363100 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........
Merged revisions 363102 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 363103 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The CHANNEL_DEADLOCK_AVOIDANCE() feature of preserving where the channel
lock was originally obtained is overkill where ast_channel_lock_both() was
inlined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
ISDN ETSI PTP and Q.SIG (And SS7 in future) have support for reporting who
was the original redirecting party of a call.
* Added support for the original redirecting party and reason to the
REDIRECTING function and the system core as well as to the stubbed
locations in sig_pri.c.
Review: https://reviewboard.asterisk.org/r/1829/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array
of size 16) would be overrun due to improper bounds checking. At worst, the
buffer can be overrun by a total of 48 bytes (assuming 4-byte integers),
which would still leave it within the allocated memory of struct hfp. This
would corrupt other elements in that struct but not necessarily cause any
further issues.
* app_sms: The array imsg is of size 250, while the array (ud) that the data
is copied into is of size 160. If the size of the inbound message is
greater then 160, up to 90 bytes could be overrun in ud. This would corrupt
the user data header (array udh) adjacent to ud.
* chan_unistim: A number of invalid memmoves are corrected. These would move
data (which may or may not be valid) into the ends of these buffers.
* asterisk: ast_console_toggle_loglevel does not check that the console log
level being set is less then or equal to the allowed log levels of 32.
* format_pref: In ast_codec_pref_prepend, if any occurrence of the specified
codec is not found, the value used to index into the array pref->order
would be one greater then the maximum size of the array.
* jitterbuf: If the element being placed into the jitter buffer lands in the
last available slot in the jitter history buffer, the insertion sort attempts
to move the last entry in the buffer into one slot past the maximum length
of the buffer. Note that this occurred for both the min and max jitter
history buffers.
* tdd: If a read from fsk_serial returns a character that is greater then 32,
an attempt to read past one of the statically defined arrays containing the
values that character maps to would occur.
* localtime: struct ast_time and tm are not the same size - ast_time is larger,
although it contains the elements of tm within it in the same layout. Hence,
when using memcpy to copy the contents of tm into ast_time, the size of tm
should be used, as opposed to the size of ast_time.
* extconf: this treats ast_timing's minmask array as if it had a length of 48,
when it has defined the size of the array as 24. pbx.h defines minmask as
having a size of 48.
(issue ASTERISK-19668)
Reported by: Matt Jordan
........
Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Several telcos bring the BRI PTMP layer 1 down when the line is idle.
When layer 1 goes down, Asterisk cannot make outgoing calls. Incoming
calls could fail as well because the alarm processing is handled by a
different code path than the Q.931 messages.
* Add the layer1_presence configuration option to ignore layer 1 alarms
when the telco brings layer 1 down. This option can be configured by span
while the similar DAHDI driver teignorered=1 option is system wide. This
option unlike layer2_persistence does not require libpri v1.4.13 or newer.
Related to JIRA AST-598
JIRA ABE-2845
........
Merged revisions 362428 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 362429 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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)
........
Merged revisions 362253 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 362264 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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/
........
Merged revisions 362204 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 362205 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The current Security Events Framework API only supports IPv4 when it comes to
generating security events. This patch does the following:
* Changes the Security Events Framework API to support IPV6 and updates
the components that use this API.
* Eliminates an error message that was being generated since the current
implementation was treating an IPv6 socket address as if it was IPv4.
* Some copyright dates were updated on files touched by this patch.
(closes issue ASTERISK-19447)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
security_events_ipv6v3.diff uploaded by Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/1777/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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.
........
Merged revisions 361854 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 361855 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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.
........
Merged revisions 361705 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 361706 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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)
........
Merged revisions 360862 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 360863 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This is just a minor code cleanup change. These uses of ao2_callback() would
never return anything since the callbacks always returned 0. However, be more
explicit that no returned results are wanted by specifying OBJ_NODATA.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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.
........
Merged revisions 360309 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 360310 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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
........
Merged revisions 360086 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 360088 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Added new chan_dahdi.conf colp_send option parameter to block connected
line updates per span.
(closes issue ASTERISK-17025)
Reported by: Michael Smith
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Added ability to use multiple lines on phone, so for one device in configuration multiple lines can be defined, it allows to have multiple calls on one phone, callwaiting and switching between calls.
* Added ability for translation on-screen menu to multiple languages. Tested on Russian languages. Supported encodings: ISO 8859-1, ISO 8859-2, ISO 8859-4, ISO 8859-5, ISO 2022-JP. Language controlled by 'language' and on-screen menu of phone
* Other described in CHANGES file
Testing done by issue tracker users: ibercom, scsiborg, idarwin, TeknoJuce, c0rnoTa.
Tested on production system by Jonn Taylor (jonnt) using phone models: Nortel i2004, 1120E and 1140E.
(closes issue ASTERISK-16890)
Review: https://reviewboard.asterisk.org/r/1243/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
For analog lines, enables Asterisk to use dialtone detection per channel
if an incoming call was hung up before it was answered. If dialtone is
detected, the call is hung up.
no: Disabled. (Default)
yes: Look for dialtone for 10000 ms after answer.
<number>: Look for dialtone for the specified number of ms after answer.
always: Look for dialtone for the entire call. Dialtone may return
if the far end hangs up first.
dialtone_detect=yes
dialtone_detect=5000
dialtone_detect=always
(closes issue ASTERISK-19316)
Reported by: Jeremy Pepper
Patch by: Jeremy Pepper
Tested by: rmudgett,Jeremy Pepper
Review: https://reviewboard.asterisk.org/r/1737/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Outgoing SS7 calls fail to detect incoming DTMF so any bridged channel
that requires out-of-band DTMF will not work.
* Added sig_ss7_open_media() calls at appropriate places in sig_ss7.c.
The new call converts conditionaled out unconverted code and shows that
the code really did something useful.
* Improved some chan_dahdi DTMF debug messages to help track DTMF
handling.
(closes issue ASTERISK-19312)
Reported by: Igor Nikolaev
........
Merged revisions 358260 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 358261 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The check if an ISDN call is bridged before it could be placed on hold is
not necessary and is overly restrictive. The check was originally done to
prevent problems with call transfers in case a user tried to transfer a
call connected to an application to another call connected to an
application. The ISDN transfer code has not required this restriction for
quite some time because ECT could transfer any two active calls to each
other.
* Remove ISDN hold restriction for calls connected to applications.
* Made ast_waitfordigit_full() ignore AST_CONTROL_HOLD and
AST_CONTROL_UNHOLD instead of generating a warning message.
(closes issue ASTERISK-19388)
Reported by: Birger Harzenetter
Tested by: rmudgett
........
Merged revisions 357894 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 357895 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to this patch, Using "transport=" multiple times would cause them to add to one
another like allow/deny. This patch changes that behavior to simply use the transport
option specified last. Also, if no transport option is applied now, the default will
automatically be UDP.
(closes ASTERISK-19352)
Reported by: jamicque
Patches:
asterisk-19352-transport-warning-message-v1.patch uploaded by Michael L. Young (license 5026)
issueA19352_no_transport_is_udp.patch uploaded by Walter Doekes (license 5674)
Review: https://reviewboard.asterisk.org/r/1745/diff/#index_header
........
Merged revisions 357266 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 357271 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
chan_iax2 to pass in the correct types.
chan_iax2 is the only consumer for the various ast_netsock_* functions in trunk
at this point, so this feels like a safe change to make.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
send_diversion=no will prevent Diversion headers from being added to SIP
requests. This doesn't prevent Diversion from being added with dialplan
such as with SIPAddHeader.
(closes issue ASTERISK-16862)
Reported by: rsw686
Review: https://reviewboard.asterisk.org/r/1769/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Currently, when using res_srtp, once the SRTP policy has been added to the
current session the policy is locked into place. Any attempt to replace an
existing policy, which would be needed if the remote endpoint negotiated a new
cryptographic key, is instead rejected in res_srtp. This happens in particular
in transfer scenarios, where the endpoint that Asterisk is communicating with
changes but uses the same RTP session.
This patch modifies res_srtp to allow remote and local policies to be reloaded
in the underlying SRTP library. From the perspective of users of the SRTP API,
the only change is that the adding of remote and local policies are now added
in a single method call, whereas they previously were added separately. This
was changed to account for the differences in handling remote and local
policies in libsrtp.
Review: https://reviewboard.asterisk.org/r/1741/
(closes issue ASTERISK-19253)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283)
(with some small modifications for this check-in)
........
Merged revisions 356604 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 356605 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Custom parking extensions may not be coded such that the first and only
extension priority is the Park application. These custom parking
extensions will not be recognized as parking extensions. When a call is
blind transferred to an extension that is not recognized as a parking
extension, the normal blind transfer code causes the transferred channel
to start executing dialplan. Calls that get parked in this manner do not
know the original channel name that parked the call so the original parker
could never be called back if the parked call is not retrieved before the
timeout time. The parking space is also announced to the call being
parked as a side effect of not knowing the original parking channel.
* Fix handling of BLINDTRANSFER channel variable for call parking.
* Fixed SIP blind transfer using the wrong dialplan context variable to
check for the parking extension.
(closes issue ASTERISK-19322)
Reported by: aragon
Tested by: rmudgett, jparker
Review: https://reviewboard.asterisk.org/r/1730/
JIRA AST-766
........
Merged revisions 356521 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 356522 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When we send an ACK for a 2xx response to an INVITE, we are supposed
to use the learned route set. However, when we receive a non-2xx final
response to an INVITE, we are supposed to send the ACK to the same place
we initially sent the INVITE.
We had been doing this up until the changes went in that would build a route
set from provisional responses. That introduced a regression where we would
use the learned route set under all circumstances.
With this change, we now will set the destination of our ACK based on the
invitestate. If it is INV_COMPLETED then that means that we have received
a non-2xx final response (INV_TERMINATED indicates a 2xx response was received).
If it is INV_CANCELLED, then that means the call is being canceled, which
means that we should be ACKing a 487 response.
The other change introduced here is setting the invitestate to INV_CONFIRMED
when we send an ACK *after* the reqprep instead of before. This way, we can
tell in reqprep more easily what the invitestate is prior to sending the ACK.
(closes issue ASTERISK-19389)
reported by Karsten Wemheuer
patches:
ASTERISK-19389v2.patch uploaded by Mark Michelson (license #5049)
(with some slight modifications prior to commit)
........
Merged revisions 356475 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 356476 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r356215 | mjordan | 2012-02-22 08:53:53 -0600 (Wed, 22 Feb 2012) | 32 lines
Merged revisions 356214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r356214 | mjordan | 2012-02-22 08:50:20 -0600 (Wed, 22 Feb 2012) | 27 lines
Fix potential buffer overrun and memory leak when executing "sip show peers"
The "sip show peers" command uses a fix sized array to sort the current peers
in the peers ao2_container. The size of the array is based on the current
number of peers in the container. However, once the size of the array is
determined, the number of peers in the container can change, as the peers
container is not locked. This could cause a buffer overrun when populating
the array, if peers were added to the container after the array was created.
Additionally, a memory leak of the allocated array would occur if a user
caused the _show_peers method to return CLI_SHOWUSAGE.
We now create a snapshot of the current peers using an ao2_callback with the
OBJ_MULTIPLE flag. This size of the array is set to the number of peers
that the iterator will iterate over; hence, if peers are added or removed
from the peers container it will not affect the execution of the "sip show
peers" command.
Review: https://reviewboard.asterisk.org/r/1738/
(closes issue ASTERISK-19231)
(closes issue ASTERISK-19361)
Reported by: Thomas Arimont, Jamuel Starkey
Tested by: Thomas Arimont, Jamuel Starkey
Patches: sip_show_peers_2012_02_16.diff uploaded by mjordan (license 6283)
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
IAX2 uses the trunkfreq variable to determine how often to send trunk packets, but
this value is in milliseconds while ast_timer_set_rate() expects the rate argument
to be ticks per second. So we divide 1000 by trunkfreq and pass that in instead.
With a default of 20ms, this change makes IAX2 send trunk packets every 20ms
instead of every 50ms.
Tracked down by myself and Bob Wienholt.
........
Merged revisions 355746 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 355747 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This fixes two main issues:
1. Asterisk would send a CANCEL to the route created by the provisional response
instead of using the same destination it did in the initial INVITE.
2. If a new route set arrives in a 200 OK than was in the 1XX response (perfectly
possible if our outbound INVITE gets forked), then the route set in the 200 OK
needs to overwrite the route set in the 1XX response.
(closes issue ASTERISK-19358)
Reported by: Karsten Wemheuer
Tested by: Karsten Wemheuer
patches:
ASTERISK-19358.patch uploaded by Mark Michelson (license 5049)
ASTERISK-19358.patch uploaded by Stefan Schmidt (license 6034)
Review: https://reviewboard.asterisk.org/r/1749
........
Merged revisions 355732 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 355733 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds the auto_force_rport and auto_comedia NAT options. It
also converts the nat= setting to a list of comma-separated combinable
options: no, force_rport, comedia, auto_force_rport, and auto_comedia.
nat=yes remains as an undocumented option equal to
"force_rport,comedia". The first instance of 'yes' or 'no' in the list
stops parsing and overrides any previously set options. If an auto_*
option is specified with its non-auto_ counterpart, the auto setting
takes precedence.
This patch builds upon the patch posted to ASTERISK-17860 by JIRA user
pedro-garcia.
(closes issue ASTERISK-17860)
Review: https://reviewboard.asterisk.org/r/1698/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
In ASTERISK-18924, SIP INFO DTMF handlingw as changed to account for both
lowercase alphatbetic DTMF events, as well as uppercase alphabetic DTMF
events. When this occurred, the comparison of the character buffer containing
the event code was changed such that the buffer was first compared again '0'
and '9' to determine if it was numeric. Unfortunately, since the first
character in the buffer will typically be '1' in the case of non-numeric
event codes (10-16), this caused those codes to be converted to a DTMF event
of '1'. This patch fixes that, and cleans up handling of both
application/dtmf-relay and application/dtmf content types.
Review: https://reviewboard.asterisk.org/r/1722/
(closes issue ASTERISK-19290)
Reported by: Ira Emus
Tested by: mjordan
........
Merged revisions 354542 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 354543 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch is based on the one by David Vossel, developer extrodinaire, at
https://reviewboard.asterisk.org/r/344/. If multiple peers are defined with the
same host/port, but differing callbackextensions, it chooses the peer with the
matching callbackextension. Since callbackextension creates an outbound
registration with the callbackextension as the Contact address, matching an
incoming request by that (in addition to the host/port) makes a lot of sense.
This patch also adds support for callbackextension to realtime by querying all
peers with callbackextensions on reload and adding registrations for them.
(closes issue ASTERISK-13456)
Review: https://reviewboard.asterisk.org/r/344/
Review: https://reviewboard.asterisk.org/r/1717/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This changes the debuglevel of 'pri set debug' to a bit mask allowing the user
to independently select bits of output:
1 libpri internals including state machine
2 Decoded Q.931 messages
4 Decoded Q.921 headers
8 raw hex dump of the full frames
Additionally, this ensures that the meaning of "on" does not change and
intrudces intense and hex to simplify usage.
(closes issue ASTERISK-17159)
Original-patch-by: wimpy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
After R340970 Asterisk was still polling the RTCP file descriptor after RTCP is
shut down and removed. If the descriptor happened to have data ready when the
removal occured then Asterisk would go into an infinite loop trying to read
data that it can never actually access. This change disables the audio RTCP
file descriptor for the duration of the T.38 transaction.
(closes issue ASTERISK-18951)
Reported-by: Kristijan Vrban
........
Merged revisions 353915 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353916 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This feature also causes the sending complete ie to be sent for switch
types that do not automatically send the ie. (EuroISDN/ETSI)
The main difference between dialing Dial(DAHDI/g0/1234w888) and
Dial(DAHDI/g0/1234,,D(888)) is the sending of the sending complete ie.
(closes issue ASTERISK-19176)
Reported by: rmudgett
Tested by: rmudgett
........
Merged revisions 353867 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353868 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A previous patch I committed from ASTERISK-16930 unexpectedly changed some output for
the AMI action "sippeers" which this patch changes back. Also, this aligns the output
for the cli command "sip show peers" and fixes another issue that patch introduced by
using ast_sockaddr_stringify calls multiple times without immediately using the pointer.
I also went ahead and did a little janitorial work to clean up whitespace in
_sip_show_peers.
(issue ASTERISK-16930)
(closes issue ASTERISK-19281)
Reported by: Patrick El Youssef
Patches:
ASTERISK-19281.diff uploaded by Walter Doekes (license 5674)
........
Merged revisions 353769 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353771 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There are a number of cleaner looking wrappers for ast_sockaddr_stringify_fmt
available which are slightly more readable than using a direct call to
ast_sockaddr_stringify_fmt. This patch switches a number of those calls in
chan_sip to use those wrappers and is generally harmless.
(Closes issue ASTERISK-16930)
Reported by: Michael L. Young
Patches:
chan_sip-broken-registration-1.8.diff uploaded by Michael L. Young (license 5026)
........
Merged revisions 353720 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353721 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it
anytime an address resolves to something different. There are a couple of
issues with this. First, the ast_sockaddr is usually the address of an
ast_sockaddr inside a refcounted struct and we never bump the refcount of those
structs when using dnsmgr. This makes it possible that a refresh could happen
after the destructor for that object is called (despite ast_dnsmgr_release
being called in that destructor). Second, the module using dnsmgr cannot be
aware of an address changing without polling for it in the code. If an action
needs to be taken on address update (like re-linking a SIP peer in the
peers_by_ip table), then polling for this change negates many of the benefits
of having dnsmgr in the first place.
This patch adds a function to the dnsmgr API that calls an update callback
instead of blindly updating the address itself. It also moves calls to
ast_dnsmgr_release outside of the destructor functions and into cleanup
functions that are called when we no longer need the objects and increments the
refcount of the objects using dnsmgr since those objects are stored on the
ast_dnsmgr_entry struct. A helper function for returning the proper default SIP
port (non-tls vs tls) is also added and used.
This patch also incorporates changes from a patch posted by Timo Teräs to
ASTERISK-19106 for related dnsmgr issues.
(closes issue ASTERISK-19106)
Review: https://reviewboard.asterisk.org/r/1691/
........
Merged revisions 353371 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353397 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r353321 | alecdavis | 2012-01-31 11:16:22 +1300 (Tue, 31 Jan 2012) | 25 lines
Merged revisions 353320 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r353320 | alecdavis | 2012-01-31 10:57:49 +1300 (Tue, 31 Jan 2012) | 18 lines
RFC3261 Section 8.1.1.5. The sequence number value MUST be expressible as a 32-bit unsigned integer
* fix: use %u instead of %d when dealing with CSeq numbers - to remove possibility of -ve numbers.
* fix: change all uses of seqno and friends (ocseq icseq) from 'int' or 'unsigned int' to uint32_t.
Summary of CSeq numbers.
An initial CSeq number must be less than 2^31
A CSeq number can increase in value up to 2^32-1
An incrementing CSeq number must not wrap around to 0.
Tested with Asterisk 1.8.8.2 with Grandstream phones.
alecdavis (license 585)
Tested by: alecdavis
Review: https://reviewboard.asterisk.org/r/1699/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Previously, if an m-line in an SDP offer or answer had a port number of zero,
that line was skipped, and resulted in an 'Unsupported SDP media type...'
warning message. This was misleading, as the media type was not unsupported,
but was ignored because the m-line indicated that the media stream had been
rejected (in an answer) or was not going to be used (in an offer).
........
Merged revisions 353260 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 353261 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Fixes up softkey endcall. Previous code was a copy of onhook, now
allows for endcall softkey to be used while device is still onhook.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r352863 | alecdavis | 2012-01-27 13:08:03 +1300 (Fri, 27 Jan 2012) | 19 lines
Merged revisions 352862 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r352862 | alecdavis | 2012-01-27 13:05:30 +1300 (Fri, 27 Jan 2012) | 12 lines
rfc4235 - Section 4.1: Versions MUST be representable using a non-negative 32 bit integer.
If a BLF subscription exists for long enough, using %d may print negative version numbers.
Unlikely, as 2^32 at 1 update per second is ~137 years, or half that before the versions number started going negative.
Tested with Asterisk 1.8.8.2 with Grandstream phones.
alecdavis (license 585)
Tested by: alecdavis
Review: https://reviewboard.asterisk.org/r/1694/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
For whatever reason, we don't have a single function for copying data like this
from SIP peers to the SIP pvt. This patch adds the copying of amaflags to the
sip_pvt, but it would probably be worth discussing this function along with
the others that essentially just copy some amount of data from a peer to a
private.
(Closes issue ASTERISK-19029)
Reported by: Matt Lehner
........
Merged revisions 352755 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 352756 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA
function in the authorization attempt.
* Pass up better From header contents for SIP to use. Now is in the
"display-name" <URI> format expected by MessageSend. (Note that this is a
behavior change that could concievably affect some people.)
* Block user from adding standard headers that are added automatically.
(To, From,...)
* Allow the user to override the Content-Type header contents sent by
MessageSend.
* Decrement Max-Forwards header if the user transferred it from an
incoming message.
* Expand SIP short header names so the dialplan and other code only has to
deal with the full names.
* Documents what SIP expects in the MessageSend(from) parameter.
(closes issue ASTERISK-18992)
Reported by: Yuri
(closes issue ASTERISK-18917)
Reported by: Shaun Clark
Review: https://reviewboard.asterisk.org/r/1683/
........
Merged revisions 352520 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.
Review: https://reviewboard.asterisk.org/r/1661/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If a blind transfer were initiated using a REFER without a prior
reINVITE to place the call on hold, AND if Asterisk were sending
RTCP reports, then there was a reference for the RTP instance
of the transferer.
This fixes the issue by merging two similar but slightly conflicting
sections of code into a single area. It also adds a stop_media_flows()
call in the case that the transferer's UA never sends a BYE to us
like it is supposed to.
(issue ASTERISK-19192)
Review: https://reviewboard.asterisk.org/r/1681/
........
Merged revisions 352014 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 352015 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Add an AMI event in the Call category that is issued when a call is terminated
due to either RTP stream inactivity or SIP session timer expiration.
Event description:
Event: SessionTimeout
Source: source
Channel: channel-name
Uniqueid: channel-unique-id
`source` can be either RTPTimeout or SIPSessionTimer
(closes issue ASTERISK-16467)
Patch-by: Kirill Katsnelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fix corner cases in get_calleridname() parsing and ensure that the
output buffer is nul terminated.
* Make get_calleridname() truncate the name it parses if the given buffer
is too small rather than abandoning the parse and not returning anything
for the name. Adjusted get_calleridname_test() unit test to handle the
truncation change.
* Fix get_in_brackets_test() unit test to check the results of
get_in_brackets() correctly.
* Fix parse_name_andor_addr() to not return the address of a local buffer.
This function is currently not used.
* Fix potential NULL pointer dereference in sip_sendtext().
* No need to memset(calleridname) in check_user_full() or tmp_name in
get_name_and_number() because get_calleridname() ensures that it is nul
terminated.
* Reply with an accurate response if get_msg_text() fails in
receive_message(). This is academic in v1.8 because get_msg_text() can
never fail.
........
Merged revisions 351618 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 351646 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
If a Contact or a Record-Route header had a quoted string with an
item in angle brackets, then we would mis-parse it. For instance,
"Bob <1234>" <1234@example.org>
would be misparsed as having the URI "1234"
The fix for this is to use parsing functions from reqresp_parser.h
since they are heavily tested and are awesome.
(issue ASTERISK-18990)
........
Merged revisions 351284 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 351286 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r351183 | russell | 2012-01-16 20:43:19 -0500 (Mon, 16 Jan 2012) | 29 lines
Merged revisions 351182 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r351182 | russell | 2012-01-16 20:37:03 -0500 (Mon, 16 Jan 2012) | 22 lines
Add some missing locking in chan_sip.
This patch adds some missing locking to the function
send_provisional_keepalive_full(). This function is called from the scheduler,
which is processed in the SIP monitor thread. The associated channel (or pbx)
thread will also be using the same sip_pvt and ast_channel so locking must be
used. The sip_pvt_lock_full() function is used to ensure proper locking order
in a safe manner.
In passing, document a suspected reference counting error in this function.
The "fix" is left commented out because when the "fix" is present, crashes
occur. My theory is that fixing it is exposing a reference counting error
elsewhere, but I don't know where. (Or my analysis of this being a problem
could have been completely wrong in the first place). Leave the comment in
the code for so that someone may investigate it again in the future.
Also add a bit of doxygen to transmit_provisional_response().
(closes issue ASTERISK-18979)
Review: https://reviewboard.asterisk.org/r/1648
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When handling a non-2xx final response on an INVITE transaction, we have to
keep the transaction around after we send an ACK in case we receive a
retransmission of the response so we can re-transmit the ACK, but also tear
down the ast_channel as soon as we transmit the ACK. Before this patch, we
could fail at both of these things. Calling sip_alreadygone/needdestroy
prevented us from keeping the transaction up and retransmitting the ACK, and
queueing CONGESTION was not sufficient to cause the channel to be torn down
when originating calls via the CLI, for example.
This patch queues a hangup with CONGESTION instead of just queueing CONGESTION
for these responses and removes the sip_alreadygone and sip_needdestroy calls
from handle_response_invite on non-2xx responses. It relies on the hangup
calling sip_scheddestroy.
For more information, see section 17.1.1.1 of RFC 3261.
(closes issue ASTERISK-17717)
Review: https://reviewboard.asterisk.org/r/1672/
........
Merged revisions 351130 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 351131 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When Asterisk is the UAS (incoming call, endpoint is re-inviting) the SIP session timer expires after half the time the sip endpoint indicates in the Session-expires header in proc_session_timer(). The session timer was being stopped totally and being handled as an error case instead of running again until the second expiry. This patch treats the half-time expiry as a non-error case and continues the timer until the true expiry.
(closes issue ASTERISK-18996)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches: session_timer_fix.diff by Terry Wilson (License #5357)
based on session_timer.patch by Thomas Arimont (License #5525)
........
Merged revisions 351080 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 351081 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to this patch, the udptl struct was allocated and initialized when a
dialog was associated with a peer that supported T.38, when a new SIP
channel was allocated, or what an INVITE request was received. This resulted
in any dialog associated with a peer that supported T.38 having udptl support
assigned to it, including the UDP ports needed for communication. This
occurred even in non-INVITE dialogs that would never send image media.
This patch creates and initializes the udptl structure only when the SDP
for a dialog specifies that image media is supported, or when Asterisk
indicates through the appropriate control frame that a dialog is to support
T.38.
(closes issue ASTERISK-16698)
Reported by: under
Tested by: Stefan Schmidt
Patches: udptl_20120113.diff uploaded by mjordan (License #6283)
(closes issue ASTERISK-16794)
Reported by: Elazar Broad
Tested by: Stefan Schmidt
review: https://reviewboard.asterisk.org/r/1668/
........
Merged revisions 351027 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 351028 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
........
r350788 | kpfleming | 2012-01-14 09:22:33 -0600 (Sat, 14 Jan 2012) | 8 lines
Ensure that two prerequisites are properly installed on Debian-style distributions.
* Don't specify a specific version of libgmime; newer versions are available
now and acceptable.
* Install libsrtp so that res_srtp can be built.
........
r350789 | kpfleming | 2012-01-14 09:23:32 -0600 (Sat, 14 Jan 2012) | 3 lines
Correct some 'set-but-not-used' variable warnings.
........
Merged revisions 350788-350789 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 350790 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch addresses two issues in ConfBridge and the channel bridge layer:
1. It fixes a race condition wherein the bridge channel could be hung up
2. It removes the deadlock avoidance from the bridging layer and makes the
bridge_pvt an ao2 ref counted object
Patch by David Vossel (mjordan was merely the commit monkey)
(issue ASTERISK-18988)
(closes issue ASTERISK-18885)
Reported by: Dmitry Melekhov
Tested by: Matt Jordan
Patches: chan_bridge_cleanup_v.diff uploaded by David Vossel (license 5628)
(closes issue ASTERISK-19100)
Reported by: Matt Jordan
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1654/
........
Merged revisions 350550 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.
This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.
The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.
The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).
Review: https://reviewboard.asterisk.org/r/1655/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The iax2_process_thread() can exit without anyone waiting to join the
thread. If noone is waiting to join the thread then a large memory leak
occurs.
* Made iax2_process_thread() deatach itself if nobody is waiting to join
the thread.
(closes issue ASTERISK-17339)
Reported by: Tzafrir Cohen
Patches:
asterisk-1.8.4.4-chan_iax2-detach-thread-on-non-stop-exit.patch (license #5617) patch uploaded by Alex Villacis Lasso (modified)
(closes issue ASTERISK-17825)
Reported by: wangjin
........
Merged revisions 350220 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 350221 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Adds two new options to SIP peers allowing them to specify features (dynamic or builtin)
to use when sending INFO/record requests. Recordonfeature activates whatever feature
is specified when recieving a record: on request while recordofffeature activates
whatever feature is specified when receiving a record: off request. Both of these
features can be disabled by setting the feature to an empty string.
(closes issue ASTERISK-16507)
Reported by: Jon Bright
Review: https://reviewboard.asterisk.org/r/1634/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch moves destruction of sip peers to immediately after the general section of
sip.conf is read so that autocreatepeer setting can be read before deletion of peers.
If autocreatepeer=persist at reload, then peers created by the autocreatepeer setting
will be skipped when purging the current SIP peer list.
(closes ASTERISK-16508)
Reported by: Kirill Katsnelson
Patches:
017797-kkm-persist-autopeers-1.8.patch uploaded by Kirill Katsnelson (license 5845)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Chan_sip gives a dialog reference to the extension state callback and
assumes that when ast_extension_state_del() returns, the callback cannot
happen anymore. Chan_sip then reduces the dialog reference count
associated with the callback. Recent changes (ASTERISK-17760) have
resulted in the potential for the callback to happen after
ast_extension_state_del() has returned. For chan_sip, this could be very
bad because the dialog pointer could have already been destroyed.
* Added ast_extension_state_add_destroy() so chan_sip can account for the
sip_pvt reference given to the extension state callback when the extension
state callback is deleted.
* Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy()
and handle_statechange() now that the struct ast_state_cb has a destructor
to call.
* Ensure that ast_extension_state_add_destroy() will never return -1 or 0
for a successful registration.
* Fixed pbx.c statecbs_cmp() to compare the correct information. The
passed in value to compare is a change_cb function pointer not an object
pointer.
* Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with
AST_EXTENSION_REMOVED with locks held. Chan_sip is notorious for
deadlocking when those locks are held during the callback.
* Removed unused lock declaration for the pbx.c store_hints list.
(closes issue ASTERISK-18844)
Reported by: rmudgett
Review: https://reviewboard.asterisk.org/r/1635/
........
Merged revisions 348940 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 348952 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Fix a segfault if an attempt to answer a call is made between when
the inbound call gives up (and the channel is removed) and when the
device is notified and removes the call from the device.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch resolves the issue where MWI subscriptions are orphaned
by subsequent SIP SUBSCRIBE messages. When a peer is removed, either
by pruning realtime SIP peers or by unloading / loading chan_sip, the
MWI subscriptions that were orphaned would still be on the event engine
list of valid subscriptions but have a pointer to a peer that no longer
was valid. When an MWI event would occur, this would cause a seg fault.
(closes issue ASTERISK-18663)
Reported by: Ross Beer
Tested by: Ross Beer, Matt Jordan
Patches:
blf_mwi_diff_12_06_11.txt uploaded by Matt Jordan (license 6283)
Review: https://reviewboard.asterisk.org/r/1610/
........
Merged revisions 347058 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 347068 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Extracting sig_analog from chan_dahdi lost call progress detection
functionality.
* Fix analog ports from considering a call answered immediately after
dialing has completed if the callprogress option is enabled.
(closes issue ASTERISK-18841)
Reported by: Richard Miller
Patches:
chan_dahdi.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
sig_analog.c.diff (license #5685) patch uploaded by Richard Miller (Modified by me)
sig_analog.h.diff (license #5685) patch uploaded by Richard Miller
........
Merged revisions 347006 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 347007 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The code that allowed admins to create users with domain-only uri's had
stopped to work in 1.8 because of the reqresp parser rewrites. This is
fixed now: if you have a [mydomain.com] sip user, you can register with
useraddr sip:mydomain.com. Note that in that case -- if you're using
domain ACLs (a configured domain list) -- mydomain.com must be in the
allow list as well.
Reviewboard r1606 shows a list of registration combinations and which
SIP response codes are returned.
Review: https://reviewboard.asterisk.org/r/1533/
Reviewed by: Terry Wilson
(closes issue ASTERISK-18389)
(closes issue ASTERISK-18741)
........
Merged revisions 346899 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 346900 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The previous patch (r346040) incorrectly parsed the URI in the presence
of a port, e.g., user@hostname:port would fail as the port would be
double appended to the SIP message. This patch uses the parse_uri function
to correctly parse the URI into its username and hostname parts, and places
them in the correct fields in the sip_pvt structure.
(issue ASTERISK-18903)
Review: https://reviewboard.asterisk.org/r/1597/
........
Merged revisions 346856 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Cleaning up chan_sip/tcptls file descriptor closing.
This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.
(closes issue ASTERISK-18700)
Reported by: Erik Wallin
(issue ASTERISK-18345)
Reported by: Stephane Cazelas
(issue ASTERISK-18342)
Reported by: Stephane Chazelas
Review: https://reviewboard.asterisk.org/r/1576/
........
Merged revisions 346564 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 346565 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.
(closes issue ASTERISK-18700)
Reported by: Erik Wallin
(issue ASTERISK-18345)
Reported by: Stephane Cazelas
(issue ASTERISK-18342)
Reported by: Stephane Chazelas
Review: https://reviewboard.asterisk.org/r/1576/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
When using the MessageSend application to send a SIP MESSAGE to a non-peer,
chan_sip attempted to validate the hostname or IP Address. In the process,
it stripped off the extension and failed to add it back to the sip_pvt
structure before transmitting. This patch adds the full URI passed in
from the message core to the sip_pvt structure.
(closes issue ASTERISK-18903)
Reported by: Shaun Clark
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1597/
........
Merged revisions 346040 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The recent fix for ASTERISK-17288 to get RFC3578 SIP overlap support
working correctly removed a long standing ability to do overlap dialing
using DTMF in the early media phase of a call.
See ASTERISK-18702 it has a very good description of the issue.
I started with Pavel Troller's chan_sip.diff patch on issue
ASTERISK-18702.
* Added 'dtmf' enum value to sip.conf allowoverlap config option. The new
option value causes the Incomplte application to not send anything with
chan_sip so the caller can supply more digits via DTMF.
* Renames SIP_GET_DEST_PICKUP_EXTEN_FOUND to SIP_GET_DEST_EXTEN_MATCHMORE
since that is what it really means.
* Fixed get_destination() inconsistency with the pickup extension
matching.
* Fixed initialization of PAGE3 of global_flags in reload_config().
(closes issue ASTERISK-18702)
Reported by: Pavel Troller
Review: https://reviewboard.asterisk.org/r/1517/
Review: https://reviewboard.asterisk.org/r/1582/
........
Merged revisions 345273 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 345275 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Fix bug ASTERISK-16558 which dealt with the order of responses to incoming
streams defined by SDP.
Fix unreported bug where offering multiple same-type streams would cause
Asterisk to reply with an incorrect SDP response missing one or more streams
without a proper declination.
Fix bugs related to a single non-audio stream being offered with responses
requesting codecs that were not offered in the initial invite along with an
additional audio stream that was not in the initial invite.
Review: https://reviewboard.asterisk.org/r/1516/
........
Merged revisions 344385 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 344386 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Another deadlock between the conlock/hints and channels/channel locking
orders.
* Don't hold the channel and private lock in sip_new() when calling
ast_exists_extension().
(closes issue ASTERISK-18740)
Reported by: Byron Clark
Patches:
sip_exists_exten_dlock_3.diff (license #5041) patch uploaded by Gregory Hinton Nietsky
ASTERISK-18740.patch (license #6157) patch uploaded by Byron Clark
Tested by: Byron Clark
........
Merged revisions 344268 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 344271 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The domain matching code prior to 1.8 used to manually remove the port
from the host:port string when determining if an incoming request
matched the list of domains. When switching to the new parsing
functions, the documentation implied that the "domain" was being
returned by these functions, when instead it was returning the
"hostport" as defined by RFC 3261. This led to confusion and resulted
in 1.8+ rejecting an incoming request from x.x.x.x:xxxxx when
domain=x.x.x.x was set in sip.conf.
This patch renames the "domain" variables in the parsing functions to
"hostport" to more accurately describe what it is that they are
returning and also properly truncates the resulting hostport strings
when dealing with domain matching.
Review: https://reviewboard.asterisk.org/r/1574/
........
Merged revisions 344215 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 344216 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
........
r343900 | dvossel | 2011-11-08 12:29:33 -0600 (Tue, 08 Nov 2011) | 11 lines
Fixes regression caused by r343635
There was a missing unlock for a function return that is only
present in Asterisk 10 and Asterisk Trunk.
(closes issue ASTERISK-18839)
Reported by: Michael L. Young
Patches:
asterisk-18839-missing-lock-trunk-v2.diff (License #5026) patch uploaded by Michael L. Young
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fixed a LOG_ERROR message referencing the config variable list v that
had previously been processed and became NULL.
* Added error return value set that was missing in an ast_append_ha()
error return path.
(closes issue ASTERISK-18743)
Reported by: Michele
Patches:
issueA18743-fix_dynamic_exclude_static_bad_host_log.patch (license #5674) patch uploaded by Walter Doekes
Tested by: Michele
........
Merged revisions 343851 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 343852 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A dialog cannot be destroyed by the ao2_callback dialog_needdestroy
because of a deadlock between the dialogs container lock and the RWLOCK of
the events subscription list.
* Create dialogs_to_destroy container to hold dialogs that will be
destroyed.
* Ensure that the event subscription callback will never happen with an
invalid peer pointer by making the event callback removal the first thing
in the peer destructor callback.
NOTE: This particular deadlock will not happen with Asterisk 10, but some
of the changes still apply.
(closes issue ASTERISK-18747)
Reported by: Gregory Hinton Nietsky
Review: https://reviewboard.asterisk.org/r/1564/
........
Merged revisions 343577 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 343578 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This option is not only useless, but has been broken since inception since
the flag was never copied from the peer where it is set to the pvt where
it was checked. RFC 3261 specificially states that you should not send a
provisional response to a non-INVITE request, and if we did fix the code
so that it worked, it would cause the same kind of user enumeration
vulnerability that we've discussed with the nat= setting. This patch
removes registertrying option and any code that would have sent a 100
response to a register.
Review: https://reviewboard.asterisk.org/r/1562/
........
Merged revisions 343220 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 343221 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343222 65c4cc65-6c06-0410-ace0-fbb531ad65f3