asterisk/asterisk.git
6 years agoconfigure: Undefine FORTIFY_SOURCE prior to defining it for patched gcc
Matthew Jordan [Sun, 17 Aug 2014 22:35:27 +0000 (22:35 +0000)]
configure: Undefine FORTIFY_SOURCE prior to defining it for patched gcc

Some distributions of Linux patch gcc to define FORTIFY_SOURCE when gcc is
executed with optimization. This "help" unfortunately results in re-definition
warnings when FORTIFY_SOURCE is later defined in Asterisk's build system. This
patch undefines FORTIFY_SOURCE prior to defining it to prevent this warning.

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

ASTERISK-24032 #close
Reported by: Kilburn
Tested by: Kilburn, wdoekes
patches:
  1.8.diff uploaded by cloos (License 5956)
  10.diff uploaded by cloos (License 5956)
  11.diff uploaded by cloos (License 5956)
  12.diff uploaded by cloos (License 5956)
  13.diff uploaded by cloos (License 5956)
........

Merged revisions 421227 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 421228 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 421229 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421230 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421231 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_http_websocket: Include query parameters in client connection requests.
Joshua Colp [Sun, 17 Aug 2014 16:11:27 +0000 (16:11 +0000)]
res_http_websocket: Include query parameters in client connection requests.

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

Merged revisions 421210 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421211 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBridging: Fix a behavioral change when checking if a channel is leaving a bridge
Jonathan Rose [Fri, 15 Aug 2014 17:26:12 +0000 (17:26 +0000)]
Bridging: Fix a behavioral change when checking if a channel is leaving a bridge

r420934 introduced some failures in the test suite.  Upon investigating, it was
discovered that differences in the way we were evaluating whether a channel was in
the process of leaving a bridge were causing some reinvites not to occur (mostly
reinvites back to Asterisk when ending a call). This patch fixes that behavioral
change.

ASTERISK-24027 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3910/
........

Merged revisions 421186 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421187 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421195 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_voicemail/app: Remove test events that were duplicated by r421059
Matthew Jordan [Fri, 15 Aug 2014 15:50:46 +0000 (15:50 +0000)]
app_voicemail/app: Remove test events that were duplicated by r421059

Moving the test event raised when a file is played back (which occurred in
r421059) broke the ever loving snot out of the voicemail tests. This caused
duplicate test events to get raised, as app_voicemail and main/app were raising
events prior to call ast_streamfile. The voicemail tests did not enjoy getting
multiple events.

Since raising the playback event in ast_streamfile is far more useful to the
vast majority of tests, this patch keeps the call there and simply removes the
extraneous calls that duplicated the event.
........

Merged revisions 421125 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 421164 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 421165 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421166 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421167 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores/res_hep_rtcp: Remove dependency on PJSIP
Matthew Jordan [Thu, 14 Aug 2014 21:16:32 +0000 (21:16 +0000)]
res/res_hep_rtcp: Remove dependency on PJSIP

The res_hep_rtcp module was incorrectly including <pjsip.h>. This didn't need
to be included, as the module does not using PJPROJECT any fashion.
Unfortunately, because res_hep_rtcp did not include pjsip in its MODULEINFO as
a dependency, this also meant that res_hep_rtcp will fail to compile on a
system without PJPROJECT.

This patch removes the include.

Thanks to Damien Wedhorn for pointing this out in #asterisk-dev.

ASTERISK-24236 #close
Reported by: Damien Wedhorn, Matt Jordan
Tested by: Damien Wedhorn
........

Merged revisions 421064 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421065 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421066 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agomain/file: Move test event to emit PLAYBACK event more consistently
Matthew Jordan [Thu, 14 Aug 2014 20:59:15 +0000 (20:59 +0000)]
main/file: Move test event to emit PLAYBACK event more consistently

This is being done in advance of the test for ASTERISK-23953
........

Merged revisions 421059 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 421060 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 421061 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421062 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421063 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocel: Make sure channels in extra fields include their unique IDs as well
Matthew Jordan [Thu, 14 Aug 2014 19:21:51 +0000 (19:21 +0000)]
cel: Make sure channels in extra fields include their unique IDs as well

CEL typically tracks a lot of information using the unique ID of the channel.
This is typically needed due to tying events together using the linked ID of
the various channels involved in a "call", which is derived from the channel ID
of the oldest channel involved in a bridge (or in the case of a Dial, the
parent channel).

Previously, we had updated the extra fields to include the involved channel
names, but forgot to put in the unique ID. This patch corrects that error.
........

Merged revisions 421037 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421042 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421043 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoARI: Originate to app local channel subscription code optimization.
Richard Mudgett [Thu, 14 Aug 2014 16:33:27 +0000 (16:33 +0000)]
ARI: Originate to app local channel subscription code optimization.

Reduce the scope of local_peer and only get it if the ARI originate is
subscribing to the channels.

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

Merged revisions 421009 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 421010 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421012 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochannel_internal_api.c: Replace some code with ao2_replace().
Richard Mudgett [Thu, 14 Aug 2014 16:01:39 +0000 (16:01 +0000)]
channel_internal_api.c: Replace some code with ao2_replace().

Use ao2_replace() instead of ao2_cleanup(); ao2_bump().

ao2_replace() has the advantange of not altering the ref count if the
replaced pointer is the same.

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

Merged revisions 420992 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420993 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_pjsip_send_to_voicemail.c: Fix svn file properties.
Richard Mudgett [Wed, 13 Aug 2014 17:05:01 +0000 (17:05 +0000)]
res_pjsip_send_to_voicemail.c: Fix svn file properties.
........

Merged revisions 420956 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420957 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420958 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPJSIP: Prevent crash no-URI contacts
Kinsey Moore [Wed, 13 Aug 2014 16:56:14 +0000 (16:56 +0000)]
PJSIP: Prevent crash no-URI contacts

This prevents a crash from occurring when a contact with no URI is used
for the creation of an outbound out-of-dialog request with no
associated endpoint.
........

Merged revisions 420949 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420950 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420953 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBridges: Fix feature interruption/unintended kick caused by external actions
Jonathan Rose [Wed, 13 Aug 2014 16:24:37 +0000 (16:24 +0000)]
Bridges: Fix feature interruption/unintended kick caused by external actions

If a manager or CLI user attached a mixmonitor to a call running a dynamic
bridge feature while in a bridge, the feature would be interrupted and the
channel would be forcibly kicked out of the bridge (usually ending the call
during a simple 1 to 1 call). This would also occur during any similar action
that could set the unbridge soft hangup flag, so the fix for this was to
remove unbridge from the soft hangup flags and make it a separate thing all
together.

ASTERISK-24027 #close
Reported by: mjordan
Review: https://reviewboard.asterisk.org/r/3900/
........

Merged revisions 420934 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420940 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420947 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAMI: Improve documentation for Status action
Kinsey Moore [Wed, 13 Aug 2014 14:31:46 +0000 (14:31 +0000)]
AMI: Improve documentation for Status action
........

Merged revisions 420919 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420921 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agologger: Don't store verbose-magic in the log files.
Walter Doekes [Wed, 13 Aug 2014 07:54:10 +0000 (07:54 +0000)]
logger: Don't store verbose-magic in the log files.

In r399267, the verbose2magic stuff was edited. This time it results
in magic characters in the log files for multiline messages.

In trunk (and 13) this was fixed by the "stripping" of those
characters from multiline messages (in r414798).

This fix is altered to actually strip the characters and not replace
them with blanks.

Review: https://reviewboard.asterisk.org/r/3901/
Review: https://reviewboard.asterisk.org/r/3902/
........

Merged revisions 420897 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420898 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420899 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Fix type mismatch when the format is changed.
Richard Mudgett [Tue, 12 Aug 2014 23:45:17 +0000 (23:45 +0000)]
chan_sip: Fix type mismatch when the format is changed.

