asterisk/asterisk.git
8 years agoutils dir: Remove no longer needed traces of refcounter except in the clean make...
Richard Mudgett [Fri, 11 Apr 2014 18:04:41 +0000 (18:04 +0000)]
utils dir: Remove no longer needed traces of refcounter except in the clean make target.

* Removed no longer needed files from the svn:ignore property to make them visible.

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

8 years agobridging: Ensure locking during snapshot creation
Kinsey Moore [Fri, 11 Apr 2014 12:43:34 +0000 (12:43 +0000)]
bridging: Ensure locking during snapshot creation

While the vast majority of bridge snapshot creation is locked properly,
there are currently some instances that are not. This adds the missing
locking to ensure bridge state is not malleable during snapshot
creation.

(closes issue ASTERISK-22904)
Review: https://reviewboard.asterisk.org/r/3415/
Reported by: Matt Jordan
........

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

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

8 years agoFormatting: Remove invisible characters
Olle Johansson [Fri, 11 Apr 2014 08:28:14 +0000 (08:28 +0000)]
Formatting: Remove invisible characters

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

8 years agoFormatting only.
Olle Johansson [Fri, 11 Apr 2014 07:07:36 +0000 (07:07 +0000)]
Formatting only.

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

8 years agomain/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG output
Matthew Jordan [Fri, 11 Apr 2014 02:59:19 +0000 (02:59 +0000)]
main/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG output

This patch does the following:
(1) It makes REF_DEBUG a meneselect item. Enabling REF_DEBUG now enables
    REF_DEBUG globally throughout Asterisk.
(2) The ref debug log file is now created in the AST_LOG_DIR directory.
    Every run will now blow away the previous run (as large ref files
    sometimes caused issues). We now also no longer open/close the file
    on each write, instead relying on fflush to make sure data gets written
    to the file (in case the ao2 call being performed is about to cause a
    crash)
(3) It goes with a comma delineated format for the ref debug file. This
    makes parsing much easier. This also now includes the thread ID of the
    thread that caused ref change.
(4) A new python script instead for refcounting has been added in the
    contrib/scripts folder.
(5) The old refcounter implementation in utils/ has been removed.

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

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

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

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

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

8 years agomonitor: use app options parsing helper code
Russell Bryant [Fri, 11 Apr 2014 01:12:54 +0000 (01:12 +0000)]
monitor: use app options parsing helper code

This app is pretty ancient, so it was never converted to use the
option parsing helper code.  I'd like to add an option to this app
that takes an argument, and that's a pain to do when not using this
helper, so start by doing this conversion.

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

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

8 years agores_hep_pjsip: Use the channel name instead of the call ID when it is available
Matthew Jordan [Thu, 10 Apr 2014 21:28:08 +0000 (21:28 +0000)]
res_hep_pjsip: Use the channel name instead of the call ID when it is available

During discussions with Alexandr Dubovikov at Kamailio World, it became
apparent that while the SIP call ID is a useful identifier prior to an Asterisk
channel being created, it is far more preferable to use the channel name (or
some channel based identifier) when the channel is available. Homer is smart
enough to tie the various messages together. This patch opts to use the channel
name when it is available, falling back to the call ID otherwise.
........

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

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

8 years agores_pjsip_pubsub: Set the body generation result to 0 for a valid path
Kevin Harwell [Thu, 10 Apr 2014 21:10:46 +0000 (21:10 +0000)]
res_pjsip_pubsub: Set the body generation result to 0 for a valid path

The result of the "ast_sip_pubsub_generate_body_content" was not
set/initialized.  Consequently, the nominal path potentially returned
an invalid value, thus not sending mwi notifications.
........

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

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

8 years agoAdd a Command header to the AMI Mixmonitor action.
Mark Michelson [Wed, 9 Apr 2014 21:43:23 +0000 (21:43 +0000)]
Add a Command header to the AMI Mixmonitor action.

This fixes a parsing error that occurred during the processing of
the AMI action. The error did not result in MixMonitor itself
misbehaving, but it could result in the AMI response not giving
correct information back.

The new header allows for one to specify a post-process command
to run when recording finishes. Previously, in order to do this,
the post-process command would have to be placed at the end of
the Options: header.

