Joshua Colp [Thu, 15 Jan 2015 12:10:22 +0000 (12:10 +0000)]
res_pjsip_outbound_registration: Fix race condition when reloading and listing registrations.
Due to the split of outbound registration state from configuration it is possible during
a reload for a "pjsip show registrations" CLI command to be executed which gets an older
snapshot of the configuration. This configuration may include outbound registrations which
have been removed due to a reload operation occurring at the same time. The code for
printing the outbound registration did not take this into account but now it does.
AST-1506 #close
Review: https://reviewboard.asterisk.org/r/4338/
........
Merged revisions 430664 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430665
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Thu, 15 Jan 2015 02:19:49 +0000 (02:19 +0000)]
configure: If cross-compiling, assume we have working semaphores
The Asterisk 13 configure.ac checks for HAS_WORKING_SEMAPHORE but does not have
an option for cross-compiling so it fails with an exit. Since we're cross-
compiling, we can't exactly go looking for the header. The semaphore.h header
is relatively common:
* It's part of the POSIX standard
* It's part of GNU C Library
As such, we assume that it will be present when cross-compiling.
As such, this patch defaults "HAS_WORKING_SEMAPHORE" to "1" if cross-compiling
is detected.
If you're cross-compiling to a platform that doesn't support this, then make
sure you re-define this to 0.
ASTERISK-24663 #close
Reported by: abelbeck
patches:
asterisk-13-anonymous-semaphores.patch uploaded by abelbeck (License 5903)
........
Merged revisions 430646 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430647
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Wed, 14 Jan 2015 23:15:23 +0000 (23:15 +0000)]
res_pjsip: make it unloadable
The res_pjsip module was previously unloadable. With this patch it can now
be unloaded.
This patch is based off the original patch on the issue (listed below) by Corey
Farrell with a few modifications. Namely, removed a few changes not required to
make the module unloadable and also fixed a bug that would cause asterisk to
crash on unloading.
This patch is the first step (should hopefully be followed by another/others at
some point) in allowing res_pjsip and the modules that depend on it to be
unloadable. At this time, res_pjsip and some of the modules that depend on
res_pjsip cannot be unloaded without causing problems of some sort.
The goal of this patch is to get res_pjsip and only res_pjsip to be able to
unload successfully and/or shutdown without incident (crashes, leaks, etc...).
Other dependent modules may still cause problems on unload.
Basically made sure, with the patch applied, that res_pjsip (with no other
dependent modules loaded) could be succesfully unloaded and Asterisk could
shutdown without any leaks or crashes that pertained directly to res_pjsip.
ASTERISK-24485 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4311/
patches:
pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
........
Merged revisions 430628 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430629
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Wed, 14 Jan 2015 20:39:01 +0000 (20:39 +0000)]
Prevent slow graceful shutdown when outbound publications never started.
The code was missing the case for explicitly destroying an outbound publication
when Asterisk had never actually published anything. The result was that Asterisk
would hang for a while on a graceful shutdown.
With this change, the case is taken into account, and on a graceful shutdown, these
publications are destroyed without the need to actually send a PUBLISH request.
ASTERISK-24655 #close
Reported by Kevin Harwell
Review: https://reviewboard.asterisk.org/r/4325
........
Merged revisions 430608 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430609
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Wed, 14 Jan 2015 15:40:31 +0000 (15:40 +0000)]
build_tools/mkpkgconfig: Fix Cflags concatenation error in asterisk.pc
The mkpkgconfig script incorrectly concatenates Cflags options together. As an
example, the following:
Cflags: -I/usr/include/libxml2 -g3
Is instead generated as:
Cflags: -I/usr/include/libxml2-g3
This patch corrects the generation of Cflags in mkpkgconfig such that the
Cflags options are output correctly.
Review: https://reviewboard.asterisk.org/r/3707/
ASTERISK-23991 #close
Reported by: Diederik de Groot
patches:
fix_mkpkgconfig.diff uploaded by Diederik de Groot (License 6600)
........
Merged revisions 430589 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430590 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430591
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Tue, 13 Jan 2015 18:17:51 +0000 (18:17 +0000)]
app_macro: Don't restore the calling location on a channel redirect.
v11: If a channel redirect to a macro exten of a macro that is active
happens, the redirect location doesn't get executed. Instead the original
macro location is restored and gets reexecuted.
v13: An additional effect happens if a parked call times out to an
extension in the macro that parked the call then the macro is reexecuted
instead of the expected park return location.
* Made not restore the macro calling location on an
AST_SOFTHANGUP_ASYNCGOTO.
* Increased the locked channel range when setting up the macro execution
environment to cover things that should be done while the channel is
locked.
* Removed unnecessary NULL tests before calling ast_free() in
_macro_exec().
ASTERISK-23850 #close
Reported by: Andrew Nagy
Review: https://reviewboard.asterisk.org/r/4292/
........
Merged revisions 430564 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430565 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430567
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Tue, 13 Jan 2015 12:09:45 +0000 (12:09 +0000)]
chan_pjsip: Add configure check for 'pjsip_get_dest_info' function.
The 'pjsip_get_dest_info' function is used to determine if the signaling transport
of the dialog is secure or not. This function was added in PJSIP 2.3 and does not
exist in earlier versions.
This configure check allows Asterisk to build and run with older versions at the
loss of the 'secure' argument for the PJSIP CHANNEL dialplan function. Usage of
this argument will require upgrading to PJSIP 2.3.
ASTERISK-24665 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4329/
........
Merged revisions 430546 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430547
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Mon, 12 Jan 2015 19:13:03 +0000 (19:13 +0000)]
AMI: Revert non-backwards compatible changes from earlier commit.
* Reverted the change to astman_send_listack() to not use the listflag
parameter and always set the value to "Start" so the start capitalization
is consistent. Unfortunately changing the case of a returned value is not
a backward compatible change so for now FAXSessions is going to have to
remain inconsistent with all of the other AMI list actions.
* Reverted the minor protocol error fix in action_getconfig() when no
requested categories are found. Each line needs to be formatted as
"Header: text".
Caught by the testsuite.
ASTERISK-24049
........
Merged revisions 430528 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430529
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 12 Jan 2015 18:28:50 +0000 (18:28 +0000)]
configs/samples/features.conf.sample: Document attended transfer DTMF options
The sample config was missing the configuration options for DTMF attended
transfer completion scenarios. The configuration options 'atxferabort',
'atxfercomplete', 'atxferthreeway', and 'atxferswap' are now documented in the
appropriate configuration file.
ASTERISK-24678 #close
Reported by: Niklas Larsson
patches:
features.conf.sample.diff uploaded by Niklas Larsson (License 5068)
........
Merged revisions 430526 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430527
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Mon, 12 Jan 2015 18:09:27 +0000 (18:09 +0000)]
Revert -r430452 It needs to be redone for the next major AMI version change instead.
ASTERISK-24049
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 12 Jan 2015 18:01:46 +0000 (18:01 +0000)]
main/syslog: Allow dynamic logs, such as security events, to log to the syslog
The security event log uses a dynamic log level (SECURITY) that is registered
with the Asterisk logging core. Unfortunately, the syslog would ignore log
statements that had a dynamic log level associated with them. Because the
syslog cannot handle ad hoc dynamic log levels, this patch treats any dynamic
log entries sent to the syslog as logs with a level of NOTICE.
ASTERISK-20744 #close
Reported by: Michael Keuter
Tested by: Michael L. Young, Jacek Konieczny
patches:
asterisk-20744-syslog-dynamic-logging_trunk.diff uploaded by Michael L. Young (license 5026)
........
Merged revisions 430506 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430507 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430508
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 12 Jan 2015 15:18:24 +0000 (15:18 +0000)]
funcs/func_curl: Fix memory leak when CURLOPT channel datastore is destroyed
When the channel datastore associated with the usage of CURLOPT on a specific
channel is freed, the underlying structure holding the list of options is not
disposed of. This patch properly frees the structure in the datastore .destroy
callback.
ASTERISK-24672 #close
Reported by: Kristian Hogh
patches:
func_curl-memory-leak.diff uploaded by Kristian Hogh (License 6639)
........
Merged revisions 430487 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430488 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430489
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Fri, 9 Jan 2015 22:09:04 +0000 (22:09 +0000)]
sip_to_pjsip: improve ability to parse input files
General improvements to SIP to PJSIP conversion utility:
1) track default section of input file to allow parsing
an include file that doesn't specify a [section]
2) informatively handle case of assignment without [section]
3) correctly handle getting sections from included files
- [section]'s are inherited by included file
4) provide null string as default transport bind ip
5) gracefully handle missing portions of registration string
6) denote steps of operation during conversion and confirm
top level files as a convenience
ASTERISK-24474 #close
Review: https://reviewboard.asterisk.org/r/4280/
Reported by: John Kiniston
........
Merged revisions 430469 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430470
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Fri, 9 Jan 2015 21:45:10 +0000 (21:45 +0000)]
app_bridge: return to the next dialplan priority
When app_bridge grabs a channel and puts it into
a bridge, the channel should then continue where
it left off in the dialplan after the bridge has
ended. Although it stores the current dialplan
location as an after bridge goto on the channel,
it was executing the same priority again instead
of going to the next priority. By swapping the
"specific" version of bridge_set_after_goto with
bridge_set_after_go_on, the next priority in the
dialplan is executed instead.
ASTERISK-24637 #close
Review: https://reviewboard.asterisk.org/r/4322/
Reported by: John Bigelow
........
Merged revisions 430467 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430468
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Fri, 9 Jan 2015 18:53:49 +0000 (18:53 +0000)]
AMI: Remove no longer used parameter from astman_send_listack().
Follow-up issue to -r430435 from reviewboard review.
ASTERISK-24049
Review: https://reviewboard.asterisk.org/r/4315/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Fri, 9 Jan 2015 18:16:54 +0000 (18:16 +0000)]
AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency:
Agents
BridgeInfo
BridgeList
BridgeTechnologyList
ConfbridgeLIst
ConfbridgeLIstRooms
CoreShowChannels
DAHDIShowChannels
DBGet
DeviceStateList
ExtensionStateList
FAXSessions
Hangup
IAXpeerlist
IAXpeers
IAXregistry
MeetmeList
MeetmeListRooms
MWIGet
ParkedCalls
Parkinglots
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PresenceStateList
PRIShowSpans
QueueStatus
QueueSummary
ShowDialPlan
SIPpeers
SIPpeerstatus
SIPshowregistry
SKINNYdevices
SKINNYlines
Status
VoicemailUsersList
* Incremented the AMI version to 2.7.0.
* Changed astman_send_listack() to not use the listflag parameter and
always set the value to "Start" so the start capitalization is consistent.
i.e., The FAXSessions used "Start" while the rest of the system used
"start". The corresponding complete event always used "Complete".
* Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the
AMI ActionID for all of its list events.
* Fixed off-nominal AMI protocol error in manager_bridge_info(),
manager_parking_status_single_lot(), and
manager_parking_status_all_lots(). Use of astman_send_error() after
responding to the original AMI action request violates the action response
pattern by sending two responses.
* Fixed minor protocol error in action_getconfig() when no requested
categories are found. Each line needs to be formatted as "Header: text".
* Fixed off-nominal memory leak in manager_build_parked_call_string().
* Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail().
ASTERISK-24049 #close
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/4315/
........
Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Fri, 9 Jan 2015 14:53:09 +0000 (14:53 +0000)]
res_fax: Add T.38 negotiation timeout option
This change makes the T.38 negotiation timeout configurable via
't38timeout' in res_fax.conf or FAXOPT(t38timeout). It was previously
hard coded to be 5000 milliseconds.
This change also handles T.38 switch failures by aborting the fax since
in the case where this can happen, both sides have agreed to switch to
T.38 and Asterisk is unable to do so.
Review: https://reviewboard.asterisk.org/r/4320/
........
Merged revisions 430415 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430416 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430417
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Thu, 8 Jan 2015 21:41:02 +0000 (21:41 +0000)]
res_pjsip_pubsub: Fix persistent subscriptions not surviving graceful shutdown
If you do a 'core (shutdown|restart) graceful' persistent subscriptions won't
survive. If you do a 'core (shutdown|restart) now' or asterisk terminates for
some reason, they do. Here's why...
When asterisk shuts down gracefully, it sends a 'NOTIFY/terminated' to
subscribers for each subscription. This not only tells the subscribers that the
dialog/state machine is done, it also frees the last reference to the
subscription tree which causes the persistent subscription to get deleted from
astdb. When asterisk restarts, nothing's left. Just preventing the delete from
astdb doesn't work because we already told the subscriber to terminate the
dialog so we can't restart it even if it was still in astdb. Everything works
OK if asterisk terminates unexpectedly because we never send the 'terminated'
message so on restart, the subscription is still in astdb and the subscriber is
none the wiser.
This patch suppresses the sending of 'NOTIFY/terminated' on shutdown for
persistent connections.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4318/
........
Merged revisions 430397 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430398
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Thu, 8 Jan 2015 21:38:26 +0000 (21:38 +0000)]
res_pjsip_outbound_registration: Fix reference leak.
Every time a registration started, sip_outbound_registration_response_cb bumps
the ref count on client_state then pushes a handle_registration_response task.
handle_registration_response never unreffed it though. So every time a
registration goes out, the ref count goes up by one.
This patch adds the unreffs to handle_registration_response.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4303/
........
Merged revisions 430395 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430396
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Thu, 8 Jan 2015 17:51:36 +0000 (17:51 +0000)]
res_pjsip_outbound_registration: Fix several reload issues
There are 2 issues with reloading registrations...
1. The 'can_reuse_registration' test wasn't considering the intervals or
expiration in its determination of whether a registration changed or not so if
you changed any of the intervals or the expiration and reloaded, the object
would get reloaded but the actual timers wouldn't change.
can_reuse_registration now does a sorcery diff on the old and new objects
instead of discretely testing certain fields. Now if you change expiration for
instance, and reload, the timer is updated and re-registration will occur on the
new value.
2. If you mung up your password on an outbound registration you get a permanent
failure. If you fix the password (on the outbound_auth object) and reload,
nothing tells outbound_registration to try again because the registration itself
didn't change. This patch adds an observer on the "auth" object type and if any
auth changes, existing registration states are searched and those in a
REJECTED_PERMANENT state are retried.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4304/
........
Merged revisions 430373 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430374
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Wed, 7 Jan 2015 21:26:48 +0000 (21:26 +0000)]
ARI: Allow usage of ASYNCGOTO with Stasis()
When the AMI Redirect action is used with a channel bridged inside
Stasis() and not running a pbx, the channel is hung up instead of
proceeding to the desired location in dialplan. This change allows
such channels to be Redirected properly by detecting the operation
used by Redirect (ASYNCGOTO) and using the code already established
for functionality of the ARI channel continue operation.
ASTERISK-24591 #close
Review: https://reviewboard.asterisk.org/r/4271/
........
Merged revisions 430355 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430356
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Wed, 7 Jan 2015 18:54:06 +0000 (18:54 +0000)]
Add the ability to continue and originate using priority labels.
With this patch, the following two ARI commands
POST /channels
POST /channels/{id}/continue
Accept a new parameter, label, that can be used to continue to or originate
to a priority label in the dialplan.
Because this is adding a new parameter to ARI commands, the API version of
ARI has been bumped from 1.6.0 to 1.7.0.
This patch comes courtesy of Nir Simionovich from Greenfield Tech. Thanks!
ASTERISK-24412 #close
Reported by Nir Simionovich
Review: https://reviewboard.asterisk.org/r/4285
........
Merged revisions 430337 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430338
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Wed, 7 Jan 2015 18:17:42 +0000 (18:17 +0000)]
res_pjsip_exten_state: Change 'does not exist' warning to notice
The 'new_subscribe: Extension <> does not exist or has no associated hint'
is a config issue and doesn't need to clutter up logs with warnings.
Changed to notice.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4307/
........
Merged revisions 430319 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430321
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Wed, 7 Jan 2015 18:15:02 +0000 (18:15 +0000)]
res_pjsip_mwi: Change "MWI Subscription failed" message from warning to notice
The "MWI Subscription failed" message means the client is trying to subscribe
to a mailbox that doesn't exist. There's no need to clutter up logs with
warnings for a client misconfiguration so I changed it to a notice.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4306/
........
Merged revisions 430317 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430318
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Wed, 7 Jan 2015 17:54:13 +0000 (17:54 +0000)]
func_config: Add ability to retrieve specific occurrence of a variable
I guess nobody uses templates with AST_CONFIG because today if you have a
context that inherits from a template and you call AST_CONFIG on the context,
you'll get the value from the template even if you've overridden it in the
context. This is because AST_CONFIG only gets the first occurrence which is
always from the template.
This patch adds an optional 'index' parameter to AST_CONFIG which lets you
specify the exact occurrence to retrieve, or '-1' to retrieve the last.
The default behavior is the current behavior.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4313/
........
Merged revisions 430315 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430316
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Wed, 7 Jan 2015 17:45:56 +0000 (17:45 +0000)]
Fix ability to perform a remote attended transfer with PJSIP.
This fix has two parts:
* Corrected an error message to properly state that external_replaces is an extension. The
error message also prints what dialplan context the external_replaces extension was being
looked for in.
* Corrected the printing of the Replaces: header in an INVITE request. We were duplicating
"Replaces: " in the header.
ASTERISK-24376 #close
Reported by Matt Jordan
Review: https://reviewboard.asterisk.org/r/4296
........
Merged revisions 430313 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430314
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Wed, 7 Jan 2015 16:56:59 +0000 (16:56 +0000)]
config: Add option to NOT preserve effective context when changing a template
Let's say you have a template T with variable VAR1 = ON and you have a
context C(T) that doesn't specify VAR1. If you read C, the effective value
of VAR1 is ON. Now you change T VAR1 to OFF and call
ast_config_text_file_save. The current behavior is that the file gets
re-written with T/VAR1=OFF but C/VAR1=ON is added. Personally, I think this
is a bug. It's preserving the effective state of C even though I didn't
specify C/VAR1 in th first place. I believe the behavior should be that if
I didn't specify C/VAR1 originally, then the effective value of C/VAR1 should
continue to follow the inherited state. Now, if I DID explicitly specify
C/VAR1, the it should be preserved even if the template changes.
Even though I think the existing behavior is a bug, it's been that way forever
so I'm not changing it. Instead, I've created ast_config_text_file_save2()
that takes a bitmask of flags, one of which is to preserve the effective context
(the current behavior). The original ast_config_text_file_save calls *2 with
the preserve flag. If you want the new behavior, call *2 directly without a
flag.
I've also updated Manager UpdateConfig with a new parameter
'PreserveEffectiveContext' whose default is 'yes'. If you want the new behavior
with UpdateConfig, set 'PreserveEffectiveContext: no'.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4297/
........
Merged revisions 430295 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430296
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Wed, 7 Jan 2015 03:01:39 +0000 (03:01 +0000)]
Fix dev-mode build on recent gcc
........
Merged revisions 430274 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430275
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Tue, 6 Jan 2015 22:46:43 +0000 (22:46 +0000)]
Blocked revisions 430252
........
contrib/ast-db-manage: Correct down_revision path for user_eq_phone
When the user_eq_phone patch was backported to 13, it referenced the downward
revision that the PJSIP optimistic encryption option also references. This
creates a multi-path upgrade Exception when generating the SQL files.
This patch corrects this in the 13 branch. Note that trunk, which already
contained both of these features, is unaffected by this problem.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430254
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 6 Jan 2015 17:53:42 +0000 (17:53 +0000)]
res_pjsip_mwi: Change warning to notice
When res_pjsip loads and an endpoint auto-subscribes a mailbox for mwi,
if a contact hasn't registered yet, res_pjsip_mwi spits out a warning.
This is a perfectly normal situation though and doesn't require something
as serious as a warning. It's also self correcting. The device will start
getting mwi as soon as it registers.
This patch changes the warning to a notice.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4314/
........
Merged revisions 430227 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430228
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 6 Jan 2015 17:49:03 +0000 (17:49 +0000)]
bridge_native_rtp: Change local/remote message from debug/2 to verb/4
Change the "Locally bridged"/"Remotely bridged" messages from dbg/2 to verb/4.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4300/
........
Merged revisions 430225 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430226
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 6 Jan 2015 17:43:16 +0000 (17:43 +0000)]
outbound_registration: Add 'pjsip send register' and update 'send unregister'
The current behavior of 'pjsip send unregister' is to send the unregister
(REGISTER with 0 exp) but let the next scheduled register proceed normally.
I don't think that's a good idea. If you unregister, it should stay
unregistered until you decide to start registrations again. So this patch
just adds a cancel_registration call to the current unregister_task to
cancel the timer.
Of course, now you need a way to start registration again so I've added
a 'pjsip send register' command that unregisters and cancels any existing
registration (the same as send unregister), then sends an immediate
registration and starts the timer back up again.
Both changes also ripple to AMI. There's a new PJSIPRegister command.
There's no harm in calling either command repeatedly. They don't care
about the actual state.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4301/
........
Merged revisions 430223 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430224
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 6 Jan 2015 17:29:33 +0000 (17:29 +0000)]
pjsip cli: Fix sorting of contacts for 'pjsip list contacts'
For some reason I was using a hash container instead of a list to gather the
contacts for 'pjsip list/show contacts' so even though I had a sort function,
the output wasn't sorted. This patch just changes the hash container to a
list container and the contacts now appear sorted in the CLI.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4305/
........
Merged revisions 430221 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430222
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Mon, 5 Jan 2015 22:50:32 +0000 (22:50 +0000)]
bridge: avoid leaking channel during blond transfer pt2
A blond transfer to a failed destination, when followed
by a recall attempt, lead to a leak of the reference to
the destination channel. In addition to correcting the
regression on the previous attempt (r429826) this fixes
the leak and two additional reference leaks on failures
of bridge_import.
ASTERISK-24513 #close
Review: https://reviewboard.asterisk.org/r/4302/
........
Merged revisions 430199 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 430200 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430201
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Mon, 5 Jan 2015 17:57:43 +0000 (17:57 +0000)]
pjsip: Document addition of 'PJSIP_AOR' and 'PJSIP_CONTACT' in CHANGES file.
........
Merged revisions 430181 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430182
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Mon, 5 Jan 2015 17:53:42 +0000 (17:53 +0000)]
pjsip: Add 'PJSIP_AOR' and 'PJSIP_CONTACT' dialplan functions.
The PJSIP_AOR dialplan function allows inspection of configured AORs including
what contacts are currently bound to them.
The PJSIP_CONTACT dialplan function allows inspection of contacts in existence.
These can include both externally added (by way of registration) or permanent
ones.
ASTERISK-24341
Reported by: xrobau
Review: https://reviewboard.asterisk.org/r/4308/
........
Merged revisions 430179 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430180
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Wed, 31 Dec 2014 18:54:37 +0000 (18:54 +0000)]
rtp_engine: keep payload types in correct range
In r428708 additional codecs were added including
a payload type of 128 which is outside of nominal
range of 0-127. This change moves changes 128 to
96 to avoid causing a pjsip assertion when making
a call to an endpoint configured with allow=all.
ASTERISK-24367 #close
Review: https://reviewboard.asterisk.org/r/4286/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430164
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Mon, 29 Dec 2014 13:14:19 +0000 (13:14 +0000)]
PJSIP: Update transport method documentation
This updates the documentation for the 'method' configuration option to
be more verbose about the behaviors of values 'unspecified' and
'default'. They do exactly the same thing which is to select the
default as defined by PJSIP which is currently TLSv1.
Review: https://reviewboard.asterisk.org/r/4264/
........
Merged revisions 430145 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430146
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Wed, 24 Dec 2014 21:28:14 +0000 (21:28 +0000)]
app_queue: Update sample conf documenation
Updated the queues.conf.sample file to explicitly state which channel queue
variables are propagated to.
ASTERISK-24267
Reported by: Mitch Claborn
........
Merged revisions 430126 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430127 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430128
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Wed, 24 Dec 2014 16:59:42 +0000 (16:59 +0000)]
main/pbx.c: Fix double lock of contexts lock introduced by r429967
We only need to hold the context_merge_lock once. Locking it twice will make
many other parts of Asterisk very sad.
ASTERISK-24641 #close
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430111
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 23 Dec 2014 23:19:30 +0000 (23:19 +0000)]
pjsip_options: Fix continued qualifies after endpoint/aor deletion
If you remove an endpoint/aor from pjsip.conf then do a core reload,
qualifies will continue even though the object are gone. This happens
because nothing clears out the qualify tasks.
This patch unschedules all existing qualify tasks before scheduling
new ones on reload.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4290/
........
Merged revisions 430064 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430067
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 23 Dec 2014 23:16:35 +0000 (23:16 +0000)]
test_astobj2: Fix warning for missing trailing slash in category
This patch adds a trailing slash to the category for this test.
No more warning.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4295/
........
Merged revisions 430059 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430060
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Mon, 22 Dec 2014 21:20:11 +0000 (21:20 +0000)]
DTMF atxfer: Setup recall channels as if the transferee initiated the call.
After the initial DTMF atxfer call attempt to the transfer target fails to
answer during a blonde transfer, the recall callback channels do not get
setup with information from the initial transferrer channel. As a result,
the recall callback to the transferrer does not have callid, channel
variables, datastores, accountcode, peeraccount, COLP, and CLID setup. A
similar situation happens with the recall callback to the transfer target
but it is less visible. The recall callback to the transfer target does
not have callid, channel variables, datastores, accountcode, peeraccount,
and COLP setup.
* Added missing information to the recall callback channels before
initiating the call. callid, channel variables, datastores, accountcode,
peeraccount, COLP, and CLID
* Set callid of the transferrer channel on the DTMF atxfer controller
thread attended_transfer_monitor_thread().
* Added missing channel unlocks and props unref to off nominal paths in
attended_transfer_properties_alloc().
ASTERISK-23841 #close
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/4259/
........
Merged revisions 430034 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430041
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Mon, 22 Dec 2014 20:25:40 +0000 (20:25 +0000)]
Fix compilation since the patch for ASTERISK-24363 went in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430028
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Mon, 22 Dec 2014 20:08:35 +0000 (20:08 +0000)]
queue_log: Post QUEUESTART entry when Asterisk fully boots.
The QUEUESTART log entry has historically acted like a fully booted event
for the queue_log file. When the QUEUESTART entry was posted to the log
was broken by the change made by ASTERISK-15863.
* Made post the QUEUESTART queue_log entry when Asterisk fully boots.
This restores the intent of that log entry and happens after realtime has
had a chance to load.
AST-1444 #close
Reported by: Denis Martinez
Review: https://reviewboard.asterisk.org/r/4282/
........
Merged revisions 430009 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 430010 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430011
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 22 Dec 2014 15:40:27 +0000 (15:40 +0000)]
chan_sip: Send CANCEL via original INVITE destination even after UPDATE request
Given the following scenario:
* Three SIP phones (A, B, C), all communicating via a proxy with Asterisk
* A call is established between A and B. B performs a SIP attended transfer of
A to C. B sets the call on hold (A is hearing MOH) and dials the extension of
C. While phone C is ringing, B transfers the call (that is, what we typically
call a 'blond transfer').
* When the transfer completes, A hears the ringing of phone C, while B is idle.
In the SIP messaging for the above scenario, a REFER request is sent to
transfer the call. When "sendrpid=yes" is set in sip.conf, Asterisk may send an
UPDATE request to phone C to update party information. This update is sent
directly to phone C, not through the intervening proxy. This has the unfortunate
side effect of providing route information, which is then set on the sip_pvt
structure for C. If someone (e.g. B) is trying to get the call back (through a
directed pickup), Asterisk will send a CANCEL request to C. However, since we
have now updated the route set, the CANCEL request will be sent directly to C
and not through the proxy. The phone ignores this CANCEL according to RFC3261
(Section 9.1).
This patch updates reqprep such that the route is not updated if an UPDATE
request is being sent while the INVITE state is INV_PROCEEDING or
INV_EARLY_MEDIA. This ensures that a subsequent CANCEL request is still sent
to the correct location.
Review: https://reviewboard.asterisk.org/r/4279
ASTERISK-24628 #close
Reported by: Karsten Wemheuer
patches:
issue.patch uploaded by Karsten Wemheuer (License 5930)
........
Merged revisions 429982 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429983 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429984
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 22 Dec 2014 14:33:24 +0000 (14:33 +0000)]
presencestate: Allow channel drivers to provide presence state information
This patch adds the ability for channel drivers to supply presence information
in a similar manner to device state. The patch does not provide any channel
driver implementations, but it does provide the core infrastructure necessary
for channel drivers to provide such information.
The core handles multiple providers of presence state information. Ordering
of presence state is as follows:
INVALID < NOT_SET < AVAILABLE < UNAVAILABLE < CHAT < AWAY < XA < DND
Each provider can trump the previous if it provides a presence state that
supercedes a previous one.
Review: https://reviewboard.asterisk.org/r/4050
ASTERISK-24363 #close
Reported by: Gareth Palmer
patches:
chan_presencestate-428146.patch uploaded by Gareth Palmer (License 5169)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429967
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 22 Dec 2014 12:16:36 +0000 (12:16 +0000)]
app_confbridge: Fix build error caused by XML validation errors
Summaries can't contain XML nodes, as they are defined to contain only text
data.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429952
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 22 Dec 2014 02:35:05 +0000 (02:35 +0000)]
app_confbridge: Add the ability to pass options/command to MixMonitor
This patch adds the ability to pass options and a command to MixMontor when
recording a conference using ConfBridge.
New options are -
* record_options: Options to MixMontor, eg: m(), W() etc.
* record_command: The command to execute when recording is over.
* record_file_timestamp: Append the start time to the file name.
These options can also be used with the CONFBRIDGE function, e.g.,
Set(CONFBRIDGE(bridge,record_command)=/path/to/command ^{MIXMONITOR_FILENAME}))
Review: https://reviewboard.asterisk.org/r/4023
ASTERISK-24351 #close
Reported by: Gareth Palmer
patches:
record_command-428838.patch uploaded by Gareth Palmer (License 5169)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429934
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Mon, 22 Dec 2014 00:17:49 +0000 (00:17 +0000)]
res_pjsip_phoneprovi_provider: Fix reload
Reloading wasn't working correctly because on a reload, the sorcery apply
handler was never being called for unchanged users. So, instead of using
an apply handler, I'm now iterating over all users. Works much more reliably.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4288/
........
Merged revisions 429914 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429915
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Sat, 20 Dec 2014 20:57:47 +0000 (20:57 +0000)]
acl: Fix reloading of configuration if configuration file does not exist at startup.
The named ACL code incorrectly destroyed the config options information if loading
of the configuration file failed at startup. This would result in reloading
also failing even if a valid configuration file was put in place.
ASTERISK-23733 #close
Reported by: Richard Kenner
........
Merged revisions 429893 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429894 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429895
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Fri, 19 Dec 2014 20:56:12 +0000 (20:56 +0000)]
res_http_websocket.c: Fix incorrect use of sizeof in ast_websocket_write().
This won't fix the reported issue but it is an incorrect use of sizeof.
ASTERISK-24566
Reported by: Badalian Vyacheslav
........
Merged revisions 429867 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429868 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429870
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Fri, 19 Dec 2014 17:34:33 +0000 (17:34 +0000)]
chan_dahdi: Don't ignore setvar when using configuration section scheme.
When the configuration section scheme of chan_dahdi.conf is used (keyword
dahdichan instead of channel) all setvar= options are completely ignored.
No variable defined this way appears in the created DAHDI channels.
* Move the clearing of setvar values to after the deferred processing of
dahdichan.
AST-1378 #close
Reported by: Guenther Kelleter
Patch by: Guenther Kelleter
........
Merged revisions 429825 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429829 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429830
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Fri, 19 Dec 2014 17:27:25 +0000 (17:27 +0000)]
bridge: avoid leaking channel during blond transfer
After a blond transfer (start attended and hang up)
to a destination that also hangs up without answer,
the Local;1 channel was leaked and would show up on
core show channels. This was happening because the
attended state blond_nonfinal_enter() resetting the
props->transfer_target to null while releasing it's
own reference, which would later prevent props from
releasing another reference during destruction. The
change made here is simply to not assign the target
to NULL.
ASTERISK-24513 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4262/
........
Merged revisions 429826 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429827 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429828
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Thu, 18 Dec 2014 22:40:16 +0000 (22:40 +0000)]
chan_dahdi.c, res_rtp_asterisk.c: Change some spammy debug messages to level 5.
ASTERISK-24337 #close
Reported by: Rusty Newton
........
Merged revisions 429804 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429805 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429806
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Thu, 18 Dec 2014 20:09:21 +0000 (20:09 +0000)]
chan_dahdi: Populate CALLERID(ani2) for incoming calls in featdmf signaling mode.
For the featdmf signaling mode the incoming MF Caller-ID information is
formatted as follows: *${CALLERID(ani2)}${CALLERID(ani)}#*${EXTEN}#
Rather than discarding the ani2 digits, populate the CALLERID(ani2) value
with what is received instead.
AST-1368 #close
Reported by: Denis Martinez
Patches:
extract_ani2_for_featdmf_v11.patch (license #5621) patch uploaded by Richard Mudgett
........
Merged revisions 429783 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429784 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429785
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Thu, 18 Dec 2014 15:55:03 +0000 (15:55 +0000)]
res_pjsip_sdp_rtp: wrong bridge chosen when the DTMF mode is not compatible
A native rtp bridge was being chosen (it shouldn't have been) when using two
pjsip channels with incompatible DTMF modes. This patch sets the rtp instance
property, AST_RTP_PROPERTY_DTMF, for the appropriate DTMF mode(s) for pjsip.
It was not being set before, meaning all DTMF modes for pjsip were being treated
as compatible, thus native bridging would be chosen as the bridge type when it
shouldn't have been.
ASTERISK-24459 #close
Reported by: Yaniv Simhi
Review: https://reviewboard.asterisk.org/r/4265/
........
Merged revisions 429763 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429764
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Thu, 18 Dec 2014 15:40:13 +0000 (15:40 +0000)]
Prevent potential infinite outbound authentication loops in registration.
Prior to this patch, Asterisk would always respond to 401 responses to
registration attempts by trying to provide a registration with authentication
credentials. Even if subsequent attempts were rejected with 401 responses,
Asterisk would continue this behavior. If authentication credentials were
incorrect, this could continue forever.
With this patch, we keep track of whether we have attempted authentication
on an outbound registration attempt. If we already have, we don not try
again until the next attempt. This prevents the infinite loop scenario.
Review: https://reviewboard.asterisk.org/r/4273
........
Merged revisions 429761 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429762
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Thu, 18 Dec 2014 15:18:45 +0000 (15:18 +0000)]
Prevent possible race condition on dual redirect of channels in the same bridge.
The AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT flag was created to prevent bridges from
prematurely acting on orphaned channels in bridges. The problem with the AMI
redirect action was that it was setting this flag on channels based on the presence
of a PBX, not whether the channel was in a bridge. Whether a channel has a PBX
is irrelevant, so the condition has been altered to check if the channel is in a
bridge.
ASTERISK-24536 #close
Reported by Niklas Larsson
Review: https://reviewboard.asterisk.org/r/4268
........
Merged revisions 429741 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429745
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Thu, 18 Dec 2014 14:50:06 +0000 (14:50 +0000)]
Ensure the correct value is returned for CHANNEL(pjsip, secure)
Prior to this patch, we were using the PJSIP dialog's secure flag
to determine if a secure transport was being used. Unfortunately,
the dialog's secure flag was only set if a SIPS URI were in use,
as required by RFC 3261 sections 12.1.1 and 12.1.2. What we're interested
in is not dialog security, but transport security. This code change
switches to a model where we use the dialog's target URI to determine
what transport would be used to communicate, and then check if that
transport is secure.
AST-1450 #close
Reported by John Bigelow
Review: https://reviewboard.asterisk.org/r/4277
........
Merged revisions 429739 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429740
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Thu, 18 Dec 2014 00:11:24 +0000 (00:11 +0000)]
res_pjsip_config_wizard: fix unload SEGV
If certain pjsip modules aren't loaded, the wizard causes a SEGV
when it unloads. Added a check for the presense of the object
type wizard before trying to clean it up.
Tested-by: George Joseph
........
Merged revisions 429719 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429720
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Wed, 17 Dec 2014 23:06:01 +0000 (23:06 +0000)]
res_pjsip_config_wizard: Change FILEUNCHANGED config_load2 flag determination
The module now applies the FILEUNCHANGED flag when both reloaded is
specified AND there's no last_config for the object type.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4276/
........
Merged revisions 429699 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429700
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Walter Doekes [Wed, 17 Dec 2014 10:23:32 +0000 (10:23 +0000)]
Fix printf problems with high ascii characters after r413586 (1.8).
In r413586 (1.8) various casts were added to silence gcc 4.10 warnings.
Those fixes included things like:
-out += sprintf(out, "%%%02X", (unsigned char) *ptr);
+out += sprintf(out, "%%%02X", (unsigned) *ptr);
That works for low ascii characters, but for the high range that yields
e.g.
FFFFFFC3 when C3 is expected.
This changeset:
- fixes those casts to use the 'hh' unsigned char modifier instead
- consistently uses %02x instead of %2.2x (or other non-standard usage)
- adds a few 'h' modifiers in various places
- fixes a 'replcaes' typo
- dev/urandon typo (in 13+ patch)
Review: https://reviewboard.asterisk.org/r/4263/
ASTERISK-24619 #close
Reported by: Stefan27 (on IRC)
........
Merged revisions 429673 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429674 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429675 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429683
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Tue, 16 Dec 2014 17:53:59 +0000 (17:53 +0000)]
res_pjsip_config_wizard: fix test breakage
Fix test breakage caused by not checking for res_pjsip before
calling ast_sip_get_sorcery.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4269/
........
Merged revisions 429653 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429654
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Tue, 16 Dec 2014 16:39:47 +0000 (16:39 +0000)]
chan_sip: Allow T.38 switch-over when SRTP is in use.
Previously when SRTP was enabled on a channel it was not possible
to switch to T.38 as no crypto attributes would be present.
This change makes it so it is now possible. If a T.38 re-invite
comes in SRTP is terminated since in practice you can't encrypt
a UDPTL stream. Now... if we were doing T.38 over RTP (which
does exist) then we'd have a chance but almost nobody does that so
here we are.
ASTERISK-24449 #close
Reported by: Andreas Steinmetz
patches:
udptl-ignore-srtp-v2.patch submitted by Andreas Steinmetz (license 6523)
........
Merged revisions 429632 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429633 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429634
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Tue, 16 Dec 2014 15:44:43 +0000 (15:44 +0000)]
res_pjsip_t38: Fix T.38 failure when peer reinvites immediately.
If a remote endpoint reinvites to T.38 immediately the state machine
will go into a peer reinvite state. If a T.38 capable application
(such as ReceiveFax) queries it will receive this state. Normally
the application will then indicate so that the channel driver will
queue up the T.38 offer previously received. Once it receives this
offer the application will act normally and negotiate.
The res_pjsip_t38 module incorrectly partially squashed this indication.
This would cause the application to think the request had failed when
in reality it had actually worked.
This change makes it so that no T.38 control frames (or indications)
are squashed.
........
Merged revisions 429612 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429613
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Mon, 15 Dec 2014 17:08:24 +0000 (17:08 +0000)]
res_pjsip_config_wizard: Allow streamlined config of common pjsip scenarios
res_pjsip_config_wizard
------------------
* This is a new module that adds streamlined configuration capability for
chan_pjsip. It's targetted at users who have lots of basic configuration
scenarios like 'phone' or 'agent' or 'trunk'. Additional information
can be found in the sample configuration file at
config/samples/pjsip_wizard.conf.sample.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4190/
........
Merged revisions 429592 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429593
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Mon, 15 Dec 2014 15:48:47 +0000 (15:48 +0000)]
Activate persistent subscriptions when they are recreated.
Prior to this change, recreating persistent subscriptions would
create the subscription but would not activate it. This led to subscriptions
being listed in the "NULL" state by diagnostics and not sending NOTIFYs
when expected.
Review: https://reviewboard.asterisk.org/r/4261
........
Merged revisions 429571 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429573
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Fri, 12 Dec 2014 23:57:50 +0000 (23:57 +0000)]
loader: Move definition of ast_module_reload from _private.h to module.h
No functionality change. Just move the definition of ast_module_reload
from _private.h to module.h so it can be public.
Also removed the include of _private.h from manager.c since ast_module_load
was the only reason for including it.
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4251/
........
Merged revisions 429542 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429543
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Richard Mudgett [Fri, 12 Dec 2014 23:49:36 +0000 (23:49 +0000)]
DEBUG_THREADS: Fix regression and lock tracking initialization problems.
This patch started with David Lee's patch at
https://reviewboard.asterisk.org/r/2826/ and includes a regression fix
introduced by the ASTERISK-22455 patch.
The initialization of a mutex's lock tracking structure was not protected
in a critical section. This is fine for any mutex that is explicitly
initialized, but a static mutex may have its lock tracking double
initialized if multiple threads attempt the first lock simultaneously.
* Added a global mutex to properly serialize initialization of the lock
tracking structure. The painful global lock can be mitigated by adding a
double checked lock flag as discussed on the original review request.
* Defer lock tracking initialization until first use.
* Don't be "helpful" and initialize an uninitialized lock when
DEBUG_THREADS is enabled. Debug code is not supposed to fix or change
normal code behavior. We don't need a lock initialization race that would
force a re-setup of lock tracking. Lock tracking already handles
initialization on first use.
* Properly handle allocation failures of the lock tracking structure.
* No need to initialize tracking data in __ast_pthread_mutex_destroy()
just to turn around and destroy it.
The regression introduced by ASTERISK-22455 is the result of manipulating
a pthread_mutex_t struct outside of the pthread library code. The
pthread_mutex_t struct seems to have a global linked list pointer member
that can get changed by other threads. Therefore, saving and restoring
the contents of a pthread_mutex_t struct is a bad thing.
Thanks to Thomas Airmont for finding this obscure regression.
* Don't overwrite the struct ast_lock_track.reentr_mutex member to restore
tracking data in __ast_cond_wait() and __ast_cond_timedwait(). The
pthread_mutex_t struct must be treated as a read-only opaque variable.
Miscellaneous other items fixed by this patch:
* Match ast_suspend_lock_info() with ast_restore_lock_info() in
__ast_cond_timedwait().
* Made some uninitialized lock sanity checks return EINVAL and try a
DO_THREAD_CRASH.
* Fix bad canlog initialization expressions.
ASTERISK-24614 #close
Reported by: Thomas Airmont
Review: https://reviewboard.asterisk.org/r/4247/
Review: https://reviewboard.asterisk.org/r/2826/
........
Merged revisions 429539 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429541
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Fri, 12 Dec 2014 22:54:02 +0000 (22:54 +0000)]
res/res_agi: Make Verbose message for 'stream file' match other playbacks
The Verbose message displayed when a file is played back via 'stream file'
was formatted differently than other playbacks:
* It didn't include the channel name
* It didn't include the channel language
It does, however, include the playback offset as well as any escape digits.
That information was kept; however, this patch updates the formatting to more
closely match the Verbose messages displayed when a file is played back by
'control stream file', Playback, ControlPlayback, or any other file playback
operation.
........
Merged revisions 429519 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429520
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Fri, 12 Dec 2014 17:01:42 +0000 (17:01 +0000)]
media: Fix crash when determining sample count of a frame during shutdown.
When shutting down Asterisk the codecs are cleaned up. As a result anything
attempting to get a codec based on ID or details will find that no codec
exists. This currently occurs when determining the sample count of a frame.
This code did not take this situation into account.
This change fixes this by getting the codec directly from the format and
eliminates the lookup. This is both faster and also provides a guarantee
that the codec will exist and will be valid.
ASTERISK-24604 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4260/
........
Merged revisions 429497 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429498
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Fri, 12 Dec 2014 15:31:38 +0000 (15:31 +0000)]
chan_pjsip: Race between channel answer and bridge setup when using direct media
When direct media is enabled and a pjsip channel is answered a race would occur
between the handling of the answer and bridge setup. Sometimes the media
negotiation would take place after the native bridge was setup. This resulted
in a NULL media address, which in turn resulted in Asterisk using its address
as the remote media address when sending a reinvite. This patch makes the
chan_pjsip answer handler synchronous thus alleviating the race condition (the
bridge won't start setting things up until after it returns).
ASTERISK-24563 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4257/
........
Merged revisions 429477 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429478
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
David M. Lee [Fri, 12 Dec 2014 15:03:16 +0000 (15:03 +0000)]
Fix crash for sorcery misconfigs
res_pjsip_outbound_publish was missing the CHECK_PJSIP_MODULE_LOADED()
call in load_module, and would crash with a segfault if res_pjsip
declined to load.
Review: https://reviewboard.asterisk.org/r/4258/
........
Merged revisions 429457 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429458
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Fri, 12 Dec 2014 14:12:38 +0000 (14:12 +0000)]
PJSIP: Allow use of 'inactive' streams for hold
This allows use of the 'inactive' stream direction identifier to be
used for hold where 'sendonly' is normally used. Some Seimens phones
use 'inactive' and this change allows music on hold to operate
properly.
Review: https://reviewboard.asterisk.org/r/4252/
Reported by: Steve Pitts
........
Merged revisions 429432 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429433 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429434
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Fri, 12 Dec 2014 14:04:06 +0000 (14:04 +0000)]
Sorcery: Log when old config remains in use
This adds a log message notifying the user that a stale configuration
is in place upon reload when a config object fails to load. This
situation can end up causing confusion when the object failed to load
but exists from a previous config load especially when the old config
is significantly different from the new config.
Review: https://reviewboard.asterisk.org/r/4250/
Reported by: Thomas Thompson
........
Merged revisions 429429 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429430 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429431
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Fri, 12 Dec 2014 13:06:24 +0000 (13:06 +0000)]
res_pjsip_session: Delay sending BYE if a re-INVITE transaction is in progress.
Given the scenario where a PJSIP channel is in a native RTP bridge with direct
media and the channel is then hung up the code will currently re-INVITE the channel
back to Asterisk and send a BYE at the same time. Many SIP implementations dislike
this greatly.
This change makes it so that if a re-INVITE transaction is in progress the BYE
is queued to occur after the completion of the transaction (be it through normal
means or a timeout).
Review: https://reviewboard.asterisk.org/r/4248/
........
Merged revisions 429409 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429410
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Fri, 12 Dec 2014 12:32:13 +0000 (12:32 +0000)]
res_pjsip_session: Fix issue where a declined media stream in a re-INVITE would fail SDP negotiation.
In the past the SDP negotiation within res_pjsip_session was made more tolerant of
certain situations. The only case where SDP negotiation will fail is when a major
error occurs during negotiation. Receiving an already declined media stream is
not considered a major error.
When producing the local SDP the logic took this into account so on the initial INVITE
the declined media stream did not cause an SDP negotiation failure. Unfortunately
the logic for handling media streams with a handler did not mirror this logic and
considered an already declined media stream an error and thus failed the SDP
negotiation.
This change makes the logic between both situations match so only under major
errors will the SDP negotiation fail.
ASTERISK-24607 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4254/
........
Merged revisions 429407 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429408
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Thu, 11 Dec 2014 20:32:21 +0000 (20:32 +0000)]
ARI/AMI: Include language in standard channel snapshot output
The CHANGES verbiage for the "language" addition had been put under the wrong
release. This moves it to be under 13.1 to 13.2 changes.
ASTERISK-24553
Reported by: Matt Jordan
........
Merged revisions 429387 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429388
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Thu, 11 Dec 2014 13:53:39 +0000 (13:53 +0000)]
Stasis: Update unittest for channel snapshots
This adjusts the unit test for channel snapshots to take the new
language key into account.
........
Merged revisions 429352 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429353
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Wed, 10 Dec 2014 15:43:48 +0000 (15:43 +0000)]
ARI/AMI: Include language in standard channel snapshot output
Adding information about including "language" in the standard channel snapshot
output to the CHANGES file. Note the actual source changes have already been
previously committed.
ASTERISK-24553
Reported by: Matt Jordan
........
Merged revisions 429325 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429326 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429327
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Wed, 10 Dec 2014 13:35:52 +0000 (13:35 +0000)]
res_http_websocket: Fix crash due to double freeing memory when receiving a payload length of zero.
Frames with a payload length of 0 were incorrectly handled in res_http_websocket.
Provided a frame with a payload had been received prior it was possible for a double
free to occur. The realloc operation would succeed (thus freeing the payload) but be
treated as an error. When the session was then torn down the payload would be
freed again causing a crash. The read function now takes this into account.
This change also fixes assumptions made by users of res_http_websocket. There is no
guarantee that a frame received from it will be NULL terminated.
ASTERISK-24472 #close
Reported by: Badalian Vyacheslav
Review: https://reviewboard.asterisk.org/r/4220/
Review: https://reviewboard.asterisk.org/r/4219/
........
Merged revisions 429270 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429272 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429273 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429274
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Wed, 10 Dec 2014 13:16:19 +0000 (13:16 +0000)]
PJSIP: Fix assert on initial mass qualify
This fixes the MWI test regressions caused by r429127 and ensures that
contacts have non-zero qualify_frequency before attempting scheduling.
........
Merged revisions 429245 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429246 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429247
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Scott Griepentrog [Tue, 9 Dec 2014 20:47:05 +0000 (20:47 +0000)]
core: avoid possible asterisk -r crash from long id
When connecting to the remote console, an id string
is first provided that consts of the hostname, pid,
and version. This is parsed by the remote instance
using a buffer that may be too short, and can allow
a buffer overrun because it is not terminated. This
patch adds termination and a larger buffer.
Review: https://reviewboard.asterisk.org/r/4182/
........
Merged revisions 429223 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429224
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Tue, 9 Dec 2014 20:20:27 +0000 (20:20 +0000)]
ARI/AMI: Include language in standard channel snapshot output
The channel "language" was already part of a channel snapshot, however is was
not sent out over AMI or ARI. This patch makes it so the channel "language" is
included in the appropriate AMI or ARI events.
ASTERISK-24553 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4245/
........
Merged revisions 429204 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429206 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429209
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Tue, 9 Dec 2014 20:03:22 +0000 (20:03 +0000)]
Direct Media calls within private network sometimes get one way audio
When endpoints with direct_media enabled, behind a firewall (Asterisk on a
separate network) and were bridged sometimes Asterisk would send the ip
address of the firewall in the sdp to one of the phones in the reinvite
resulting in one way audio. When sending the reinvite Asterisk will retrieve
the media address from the associated rtp instance, but if frames were being
read this can be overwritten with another address (in this case the
firewall's). This patch ensures that Asterisk uses the original device
address when using direct media.
ASTERISK-24563
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4216/
........
Merged revisions 429195 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429196 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429197
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kevin Harwell [Tue, 9 Dec 2014 18:36:47 +0000 (18:36 +0000)]
res_pjsip_outbound_publish: stack overflow when using non-default sorcery wizard
When using a non-default sorcery wizard (in this instance realtime) for outbound
publishes Asterisk will crash after a stack overflow occurs due to the code
infinitely recursing. The fix entails removing the outbound publish state
dependency from the outbound publish sorcery object and instead keeping an in
memory container that can be used to lookup the state when needed.
ASTERISK-24514 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4178/
........
Merged revisions 429175 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429176
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Joshua Colp [Tue, 9 Dec 2014 15:45:19 +0000 (15:45 +0000)]
ari: Add support for specifying an originator channel when originating.
If an originator channel is specified when originating a channel the linked ID
of it will be applied to the newly originated outgoing channel. This allows
an association to be made between the two so it is known that the originator
has dialed the originated channel.
ASTERISK-24552 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4243/
........
Merged revisions 429153 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429154
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Tue, 9 Dec 2014 14:01:43 +0000 (14:01 +0000)]
PJSIP: Stagger outbound qualifies
This change staggers initiation of outbound qualify (OPTIONS) attempts
to reduce instantaneous server load and prevent network congestion.
Review: https://reviewboard.asterisk.org/r/4246/
ASTERISK-24342 #close
Reported by: Richard Mudgett
........
Merged revisions 429127 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429128 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429129
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Mon, 8 Dec 2014 16:54:43 +0000 (16:54 +0000)]
AMI/ARI: Update version to 2.6.0/1.6.0 respectively for new features
AMI/ARI are getting a few enhancements in the next release of Asterisk 13. Per
semantic versioning, that warrants a bump in the minor version number, as it
reflects a backwards compatible change. Hence, this commit.
........
Merged revisions 429091 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429092
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Mon, 8 Dec 2014 16:43:00 +0000 (16:43 +0000)]
Fix a crash that would occur when receiving a 491 response to a reinvite.
The reviewboard description does a fine job of summarizing this, so here it is:
A reporter discovered that Asterisk would crash when attempting to retransmit
a reinvite that had previously received a 491 response. The crash occurred
because a pjsip_tx_data structure was being saved for reuse, but its reference
count was not being increased. The result was that the pjsip_tx_data was being
freed before we were actually done with it. When we attempted to re-use the
structure when re-sending the reinvite, Asterisk would crash.
The fix implemented here is not to try holding onto the pjsip_tx_data at all.
Instead, when we reschedule sending the reinvite, we create a brand new
pjsip_tx_data and send that instead. Because of this change, there is no need
for an ast_sip_session_delayed_request structure to have a pjsip_tx_data on
it any more. So any code referencing its use has been removed.
When this initial fix was introduced, I encountered a second crash when
processing a subsequent 200 OK on a rescheduled reinvite. The reason was
that when rescheduling the reinvite, we gave the wrong location for a
response callback. This has been fixed in this patch as well.
ASTERISK-24556 #close
Reported by Abhay Gupta
Review: https://reviewboard.asterisk.org/r/4233
........
Merged revisions 429089 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429090
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Mark Michelson [Mon, 8 Dec 2014 16:24:36 +0000 (16:24 +0000)]
Add new AMI and ARI events for connected line changes on a channel.
The AMI event is called NewConnectedLine and the ARI event is called
ChannelConnectedLine.
ASTERISK-24554 #close
Reported by Matt Jordan
Review: https://reviewboard.asterisk.org/r/4231
........
Merged revisions 429064 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429084
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Kinsey Moore [Mon, 8 Dec 2014 15:45:46 +0000 (15:45 +0000)]
Stasis: Fix StasisStart/End order and missing events
This corrects several bugs that currently exist in the stasis
application code.
* After a masquerade, the resulting channels have channel topics that
do not match their uniqueids
** Masquerades now swap channel topics appropriately
* StasisStart and StasisEnd messages are leaked to observer
applications due to being published on channel topics
** StasisStart and StasisEnd publishing is now properly restricted
to controlling apps via app topics
* Race conditions exist where StasisStart and StasisEnd messages due to
a masquerade may be received out of order due to being published on
different topics
** These messages are now published directly on the app topic so this
is now a non-issue
* StasisEnds are sometimes missing when sent due to masquerades and
bridge swaps into and out of Stasis()
** This was due to StasisEnd processing adjusting message-sent flags
after Stasis() had already exited and Stasis() had been re-entered
** This was corrected by adjusting these flags prior to sending the
message while the initial Stasis() application was still shutting
down
Review: https://reviewboard.asterisk.org/r/4213/
ASTERISK-24537 #close
Reported by: Matt DiMeo
........
Merged revisions 429061 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429062 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429063
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Sat, 6 Dec 2014 18:16:49 +0000 (18:16 +0000)]
res/res_monitor: Reset in/out sample counts on Monitor start
When repeatedly starting/stopping a Monitor on a channel, the accumulated
in/out sample counts are never reset to 0. This can cause inadvertent jumps
in the recordings, as the code in the channel core will determine incorrectly
that a jump in the recorded file position should occur. Setting the sample
counts to 0 simply reflects the initial state a Monitor should be in when it
is started, as this is the initial count that would be on the channels at that
time.
ASTERISK-24573 #close
Reported by: Nuno Borges
patches:
24573.patch uploaded by Nuno Borges (License 6116)
........
Merged revisions 429031 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429032 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429033 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429034
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Sat, 6 Dec 2014 17:36:21 +0000 (17:36 +0000)]
apps/app_meetme: Apply default values on initial load with no config file
When the app_meetme module is loaded without its configuration file, the
module settings aren't initialized. In particular, this impacts the use
of logging realtime members. This patch guarantees that we always set the
default module settings on initial load.
Review: https://reviewboard.asterisk.org/r/4242/
ASTERISK-24572 #close
Reported by: Nuno Borges
patches:
24572.patch uploaded by Nuno Borges (License 6116)
........
Merged revisions 429027 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 429028 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429029 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429030
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
George Joseph [Fri, 5 Dec 2014 17:08:27 +0000 (17:08 +0000)]
sorcery: Add additional observer capabilities.
Add new global, instance and wizard observers.
instance_created
wizard_registered
wizard_unregistered
instance_destroying
instance_loading
instance_loaded
wizard_mapped
object_type_registered
object_type_loading
object_type_loaded
wizard_loading
wizard_loaded
Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4215/
........
Merged revisions 428999 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 429000 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429001
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Thu, 4 Dec 2014 17:13:48 +0000 (17:13 +0000)]
main/test: Fix compilation issue on 32-bit systems
On a 32-bit system, a type of intmax_t will result in a compilation warning
when formatted as a 'long int'. Use the format specifier of %jd (which was
what was used originally in manager.c) to format the JSON extracted integer
on both 32-/64-bit systems.
........
Merged revisions 428972 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 428973 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428974
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Thu, 4 Dec 2014 15:48:26 +0000 (15:48 +0000)]
main/test: Fix race condition between AMI topic and Test Suite topic
This patch fixes a race condition between the raising of test AMI events (which
drive many tests in the Asterisk Test Suite) and other AMI events. Prior to
this patch, the Stasis messages published to the test topic were not forwarded
to the AMI topic. Instead, the code in manager had a dedicated handler for test
messages that was independent of the topics forwarded to the AMI topic. This
results in no synchronization between the test messages and the rest of the
Stasis messages published out over AMI. In some test with very tight timing
constraints, this can result in out of order messages and spurious test
failures. Properly forwarding the Test Suite topic to the AMI topic ensures
that the messages are synchronized properly.
This patch does that, and moves the message handling to the Stasis definition
of the Test Suite message in test.c as well.
Review: https://reviewboard.asterisk.org/r/4221/
........
Merged revisions 428945 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 428946 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428947
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Wed, 3 Dec 2014 20:59:01 +0000 (20:59 +0000)]
tests/test_cel: Add test_cel_attended_transfer_bridges_link to racey tests
Despite failing less often, the ordering of the ATTENDEDTRANSFER event and the
BRIDGE_EXIT event for the Alice and David channels is not defined. This makes
the test still fail.
........
Merged revisions 428918 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 428919 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428920
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
Matthew Jordan [Wed, 3 Dec 2014 19:49:38 +0000 (19:49 +0000)]
tests/test_cel: Fix CEL unit test failures caused by attended transfer changes
When the publication of attended transfer messages were pushed to another
thread, some subtle race conditions were introduced with the CEL unit tests.
This patch fixes one of them, and pushes the other to ASTERISK-22367, which
already exists to fix another bouncy CEL unit test.
In particular, this patch fixes the test_cel_attended_transfer_bridges_link
test, and defers the test_cel_attended_transfer_bridges_swap test to the
aforementioned JIRA issue.
ASTERISK-22367
........
Merged revisions 428891 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 428892 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428893
65c4cc65-6c06-0410-ace0-
fbb531ad65f3