Symptom is most likely an invalid ao2 object bad magic number message or a
less likely crash.
........

Merged revisions 420881 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420882 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_stasis_snoop.c: Fix off nominial exit path leaving Snoop channel locked and not...
Richard Mudgett [Tue, 12 Aug 2014 23:36:37 +0000 (23:36 +0000)]
res_stasis_snoop.c: Fix off nominial exit path leaving Snoop channel locked and not hungup.

* Made use ast_copy_string() instead of strcpy() for snoop uniqueid for
safety.  There is no guarantee that the max channel uniqueid length will
remain the same as the snoop uniqueid space.
........

Merged revisions 420879 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420880 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_voicemail: Fix the "test_voicemail_vm_info" unit test.
Joshua Colp [Tue, 12 Aug 2014 11:18:17 +0000 (11:18 +0000)]
app_voicemail: Fix the "test_voicemail_vm_info" unit test.
........

Merged revisions 420856 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420858 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores/stasis/command.c: Fix recent commit using spaces instead of tabs.
Richard Mudgett [Mon, 11 Aug 2014 21:04:21 +0000 (21:04 +0000)]
res/stasis/command.c: Fix recent commit using spaces instead of tabs.
........

Merged revisions 420836 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420837 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAMI/ARI: Update version to 2.5.0/1.5.0 respectively
Matthew Jordan [Mon, 11 Aug 2014 18:51:43 +0000 (18:51 +0000)]
AMI/ARI: Update version to 2.5.0/1.5.0 respectively

This is to support the backwards compatible changes made in the next version
of Asterisk.
........

Merged revisions 420805 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420808 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420811 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Use the correct return value
Kinsey Moore [Mon, 11 Aug 2014 18:46:59 +0000 (18:46 +0000)]
Stasis: Use the correct return value

Return the correct value instead of always returning 0 when setting
internal status on unreal channels.

Reported by: Richard Mudgett
........

Merged revisions 420802 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420803 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Allow internal channels directly into bridges
Kinsey Moore [Mon, 11 Aug 2014 18:38:15 +0000 (18:38 +0000)]
Stasis: Allow internal channels directly into bridges

The patch to catch channels being shoehorned into Stasis() via external
mechanisms also happens to catch Announcer and Recorder channels
because they aren't known to be stasis-controlled channels in the usual
sense. This marks those channels as Stasis()-internal channels and
allows them directly into bridges.

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

Merged revisions 420795 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420796 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420797 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix crashing unit tests with regards to RLS.
Mark Michelson [Mon, 11 Aug 2014 17:40:07 +0000 (17:40 +0000)]
Fix crashing unit tests with regards to RLS.

The unit tests require a sorcery.conf file that has been
set up to store resource lists in memory rather than retrieving
from configuration.

With a setup that is not conducive to running the tests, a fault
in sorcery currently causes Asterisk to crash when attempting to
run any of the tests.

To get around the crash, this adds a function that verifies the
current environment and marks the tests as "not run" if the setup
is not correct.
........

Merged revisions 420779 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420780 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix crash encountered by the testsuite.
Mark Michelson [Mon, 11 Aug 2014 16:03:41 +0000 (16:03 +0000)]
Fix crash encountered by the testsuite.

Running testsuite tests locally produced no errors, but when
run using the continuous integration framework, crashes occurred.

The crashes occurred due to a refcounting error that had been fixed
for a similar situation.
........

Merged revisions 420758 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420759 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_hep: Remove disabling of modules
Matthew Jordan [Mon, 11 Aug 2014 13:57:53 +0000 (13:57 +0000)]
res_hep: Remove disabling of modules

These modules were originally specified as being disabled, as they were
introduced midstream in Asterisk 12. That makes it nicer for folks who are
upgrading to a new release in the middle of Asterisk 12. That's not the case
for Asterisk 13: it's a brand new release. There's no reason to have the
modules disabled by default in that case.
........

Merged revisions 420742 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420743 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agogeneral: Fix memory Corruption in __ast_string_field_ptr_build_va.
Walter Doekes [Mon, 11 Aug 2014 10:41:07 +0000 (10:41 +0000)]
general: Fix memory Corruption in __ast_string_field_ptr_build_va.

If the space left in a stringfield is between 0 and
(alignof(ast_string_field_allocation)-1) adding new data would cause
memory corruption, because we would assume enough space (unsigned
underrun).

Thanks Arnd Schmitter for reporting and finding out the cause!

ASTERISK-23508 #close
Reported by: Arnd Schmitter
Tested by: Arnd Schmitter, JoshE

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

Merged revisions 420680 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 420715 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420716 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420717 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420718 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agotcptls: Avoid compiler warning on non-dev-mode.
Walter Doekes [Mon, 11 Aug 2014 09:55:13 +0000 (09:55 +0000)]
tcptls: Avoid compiler warning on non-dev-mode.
........

Merged revisions 420654 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 420655 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420656 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420657 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420658 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agofuncs/func_jitterbuffer: Tweak documentation
Matthew Jordan [Mon, 11 Aug 2014 01:31:56 +0000 (01:31 +0000)]
funcs/func_jitterbuffer: Tweak documentation

This patch merely reformats and cleans up a bit of the jitterbuffer
documentation for the wiki.
........

Merged revisions 420639 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_queue: Add RealTime support for queue rules
Matthew Jordan [Mon, 11 Aug 2014 00:14:53 +0000 (00:14 +0000)]
app_queue: Add RealTime support for queue rules

This patch gives the optional ability to keep queue rules in RealTime. It is
important to note that with this patch:
 (a) Queue rules in RealTime are only examined on module load/reload
 (b) Queue rules are loaded both from the queuerules.conf file as well as the
     RealTime backend
To inform app_queue to examine RealTime for queue rules, a new setting has been
added to queuerules.conf's general section "realtime_rules". RealTime queue
rules will only be used when this setting is set to "yes".

The schema for the database table supports a rule_name, time, min_penalty, and
max_penalty columns. min_penalty and max_penalty can be relative, if a '-' or
'+' literal is provided. Otherwise, the penalties are treated as constants.

For example:
rule_name, time, min_penalty, max_penalty
'default', '10', '20', '30'
'test2', '20', '30', '55'
'test2', '25', '-11', '+1111'
'test2', '400', '112', '333'
'test3', '0', '4564', '46546'
'test_rule', '40', '15', '50'

which would result in :

Rule: default
 - After 10 seconds, adjust QUEUE_MAX_PENALTY to 30 and adjust
   QUEUE_MIN_PENALTY to 20
Rule: test2
 - After 20 seconds, adjust QUEUE_MAX_PENALTY to 55 and adjust
   QUEUE_MIN_PENALTY to 30
 - After 25 seconds, adjust QUEUE_MAX_PENALTY by 1111 and adjust
   QUEUE_MIN_PENALTY by -11
 - After 400 seconds, adjust QUEUE_MAX_PENALTY to 333 and adjust
   QUEUE_MIN_PENALTY to 112
Rule: test3
 - After 0 seconds, adjust QUEUE_MAX_PENALTY to 46546 and adjust
   QUEUE_MIN_PENALTY to 4564
Rule: test_rule
 - After 40 seconds, adjust QUEUE_MAX_PENALTY to 50 and adjust
   QUEUE_MIN_PENALTY to 15

If you use RealTime, the queue rules will be always reloaded on a module
reload, even if the underlying file did not change. With the option disabled,
the rules will only be reloaded if the file was modified.

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

ASTERISK-23823 #close
Reported by: Michael K
patches:
  app_queue.c_realtime_trunk.patch uploaded by Michael K (License 6621)
........

Merged revisions 420624 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420625 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate CHANGES file
Matthew Jordan [Sun, 10 Aug 2014 22:02:03 +0000 (22:02 +0000)]
Update CHANGES file
........