Patches: mixmonitor_command_2.patch by jhardin (License #6512)
........

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

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

8 years agores_stasis_answer: Add missing newlines
Kinsey Moore [Wed, 9 Apr 2014 18:17:01 +0000 (18:17 +0000)]
res_stasis_answer: Add missing newlines
........

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

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

8 years agoInternal timing: Add notice that the -I and internal_timing option are no longer...
Richard Mudgett [Tue, 8 Apr 2014 21:25:15 +0000 (21:25 +0000)]
Internal timing: Add notice that the -I and internal_timing option are no longer needed.

Add notice messages during execution that the -I command line option and
the astersik.conf internal_timing option are no longer needed.  The
internal timing functionality is now always enabled if there is a timing
module loaded.

NOTE: Since the command line options and the asterisk.conf config file are
processed before the logging system is initialized, the messages are
output to stderr.

Change requested as a result of asterisk-dev list comments about the
commit for ASTERISK-22846 that removed the -I and internal_timing options.

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

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

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

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

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

8 years agoconfig: Fix CB_ADD_LEN() to work as originally intended.
Richard Mudgett [Tue, 8 Apr 2014 20:53:33 +0000 (20:53 +0000)]
config: Fix CB_ADD_LEN() to work as originally intended.

Fix a long standing bug in CB_ADD_LEN() behaving like CB_ADD().

ASTERISK-23546 #close
Reported by: Walter Doekes
........

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

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

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

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

8 years agoapp_confbridge: Fix confbridge.conf dsp_talking_threshold option setting wrong parameter.
Richard Mudgett [Tue, 8 Apr 2014 18:10:43 +0000 (18:10 +0000)]
app_confbridge: Fix confbridge.conf dsp_talking_threshold option setting wrong parameter.

Fixed copy pasta error.

ASTERISK-23545 #close
Reported by: John Knott
........

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

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

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

8 years agores_pjsip: Ignore explicit transport configuration if a WebSocket transport is specified.
Joshua Colp [Tue, 8 Apr 2014 14:49:47 +0000 (14:49 +0000)]
res_pjsip: Ignore explicit transport configuration if a WebSocket transport is specified.

This change makes it so if a transport is configured on an endpoint that is a WebSocket
type the option will be ignored. In practice this is fine because the WebSocket
transport can not create outgoing connections, it can only reuse existing ones. By
ignoring the option the existing PJSIP logic for using the existing connection will
be invoked and stuff will proceed.

(closes issue ASTERISK-23584)
Reported by: Rusty Newton
........

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

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

8 years agofunc_periodic_hook: List more modules as dependencies
Russell Bryant [Tue, 8 Apr 2014 00:26:57 +0000 (00:26 +0000)]
func_periodic_hook: List more modules as dependencies

This module makes use of some existing Asterisk components.  app_chanspy was
already listed as a dependency.  There are a few function modules used, as
well, so list them.

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

8 years agoPJSIP: Ensure test event has new state
Kinsey Moore [Mon, 7 Apr 2014 20:41:05 +0000 (20:41 +0000)]
PJSIP: Ensure test event has new state

The change that fixed the pubsub test event's use of a dangling pointer
also changed when it was processed relative to the pjsip subscription
state change processing. This change corrects the order of events while
holding a reference to the pointer that was previously dangling.
........

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

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

8 years agoAGI/Manager: Prevent multiple NewExten events during AGI application changes
Jonathan Rose [Mon, 7 Apr 2014 16:15:34 +0000 (16:15 +0000)]
AGI/Manager: Prevent multiple NewExten events during AGI application changes

AGI applications would trigger NewExten events every time the state of the AGI
application changed. This has historically not been the behavior and this
behavior was introduced with a CDR patch. This patch corrects that.

(closes issue ASTERISK-23390)
Reported by: Benjamin Keith Ford
Review: https://reviewboard.asterisk.org/r/3406/
........

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

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

8 years agoapp_queue: Re-add HoldTime to QueueCallerAbandon event (simple typo during ast12...
Walter Doekes [Mon, 7 Apr 2014 14:57:57 +0000 (14:57 +0000)]
app_queue: Re-add HoldTime to QueueCallerAbandon event (simple typo during ast12 refactor).

Reported by: Ibrahim22 (on IRC)
Tested by: Ibrahim22
........

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

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

8 years agoBlocked revisions 411809
Walter Doekes [Mon, 7 Apr 2014 14:53:02 +0000 (14:53 +0000)]
Blocked revisions 411809

........
configs: Clean up long line and typo in res_odbc.conf.sample.
........

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

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

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

8 years agoStasis: Fix Stasis() bridge refcount issue
Kinsey Moore [Mon, 7 Apr 2014 14:29:37 +0000 (14:29 +0000)]
Stasis: Fix Stasis() bridge refcount issue

The Stasis() dialplan application monitors what bridge a channel is in
and so necessarily holds on to a bridge pointer. This change ensures
that it also holds on to a reference for that bridge to prevent the
bridge pointer from becoming a dangling pointer.
........

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

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

8 years agoPJSIP: Fix crash introduced in r411671
Kinsey Moore [Mon, 7 Apr 2014 13:30:25 +0000 (13:30 +0000)]
PJSIP: Fix crash introduced in r411671

The test event introduced in revision 411671 uses a dangling pointer to
access information about pubsub state changes. This moves the event to
within the lifetime of the pointer.
........

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

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

8 years agofunc_periodic_hook: New function for periodic hooks.
Russell Bryant [Sat, 5 Apr 2014 13:06:34 +0000 (13:06 +0000)]
func_periodic_hook: New function for periodic hooks.

This commit introduces a new dialplan function, PERIODIC_HOOK().
It allows you run to a dialplan hook on a channel periodically.  The
original use case that inspired this was the ability to play a beep
periodically into a call being recorded.  The implementation is much
more generic though and could be used for many other things.

The implementation makes heavy use of existing Asterisk components.
It uses a combination of Local channels and ChanSpy() to run some
custom dialplan and inject any audio it generates into an active call.

The other important bit of the implementation is how it figures out
when to trigger the beep playback.  This implementation uses the
audiohook API, even though it's not actually touching the audio in any
way.  It's a convenient way to get a callback and check if it's time
to kick off another beep.  It would be nice if this was timer event
based instead of polling based, but unfortunately I don't see a way to
do it that won't interfere with other things.

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

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

8 years agointernal_timing: Remove the option and always make it enabled if a timing module...
Richard Mudgett [Fri, 4 Apr 2014 19:19:55 +0000 (19:19 +0000)]
internal_timing: Remove the option and always make it enabled if a timing module is loaded.

The masquerade supertest frequently fails because either the local channel
chain doesn't completely optimize out or the DTMF handshake doesn't
completely get accross.  Local channel optimization requires frames
flowing to trigger when optimization can happen.  When optimization
happens the media frame that triggered the optimization is dropped.
Sending DTMF requires frames to flow in the other direction for timing
purposes while sending nothing.  If internal timing is not enabled when
MOH is playing, Asterisk switches to received timing when an audio frame
is received.  With optimization dropping media frames and MOH not sending
frames unless it receives frames, occasionaly there are no more frames
being passed and the test fails.

* The asterisk command line -I option and the asterisk.conf
internal_timing option are removed.  Asterisk now always uses internal
timing when needed if any timing module is loaded.  The issue
ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken
if other internal timing modules besides DAHDI are used.  The
ast_read_generator_actions() now only does received timing if it has no
choice for frame generators like MOH, silence, and playback streaming.

* Cleaned up some code dealing with frame generators in
ast_deactivate_generator(), generator_write_format_change(),
ast_activate_generator(), and ast_channel_stop_silence_generator().

* Removed ast_internal_timing_enabled(), AST_OPT_FLAG_INTERNAL_TIMING, and
ast_opt_internal_timing.

ASTERISK-22846 #close
Reported by: Matt Jordan

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

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

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

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

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

8 years agoAdd some asserts that were handy when looking for a stasis cache problem.
Richard Mudgett [Fri, 4 Apr 2014 17:57:46 +0000 (17:57 +0000)]
Add some asserts that were handy when looking for a stasis cache problem.

* Assert if a channel is destroyed but has the snapshot staging flag set.
In this case the final channel destruction snapshot would never get taken.

* Assert if what we just got out of the stasis cache is not what we were
looking for.  This assert would have saved several days searching for a
bug and a lot of my hair.

* Assert if the music on hold message posts could not find the associated
channel.  A crash will happen later when manager tries to send the MOH AMI
message.  This assert catches the problem when the stasis message is
posted instead of by the thread processing the defective message.

* Always generate a backtrace when an ast_assert() fails.

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

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

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

8 years agohttp: Fix spurious ERROR message in responses with no content
Matthew Jordan [Fri, 4 Apr 2014 15:13:55 +0000 (15:13 +0000)]
http: Fix spurious ERROR message in responses with no content

When a response has a content length of 0, fwrite would be called to write a
buffer with no data in it. This resulted in the following classic error
message:

  [Apr  3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success

This patch makes it so that we only attempt to write out the content if the
calculated content_length is non-zero.
........

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

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

8 years agores_pjsip_pubsub: Add test event for state change
Kinsey Moore [Thu, 3 Apr 2014 12:06:37 +0000 (12:06 +0000)]
res_pjsip_pubsub: Add test event for state change

This adds a test event when subscription state changes so that
integration tests may trigger new actions at the appropriate times.

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

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

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

8 years agores_hep: Fix crash when hep.conf not available
Matthew Jordan [Thu, 3 Apr 2014 11:47:03 +0000 (11:47 +0000)]
res_hep: Fix crash when hep.conf not available

Parts of res_hep properly checked for a valid configuration object before
attempting to access the configuration. A check, however, was missed when
a packet is sent. This patch fixes the crash caused by not checking if the
configuration object is valid.
........

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

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

8 years agoPrevent duplicate sorcery wizards from being applied to sorcery object types.
Mark Michelson [Wed, 2 Apr 2014 18:57:29 +0000 (18:57 +0000)]
Prevent duplicate sorcery wizards from being applied to sorcery object types.

This commit contains several changes to sorcery:

1) Application of sorcery configuration based on module name is automatically performed
when sorcery is opened for a module.
2) Sorcery will not attempt to apply the same wizard to an object type more than once.
3) Sorcery gives more exact results when attempting to apply a wizard, whether as the
default or based on configuration.

Sorcery unit tests still pass for me after making these changes.

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

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

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

8 years agores_parking: Minor tweaks.
Richard Mudgett [Tue, 1 Apr 2014 22:42:23 +0000 (22:42 +0000)]
res_parking: Minor tweaks.

* Use ast_bridge_channel_lock()/ast_bridge_channel_unlock() instead of
ao2_lock()/ao2_unlock() for struct ast_bridge_channel variables.

* Use ast_copy_string() instead of inlining it.

* Remove an already done TODO comment.

* Some whitespace tweaks.
........

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

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

8 years agostasis_channels.c: Eliminate another overuse of RAII_VAR().
Richard Mudgett [Tue, 1 Apr 2014 22:34:30 +0000 (22:34 +0000)]
stasis_channels.c: Eliminate another overuse of RAII_VAR().
........

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

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

8 years agoapp_queue: Fix a bug where realtime members would be deleted during reload causing...
Joshua Colp [Tue, 1 Apr 2014 16:52:12 +0000 (16:52 +0000)]
app_queue: Fix a bug where realtime members would be deleted during reload causing waiting callers to get ejected.

This patch causes realtime queue members to remain in queues during the reload process. Previously these
members would be removed causing any waiting callers to be ejected from the queue with a reason of "EXITEMPTY".

ASTERISK-23547 #close
ASTERISK-23547 #comment Patch app_queue_fix_realtime_reload_1.8_trunk.patch submitted by Italo Rossi (license 6409)

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

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

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

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

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

9 years agores_hep/res_hep_pjsip: Add a HEPv3 capture agent module and a logger for PJSIP
Matthew Jordan [Fri, 28 Mar 2014 18:32:50 +0000 (18:32 +0000)]
res_hep/res_hep_pjsip: Add a HEPv3 capture agent module and a logger for PJSIP

This patch adds the following:
(1) A new module, res_hep, which implements a generic packet capture agent for
the Homer Encapsulation Protocol (HEP) version 3. Note that this code is based
on a patch provided by Alexandr Dubovikov; I basically just wrapped it up,
added configuration via the configuration framework, and threw in a
taskprocessor.
(2) A new module, res_hep_pjsip, which forwards all SIP message traffic that
passes through the res_pjsip stack over to res_hep for encapsulation and
transmission to a HEPv3 capture server.

Much thanks to Alexandr for his Asterisk patch for this code and for a *lot*
of patience waiting for me to port it to 12/trunk. Due to some dithering on
my part, this has taken the better part of a year to port forward (I still
blame CDRs for the delay).

ASTERISK-23557 #close

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

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

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

9 years agoprocess stack command even if gatekeeper client isn't register
Alexandr Anikin [Fri, 28 Mar 2014 18:00:18 +0000 (18:00 +0000)]
process stack command even if gatekeeper client isn't register
don't destroy gatekeeper client if it is not started
don't destroy gatekeeper client in some sort of gatekeeper errors
signal rtp create condition when call cleared before rtp structure created

(closes issue ASTERISK-23460)

Reported by: Dmitry Melekhov
Patches:
ASTERISK-23460-2.patch

Tested by: Dmitry Melekhov
........

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

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

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

9 years agoUpdate API versions and UPGRADE/CHANGES for 12.2.0
Matthew Jordan [Fri, 28 Mar 2014 17:41:23 +0000 (17:41 +0000)]
Update API versions and UPGRADE/CHANGES for 12.2.0

This patch does the following:
 * It updates the AMI version to 2.2.0 to indicate backwards compatible
   changes have been made since the last release
 * It updates the ARI version to 1.2.0 to indicate backwards compatible
   changes have been made since the last release
 * It updates the UPGRADE/CHANGES files with changes that were not
   mentioned
........

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

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

9 years agores_config_odbc: Fix for nullable integer columns and keyfield existence check in...
Matthew Jordan [Fri, 28 Mar 2014 17:09:14 +0000 (17:09 +0000)]
res_config_odbc: Fix for nullable integer columns and keyfield existence check in update_odbc.

This patch fixes setting nullable integer columns to NULL instead of an empty
string, which fails for PostgreSQL, for example. The current code is supposed
to do so, but the check is broken. The patch also allows the first column in
the list to be a nullable integer.

Also, the check for existence of a mandatory column checked for the first
column in the list instead of the key field lookup column. This patch fixes
that issue as well.

Finally, the compatibility option allow_empty_string_in_nontext, which was
added to previous revisions to allow for some database backends with certain
schemas to function, has been removed.

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

ASTERISK-23459 #close
ASTERISK-23351 #close

(closes issue ASTERISK-23459)
Reported by: zvision
patches:
  res_config_odbc.diff uploaded by zvision (License 5755)

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

9 years agoBlocked revisions 411512
Matthew Jordan [Fri, 28 Mar 2014 16:49:09 +0000 (16:49 +0000)]
Blocked revisions 411512