Merged revisions 420609 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420610 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate UPGRADE-13.txt file
Matthew Jordan [Sun, 10 Aug 2014 21:35:54 +0000 (21:35 +0000)]
Update UPGRADE-13.txt file

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420608 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix build in devmode.
Jason Parker [Fri, 8 Aug 2014 20:08:53 +0000 (20:08 +0000)]
Fix build in devmode.
........

Merged revisions 420592 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420593 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_voicemail: Add the ability to specify multiple email addresses.
Jason Parker [Fri, 8 Aug 2014 19:16:29 +0000 (19:16 +0000)]
app_voicemail: Add the ability to specify multiple email addresses.

ASTERISK-24045
Reported by: Jacob Barber
Review: https://reviewboard.asterisk.org/r/3833/
........

Merged revisions 420577 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420578 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Mark chan_sip and its files as extended support
Matthew Jordan [Fri, 8 Aug 2014 17:53:39 +0000 (17:53 +0000)]
chan_sip: Mark chan_sip and its files as extended support
........

Merged revisions 420562 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420563 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agomake_ari_stubs: Update wiki prefix to '13'
Matthew Jordan [Fri, 8 Aug 2014 12:40:16 +0000 (12:40 +0000)]
make_ari_stubs: Update wiki prefix to '13'
........

Merged revisions 420538 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420539 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_ari_resource.c.mustache: Update template to emit module support level
Matthew Jordan [Fri, 8 Aug 2014 12:38:18 +0000 (12:38 +0000)]
res_ari_resource.c.mustache: Update template to emit module support level
........

Merged revisions 420536 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420537 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agomain/message: remove debug message
Matthew Jordan [Fri, 8 Aug 2014 12:33:06 +0000 (12:33 +0000)]
main/message: remove debug message
........

Merged revisions 420533 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420534 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420535 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoCEL: Update unit tests for additional information
Kinsey Moore [Fri, 8 Aug 2014 03:07:41 +0000 (03:07 +0000)]
CEL: Update unit tests for additional information

This updates the CEL unit tests for the new information contained in
the attended transfer CEL extra field.
........

Merged revisions 420513 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420514 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420515 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoInitialize svnmerge from branches/13
Matthew Jordan [Fri, 8 Aug 2014 01:37:05 +0000 (01:37 +0000)]
Initialize svnmerge from branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420499 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove 12 merge properties
Matthew Jordan [Fri, 8 Aug 2014 01:36:16 +0000 (01:36 +0000)]
Remove 12 merge properties

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420498 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoUpdate UPGRADE.txt for 13 branch
Matthew Jordan [Fri, 8 Aug 2014 01:33:18 +0000 (01:33 +0000)]
Update UPGRADE.txt for 13 branch

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420497 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.
Richard Mudgett [Thu, 7 Aug 2014 21:58:38 +0000 (21:58 +0000)]
chan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.

Replace sip_tls_read() and sip_tcp_read() with a single function and
resolve the poll/wait issue with large SDP payloads.

ASTERISK-18345 #close
Reported by: Stephane Chazelas
Patches:
      tcptls_pollv4.diff (license #5835) patch uploaded by Elazar Broad

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

Merged revisions 420434 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 420435 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420436 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420437 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Correct blind transfer message generation
Kinsey Moore [Thu, 7 Aug 2014 21:17:05 +0000 (21:17 +0000)]
Stasis: Correct blind transfer message generation

This fixes the json object creation format string and key name for the
BridgeBlindTransfer Stasis event allowing it to be published properly.
........

Merged revisions 420414 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420415 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Ensure transfer messages follow validation rules
Kinsey Moore [Thu, 7 Aug 2014 20:24:15 +0000 (20:24 +0000)]
Stasis: Ensure transfer messages follow validation rules

This makes Stasis() event generation for transfer messages follow
validation rules. Currently, ast_json_null() is being used in place of
omitting a key entirely which falls afoul of these validation rules.

https://reviewboard.asterisk.org/r/3892/
........

Merged revisions 420408 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420410 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix build in dev mode
Kinsey Moore [Thu, 7 Aug 2014 20:11:15 +0000 (20:11 +0000)]
Fix build in dev mode

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420389 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoEnsure bridges exist when trying to determine bridged parties when publishing transfe...
Mark Michelson [Thu, 7 Aug 2014 19:44:32 +0000 (19:44 +0000)]
Ensure bridges exist when trying to determine bridged parties when publishing transfer information.
........

Merged revisions 420387 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420388 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd support for RFC 4662 resource list subscriptions.
Mark Michelson [Thu, 7 Aug 2014 19:26:32 +0000 (19:26 +0000)]
Add support for RFC 4662 resource list subscriptions.

This commit adds the ability for a user to configure
a resource list in pjsip.conf. Subscribing to this
list simultaneously subscribes the subscriber to all
resources listed. This has the potential to reduce
the amount of SIP traffic when loads of subscribers
on a system attempt to subscribe to each others' states.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420384 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_iax2: Several media format fixes.
Richard Mudgett [Thu, 7 Aug 2014 18:51:16 +0000 (18:51 +0000)]
chan_iax2: Several media format fixes.

* Fixed the iax.conf bandwidth option.  This is the root cause of
ASTERISK-24150.

* Added checks in iax2_request() to ensure that there are actual formats
requested for the new channel to prevent any more fracks from issues like
ASTERISK-24150.  This is a consequence of the iax.conf bandwidth option
not working.

* Fixed struct iax2_codec_pref.order member size mismatch issue when
converting to and from the codec preference order list passed over the
wire.  In addition the values sent over the wire are now compatible with
previous Asterisk versions.

* Fixed several issues dealing with the struct iax2_codec_pref members.
Off-by-one, array limit errors, and the order/framing members always need
to be updated together.

* Made iax2_request() setup the channel's native format preference order
according to the user's wishes.  The new media format strategy needs the
order specified earler.

* Fixed usage of ast_format_compatibility_bitfield2format().  The function
can return NULL if the bitfield was not associated with a function.

* Deleted dead code iax2_codec_pref_getsize() and
iax2_codec_pref_setsize().

* Made iax2_parse_allow_disallow() and iax2_codec_pref_string() call
iax2_codec_pref_to_cap() instead of inlining it.

* Made IAX_CAPABILITY_MEDBANDWIDTH, IAX_CAPABILITY_LOWBANDWIDTH, and
IAX_CAPABILITY_LOWFREE constants again as they were in Asterisk v1.8.

* Renamed prefs to prefs_global so it won't get confused with the local
pref versions.

* Fixed too small buffer in handle_cli_iax2_show_peer().

* Fixed ast_cli() calls in handle_cli_iax2_show_peer() to output complete
lines.

* Changed struct create_addr_info.prefs to be struct iax2_codec_pref as an
optimization so iax2_request() and iax2_call() do less work.

* Fixed a potential deadlock in ast_iax2_new() on an off-nominal path when
the pbx could not get started.

* Made set_config() setup a local prefs list along side the local
capability format bitfield.  Once the config is loaded, then the local
copies are put into the global versions.

* Fix unininialized codec_buf in function_iaxpeer().

ASTERISK-24150 #close
Reported by: Scott Griepentrog

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420364 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Convey transfer information to applications
Kinsey Moore [Thu, 7 Aug 2014 15:30:19 +0000 (15:30 +0000)]
Stasis: Convey transfer information to applications

This fixes a class of issues where Stasis applications were not made
aware that their channels were being manipulated or replaced by
external entitiessuch as transfers, AMI commands, or dialplan
applications such as Bridge(). Inconsistent information such as
StasisEnd events with unknown channels as a result of masquerades has
also been corrected. To accomplish these fixes, several new fields
were added to blind and attended transfer messages as well as
StasisStart and BridgeAttendedTransfer Stasis events.

ASTERISK-23941 #close
Review: https://reviewboard.asterisk.org/r/3865/
Review: https://reviewboard.asterisk.org/r/3857/
Review: https://reviewboard.asterisk.org/r/3852/
Review: https://reviewboard.asterisk.org/r/3816/
Review: https://reviewboard.asterisk.org/r/3731/
Review: https://reviewboard.asterisk.org/r/3729/
Review: https://reviewboard.asterisk.org/r/3728/
........

Merged revisions 420325 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_pjsip_publish_asterisk: Add support for exchanging device and mailbox state using...
Joshua Colp [Thu, 7 Aug 2014 14:37:26 +0000 (14:37 +0000)]
res_pjsip_publish_asterisk: Add support for exchanging device and mailbox state using SIP.

This module uses the inbound and outbound PUBLISH support to exchange device and mailbox
state between Asterisk instances. Each instance is configured to publish to the other and
requires no intermediary server. The functionality provided is similar to the XMPP and
Corosync support.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420315 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_pjsip_outbound_publish: Add module which provides outbound PUBLISH support.
Joshua Colp [Thu, 7 Aug 2014 14:35:09 +0000 (14:35 +0000)]
res_pjsip_outbound_publish: Add module which provides outbound PUBLISH support.

This module implements the core parts required for doing outbound PUBLISH.
It takes care of configuration, lifetime management, and authentication.
Additional modules implement the specific events that are published.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420314 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agopbx: Filter out pattern matching hints in responses sent to ExtensionStateList
Matthew Jordan [Thu, 7 Aug 2014 14:17:54 +0000 (14:17 +0000)]
pbx: Filter out pattern matching hints in responses sent to ExtensionStateList

Hints that are a pattern match are technically stored in the hint container in
the same fashion as concrete implementations of hints. The pattern matching
hints, however, are not "real" in the sense that things can subscribe to them:
rather, they are stored in the hints container so that when a subscription is
made a "real" hint can be generated for the subscription if one does not yet
exist. The extension state core takes care of this correctly by matching
against non-pattern matching extensions prior to pattern matching extensions.

Because of this, however, the ExtensionStateList AMI action was returning
pattern matching hints when executed. These hints are meaningless from the
perspective of AMI clients: their state will never change, they cannot be
subscribed to, and events would never normally be generated from them. As such,
we now filter these out of the response.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420309 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agobuild_tools: Skip managerEvent combining for AMI action responses
Matthew Jordan [Thu, 7 Aug 2014 03:04:49 +0000 (03:04 +0000)]
build_tools: Skip managerEvent combining for AMI action responses

AMI action responses can (and will) reference AMI events that they return.
These event references and definitions should not be combined with AMI events
raised elsewhere in the code, as they are specifically tied to the AMI action
that raised them.

ASTERISK-24156 #close
Reported by: Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420289 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBlocked revisions 420262
Richard Mudgett [Wed, 6 Aug 2014 21:48:13 +0000 (21:48 +0000)]
Blocked revisions 420262

........
Change comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420263 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoFix alembic script to work properly in offline mode.
Richard Mudgett [Wed, 6 Aug 2014 18:12:48 +0000 (18:12 +0000)]
Fix alembic script to work properly in offline mode.

When run in offline mode, this would attempt to check the database for
the presence of a type it was going to try to create. I now check the
context to see if we're running in offline mode and change a parameter
accordingly.
........

Merged revisions 407567 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420237 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd alembic script that adds contact user_agent and endpoint message_context.
Richard Mudgett [Wed, 6 Aug 2014 17:56:09 +0000 (17:56 +0000)]
Add alembic script that adds contact user_agent and endpoint message_context.
........

Merged revisions 411514 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420236 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoalembic: Adjust sippeers, queue_members, and voicemail_messages tables.
Richard Mudgett [Wed, 6 Aug 2014 17:04:08 +0000 (17:04 +0000)]
alembic: Adjust sippeers, queue_members, and voicemail_messages tables.

* Increased the sippeers useragent max string size to 255.

* Changed the queue_members uniqueid to an auto incremented integer
instead of a string.

* Increased the voicemail_messages BLOB size to LONGBLOB on mysql.

* Fixed the add_tables_for_pjsip config change version downgrade actions
to drop a table it created.

* Adjusted the sample alembic.ini files cdr.ini.sample, config.ini.sample,
and voicemail.ini.sample to give a mysql and postgres sqlalchemy.url
lines.

ASTERISK-23847 #close
Reported by: Stephen More

ASTERISK-23825 #close
Reported by: Stephen More

ASTERISK-23909 #close
Reported by: Stephen More

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

Merged revisions 420211 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420212 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agopbx_lua: fix regression with global sym export and context clash by pbx_config.
George Joseph [Wed, 6 Aug 2014 16:12:26 +0000 (16:12 +0000)]
pbx_lua: fix regression with global sym export and context clash by pbx_config.

ASTERISK-23818 (lua contexts being overwritten by contexts of the same name in
pbx_config) surfaced because pbx_lua, having the AST_MODFLAG_GLOBAL_SYMBOLS
set, was always force loaded before pbx_config.  Since I couldn't find any
reason for pbx_lua to export it's symbols to the rest of Asterisk, I simply
changed the flag to AST_MODFLAG_DEFAULT.  Problem solved.  What I didn't
realize was that the symbols need to be exported not because Asterisk needs
them but because any external Lua modules like luasql.mysql need the base
Lua language APIs exported (ASTERISK-17279).

Back to ASTERISK-23818...  It looks like there's an issue in pbx.c where
context_merge was only merging includes, switches and ignore patterns if
the context was already existing AND has extensions, or if the context was
brand new.  If pbx_lua is loaded before pbx_config, the context will exist
BUT pbx_lua, being implemented as a switch, will never place extensions in
it, just the switch statement.  The result is that when pbx_config loads,
it never merges the switch statement created by pbx_lua into the final
context.

This patch sets pbx_lua's modflag back to AST_MODFLAG_GLOBAL_SYMBOLS and adds
an "else if" in context_merge that catches the case where an existing context
has includes, switchs or ingore patterns but no actual extensions.

ASTERISK-23818 #close
Reported by: Dennis Guse
Reported by: Timo Teräs
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3891/
........

Merged revisions 420146 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 420147 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420148 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420149 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd documentation to the ability to retrieve the source port of a SIP call.
Walter Doekes [Wed, 6 Aug 2014 15:32:22 +0000 (15:32 +0000)]
Add documentation to the ability to retrieve the source port of a SIP call.

(belongs with r419970)

ASTERISK-24040 #close
Patches:
func_channel.c.diff uploaded by dtryba

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420144 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoStasis: Allow message types to be blocked
Kinsey Moore [Wed, 6 Aug 2014 12:55:28 +0000 (12:55 +0000)]
Stasis: Allow message types to be blocked

This introduces stasis.conf and a mechanism to prevent certain message
types from being published. Internally, this works by preventing the
chosen message types from being created which ensures that those
message types can never be published. This patch also adjusts message
publishers such that message payloads are not created if the related
message type is not available.

ASTERISK-23943 #close
Review: https://reviewboard.asterisk.org/r/3823/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agostasis: Fix compilation issue with ao2 tagged objects
Matthew Jordan [Tue, 5 Aug 2014 21:48:05 +0000 (21:48 +0000)]
stasis: Fix compilation issue with ao2 tagged objects
........

Merged revisions 420099 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420100 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMultiple revisions 420089-420090,420097
Matthew Jordan [Tue, 5 Aug 2014 21:44:09 +0000 (21:44 +0000)]
Multiple revisions 420089-420090,420097

........
  r420089 | mjordan | 2014-08-05 15:10:52 -0500 (Tue, 05 Aug 2014) | 72 lines

  ARI: Add channel technology agnostic out of call text messaging

  This patch adds the ability to send and receive text messages from various
  technology stacks in Asterisk through ARI. This includes chan_sip (sip),
  res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the
  endpoints resource, and can be sent directly through that resource, or to a
  particular endpoint.

  For example, the following would send the message "Hello there" to PJSIP
  endpoint alice with a display URI of sip:asterisk@mycooldomain.org:

  ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There

  This is equivalent to the following as well:

  ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There

  Both forms are available for message technologies that allow for arbitrary
  destinations, such as chan_sip.

  Inbound messages can now be received over ARI as well. An ARI application that
  subscribes to endpoints will receive messages from those endpoints:

  {
    "type": "TextMessageReceived",
    "timestamp": "2014-07-12T22:53:13.494-0500",
    "endpoint": {
      "technology": "PJSIP",
      "resource": "alice",
      "state": "online",
      "channel_ids": []
    },
    "message": {
      "from": "\"alice\" <sip:alice@127.0.0.1>",
      "to": "pjsip:asterisk@127.0.0.1",
      "body": "Watson, come here.",
      "variables": []
    },
    "application": "testsuite"
  }

  The above was made possible due to some rather major changes in the message
  core. This includes (but is not limited to):
  - Users of the message API can now register message handlers. A handler has
    two callbacks: one to determine if the handler has a destination for the
    message, and another to handle it.
  - All dialplan functionality of handling a message was moved into a message
    handler provided by the message API.
  - Messages can now have the technology/endpoint associated with them.
    Various other properties are also now more easily accessible.
  - A number of ao2 containers that weren't really needed were replaced with
    vectors. Iteration over ao2_containers is expensive and pointless when
    the lifetime of things is well defined and the number of things is very
    small.

  res_stasis now has a new file that makes up its structure, messaging. The
  messaging functionality implements a message handler, and passes received
  messages that match an interested endpoint over to the app for processing.

  Note that inadvertently while testing this, I reproduced ASTERISK-23969.
  res_pjsip_messaging was incorrectly parsing out the 'to' field, such that
  arbitrary SIP URIs mangled the endpoint lookup. This patch includes the
  fix for that as well.

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

  ASTERISK-23692 #close
  Reported by: Matt Jordan

  ASTERISK-23969 #close
  Reported by: Andrew Nagy
........
  r420090 | mjordan | 2014-08-05 15:16:37 -0500 (Tue, 05 Aug 2014) | 2 lines

  Remove automerge properties :-(
........
  r420097 | mjordan | 2014-08-05 16:36:25 -0500 (Tue, 05 Aug 2014) | 2 lines

  test_message: Fix strict-aliasing compilation issue
........

Merged revisions 420089-420090,420097 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420098 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBlocked revisions 420060
Richard Mudgett [Tue, 5 Aug 2014 19:13:58 +0000 (19:13 +0000)]
Blocked revisions 420060

........
format.c: Add reason comments for the format_list ordering.
........

Merged revisions 420054 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420061 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_iax2: Fix a crash that occurs when using allow=all for an IAX2 peer
Jonathan Rose [Tue, 5 Aug 2014 13:59:53 +0000 (13:59 +0000)]
chan_iax2: Fix a crash that occurs when using allow=all for an IAX2 peer

Or any combination of codecs that includes Opus.

ASTERISK-24107 #close
Review: https://reviewboard.asterisk.org/r/3885/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoRemove duplicate definitions of ast_format_vp8.
Richard Mudgett [Mon, 4 Aug 2014 21:00:51 +0000 (21:00 +0000)]
Remove duplicate definitions of ast_format_vp8.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420007 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd the ability to retrieve the source port of a SIP call.
Mark Michelson [Mon, 4 Aug 2014 20:25:16 +0000 (20:25 +0000)]
Add the ability to retrieve the source port of a SIP call.

This adds the ability to call CHANNEL(recvport) on chan_sip
channels to see the port on which an INVITE was received.

ASTERISK-24040 #close
Reported by dtryba
Patches:
dialplan_functions.patch uploaded by dtryba (License #6628)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419970 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoManager - Improve documentation for manager commands Getvar and Setvar.
Rusty Newton [Mon, 4 Aug 2014 19:47:06 +0000 (19:47 +0000)]
Manager - Improve documentation for manager commands Getvar and Setvar.

The documentation for these commands did not make it clear that they could
accept expressions and functions. Modified to make this clear, but tried
not to be overly explicit.

ASTERISK-21178 #close
Reported by: Rusty Newton
Tested by: Rusty Newton

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

Merged revisions 419942 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 419943 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 419944 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419945 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoManager: Add PJSIPShowEndpoint[s] documentation
Kinsey Moore [Sat, 2 Aug 2014 03:37:25 +0000 (03:37 +0000)]
Manager: Add PJSIPShowEndpoint[s] documentation

This adds a large swath of response documentation for PJSIPShowEndpoint
and PJSIPShowEndpoints AMI commands. It relies heavily on the existing
text in the configInfo documentation via xi:include tags to avoid
documentation duplication.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419914 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd ContactStatusDetail to PJSIPShowEndpoint AMI output.
Mark Michelson [Fri, 1 Aug 2014 14:48:35 +0000 (14:48 +0000)]
Add ContactStatusDetail to PJSIPShowEndpoint AMI output.

Now when running PJSIPShowEndpoint, you will receive a
ContactStatusDetail for each bound contact that Asterisk
is qualifying. This information includes the URI of the
contact, current reachability, and roundtrip time.

AFS-91 #close
Reported by Mark Michelson

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419888 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoPJSIP: Send Notify AMI and CLI commands can now send to URI instead of endpoint
Jonathan Rose [Thu, 31 Jul 2014 16:19:50 +0000 (16:19 +0000)]
PJSIP: Send Notify AMI and CLI commands can now send to URI instead of endpoint

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419851 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_hep_rtcp: Add module that sends RTCP information to a Homer Server
Matthew Jordan [Thu, 31 Jul 2014 11:57:51 +0000 (11:57 +0000)]
res_hep_rtcp: Add module that sends RTCP information to a Homer Server

This patch adds a new module to Asterisk, res_hep_rtcp. The module subscribes
to the RTCP topics in Stasis and receives RTCP information back from the
message bus. It encodes into HEPv3 packets and sends the information to the
res_hep module for transmission.

Using this, someone with a Homer server can get live call quality monitoring
for all RTP-based channels in their Asterisk 12+ systems.

In addition, there were a few bugs in the RTP engine, res_rtp_asterisk, and
chan_pjsip that were uncovered by the tests written for the Asterisk Test
Suite. This patch fixes the following:
1) chan_pjsip failed to set its channel unique ids on its RTP instance on
   outbound calls. It now does this in the appropriate location, in the
   serialized call callback.
2) The rtp_engine was overflowing some values when packed into JSON.
   Specifically, some longs and unsigned ints can't be be packed into integer
   values, for obvious reasons. Since libjansson only supports integers,
   floats, strings, booleans, and objects, we print these values into strings.
3) res_rtp_asterisk had a few problems:
   (a) it would emit a source IP address of 0.0.0.0 if bound to that IP
       address. We now use ast_find_ourip to get a better IP address, and
       properly marshal the result into an ast_strdupa'd string.
   (b) Reports can be generated with no report bodies. In particular, this
       occurs when a sender is transmitting information to a receiver (who
       will send no RTP back to the sender). As such, the sender has no report
       body for what it received. We now properly handle this case, and the
       sender will emit SR reports with no body. Likewise, if we receive an
       RTCP packet with no report body, we will still generate the appropriate
       events.