........
res_config_odbc/res_odbc: Fix handling of non-text columns updates with empty values.

This patch fixes setting nullable integer columns to NULL instead of an empty
string, which fails for PostgreSQL, for example. The current code is supposed
to do so, but the check is broken. The patch also allows the first column in
the list to be a nullable integer.

This patch also adds a compatibility setting in res_odbc.conf,
allow_empty_string_in_nontext. It is enabled by default. It should be disabled
for database backends (such as PostgreSQL) that require NULL instead of an
empty string for Integer columns.

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

(issue ASTERISK-23459)
Reported by: zvision
patches:
  res_config_odbc.diff uploaded by zvision (License 5755)
........

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

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

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

9 years agohttp: response body often missing after specific request
Scott Griepentrog [Fri, 28 Mar 2014 16:18:56 +0000 (16:18 +0000)]
http: response body often missing after specific request

This patch works around a problem with the HTTP body
being dropped from the response to a specific client
and under specific circumstances:

a) Client request comes from node.js user agent
   "Shred" via use of swagger-client library.

b) Asterisk and Client are *not* on the same
   host or TCP/IP stack

In testing this problem, it has been determined that
the write of the HTTP body is lost, even if the data
is written using low level write function.  The only
solution found is to instruct the TCP stack with the
shutdown function to flush the last write and finish
the transmission.  See review for more details.

ASTERISK-23548 #close
(closes issue ASTERISK-23548)
Reported by: Sam Galarneau
Review: https://reviewboard.asterisk.org/r/3402/
........

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

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

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

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

9 years agoUPGRADE: Note IAX2 compatibility issue between 1.4 and 1.8+ systems.
Matthew Jordan [Fri, 28 Mar 2014 15:48:48 +0000 (15:48 +0000)]
UPGRADE: Note IAX2 compatibility issue between 1.4 and 1.8+ systems.
........

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

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

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

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

9 years agocontrib/realtime: Remove empty SQL script files
Matthew Jordan [Fri, 28 Mar 2014 14:19:20 +0000 (14:19 +0000)]
contrib/realtime: Remove empty SQL script files

Since the relatime scripts are now managed by Alembic, the previous realtime
scripts were previously removed. However, the removal process messed up, as
the files were still in the repository. The contents were just empty.

This removes the files from the tree.
........

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

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

9 years agochan_sip: Add MESSAGE request to allowed methods
Matthew Jordan [Fri, 28 Mar 2014 03:55:26 +0000 (03:55 +0000)]
chan_sip: Add MESSAGE request to allowed methods

The allowed methods advertised by chan_sip did not previously note the MESSAGE
request. Even in Asterisk 1.8, we do accept in-dialog MESSAGE requests; we
should advertise that we support MESSAGE requests.

ASTERISK-23504 #close
ASTERISK-23504 #comment Reported by: Martin Kontsek
ASTERISK-23504 #comment Patch sip.h_patch.diff uploaded by Martin Kontsek (license 6587)

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

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

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

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

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

9 years agoFix dialplan function NULL channel safety issues
Corey Farrell [Thu, 27 Mar 2014 19:21:44 +0000 (19:21 +0000)]
Fix dialplan function NULL channel safety issues

(closes issue ASTERISK-23391)
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3386/
........

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

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

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

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

9 years agomain/formats: Fix crash in ast_format_cmp during non-clean shutdown.
Corey Farrell [Thu, 27 Mar 2014 18:26:12 +0000 (18:26 +0000)]
main/formats: Fix crash in ast_format_cmp during non-clean shutdown.

* Update asterisk.h to reflect availability of ast_register_cleanup in 11.9.
* Use ast_register_cleanup for format_attr_shutdown.

(closes issue ASTERISK-23103)
Reported by: JoshE
........

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

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

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

9 years agoGive sorcery instances a reference to their wizards.
Mark Michelson [Thu, 27 Mar 2014 14:21:15 +0000 (14:21 +0000)]
Give sorcery instances a reference to their wizards.

On graceful shutdown, sorcery wizards are all killed off, but it is
possible for sorcery instances to still have dangling pointers after
this, possibly causing a crash. Giving the sorcery instances a reference
to their wizards ensures that the wizard reference will remain valid for
the lifetime of the sorcery instance.

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

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

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

9 years agosay: Fix a bug where SayNumber in Polish tries to play incorrect sound.
Joshua Colp [Wed, 26 Mar 2014 22:45:10 +0000 (22:45 +0000)]
say: Fix a bug where SayNumber in Polish tries to play incorrect sound.

This change fixes a bug where calling SayNumber with a number divisible by
100 using the Polish language would cause the code to attempt to play a
sound file with an empty name.

(closes issue ASTERISK-23509)
Reported by: zvision

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

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

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

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

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

9 years agochan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)
Jonathan Rose [Wed, 26 Mar 2014 16:15:12 +0000 (16:15 +0000)]
chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325)

Prior too this patch, the P-Asserted-Identity header would include anonymous
caller id information which seems to go against the point of the
P-Asserted-Identity header. Now the real caller ID information will be
included in this header. Also, no privacy header would be included.
This patch adds 'Privacy: id' to outgoing SIP messages that include the
P-Asserted-Identity header.

(closes issue AST-1301)
........

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

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

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

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

9 years agoFix 'alembic branches' merge conflict as described by the web page.
Richard Mudgett [Wed, 26 Mar 2014 16:05:00 +0000 (16:05 +0000)]
Fix 'alembic branches' merge conflict as described by the web page.
........

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

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

9 years agoARI: Don't complain about missing ARI users when we aren't enabled
Sean Bright [Tue, 25 Mar 2014 18:44:57 +0000 (18:44 +0000)]
ARI: Don't complain about missing ARI users when we aren't enabled

Currently, if ARI is not enabled it will still complain that there are no
configured users.  This patch checks to see if ARI is enabled before logging and
error or iterating the container to validate the users.

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

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

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

9 years agoAdd a "message_context" option for PJSIP endpoints.
Mark Michelson [Tue, 25 Mar 2014 17:40:51 +0000 (17:40 +0000)]
Add a "message_context" option for PJSIP endpoints.
........

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

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

9 years agores_pjsip: Fix contact authenticate_qualify endpoint lookup when qualifing a contact.
Richard Mudgett [Tue, 25 Mar 2014 16:57:41 +0000 (16:57 +0000)]
res_pjsip: Fix contact authenticate_qualify endpoint lookup when qualifing a contact.

* Fixed bad use of ao2_find() in on_endpoint().