ASTERISK-24119 #close
........

Merged revisions 419823 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419825 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoxmldocs: Add support for an <example> tag in the Asterisk XML Documentation
Matthew Jordan [Thu, 31 Jul 2014 11:49:40 +0000 (11:49 +0000)]
xmldocs: Add support for an <example> tag in the Asterisk XML Documentation

This patch adds support for an <example /> tag in the XML documentation schema.

For CLI help, this doesn't change the formatting too much:
 - Preceeding white space is removed
 - Unlike with para elements, new lines are preserved

However, having an <example /> tag in the XML schema allows for the wiki
documentation generation script to surround the documentation with {code} or
{noformat} tags, generating much better content for the wiki - and allowing us
to put dialplan examples (and other code snippets, if desired) into the
documentation for an application/function/AMI command/etc.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419822 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agomanager: Add state list commands
Kinsey Moore [Wed, 30 Jul 2014 18:32:25 +0000 (18:32 +0000)]
manager: Add state list commands

This patch adds three new AMI commands:
 * ExtensionStateList (pbx.c) - list all known extension state hints
   and their current statuses. Events emitted by the list action are
   equivalent to the ExtensionStatus events.
 * PresenceStateList (res_manager_presencestate) - list all known
   presence state values. Events emitted are generated by the stasis
   message type, and hence are PresenceStateChange events.
 * DeviceStateList (res_manager_devicestate) - list all known device
   state values. Events emitted are generated by the stasis message
   type, and hence are DeviceStateChange events.

Patch-by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3799/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419806 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDo not omit the first header of a UserEvent AMI action from the corresponding emitted...
Mark Michelson [Tue, 29 Jul 2014 19:41:54 +0000 (19:41 +0000)]
Do not omit the first header of a UserEvent AMI action from the corresponding emitted UserEvent.

ASTERISK-24124 #close
Reported by Matt Jordan

AFS-131 #close
Reported by Matt Jordan

Patches:
userevent.patch uploaded by Matt Jordan (License #6283)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419789 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_pjsip_session: Fix race condition where redirecting information may not be set.
Joshua Colp [Tue, 29 Jul 2014 10:56:40 +0000 (10:56 +0000)]
res_pjsip_session: Fix race condition where redirecting information may not be set.

Since the PJSIP INVITE session module is invoked before any session supplements it was
possible for it to handle a redirect before the res_pjsip_diversion module interpreted
and set redirecting information on the channel. This would cause the redirecting
information to get lost.

This patch ensures that session supplements are *always* invoked before a redirect occurs
by explicitly calling them in the redirect handler.

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

Merged revisions 419764 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419766 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity...
Joshua Colp [Tue, 29 Jul 2014 09:54:24 +0000 (09:54 +0000)]
res_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity is unquoted.

The local entity as provided by PJSIP is quoted within '<' and '>'. As a result placing
this value into XML will result in malformed XML being produced. This patch now unquotes
the local entity so it can go safely into the XML.

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

Merged revisions 419750 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419751 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agodatastores: Audit ast_channel_datastore_remove usage.
Richard Mudgett [Mon, 28 Jul 2014 18:58:43 +0000 (18:58 +0000)]
datastores: Audit ast_channel_datastore_remove usage.

Audit of v1.8 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in app_speech_utils and func_frame_trace.

* Fixed app_speech_utils not locking the channel when accessing the
channel datastore list.

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

Audit of v11 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leak in func_jitterbuffer.  (Was not in v12)

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

Audit of v12 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in abstract_jb.

* Fixed leak in ast_channel_unsuppress().  Used by ARI mute control and
res_mutestream.

* Fixed ref leak in ast_channel_suppress().  Used by ARI mute control and
res_mutestream.

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

Merged revisions 419684 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 419685 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 419686 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419688 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoloader: Fix an infinite loop when printing modules using "module show".
Joshua Colp [Fri, 25 Jul 2014 18:09:40 +0000 (18:09 +0000)]
loader: Fix an infinite loop when printing modules using "module show".

When creating the alphabetical sorted list each module is added to a list
temporarily. On the second iteration each module already has a pointer to
another module, causing stuff to go into a loop.

ASTERISK-24123 #close
Reported by: Malcolm Davenport

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419612 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAdd module support level to ast_module_info structure. Print it in CLI "module show" .
Mark Michelson [Fri, 25 Jul 2014 16:47:17 +0000 (16:47 +0000)]
Add module support level to ast_module_info structure. Print it in CLI "module show" .

ASTERISK-23919 #close
Reported by Malcolm Davenport

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoMultiple revisions 419565-419566
Matthew Jordan [Fri, 25 Jul 2014 14:47:09 +0000 (14:47 +0000)]
Multiple revisions 419565-419566

........
  r419565 | mjordan | 2014-07-25 09:41:23 -0500 (Fri, 25 Jul 2014) | 21 lines

  ARI: report duration values in LiveRecording objects

  This patch adds three new fields to the LiveRecording model:
   - total_duration: the total length of the live recording
   - talking_duration: optional. The duration of talking energy that was
     detected while the recording was made.
   - silence_duration: optional. The duration of silence that was detected while
     the recording was made.

  These values are reported in the RecordingFinished ARI event.

  When a DSP is enabled on the channel during the recording - which occurs when
  the recording is created with max_silence_seconds (indicating that the user
  actually cares about how much silence is in the file), we will report the
  talking_duration and silence_duration in addition to the total_duration.

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

  ASTERISK-24037 #close
  Reported by: Samuel Galarneau
........
  r419566 | mjordan | 2014-07-25 09:46:15 -0500 (Fri, 25 Jul 2014) | 1 line

  Update CHANGES for r419565
........

Merged revisions 419565-419566 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419567 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agomodule loader: Unload modules in reverse order of their start order
Matthew Jordan [Fri, 25 Jul 2014 14:27:52 +0000 (14:27 +0000)]
module loader: Unload modules in reverse order of their start order

When Asterisk starts a module (calling its load_module function), it re-orders
the module list, sorting it alphabetically. Ostensibly, this was done so that
the output of 'module show' listed modules in alphabetic order. This had the
unfortunate side effect of making modules with complex usage patterns
unloadable. A module that has a large number of modules that depend on it is
typically abandoned during the unloading process. This results in its memory
not being reclaimed during exit.

Generally, this isn't harmful - when the process is destroyed, the operating
system will reclaim all memory allocated by the process. Prior to Asterisk 12,
we also didn't have many modules with complex dependencies. However, with
the advent of ARI and PJSIP, this can make make unloading those modules
successfully nearly impossible, and thus tracking memory leaks or ref debug
leaks a real pain.

While this patch is not a complete overhaul of the module loader - such an
effort would be beyond the scope of what could be done for Asterisk 13 -
this does make some marginal improvements to the loader such that modules
like res_pjsip or res_stasis *may* be made properly un-loadable in the future.

1. The linked list of modules has been replaced with a doubly linked list. This
   allows traversal of the module list to occur backwards. The module shutdown
   routine now walks the global list backwards when it attempts to unload
   modules.
2. The alphabetic reorganization of the module list on startup has been
   removed. Instead, a started module is placed at the end of the module list.
3. The ast_update_module_list function - which is used by the CLI to display
   the modules - now does the sorting alphabetically itself. It creates its own
   linked list and inserts the modules into it in alphabetic order. This allows
   for the intent of the previous code to be maintained.

This patch also contains a fix for res_calendar. Without calendar.conf, the
calendar modules were improperly bumping the use count of res_calendar, then
failing to load themselves. This patch makes it so that we detect whether or
not calendaring is enabled before altering the use count.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419563 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_bridgewait: Remove possibility of race condition between channels leaving/joining.
Joshua Colp [Fri, 25 Jul 2014 10:54:49 +0000 (10:54 +0000)]
app_bridgewait: Remove possibility of race condition between channels leaving/joining.

Bridges created by app_bridgewait previously had the "dissolve when empty" flag set.
This caused the bridge core to destroy them when the last channel had left. This
introduced a race condition where we may have a reference to the bridge but it is
not actually joinable when we try to join it. This flag has now been removed and the
bridge is guaranteed to be joinable at all times.

ASTERISK-23987 #close
Reported by: Matt Jordan

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

Merged revisions 419538 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419539 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agobridge: Make "bridge destroy" only available in developer mode and add "all" to ...
Joshua Colp [Fri, 25 Jul 2014 10:49:52 +0000 (10:49 +0000)]
bridge: Make "bridge destroy" only available in developer mode and add "all" to "bridge kick".

The "bridge destroy" CLI command is invasive to bridges and can leave them in an unexpected
state for the users of them. Since this command may be useful for developers it is now
only available when developer mode is available. To take its place "all" has been added
as a valid option to the "bridge kick" CLI command. It will kick all of the channels
in the bridge out.

ASTERISK-23987
Reported by: Matt Jordan

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

Merged revisions 419536 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419537 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoaccountcode: Slightly change accountcode propagation.
Richard Mudgett [Thu, 24 Jul 2014 22:48:38 +0000 (22:48 +0000)]
accountcode: Slightly change accountcode propagation.

The previous behavior was to simply set the accountcode of an outgoing
channel to the accountcode of the channel initiating the call.  It was
done this way a long time ago to allow the accountcode set on the SIP/100
channel to be propagated to a local channel so the dialplan execution on
the Local;2 channel would have the SIP/100 accountcode available.

SIP/100 -> Local;1/Local;2 -> SIP/200

Propagating the SIP/100 accountcode to the local channels is very useful.
Without any dialplan manipulation, all channels in this call would have
the same accountcode.

Using dialplan, you can set a different accountcode on the SIP/200 channel
either by setting the accountcode on the Local;2 channel or by the Dial
application's b(pre-dial), M(macro) or U(gosub) options, or by the
FollowMe application's b(pre-dial) option, or by the Queue application's
macro or gosub options.  Before Asterisk v12, the altered accountcode on
SIP/200 will remain until the local channels optimize out and the
accountcode would change to the SIP/100 accountcode.

Asterisk v1.8 attempted to add peeraccount support but ultimately had to
punt on the support.  The peeraccount support was rendered useless because
of how the CDR code needed to unconditionally force the caller's
accountcode onto the peer channel's accountcode.  The CEL events were thus
intentionally made to always use the channel's accountcode as the
peeraccount value.

With the arrival of Asterisk v12, the situation has improved somewhat so
peeraccount support can be made to work.  Using the indicated example, the
the accountcode values become as follows when the peeraccount is set on
SIP/100 before calling SIP/200:

SIP/100 ---> Local;1 ---- Local;2 ---> SIP/200
acct: 100 \/ acct: 200 \/ acct: 100 \/ acct: 200
peer: 200 /\ peer: 100 /\ peer: 200 /\ peer: 100

If a channel already has an accountcode it can only change by the
following explicit user actions:

1) A channel originate method that can specify an accountcode to use.