* Replaced use of find_endpoints() with find_an_endpoint() since only the
first found endpoint is ever needed.

* Fixed qualify_contact_cb() to update the contact with the aor
authenticate_qualify setting.  Otherwise, permanent contacts in the aor
type sections would have a config line order dependancy.

* Fixed off nominal path contact ref leak in qualify_contact().  The
comment saying the unref is not needed was wrong.

* Fixed off nominal path use of the endpoint parameter if it is NULL in
send_out_of_dialog_request().

* Added missing off nominal path unref of pjsip tdata in
send_out_of_dialog_request().

* Fixed off nominal path failing to call the callback in send_request_cb()
when the request is challenged for authentication.

* Eliminated silly RAII_VAR() use in qualify_contact_cb().

* Updated ast_sip_send_request() doxygen to better reflect reality.

(closes issue ASTERISK-23254)
Reported by: rmudgett

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

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

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

9 years agochan_sip: Fix incorrect use of timers
Kinsey Moore [Tue, 25 Mar 2014 16:06:57 +0000 (16:06 +0000)]
chan_sip: Fix incorrect use of timers

If update_provisional_keepalive() is called while
send_provisional_keepalive_full() is waiting on the PVT lock, then
pvt->provisional_keepalive_sched_id will be changed to a new sched_id
value by update_provisional_keepalive(), but that new sched_id then may
be overwritten with -1 by send_provisional_keepalive_full(), killing
the pvt's reference to a schedule and "leaking" the reference.

(closes issue ASTERISK-22079)
Review: https://reviewboard.asterisk.org/r/3368/
Reported by: Jamuel Starkey, Matteo, Leif Madsen, Steve Davies
Patches:
    provisional_keepalive_fix.diff uploaded by Steve Davies (license 5012)
........

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

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

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

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

9 years agoARI: Resolve a subscription leak against implicit bridge subscriptions
Jonathan Rose [Tue, 25 Mar 2014 15:56:05 +0000 (15:56 +0000)]
ARI: Resolve a subscription leak against implicit bridge subscriptions

When a channel in a stasis application is joined to a bridge, a subscription
for that bridge is created implicitly for the stasis application serving the
channel. Prior to this patch, subsequent removals of the channel from the
bridge would leave the subscription open.

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

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

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

9 years agoRevert -r411073. It didn't help and blew up the system.
Richard Mudgett [Tue, 25 Mar 2014 15:47:17 +0000 (15:47 +0000)]
Revert -r411073.  It didn't help and blew up the system.

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

9 years agolocking: Add temporary sanity checks.
Richard Mudgett [Mon, 24 Mar 2014 23:36:36 +0000 (23:36 +0000)]
locking: Add temporary sanity checks.

Add some temporary sanity checks to hunt for locking problems with the
masquerade supertest.

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

9 years agochan_sip: Always use fromdomain if set for domain, even if callerid is set to restricted.
Joshua Colp [Mon, 24 Mar 2014 21:39:46 +0000 (21:39 +0000)]
chan_sip: Always use fromdomain if set for domain, even if callerid is set to restricted.

(closes issue ASTERISK-20841)
Reported by: Kelly Goedert
........

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

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

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

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

9 years agores_pjsip_registrar.c: Miscellaneous cleanup in rx_task().
Richard Mudgett [Fri, 21 Mar 2014 16:04:09 +0000 (16:04 +0000)]
res_pjsip_registrar.c: Miscellaneous cleanup in rx_task().

* Fix variable shadowing of 'updated' by renaming it to 'contact_update'.

* Checked 'contact_update' for ast_sorcery_copy() failure.

* Removed silly use of RAII_VAR() for 'contact_update'.
........

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

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

9 years agoMake the AEL load process less chatty.
Sean Bright [Fri, 21 Mar 2014 15:50:11 +0000 (15:50 +0000)]
Make the AEL load process less chatty.

Switched a bunch of LOG_NOTICEs to ast_debug.  This time without breaking the
build.

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

9 years agoRevert r410981. aelparse blew up.
Sean Bright [Fri, 21 Mar 2014 15:30:37 +0000 (15:30 +0000)]
Revert r410981.  aelparse blew up.

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

9 years agoRemove a LOG_NOTICE from ast_config_engine_register.
Sean Bright [Fri, 21 Mar 2014 15:16:50 +0000 (15:16 +0000)]
Remove a LOG_NOTICE from ast_config_engine_register.

There is enough indication from the CLI that we are loading a realtime engine
as it is.

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

9 years agoMake the AEL load process less chatty.
Sean Bright [Fri, 21 Mar 2014 15:14:13 +0000 (15:14 +0000)]
Make the AEL load process less chatty.

Switched a bunch of LOG_NOTICEs to ast_debug.

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

9 years agoapp_confbridge: Fix bug - users with startmuted set don't start muted
Jonathan Rose [Thu, 20 Mar 2014 23:02:45 +0000 (23:02 +0000)]
app_confbridge: Fix bug - users with startmuted set don't start muted

(closes issue ASTERISK-23461)
Reported by: Chico Manobela
Review: https://reviewboard.asterisk.org/r/3373/
........

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

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

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

9 years agoassigned-uniqueids: Miscellaneous cleanup and fixes.
Richard Mudgett [Thu, 20 Mar 2014 16:35:57 +0000 (16:35 +0000)]
assigned-uniqueids: Miscellaneous cleanup and fixes.

* Fix memory leak in ast_unreal_new_channels().  Made it generate the ;2
uniqueid on a stack variable instead of mallocing it.

* Made send error response to ARI and AMI requests instead of just logging
excessive uniqueid length and allowing truncation.  action_originate() and
ari_channels_handle_originate_with_id().

* Fixed minor truncating uniqueid hole when generating the ;2 uniqueid
string length.  Created public and internal lengths of uniqueid.  The
internal length can handle a max public uniqueid plus an appended ;2.

* free() and ast_free() are NULL tolerant so they don't need a NULL test
before calling.

* Made use better struct initialization format instead of the position
dependent initialization format.  Also anything not explicitly initialized
in the struct is initialized to zero by the compiler.

* Made ast_channel_internal_set_fake_ids() use the safer
ast_copy_string() instead of strncpy().

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

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

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

9 years agoPJSIP: Allow for identify sections to be specified in sorcery.conf.
Mark Michelson [Wed, 19 Mar 2014 17:27:57 +0000 (17:27 +0000)]
PJSIP: Allow for identify sections to be specified in sorcery.conf.