2) The calling channel propagating its non-empty peeraccount or its
non-empty accountcode if the peeraccount was empty to the outgoing
channel's accountcode before initiating the dial.  e.g., Dial and
FollowMe.  The exception to this propagation method is Queue.  Queue will
only propagate peeraccounts this way only if the outgoing channel does not
have an accountcode.

3) Dialplan using CHANNEL(accountcode).

4) Dialplan using CHANNEL(peeraccount) on the other end of a local
channel pair.

If a channel does not have an accountcode it can get one from the
following places:

1) The channel driver's configuration at channel creation.

2) Explicit user action as already indicated.

3) Entering a basic or stasis-mixing bridge from a peer channel's
peeraccount value.

You can specify the accountcode for an outgoing channel by setting the
CHANNEL(peeraccount) before using the Dial, FollowMe, and Queue
applications.  Queue adds the wrinkle that it will not overwrite an
existing accountcode on the outgoing channel with the calling channels
values.

Accountcode and peeraccount values propagate to an outgoing channel before
dialing.  Accountcodes also propagate when channels enter or leave a basic
or stasis-mixing bridge.  The peeraccount value only makes sense for
mixing bridges with two channels; it is meaningless otherwise.

* Made peeraccount functional by changing accountcode propagation as
described above.

* Fixed CEL extracting the wrong ie value for the peeraccount.  This was
done intentionally in Asterisk v1.8 when that version had to punt on
peeraccount.

* Fixed a few places dealing with accountcodes that were reading from
channels without the lock held.

AFS-65 #close

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419520 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocore/db: Revert Patch Added In Attempt To Improve I/O Performance
Michael L. Young [Thu, 24 Jul 2014 21:01:37 +0000 (21:01 +0000)]
core/db: Revert Patch Added In Attempt To Improve I/O Performance

Reverting the patch since it was causing a regression and after fixing the
regression, there were no performance gains.  At least based on my method
for measurement.

ASTERISK-24050

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419504 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBlocked revisions 419442
Corey Farrell [Thu, 24 Jul 2014 18:01:00 +0000 (18:01 +0000)]
Blocked revisions 419442

These change was applied to trunk in r419438

........
chan_sip: sip_subscribe_mwi_destroy should not call sip_destroy

sip_subscribe_mwi_destroy calls sip_destroy on the reference counted
mwi->call.  This results in the fields of mwi->call being freed, but
mwi->call itself it leaked.  If other code is still using mwi->call
it can cause problems.  This change uses dialog_unref instead, to
balance the ref provided by sip_alloc().

ASTERISK-24087 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3834/
........

Merged revisions 419440 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 419441 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419443 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDeprecate astobj.h
Corey Farrell [Thu, 24 Jul 2014 17:50:46 +0000 (17:50 +0000)]
Deprecate astobj.h

This flags astobj.h as deprecated, warns people to use astobj2.h instead.
Only netsock.c (also deprecated) still uses astobj.h.

ASTERISK-24069 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3818/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419439 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_sip: complete upgrade to ao2
Corey Farrell [Thu, 24 Jul 2014 17:47:29 +0000 (17:47 +0000)]
chan_sip: complete upgrade to ao2

This change upgrades sip_registry and sip_subscription_mwi to astobj2.

ASTERISK-24067 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3759/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419438 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoDon't cause Asterisk to exit if ooh323.conf not found.
Jason Parker [Thu, 24 Jul 2014 16:52:00 +0000 (16:52 +0000)]
Don't cause Asterisk to exit if ooh323.conf not found.

(closes issue ASTERISK-23814)
........

Merged revisions 419374 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 419375 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 419376 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419377 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agodevice state: Update the core to report ONHOLD if a channel is on hold
Matthew Jordan [Thu, 24 Jul 2014 15:20:58 +0000 (15:20 +0000)]
device state: Update the core to report ONHOLD if a channel is on hold

In Asterisk, it is possible for a device to have a status of ONHOLD. This is
not typically an easy thing to determine, as a channel being on hold is not
a direct channel state. Typically, this has to be calculated outside of the
core independently in channel drivers, notably, chan_sip and chan_pjsip. Both
of these channel drivers already have to calculate device state in a fashion
more complex than the core can handle, as they aggregate all state of all
channels associated with a peer/endpoint; they also independently track
whether or not one of those channels is currently on hold and mark the device
state appropriately.

In 12+, we now have the ability to report an AST_DEVICE_ONHOLD state for all
channels that defer their device state to the core. This is due to channel hold
state actually now being tracked on the channel itself. If a channel driver
defers its device state to the core (which many, such as DAHDI, IAX2, and
others do in most situations), the device state core already goes out to get a
channel associated with the device. As such, it can now also factor the channel
hold state in its calculation.

This patch adds this logic to the device state core. It also uses an existing
mapping between device state and channel state to handle more channel states.
chan_pjsip has been updated slightly as well to make use of this (as it was,
for some reason, reporting a channel state of BUSY as a device state of INUSE,
which feels slightly wrong).

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

ASTERISK-24038 #close

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419358 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoAMI: Allow for command response documentation
Kinsey Moore [Thu, 24 Jul 2014 13:00:59 +0000 (13:00 +0000)]
AMI: Allow for command response documentation