"identify" is a special type of configuration object in PJSIP because
unlike the other objects, it is not provided by the base res_pjsip module.
Instead, it is provided by the res_pjsip_endpoint_identifier_ip module. If
using the default sorcery wizard (config,criteria=type=identify) then things
work because the module that applies the default wizard is the correct module.

However, if attempting to use sorcery.conf to apply an alternate wizard, it
was not possible. If you attempted to specify the identify object type in the
res_pjsip section, then the object could not be registered since the object
was undocumented for the res_pjsip module. There was no alternate configuration
section defined for it, so you were out of luck if you wanted to override the
default wizard.

With this change, the identify section will properly have a sorcery.conf-based
wizard applied when the identify definition is within the res_pjsip_endpoint_identifier_ip
section.
........

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

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

9 years agores_stasis: Fix a bug where the default bridge type was not set.
Joshua Colp [Wed, 19 Mar 2014 14:25:31 +0000 (14:25 +0000)]
res_stasis: Fix a bug where the default bridge type was not set.
........

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

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

9 years agores_stasis: Extend bridge type to be a comma separated list of bridge attributes.
Joshua Colp [Wed, 19 Mar 2014 12:54:25 +0000 (12:54 +0000)]
res_stasis: Extend bridge type to be a comma separated list of bridge attributes.

This change turns the bridge type field into a comma separated list of attributes.
These attributes include: mixing, holding, dtmf_events, and proxy_media. By setting
the various attributes a user can control the type of bridge created with the
behavior they need for their application.

(closes issue ASTERISK-23437)
Reported by: Matt Jordan

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

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

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

9 years agores_ari: Fix documentation schema error
Matthew Jordan [Wed, 19 Mar 2014 02:33:55 +0000 (02:33 +0000)]
res_ari: Fix documentation schema error
........

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

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

9 years agores_ari: Add notes about Asterisk HTTP server to the "enabled" config option for...
Rusty Newton [Tue, 18 Mar 2014 23:32:00 +0000 (23:32 +0000)]
res_ari: Add notes about Asterisk HTTP server to the "enabled" config option for the res_ari general section

Added note and see-also reminding user to enable the HTTP server.

(closes issue ASTERISK-22499)
Reported by: Rusty Newton
........

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

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

9 years agoARI: allow json content type with zero length body
Scott Griepentrog [Tue, 18 Mar 2014 15:45:04 +0000 (15:45 +0000)]
ARI: allow json content type with zero length body

When a request was received with a Content-type of json,
the body was sent for json parsing - even if it was zero
length.  This resulted in ARI requests failing that were
valid, such as a channel DELETE with no parameters.  The
code has now been changed to skip json parsing with zero
content length.

(closes issue SWP-6748)
Reported by: Samuel Galarneau
Review: https://reviewboard.asterisk.org/r/3360/
........

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

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

9 years agocdr: Add asserts for when we don't know about a CDR for a channel
Matthew Jordan [Tue, 18 Mar 2014 15:28:45 +0000 (15:28 +0000)]
cdr: Add asserts for when we don't know about a CDR for a channel

In the CDR core, every channel should either be filtered out (due to being an
'internal' channel used as an implementation detail, such as playing media
back into a bridge) or it should get a CDR. Even if that CDR ends up being
discarded, we still give the channel a CDR in case we end up needing it. If we
hit a situation where a channel does not have a CDR, we should blow up in
-dev-mode. Asserts are appropriate for that.

This patch adds those asserts, as they would have quickly caught the error
fixed by r410814.
........

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

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

9 years agores_pjsip: Fix memory leak of nameservers in off-nominal resolver creation failure.
Joshua Colp [Tue, 18 Mar 2014 12:45:49 +0000 (12:45 +0000)]
res_pjsip: Fix memory leak of nameservers in off-nominal resolver creation failure.

Thanks Walter Doekes!
........

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

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

9 years agores_fax_spandsp: Use g711_free() when available.
Sean Bright [Tue, 18 Mar 2014 11:52:15 +0000 (11:52 +0000)]
res_fax_spandsp: Use g711_free() when available.

Per Johann Steinwendtner on the asterisk-dev mailing list:

http://lists.digium.com/pipermail/asterisk-dev/2014-March/066102.html

g711_free() was introduced in spandsp 0.0.6pre4 and g711_release() became a
noop.  I opted not to remove the call to g711_release() since it is harmless
and to call g711_free() if we have a sufficiently recent version of spandsp.

(issue ASTERISK-20149)
Reported by: Alexandr Gordeev
........

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

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

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

9 years agostasis_cache: Use the right variable in the cache entry ao2 cmp function.
Richard Mudgett [Tue, 18 Mar 2014 02:09:25 +0000 (02:09 +0000)]
stasis_cache: Use the right variable in the cache entry ao2 cmp function.
........

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

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

9 years agores_pjsip: Enable PJSIP DNS client support.
Joshua Colp [Mon, 17 Mar 2014 22:54:32 +0000 (22:54 +0000)]
res_pjsip: Enable PJSIP DNS client support.

This change enables DNS client support within PJSIP. System
nameservers are automatically discovered using res_init or
res_ninit. If this fails then PJSIP will resort to using
gethostbyname for resolution.

By enabling this support we gain SRV support, failover, and
weight support.

(closes issue ASTERISK-23435)
Reported by: Matt Jordan

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

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

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

9 years agores_pjsip_multihomed: Make address replacement less aggressive.
Joshua Colp [Mon, 17 Mar 2014 22:46:56 +0000 (22:46 +0000)]
res_pjsip_multihomed: Make address replacement less aggressive.

This change makes the res_pjsip_multihomed module less aggressive when
changing the address in messages. It will now only occur if the transport
in use is bound to the any address OR if the system determined source
address matches the bound address of the transport in use.

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

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

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

9 years agocallerid: Logic error in checksum processing
Russ Meyerriecks [Mon, 17 Mar 2014 22:24:03 +0000 (22:24 +0000)]
callerid: Logic error in checksum processing

Callerid checksum-ing was being handled incorrectly here. When the checksum is
calculated to be 0x00, it will perform 0x100-0x00 which results in 0x100. This
value will then fail the otherwise correct callerid message.

This patch changes the logic to simply add the calculated checksum to the
transmitted 2's compliment checksum.

Review: https://reviewboard.asterisk.org/r/3356/
(closes issue ASTERISK-23488)

........
This is a merge of merged revisions 410750 410747 from http://svn.asterisk.org/svn/asterisk/branches/12
I didn't want a broken patch to be comitted to trunk so I pre-merge merged them.

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