Allow for responses to AMI actions/commands to be documented properly
in XML and displayed via the CLI. Response events are documented
exactly as standard AMI events are documented.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419342 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoendpoints: Fix failing unit tests from r419196
Matthew Jordan [Wed, 23 Jul 2014 16:46:13 +0000 (16:46 +0000)]
endpoints: Fix failing unit tests from r419196

This patch does two things:
(1) It updates the unit tests to expect additional stasis messages. More
    messages are now sent to the endpoint topic, due to forwarding all
    channel messages and the forwarding relationship set up between
    endpoints themselves.
(2) Remove the technology forwarding subscription during
    ast_endpoint_shutdown. This prevents an improper double shutdown of
    an endpoint from occurring.
........

Merged revisions 419318 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419319 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoBlocked revisions 419316
Matthew Jordan [Wed, 23 Jul 2014 16:43:22 +0000 (16:43 +0000)]
Blocked revisions 419316

........
res_pjsip_refer: remove stray debugging line

How'd those @ symbols get in there...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419317 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapp_voicemail: use a consistent generator string
Scott Griepentrog [Wed, 23 Jul 2014 14:00:09 +0000 (14:00 +0000)]
app_voicemail: use a consistent generator string

When updating voicemail.conf when a user changes
their pin, change the generator string to be the
same as the module name when reading so that the
same config_hook will be called.

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

Merged revisions 419284 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 419285 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419286 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agores_fax: unregister manager actions on unload
Corey Farrell [Wed, 23 Jul 2014 01:28:57 +0000 (01:28 +0000)]
res_fax: unregister manager actions on unload

* Unregister manager actions FAXSessions, FAXSession and FAXStats at unload.
* Update ast_manager_register2 use ao2_t_alloc tagged with the action name.

ASTERISK-24058 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3831/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocore/bridge_channel: Substitute Variables In Features Application Map
Michael L. Young [Tue, 22 Jul 2014 20:22:36 +0000 (20:22 +0000)]
core/bridge_channel: Substitute Variables In Features Application Map

Say you wanted to include variables in an application map and have those
variables substituted and passed along to the application being executed;
currently this does not happen.

This patch adds this ability to pass channel variable values to an
application before being executed.

ASTERISK-22608 #close
Reported by: Michael L. Young
patches:
  features_substitute_arguments_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419252 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoapps/app_mixmonitor: Add Options To Play Beep At Start Or Stop
Michael L. Young [Tue, 22 Jul 2014 20:01:42 +0000 (20:01 +0000)]
apps/app_mixmonitor: Add Options To Play Beep At Start Or Stop

We have a new periodic beep feature but sometimes a user needs some sort of
feedback, without the need to have a periodic beep during the recording, to let
them know that MixMonitor started recording or ended the recording.  The use
case where this patch is being used is when using Dynamic Features to start and
end MixMonitor.

This patch adds an option to play a beep when MixMonitor starts and an option to
play a beep when MixMonitor ends.

ASTERISK-24051 #close
Reported by: Michael L. Young
patches:
  mixmonitor-play-beep-start-stop.diff
                                     uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419238 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocore/db: Improve I/O When Updating Rows
Michael L. Young [Tue, 22 Jul 2014 18:56:00 +0000 (18:56 +0000)]
core/db: Improve I/O When Updating Rows

When updating a row, we are currently doing an INSERT OR REPLACE INTO.  The
downside to this is that the row is deleted if it exists and then a new row is
inserted.  So, we are hitting the disk twice.  One for the deletion and one for
the insertion.

This patch changes this statement to an INSERT INTO and if the insert fails
because a row with that key exists, we will IGNORE the failure.  Then we will
attempt to perform an UPDATE on the existing row if that row wasn't just
INSERTed.

ASTERISK-24050 #close
Reported by: Michael L. Young
patches:
  astdb-insert-update-io-help_trunk_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419222 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agocodec_speex: Fix trashing normal static frame for AST_FRAME_CNG.
Richard Mudgett [Tue, 22 Jul 2014 17:10:36 +0000 (17:10 +0000)]
codec_speex: Fix trashing normal static frame for AST_FRAME_CNG.

Made use a local static frame to generate the AST_FRAME_CNG frame when
silence starts.

I don't think the handling of the AST_FRAME_CNG has ever really worked
because there doesn't seem to be any consumers of it.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419206 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agoARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech
Matthew Jordan [Tue, 22 Jul 2014 16:20:58 +0000 (16:20 +0000)]
ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech

This patch serves two purposes:
(1) It fixes some bugs with endpoint subscriptions not reporting all of the
    channel events
(2) It serves as the preliminary work needed for ASTERISK-23692, which allows
    for sending/receiving arbitrary out of call text messages through ARI in a
    technology agnostic fashion.

The messaging functionality described on ASTERISK-23692 requires two things:
(1) The ability to send/receive messages associated with an endpoint. This is
    relatively straight forwards with the endpoint core in Asterisk now.
(2) The ability to send/receive messages associated with a technology and an
    arbitrary technology defined URI. This is less straight forward, as
    endpoints are formed from a tech + resource pair. We don't have a
    mechanism to note that a technology that *may* have endpoints exists.

This patch provides such a mechanism, and fixes a few bugs along the way.

The first major bug this patch fixes is the forwarding of channel messages
to their respective endpoints. Prior to this patch, there were two problems:
(1) Channel caching messages weren't forwarded. Thus, the endpoints missed
    most of the interesting bits (such as channel creation, destruction, state
    changes, etc.)
(2) Channels weren't associated with their endpoint until after creation.
    This resulted in endpoints missing the channel creation message, which
    limited the usefulness of the subscription in the first place (a major use
    case being 'tell me when this endpoint has a channel'). Unfortunately,
    this meant another parameter to ast_channel_alloc. Since not all channel
    technologies support an ast_endpoint, this patch makes such a call
    optional and opts for a new function, ast_channel_alloc_with_endpoint.

When endpoints are created, they will implicitly create a technology endpoint
for their technology (if one does not already exist). A technology endpoint is
special in that it has no state, cannot have channels created for it, cannot
be created explicitly, and cannot be destroyed except on shutdown. It does,
however, have all messages from other endpoints in its technology forwarded to
it.

Combined with the bug fixes, we now have Stasis messages being properly
forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
where bar has a single channel associated with it and foo has two channels
associated with it. The messages would be forwarded as follows:

channel PJSIP/foo-1 --
                      \
                       --> endpoint PJSIP/foo --
                      /                         \
channel PJSIP/foo-2 --                           \
                                                  ---- > endpoint PJSIP
                                                /
channel PJSIP/bar-1 -----> endpoint PJSIP/bar --

ARI, through the applications resource, can:
 - subscribe to endpoint:PJSIP/foo and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
 - subscribe to endpoint:PJSIP/bar and get notifications for channels
   PJSIP/bar-1 and endpoint PJSIP/bar
 - subscribe to endpoint:PJSIP and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar

Note that since endpoint PJSIP never changes, it never has events itself. It
merely provides an aggregation point for all other endpoints in its technology
(which in turn aggregate all channel messages associated with that endpoint).

This patch also adds endpoints to res_xmpp and chan_motif, because the actual
messaging work will need it (messaging without XMPP is just sad).

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

ASTERISK-23692
........

Merged revisions 419196 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419203 65c4cc65-6c06-0410-ace0-fbb531ad65f3

6 years agochan_iax2: Restore previous behavior of iax2_best_codec.
Joshua Colp [Tue, 22 Jul 2014 14:36:26 +0000 (14:36 +0000)]
chan_iax2: Restore previous behavior of iax2_best_codec.

The iax2_best_codec function was changed to convert the formats
into a format compatibilities structure and grab the first
format from it. The resulting order differs from the previous
order of iax2_best_codec which causes unexpected formats to
get chosen (such as g723).

This commit brings back the old behavior of iax2_best_codec by
having a specified preference list.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419180 65c4cc65-6c06-0410-ace0-fbb531ad65f3