9 years agoRevert changes to sorcery that accidentally got committed.
Mark Michelson [Mon, 17 Mar 2014 19:35:17 +0000 (19:35 +0000)]
Revert changes to sorcery that accidentally got committed.

These changes were still up for review and have not been approved
yet. I must have had the changes in my working copy when making
a different change.
........

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

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

9 years agoFix stuck channel in ARI through the introduction of synchronous bridge actions.
Mark Michelson [Mon, 17 Mar 2014 17:22:12 +0000 (17:22 +0000)]
Fix stuck channel in ARI through the introduction of synchronous bridge actions.

Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

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

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

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

9 years agoapp_confbridge: Add missing destructor call to announcer channel destructor.
Richard Mudgett [Mon, 17 Mar 2014 16:48:55 +0000 (16:48 +0000)]
app_confbridge: Add missing destructor call to announcer channel destructor.
........

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

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

9 years agostasis/app.c: Add some extra debugging for subscription counts
Matthew Jordan [Sun, 16 Mar 2014 20:27:28 +0000 (20:27 +0000)]
stasis/app.c: Add some extra debugging for subscription counts

Events are sent to a connected ARI application based on the things that ARI
application cares about. These subscriptions can be set up implicitly - such
as when that ARI application creates a new object - or explicitly, via the
application resource's subscription operations. Debugging *why* something was
being sent to an application - or why something was not being sent to an
application - was a bit tricky, as there was no debug information for the
subscriptions.

This patch adds some debug level 3 statements that show the subscription counts
for applications. (Level 3 was chosen as it matches the verbose level 3
statements elsewhere)
........

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

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

9 years agoframehook.h: Fix some doc typos.
Russell Bryant [Sat, 15 Mar 2014 15:24:23 +0000 (15:24 +0000)]
framehook.h: Fix some doc typos.

There were a number of instances in this header file where "function all" was
intended to be "function call".  This patch fixes that up.

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

9 years agoFix failing realtime sorcery tests.
Mark Michelson [Fri, 14 Mar 2014 21:56:21 +0000 (21:56 +0000)]
Fix failing realtime sorcery tests.

The store realtime callback needs to return a positive value for
sorcery to treat the store as a success.
........

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

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

9 years agomanager: fix memory leak in manager_add_filter function
Jonathan Rose [Fri, 14 Mar 2014 21:36:55 +0000 (21:36 +0000)]
manager: fix memory leak in manager_add_filter function

(closes issue ASTERISK-23420)
Reported by: Etienne Lessard
Patches:
    manager_eventfilter_leak uploaded by Etienne Lessard (license 6394)
........

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

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

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

9 years agoRemove an extra ast_cond_wait() that slipped through the patch.
Mark Michelson [Fri, 14 Mar 2014 20:55:06 +0000 (20:55 +0000)]
Remove an extra ast_cond_wait() that slipped through the patch.
........

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

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

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

9 years agoHandle the return values of realtime updates and stores more accurately.
Mark Michelson [Fri, 14 Mar 2014 18:11:55 +0000 (18:11 +0000)]
Handle the return values of realtime updates and stores more accurately.

Realtime backends' update and store callbacks return the number of rows affected,
or -1 if there was a failure. There were a couple of issues:

* The config API was treating 0 as a successful return, and positive values as
  a failure. Now the config API treats anything >= 0 as a success.

* res_sorcery_realtime was treating 0 as a successful return from the store
  procedure, and any positive values as a failure. Now sorcery treats anything
  > 0 as a success. It still considers 0 a "failure" since there is no change
  to report to observers.

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

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

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

9 years agoPrevent conflicts regarding unsolicited and solicited MWI to an endpoint.
Mark Michelson [Fri, 14 Mar 2014 18:05:04 +0000 (18:05 +0000)]
Prevent conflicts regarding unsolicited and solicited MWI to an endpoint.

If an endpoint is receiving unsolicited MWI for a mailbox and then attempts
to subscribe to an AOR that provides MWI for the same mailbox, then the SUBSCRIBE
is rejected with a 500 response.

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

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

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

9 years agouniqueid: Update CHANGES to reflect new features
Scott Griepentrog [Fri, 14 Mar 2014 17:56:53 +0000 (17:56 +0000)]
uniqueid: Update CHANGES to reflect new features

Note the new features provided by uniqueid in the
CHANGES file.

(issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3316/
........

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

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

9 years agoPJSIP: TOS values should be represented as decimals in sorcery objects
Jonathan Rose [Fri, 14 Mar 2014 16:42:54 +0000 (16:42 +0000)]
PJSIP: TOS values should be represented as decimals in sorcery objects

(closes issue ASTERISK-23235)
Reported by: George Joseph
Review: https://reviewboard.asterisk.org/r/3324/
........

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

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

9 years agoPrevent delayed astdb syncs.
Mark Michelson [Fri, 14 Mar 2014 16:19:21 +0000 (16:19 +0000)]
Prevent delayed astdb syncs.

The syncing thread sleeps for a second before waiting to be
told to attempt to sync again. If a signal were sent during this
sleeping period, we would end up having to wait until the next
sync signal occurred in order to sync up the astdb.

This code rearrangement also ensures that any pending transactions
will be synced prior to Asterisk shutting down.

Patches: db_sync.patch by John Hardin (License #6512)
........

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

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

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

9 years agoARI/bridges: Forward Playback/Recording Started/Finished to bridge topic
Jonathan Rose [Fri, 14 Mar 2014 16:17:26 +0000 (16:17 +0000)]
ARI/bridges: Forward Playback/Recording Started/Finished to bridge topic

(closes issue ASTERISK-23444)
Reported by: Ben Merrills
Review: https://reviewboard.asterisk.org/r/3340/
........

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

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

9 years agores_mwi_external: Clear the stasis cache entry when the external MWI is deleted.
Richard Mudgett [Fri, 14 Mar 2014 16:01:13 +0000 (16:01 +0000)]
res_mwi_external: Clear the stasis cache entry when the external MWI is deleted.

One of the things missing when external MWI support was added was the
ability to clear the stasis cache entry of deleted external MWI mailboxes.

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

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

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

9 years agocdr.c: Add missing aow_unlock(cdr) in off nominal path of handle_dial_message().
Richard Mudgett [Thu, 13 Mar 2014 21:27:15 +0000 (21:27 +0000)]
cdr.c: Add missing aow_unlock(cdr) in off nominal path of handle_dial_message().

* Trivial common code hoisting in handle_bridge_leave_message().

* Some whitespace fixing.
........

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

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

9 years agoARI: Ensure managing application receives ChannelEnteredBridge messages
Kinsey Moore [Thu, 13 Mar 2014 19:33:22 +0000 (19:33 +0000)]
ARI: Ensure managing application receives ChannelEnteredBridge messages

This fixes an issue where a Stasis application running over ARI and
subscribed to ari/events could miss the ChannelEnteredBridge event
because it did not subscribe to the new bridge fast enough.

To accomplish this, it subscribes the application controlling the
channel to the new bridge before adding it to that bridge which
required the stasis_app_control structure to maintain a reference to
the stasis_app.

(closes issue ASTERISK-23295)
Review: https://reviewboard.asterisk.org/r/3336/
........

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

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

9 years agoMultiple revisions 410509-410510
Joshua Colp [Thu, 13 Mar 2014 13:25:09 +0000 (13:25 +0000)]
Multiple revisions 410509-410510

........
  r410509 | file | 2014-03-13 06:23:14 -0700 (Thu, 13 Mar 2014) | 2 lines

  res_pjsip_multihomed: Fix a bug where the 200 OK for a REGISTER would contain the wrong contact.
........
  r410510 | file | 2014-03-13 06:24:17 -0700 (Thu, 13 Mar 2014) | 2 lines

  res_pjsip_multihomed: Remove change for testing fix.
........

Merged revisions 410509-410510 from http://svn.asterisk.org/svn/asterisk/branches/12

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

9 years agores_musiconhold.c: Generate MOH start/stop events whenever the MOH stream is started...
Richard Mudgett [Wed, 12 Mar 2014 19:06:52 +0000 (19:06 +0000)]
res_musiconhold.c: Generate MOH start/stop events whenever the MOH stream is started/stopped.

* Made res_musiconhold.c always post the MusicOnHoldStart/MusicOnHoldStop
events when it actually starts/stops the music streams.  This allows the
events to always happen when MOH starts/stops.  The event posting code was
moved to the MOH alloc/release routines.

* Made channel_do_masquerade() stop any MOH on the original channel before
masquerading so the original channel will get a stop event with correct
information.

* Cleaned up a couple odd codings in moh_files_alloc() and moh_alloc()
dealing with the music state variable.

(issue ASTERISK-23311)
Reported by: Benjamin Keith Ford

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

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

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

9 years agoapp_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH...
Richard Mudgett [Wed, 12 Mar 2014 18:47:10 +0000 (18:47 +0000)]
app_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH is playing.

When MOH is playing to a user in a conference and the user is kicked or
hangs up from the conference then the AMI MusicOnHoldStop events didn't
happen.  (Asterisk v11 AMI event: MusicOnHold, state:Stop)

(closes issue ASTERISK-23311)
Reported by: Benjamin Keith Ford

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

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

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

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

9 years agores_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using...
Joshua Colp [Wed, 12 Mar 2014 12:51:34 +0000 (12:51 +0000)]
res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using UDP.

This change fixes a bug where the code which changes the transport did not check whether
the message is going out over UDP or not before changing it. For TCP and TLS transports
we don't need to change the transport as the correct one is already chosen.
........

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

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

9 years agores_pjsip_multihomed: Add module which places the correct address within messages.
Joshua Colp [Tue, 11 Mar 2014 16:07:42 +0000 (16:07 +0000)]
res_pjsip_multihomed: Add module which places the correct address within messages.

Due to how messages are handled within PJSIP it is not until a message is actually
sent that the destination is reliably known. This means that the addresses placed
within the message may not be of the interface the message is being sent out on.

This module determines what interface a message is being sent on and updates the
message to contain the correct address if applicable.

This module was tested by myself in a virtualized environment with multiple interfaces
and also by Kinsey Moore in the following configuration:

Networks:
* 10.24.16.0/21
** hard phone
** default gateway
* 10.24.64.0/21
** softphone with pjsip-based stack

Transport details:
bind address: 0.0.0.0
protocol: UDP

All endpoints were tested with explicitly configured transports and unconfigured transports.

This was tested with inbound and outbound calls, both of which were experiencing detrimental
effects from incorrect IP addresses in SIP messages. These effects were only experienced by the
soft phone on the 10.24.64.0 network since the messages to the hard phone on the 10.24.16.0
network had the correct IP address.

(closes issue ASTERISK-23020)
Reported by: xrobau

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

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

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

9 years agoAST-2014-001: Stack overflow in HTTP processing of Cookie headers.
Richard Mudgett [Mon, 10 Mar 2014 17:21:01 +0000 (17:21 +0000)]
AST-2014-001: Stack overflow in HTTP processing of Cookie headers.

Sending a HTTP request that is handled by Asterisk with a large number of
Cookie headers could overflow the stack.

Another vulnerability along similar lines is any HTTP request with a
ridiculous number of headers in the request could exhaust system memory.

(closes issue ASTERISK-23340)
Reported by: Lucas Molas, researcher at Programa STIC, Fundacion; and Dr. Manuel Sadosky, Buenos Aires, Argentina
........

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

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

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

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

9 years agounqiueid: correct max uniqueid length test
Scott Griepentrog [Mon, 10 Mar 2014 16:33:10 +0000 (16:33 +0000)]
unqiueid: correct max uniqueid length test

This patch adds null string test prior to checking for
a max uniqueid value that was added in r410157.
........

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

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

9 years agoAST-2014-002: chan_sip: Exit early on bad session timers request
Kinsey Moore [Mon, 10 Mar 2014 13:30:51 +0000 (13:30 +0000)]
AST-2014-002: chan_sip: Exit early on bad session timers request

This change allows chan_sip to avoid creation of the channel and
consumption of associated file descriptors altogether if the inbound
request is going to be rejected anyway.

(closes issue ASTERISK-23373)
Reported by: Corey Farrell
Patches:
     chan_sip-earlier-st-1.8.patch uploaded by Corey Farrell (license 5909)
     chan_sip-earlier-st-11.patch uploaded by Corey Farrell (license 5909)
........

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

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

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

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

9 years agoAST-2014-003: res_pjsip: When handling 401/407 responses don't assume a request will...
Joshua Colp [Mon, 10 Mar 2014 12:53:00 +0000 (12:53 +0000)]
AST-2014-003: res_pjsip: When handling 401/407 responses don't assume a request will have an endpoint.

This change removes the assumption that an outgoing request will always
have an endpoint and makes the authenticate_qualify option work once again.

(closes issue ASTERISK-23210)
Reported by: Joshua Colp
........

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

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