asterisk/asterisk.git
9 years agoapp_agent_pool: Fix AMI/CLI AgentLogoff soft preventing agents from logging back in.
Richard Mudgett [Tue, 8 Oct 2013 21:20:19 +0000 (21:20 +0000)]
app_agent_pool: Fix AMI/CLI AgentLogoff soft preventing agents from logging back in.

* Clear the deferred_logoff flag when an agent logs in.

(closes issue ASTERISK-22669)
Reported by: John Bigelow
........

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

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

9 years agoSwitch from using pjsip_strerror to pj_strerror.
Mark Michelson [Tue, 8 Oct 2013 20:52:04 +0000 (20:52 +0000)]
Switch from using pjsip_strerror to pj_strerror.

pjsip_strerror is only aware of PJSIP-specific error
codes. pj_strerror() is aware of all PJProject error
codes and OS-specific error codes.

This specifically fixes an oft-seen error in transport
configuration code where EADDRINUSE would result in
"Unknown PJSIP error 120098" instead of a useful
message.
........

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

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

9 years agoapp_confbridge: Can now set the language used for announcements to the conference.
Richard Mudgett [Tue, 8 Oct 2013 20:18:37 +0000 (20:18 +0000)]
app_confbridge: Can now set the language used for announcements to the conference.

ConfBridge now has the ability to set the language of announcements to the
conference.  The language can be set on a bridge profile in
confbridge.conf or by the dialplan function
CONFBRIDGE(bridge,language)=en.

(closes issue ASTERISK-19983)
Reported by: Jonathan White
Patches:
      M19983_rev2.diff (license #5138) patch uploaded by junky (modified)
Tested by: rmudgett
........

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

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

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

9 years agoapp_confbridge: Fix duplicate default_user profile.
Richard Mudgett [Tue, 8 Oct 2013 19:18:05 +0000 (19:18 +0000)]
app_confbridge: Fix duplicate default_user profile.

* Fixed looking in the wrong profiles container to see if the default_user
profile is already created in verify_default_profiles().  The bridge
profile container is never going to hold user profiles. :)
........

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

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

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

9 years agoFix func_config list entry allocation
Kinsey Moore [Tue, 8 Oct 2013 18:19:59 +0000 (18:19 +0000)]
Fix func_config list entry allocation

The AST_CONFIG dialplan function defined in func_config.c allocates its
config file list entries using ast_malloc. List entry allocations
destined for use with Asterisk's linked list API must be ast_calloc()d
or otherwise initialized so that list pointers are set to NULL. These
uses of ast_malloc have been replaced by ast_calloc to prevent
dereferencing of uninitialized pointer values when traversing the list.

(closes issue ASTERISK-22483)
Reported by: Brian Scott
........

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

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

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

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

9 years agoFix STUN crash when using IPv6 any address
Kinsey Moore [Tue, 8 Oct 2013 15:46:16 +0000 (15:46 +0000)]
Fix STUN crash when using IPv6 any address

Ensure that when chan_sip binds to the IPv6 any address ([::]), IPv4
candidates are also added.

(closes issue ASTERISK-21917)
Reported by: Torrey Searle
Patches:
    0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License 5334)
........

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

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

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

9 years agoPush CLI qualify into the threadpool.
Mark Michelson [Tue, 8 Oct 2013 15:44:47 +0000 (15:44 +0000)]
Push CLI qualify into the threadpool.

If you run Asterisk in the background and then connect to
it through a separate console, the thread that runs CLI commands
is not registered with PJLIB. Thus PJLIB does not like it when
you attempt to send OPTIONS requests from that thread. So now
we push the task into the threadpool, which we know to be registered
with PJLIB.

Thanks to Antti Yrjola for reporting this.
........

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

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

9 years agoMake app_queue and res_agi independent of AMI being enabled.
Richard Mudgett [Tue, 8 Oct 2013 15:12:46 +0000 (15:12 +0000)]
Make app_queue and res_agi independent of AMI being enabled.

The https://reviewboard.asterisk.org/r/2888/ review changes manager to not
subscribe to stasis when it is disabled for performance reasons.  When
manager is disabled app_queue and res_agi decline to load and fail to
clean up what they have already allocated.

* Made app_queue and res_agi clean up allocated resources when they
decline to load.

* Made app_queue and res_agi use their own subscriptions to the stasis
topics instead of borrowing manager's message router structure
inappropriately.

(closes issue ASTERISK-22604)
Reported by: rmudgett

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

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

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

9 years agoMiscellaneous stand alone comment cleanups.
Richard Mudgett [Mon, 7 Oct 2013 15:43:22 +0000 (15:43 +0000)]
Miscellaneous stand alone comment cleanups.
........

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

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

9 years agoapp_queue: Fix Queuelog EXITWITHKEY only logging two of four fields
Michael L. Young [Sun, 6 Oct 2013 17:13:21 +0000 (17:13 +0000)]
app_queue: Fix Queuelog EXITWITHKEY only logging two of four fields

Commit r62462 added two extra fields for logging "the original position the
caller entered the queue at, and the amount of time the caller was waiting in
the queue."  But when r75969 was merged from 1.4 into trunk (r75977), these two
fields disappeared. Those two extra fields were not logged in 1.4 and when the
patch was merged, those fields went away.

Therefore, this is a regression and was caught by the reporter because he was
reading the awesome "Asterisk: The Definitive Guide" book.

(closes issue ASTERISK-22197)
Reported by: Dalius M.
Tested by: Dalius M.
Patches:
    asterisk-22197-q-log-exitwithkey.diff
     uploaded by Michael L. Young (license 5026)

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

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

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

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

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

9 years agochan_iax2: Fix compile error.
Richard Mudgett [Sat, 5 Oct 2013 00:59:17 +0000 (00:59 +0000)]
chan_iax2: Fix compile error.
........

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

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

9 years agoAdd IPv6 Support To chan_iax2
Michael L. Young [Fri, 4 Oct 2013 21:41:58 +0000 (21:41 +0000)]
Add IPv6 Support To chan_iax2

This patch adds IPv6 support to chan_iax2.  Yay!

(closes issue ASTERISK-22025)
Patches:
  iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026)

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

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

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

9 years agoAdded missing file from r400522
David M. Lee [Fri, 4 Oct 2013 19:32:29 +0000 (19:32 +0000)]
Added missing file from r400522
........

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

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

9 years agochan_pjsip: Make logger togglable without loading/unloading
Jonathan Rose [Fri, 4 Oct 2013 19:11:38 +0000 (19:11 +0000)]
chan_pjsip: Make logger togglable without loading/unloading

This patch makes the res_pjsip_logger do a few things... First, it
will be built and installed by default now, so end users won't need
to enable it in menuselect. Second, while it is loaded, it no longer
will immediately issue log messages. Upon loading, it is in the
disabled state and must be turned on with the new CLI command. The
CLI command 'pjsip set logger <on/off/host> has been added and can be
used to do the following:
pjsip set logger on:
    Enables logger for all PJSIP traffic
pjsip set logger off:
    Disables logger for all PJSIP traffic
pjsip set logger host <host>:
    Enables logger for the specific host

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

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

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

9 years agochan_pjsip: Add alembic scripts for generating db tables for PJSIP
Jonathan Rose [Fri, 4 Oct 2013 18:13:37 +0000 (18:13 +0000)]
chan_pjsip: Add alembic scripts for generating db tables for PJSIP

Also updates sample configurations for sorcery and extconfig to
demonstrate how to use databases created by that alembic script.

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

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

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

9 years agoARI: Add subscription support
Matthew Jordan [Fri, 4 Oct 2013 16:01:48 +0000 (16:01 +0000)]
ARI: Add subscription support

This patch adds an /applications API to ARI, allowing explicit management of
Stasis applications.

 * GET /applications - list current applications
 * GET /applications/{applicationName} - get details of a specific application
 * POST /applications/{applicationName}/subscription - explicitly subscribe to
   a channel, bridge or endpoint
 * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe
   from a channel, bridge or endpoint

Subscriptions work by a reference counting mechanism: if you subscript to an
event source X number of times, you must unsubscribe X number of times to stop
receiveing events for that event source.

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

(issue ASTERISK-22451)
Reported by: Matt Jordan
........

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

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

9 years agoEnclose the To URI and update its user portion if a request user has been specified.
Joshua Colp [Fri, 4 Oct 2013 15:49:39 +0000 (15:49 +0000)]
Enclose the To URI and update its user portion if a request user has been specified.
........

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

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

9 years agoReplace the connection address at the SDP level if altering the SDP with the external...
Joshua Colp [Fri, 4 Oct 2013 14:55:22 +0000 (14:55 +0000)]
Replace the connection address at the SDP level if altering the SDP with the external media address.
........

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

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

9 years agochan_sip: Don't ignore expires value in contact header if it lacks semicolon
Jonathan Rose [Thu, 3 Oct 2013 23:20:00 +0000 (23:20 +0000)]
chan_sip: Don't ignore expires value in contact header if it lacks semicolon

(closes issue ASTERISK-22574)
Reported by: Filip Jenicek
Patches:
    chan_sip_expires.patch uploaded by Filip Jenicek (license 6277)
........

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

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

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

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

9 years agoRemove publication of a channel snapshot when the technology is set
Matthew Jordan [Thu, 3 Oct 2013 21:46:07 +0000 (21:46 +0000)]
Remove publication of a channel snapshot when the technology is set

This patch removes said publication for a few reasons:
(1) It is unnecessary. Association of the channel technology with a specific
channel is an implementation detail that should be assumed to "just happen",
and consumers of Stasis don't need to be informed about it.
(2) Publication of said message can now cause crashes, as the actual creation
of a channel in normal locations now stages its messages. As a result, things
that create dummy channels (such as the SIP RTP QOS unit test) and associate
them with a channel technology were now crashing, as the channel itself was
not known by Stasis.
........

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

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

9 years agoFix assumption in bridge_native_rtp.c regarding number of participants in a bridge.
Mark Michelson [Thu, 3 Oct 2013 20:22:17 +0000 (20:22 +0000)]
Fix assumption in bridge_native_rtp.c regarding number of participants in a bridge.

When a party leaves a bridge, there may be more participants in the bridge than expected.
As such, it is important not to make assumptions regarding the list of channels in a
bridge.

This change makes it so that when a party leaves a native RTP bridge, we unbridge it and
the party it was bridged with. Previously, the first and last channels in the list were
unbridged since it was assumed that these were the two channels that had been bridged. As
previously stated, a new party had been inserted into the bridge, so this logic did not
work properly.

(closes issue ASTERISK-22615)
reported by Matt Jordan

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

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

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

9 years agoWhen serializing CDR variables (like for "core show channels") don't output an error...
Joshua Colp [Thu, 3 Oct 2013 19:32:46 +0000 (19:32 +0000)]
When serializing CDR variables (like for "core show channels") don't output an error if CDRs aren't enabled.
........

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

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

9 years agoFix security events for AMI invalid password
Kinsey Moore [Thu, 3 Oct 2013 19:30:33 +0000 (19:30 +0000)]
Fix security events for AMI invalid password

In r337595, additional security events were added for chan_sip
authentication failures. The new IEs added to the existing invalid
password event were defined as required IEs, but existing users of the
event did not set the new IEs and could not since they didn't apply to
existing uses. They are now marked as optional IEs.

(closes issue ASTERISK-22578)
Reported by: Matt Jordan
........

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

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

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

9 years agoFix a crash caused by muting and unmuting a channel in ARI without specifying a direc...
Joshua Colp [Thu, 3 Oct 2013 19:06:48 +0000 (19:06 +0000)]
Fix a crash caused by muting and unmuting a channel in ARI without specifying a direction.

(closes issue ASTERISK-22637)
Reported by: Scott Griepentrog

Patch by Matt Jordan, whose office I have taken over in the name of Canada.
........

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

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

9 years agocel: Some whitespace cleanups
Richard Mudgett [Thu, 3 Oct 2013 18:51:33 +0000 (18:51 +0000)]
cel: Some whitespace cleanups
........

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

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

9 years agores_rtp_multicast: Ensure SSRC is set properly
Kinsey Moore [Thu, 3 Oct 2013 18:32:59 +0000 (18:32 +0000)]
res_rtp_multicast: Ensure SSRC is set properly

This fixes a bug where the SSRC field on multicast RTP can be stuck at
0 which can cause problems for endpoints trying to make sense of
incoming streams.

(closes issue ASTERISK-22567)
Reported by: Simone Camporeale
Patches:
    22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale (License 6536)
........

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

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

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

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

9 years agoDetect and use xsltCleanupGlobals when available
Kinsey Moore [Thu, 3 Oct 2013 18:00:15 +0000 (18:00 +0000)]
Detect and use xsltCleanupGlobals when available

This introduces usage of an additional libxslt cleanup function,
xsltCleanupGlobals, when the configure script detects that it is
available. Early versions of the library did not include this function.

(closes issue ASTERISK-22570)
Reported by: Corey Farrell
Patches:
    xsltCleanupGlobals.patch uploaded by Corey Farrell (License 5909)
........

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

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

9 years agochan_vpb: Make compile again.
Richard Mudgett [Thu, 3 Oct 2013 16:28:35 +0000 (16:28 +0000)]
chan_vpb: Make compile again.
........

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

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

9 years agoGet rid of uses of stasis_topic_wait()
Mark Michelson [Thu, 3 Oct 2013 14:59:29 +0000 (14:59 +0000)]
Get rid of uses of stasis_topic_wait()
........

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

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

9 years agoCache string values of formats on ast_format_cap() to save processing.
Mark Michelson [Thu, 3 Oct 2013 14:58:16 +0000 (14:58 +0000)]
Cache string values of formats on ast_format_cap() to save processing.

Channel snapshots have string representations of the channel's native formats.
Prior to this change, the format strings were re-created on ever channel snapshot
creation. Since channel native formats rarely change, this was very wasteful.
Now, string representations of formats may optionally be stored on the ast_format_cap
for cases where string representations may be requested frequently. When formats
are altered, the string cache is marked as invalid. When strings are requested, the
cache validity is checked. If the cache is valid, then the cached strings are copied.
If the cache is invalid, then the string cache is rebuilt and copied, and the cache
is marked as being valid again.

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

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

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

9 years agoFix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and...
Joshua Colp [Thu, 3 Oct 2013 14:52:24 +0000 (14:52 +0000)]
Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set.

The callback function for changing the media address in streams wrongly assumes that a connection line
will always be present. This is false as no line is present if a stream has been rejected.

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

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

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

9 years agoMultiple revisions 400318-400319
Mark Michelson [Wed, 2 Oct 2013 22:22:17 +0000 (22:22 +0000)]
Multiple revisions 400318-400319

........
  r400318 | mmichelson | 2013-10-02 17:08:49 -0500 (Wed, 02 Oct 2013) | 12 lines

  Remove unnecessary waits from stasis.

  Since caches are updated on publisher threads, there is no need
  to wait for the cache updates to occur after a stasis message
  is published.

  In the case of chan_pjsip device state changes, this set of
  changes caused an improvement to performance.

  Review: https://reviewboard.asterisk.org/r/2890
........
  r400319 | mmichelson | 2013-10-02 17:10:54 -0500 (Wed, 02 Oct 2013) | 3 lines

  Remove svn:mergeinfo property.
........

Merged revisions 400318-400319 from http://svn.asterisk.org/svn/asterisk/branches/12

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

9 years agoCast Integer Argument To Unsigned Char
Michael L. Young [Wed, 2 Oct 2013 21:33:42 +0000 (21:33 +0000)]
Cast Integer Argument To Unsigned Char

The member reg in the peercnt structure is an unsigned char and peercnt_modify()
is expecting an unsigned char argument which gets assigned to peercnt->reg.

This patch fixes that by casting the integer argument being passed to
peercnt_modify to unsigned char.
........

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

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

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

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

9 years agoOnly create Stasis subscriptions when enabled
Matthew Jordan [Wed, 2 Oct 2013 21:26:34 +0000 (21:26 +0000)]
Only create Stasis subscriptions when enabled

Subscribing to Stasis isn't free.

As such, this patch makes AMI, CDR, and CEL - the "big 3" - only subscribe
when enabled. Toggling their availability via a .conf file will
unsubscribe/subscribe as appropriate.

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

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

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

9 years agoOriginate: Make setting caller id on outgoing call use either name or number.
Richard Mudgett [Wed, 2 Oct 2013 20:31:02 +0000 (20:31 +0000)]
Originate: Make setting caller id on outgoing call use either name or number.

Previous code was requiring both name and number to be available.

Also restored a comment block on why caller id is also set on an outgoing
call leg in addition to connected line from earlier versions of Asterisk.
........

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

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

9 years agoCorrect allowable values for ARI general information filter
Kinsey Moore [Wed, 2 Oct 2013 19:20:27 +0000 (19:20 +0000)]
Correct allowable values for ARI general information filter
........

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

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

9 years agoFix the CDR CLI command 'cdr show active {channel}'
Matthew Jordan [Wed, 2 Oct 2013 19:17:15 +0000 (19:17 +0000)]
Fix the CDR CLI command 'cdr show active {channel}'

When the switch from channel names to channel unique IDs happened, the poor
CLI command got left in the dust. This fixes the command so that users can
once again see how Asterisk is messing up your billing information.
........

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

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

9 years agoFix a crash in res_pjsip_t38 caused by the wrong assumption that a session will alway...
Joshua Colp [Wed, 2 Oct 2013 18:44:48 +0000 (18:44 +0000)]
Fix a crash in res_pjsip_t38 caused by the wrong assumption that a session will always have a channel.

When starting up or shutting down this assumption is false.
........

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

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

9 years agoman pages for astdb2bdb and astdb2sqlite3
Tzafrir Cohen [Wed, 2 Oct 2013 18:28:03 +0000 (18:28 +0000)]
man pages for astdb2bdb and astdb2sqlite3

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

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

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

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

9 years agoMALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.
Richard Mudgett [Wed, 2 Oct 2013 17:12:49 +0000 (17:12 +0000)]
MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.

* There were several places in ARI where an external library was mallocing
memory that must always be released with free().  When MALLOC_DEBUG is
enabled, free() is redirected to the MALLOC_DEBUG version.  Since the
external library call still uses the normal malloc(), MALLOC_DEBUG
complains that the freed memory block is not registered and will not free
it.  These cases must use ast_std_free().

* Changed calls to asprintf() and vasprintf() to the equivalent
ast_asprintf() and ast_vasprintf() versions respectively.
........

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

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

9 years agosig_ss7: Fix compiler warnings.
Richard Mudgett [Wed, 2 Oct 2013 17:10:39 +0000 (17:10 +0000)]
sig_ss7: Fix compiler warnings.
........

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

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

9 years agoReduce channel snapshot creation and publishing by up to 50%.
Joshua Colp [Wed, 2 Oct 2013 16:23:34 +0000 (16:23 +0000)]
Reduce channel snapshot creation and publishing by up to 50%.

This change introduces the ability to stage channel snapshot
creation and publishing by suppressing the implicit creation
and publishing that some functions have. Once all operations
are executed the staging is marked as done and a single snapshot
is created and published.

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

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

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

9 years agoFix a random one way audio issue in PJSIP.
Joshua Colp [Wed, 2 Oct 2013 15:33:56 +0000 (15:33 +0000)]
Fix a random one way audio issue in PJSIP.

Due to the asynchronous design of the PJMEDIA SDP negotiator it was possible for
the SDP to be negotiated *after* a channel was created and after it was being wait
on by an application. It is only after negotiation occurs that the file descriptors
for RTP are placed on the channel. Since the channel was already being waited on
these file descriptors were not monitored, causing incoming media to never be read.

This change wakes up any application waiting on the channel so that added file
descriptors end up being monitored.

(closes issue AST-1227)
Reported by: John Bigelow
........

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

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

9 years agoAllow specifying a channel to dial an extension and context in an ARI dial operation.
Joshua Colp [Wed, 2 Oct 2013 15:24:16 +0000 (15:24 +0000)]
Allow specifying a channel to dial an extension and context in an ARI dial operation.

(issue ASTERISK-22625)
Reported by: Scott Griepentrog
........

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

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

9 years agoRetrieve and store the hostname only once so multiple threads do not potentially...
Joshua Colp [Wed, 2 Oct 2013 14:13:55 +0000 (14:13 +0000)]
Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time.
........

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

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

9 years agochan_dahdi: Fix analog parking using flash-hook.
Richard Mudgett [Tue, 1 Oct 2013 21:19:13 +0000 (21:19 +0000)]
chan_dahdi: Fix analog parking using flash-hook.

Transferring an analog call using a flash-hook to parking would fail to
park the call and result in an invalid ao2 object unref.

* Park the correct bridged channel.
........

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

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

9 years agoFeatures: Rearm the parking config options have moved warning for each reload.
Richard Mudgett [Tue, 1 Oct 2013 16:44:22 +0000 (16:44 +0000)]
Features: Rearm the parking config options have moved warning for each reload.
........

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

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

9 years agoFilter out internal channels for bridge leave messages and parked call messages
Matthew Jordan [Tue, 1 Oct 2013 15:54:05 +0000 (15:54 +0000)]
Filter out internal channels for bridge leave messages and parked call messages

Granted, if you manage to park a Conference announcer channel, something has
gone horrifically wrong.
........

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

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

9 years agoconfiguration samples: Pull all parking related stuff out of features.conf
Jonathan Rose [Mon, 30 Sep 2013 21:40:36 +0000 (21:40 +0000)]
configuration samples: Pull all parking related stuff out of features.conf

This patch also adds documentation for parking from features.conf to
res_parking.conf
........

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

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

9 years agoParse arguments passed to the CDR_PROP function correctly
Matthew Jordan [Mon, 30 Sep 2013 19:58:19 +0000 (19:58 +0000)]
Parse arguments passed to the CDR_PROP function correctly

I can only blame this on a bad merge, because this in no way worked properly
the way it was written. Mea culpa. The function should now parse its arguments
correctly and function properly. (Note that the API used by the CDR_PROP
function has working unit tests... this was merely bad coding of the actual
registered function)

(closes issue ASTERISK-22613)
Reported by: Private Name
........

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

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

9 years agoRemove spurious event raised when CDRs are reloaded
Matthew Jordan [Mon, 30 Sep 2013 19:53:50 +0000 (19:53 +0000)]
Remove spurious event raised when CDRs are reloaded

The Reload event is now raised by the module loading core. As such, the Reload
event in the CDR engine was a duplicate and not needed.
........

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

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

9 years agoMultiple revisions 399887,400138,400178,400180-400181
David M. Lee [Mon, 30 Sep 2013 18:55:27 +0000 (18:55 +0000)]
Multiple revisions 399887,400138,400178,400180-400181

........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line

  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines

  Stasis performance improvements

  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.

  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().

  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.

  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.

  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.

  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines

  Taskprocessor optimization; switch Stasis to use taskprocessors

  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.

  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.

  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.

  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).

  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.

  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines

  Optimize how Stasis forwards are dispatched

  This patch optimizes how forwards are dispatched in Stasis.

  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.

  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.

  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).

  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)

  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.

  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines

  Remove dispatch object allocation from Stasis publishing

  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.

  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.

  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.

  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.

  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.

  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.

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

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12

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

9 years agoBlocked revisions 399306
David M. Lee [Mon, 30 Sep 2013 18:52:44 +0000 (18:52 +0000)]
Blocked revisions 399306

........
Blocked revisions 399305

........
Fix Segfault When Syntax Of A Line Under [applicationmap] Is Invalid

When processing the lines under the [applicationmap] context in features.conf, a
segfault occurs from attempting to process a line with an invalid syntax
(basically missing most of the arguments).

Example:
[applicationmap]
automon=*6

* This patch moves the checking for empty arguments to before they are accessed.

* Also, checked the "todo" comment and removed it.  Some applications do not
  require arguments.

(closes issue ASTERISK-22416)
Reported by: CGI.NET
Tested by: CGI.NET
Patches:
    asterisk-22416-check-syntax-first_v2.diff by Michael L. Young (license 5026)

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

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

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

9 years agochan_sip: Allow Asterisk to retry after 403 on register
Kinsey Moore [Mon, 30 Sep 2013 15:57:11 +0000 (15:57 +0000)]
chan_sip: Allow Asterisk to retry after 403 on register

This adds a global option in chan_sip to allow it to continue
attempting registration if a 403 is received, clearing the cached nonce
and treating it as a non-fatal response. Normally, this would cause
registration attempts to that endpoint to stop.

This also adds a similar per-outbound-registration option to chan_pjsip
which allows the retry interval to be altered for 403 responses to
REGISTER requests.

(closes issue ASTERISK-17138)
Review: https://reviewboard.asterisk.org/r/2874/
Reported by: Rudi
........

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

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

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

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

9 years agores_pjsip_notify: Add documentation
Matthew Jordan [Sat, 28 Sep 2013 22:57:17 +0000 (22:57 +0000)]
res_pjsip_notify: Add documentation

We forgot to add documentation for res_pjsip_notify, which would prevent it
from being loaded. Whoops.

This patch also updates res_pjsip_notify to use pjsip_notify.conf, which now
has its own sample file in the configs directory as well.

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

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

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

9 years agores_rtp_asterisk: Correct erroneous lost packet information in RTCP reports
Matthew Jordan [Sat, 28 Sep 2013 22:32:18 +0000 (22:32 +0000)]
res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports

RTCP's calculation of the number of lost packets in an RTP stream is based on
that stream's sequence number count, the number of received packets, and how
many packets we expect to receive. When the SSRC for an RTP stream changes,
there can - and almost always will be - a large jump in the next packet's
timestamp and sequence number. If we don't reset the number of received
packets, sequence number count, and other metrics used by RTCP, the next RR/SR
report will use the previous SSRC's values to calculate the lost packet count
for the new SSRC - resulting in a very large number of lost packets.

This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it
will reset the various values used by the RTCP calculations. From the
perspective of RTCP, this appears as a new media stream - which is what it is.

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

(closes issue AST-1174)
Reported by: Thomas Arimont
........

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

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

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

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

9 years agoAdd check for openSUSE when detecting bfd library
Matthew Jordan [Sat, 28 Sep 2013 22:13:57 +0000 (22:13 +0000)]
Add check for openSUSE when detecting bfd library

In ASTERISK-17842, some additional library checks were added to the configure
script so that the bfd library could be found on CentOS and Fedora systems.

As it turns out, openSUSE requires an additional library. This patch adds
another check to the configure script for openSUSE that will add that library.

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

(closes issue AST-1169)
Reported by: Guenther Kelleter
........

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

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

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

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

9 years agoCDR: Improve handling of parking; resolve assertion when originating into park
Matthew Jordan [Sat, 28 Sep 2013 20:55:48 +0000 (20:55 +0000)]
CDR: Improve handling of parking; resolve assertion when originating into park

This patch covers two problems:

1) Currently, when a call is transferred into a parking lot from a bridge
   (using either the blind transfer or one touch parking mechanisms), the
   application fails to be set to "Park" in the resulting CDR record for
   the parked channel. This is due to the ParkedCall message arriving before
   the BridgeEnter for the channel entering the parking bridge. The ParkedCall
   message isn't handled as the CDR for the channel has already been finalized
   (due to the channel having left its two party bridge), and the BridgeEnter -
   which creates the new CDR - doesn't have the parking information. This patch
   modifies the behavior so that reception of a ParkedCall message will - if
   not handled by a CDR chain - cause a new CDR to be created and put into the
   Parking state.

2) It fixes a FRACK that occurred when a channel is originated into a parking
   space. The DialedPending state - which occurs for both Dialed and Originated
   channels - assumed that it couldn't handle the parking transitions due to it
   having a Party B; however, Originated channels don't have a Party B. As such,
   the existing CDR needs to transition into the parking state - this patch does
   that.

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

(closes issue ASTERISK-22482)
Reported by: Richard Mudgett
........

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

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

9 years agoapp_queue: Make manager events tolerant of Local channel shenanigans
Matthew Jordan [Sat, 28 Sep 2013 20:39:10 +0000 (20:39 +0000)]
app_queue: Make manager events tolerant of Local channel shenanigans

app_queue currently attempts to handle Local channel optimizations in an effort
to provide accurate information in Stasis messages (and their corresponding
AMI events) as well as the Queue log. Sometimes, however, things don't go as
planned.

Consider the following scenario:
 SIP/foo <-> L;1 <-> L;2 <-> SIP/agent

SIP/agent answers, triggering a Local channel optimization. app_queue will
normally do the following:
 * Listen for the Local optimization events and update our agent accordingly
   to SIP/agent in the queue log and messages
 * When we get a hangup, publish the AgentComplete event based on our
   information (SIP/foo and SIP/agent)

However, as with all things that depend on sanity from something as capricious
as Local channels, things can go wrong:
 (1) SIP/agent immediately hangs up upon answering. This triggers a race
     condition between termination messages coming from SIP/agent and the
     ongoing Local channel optimization messages. (Note that this can also
     occur with SIP/foo)
 (2) In a race condition, Asterisk can (rarely) deliver the hangup messages
     prior to the Local channel optimization.

In that case, the messages *may* arrive to app_queue in the following order:
 * Hangup SIP/Agent
 * Hangup SIP/foo
 * Optimize L;1/L;2
 * Hangup L;2
 * Hangup L;1

When app_queue receives the hangup of the agent or the caller, it will attempt
to publish the AgentComplete event. However, it now has a problem - it thinks
its agent is the ;1 side of the Local channel, as it never received the
optimization event. At the same time, that channel is already gone. This
results in getting NULL from the Stasis cache. What's more, we can't really
wait for the optimization message, as we are currently handling the hangup
of the channel that the optimization event would tell us to use.

This patch modifies the behavior in app_queue such that, since we still have a
lot of pertinent queue information (interface, queue name, etc.), we now raise
the event with what information we know. The channels involved now may or may
not be present. Users will still at least get the "AgentComplete" event, which
"completes" the known Agent information.

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

(closes issue ASTERISK-22507)
Reported by: Richard Mudgett
........

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

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

9 years agomanager: Fix crash when appending a manager channel variable
Matthew Jordan [Sat, 28 Sep 2013 20:27:23 +0000 (20:27 +0000)]
manager: Fix crash when appending a manager channel variable

In r399887, a minor performance improvement was introduced by not allocating
the manager variable struct if it wasn't used. Unfortunately, when directly
accessing an ast_channel struct, manager assumed that the struct was always
allocated. Since this was no longer the case, things got a bit crashy.

This fixes that problem by simply bypassing appending variables if the manager
channel variable struct isn't there.
........

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

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

9 years agoapp_cdr and res_parking: Fix some resource leaks.
Richard Mudgett [Fri, 27 Sep 2013 21:58:05 +0000 (21:58 +0000)]
app_cdr and res_parking: Fix some resource leaks.

* app_cdr left the ResetCDR application registered.

* res_parking leaked a ref to config global.

(closes issue ASTERISK-22566)
Reported by: Corey Farrell
Patches:
      ASTERISK-22566-r2.patch (license #5909) patch uploaded by Corey Farrell
........

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

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

9 years agochan_sip: Increase some scratch buffer sizes dealing with caller id.
Richard Mudgett [Fri, 27 Sep 2013 21:44:42 +0000 (21:44 +0000)]
chan_sip: Increase some scratch buffer sizes dealing with caller id.

* Eliminated an unnecessary initialization in check_user_full().

(closes issue ASTERISK-22477)
Reported by: Michael Shepelev
........

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

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

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

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

9 years agoRemove some trailing whitespace and steal revision 400000.
Sean Bright [Fri, 27 Sep 2013 19:18:55 +0000 (19:18 +0000)]
Remove some trailing whitespace and steal revision 400000.

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

9 years agores_pjsip: crash when using localnet and external_signaling_address options
Kevin Harwell [Fri, 27 Sep 2013 18:28:41 +0000 (18:28 +0000)]
res_pjsip: crash when using localnet and external_signaling_address options

There was a collision of mod_data use on the transaction between using a nat
hook and an session response callback.  During state change it was assumed
what was in the mod_data was nothing or the response callback.  However, it
was possible for it to also contain a nat hook thus resulting in a bad cast
and a crash.

Added the ability to store multiple data elements in mod_data via a hash table.
In this instance, mod_data now stores a hash table of the two values that can
be retrieved using an associated string key.

(closes issue ASTERISK-22394)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2843/
........

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

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

9 years agochan_sip: Reject calls on 200 OKs if no SDP has been received
Jonathan Rose [Fri, 27 Sep 2013 17:46:16 +0000 (17:46 +0000)]
chan_sip: Reject calls on 200 OKs if no SDP has been received

When Asterisk receives a 200 OK in response to an invite, that peer should have
sent an SDP at some point by then. If the channel has never received an SDP,
media won't have been set and the remote address won't be known. Endpoints in
general should not be doing this. This patch makes it so that Asterisk will
simply hang up a call if it sends a 200 OK at this point. So far this odd
behavior for endpoints has only been observed in tests which involved manually
created SIP transactions in SIPp.

(closes issue ASTERISK-22424)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2827/
........

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

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

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

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

9 years agoastobj2: Remove OBJ_CONTINUE support.
Richard Mudgett [Fri, 27 Sep 2013 17:11:22 +0000 (17:11 +0000)]
astobj2: Remove OBJ_CONTINUE support.

OBJ_CONTINUE was a strange feature that came into the world under
suspicious circumstances to support an abuse of the ao2_container by
chan_iax2.  Since chan_iax2 no longer uses OBJ_CONTINUE, it is safe to
remove it.

The simplified code should help performance slightly and make
understanding the code easier.

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

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

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

9 years agoFix refleaks of ast_rtp_instance structures.
Mark Michelson [Fri, 27 Sep 2013 14:35:12 +0000 (14:35 +0000)]
Fix refleaks of ast_rtp_instance structures.

These refleaks were causing bridged calls not to close their RTP ports. Thus
a call would leave open 4 ports (RTP for party A, RTCP for party A, RTP for party
B, and RTCP for party B). This led to an eventual depletion of available RTP
ports.
........

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

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

9 years agoRestore usefulness of the CEL Peer field
Kinsey Moore [Fri, 27 Sep 2013 14:08:23 +0000 (14:08 +0000)]
Restore usefulness of the CEL Peer field

This change makes the CEL peer field useful again for BRIDGE_ENTER and
BRIDGE_EXIT events and fills the field with a comma-separated list of
all channels in the bridge other than the channel that is entering or
exiting the bridge.

Review: https://reviewboard.asterisk.org/r/2840/
(closes issue ASTERISK-22393)
........

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

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

9 years agopjsip: race condition in registrar
Kevin Harwell [Thu, 26 Sep 2013 18:51:54 +0000 (18:51 +0000)]
pjsip: race condition in registrar

While handling a registration request a race condition could occur if/when two+
clients registered at the same time.  This happened when one request obtained a
copy of the current contacts for an AOR and another request did the same before
the first request updated.  Thus the second would update and overwrite the first
(or vice-versa depending on which actually updated first).  In the case of it
being the same contact two "add" events would be raised.

pjsip registration handling is now serialized to alleviate this issue.

(closes issue AST-1213)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2860/
........

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

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

9 years agoAdding a few words to the Dial option 'r' help text to clarify its tone argument...
Rusty Newton [Thu, 26 Sep 2013 14:13:37 +0000 (14:13 +0000)]
Adding a few words to the Dial option 'r' help text to clarify its tone argument description
........

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

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

9 years agochan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.
Richard Mudgett [Wed, 25 Sep 2013 20:38:24 +0000 (20:38 +0000)]
chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.

The PRI and SS7 link control threads are not stopped correctly when the
chan_dahdi.so module is unloaded.  The link control threads pri_dchannel()
and ss7_linkset() are not awakened from a poll() to cancel the thread.

* Added a SIGURG signal after requesting the thread cancel to break the
link control thread poll() immediately.

For SS7 it was slightly worse, the link poll() timeout would always be
whatever was the last libss7 scheduled event time used.  If no libss7
scheduled event was pending, the thread could run more often than
necessary.

* Set nextms to 60 seconds for the ss7_linkset() poll() if there is no
other libss7 scheduled event.
........

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

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

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

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

9 years agoBroke the build - Fixing XML DTD violation added in r399782, missing <para> tags...
Rusty Newton [Wed, 25 Sep 2013 19:43:43 +0000 (19:43 +0000)]
Broke the build - Fixing XML DTD violation added in r399782, missing <para> tags inside a <note>
........

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

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

9 years agochan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header...
Michael L. Young [Wed, 25 Sep 2013 19:29:38 +0000 (19:29 +0000)]
chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok

1st Issue
When a realtime peer sends an un-REGISTER request, Asterisk
un-registers the peer but the database table record still has regseconds and
fullcontact for the peer.  This results in calls attempting to be routed to the
peer which is no longer registered.  The expected behavior is to get
busy/congested when attempting to call an un-registered peer through the
dialplan.

What was discovered is that we are clearing out the peer's registration in the
database in parse_register_contact() when calling expire_register() but then
upon returning from parse_register_contact(), update_peer() is run which stores
back in the database table regseconds and fullcontact.

2nd Issue
The reporter pointed out that the 200 ok being returned by Asterisk
after un-registering a peer contains a Contact header with ;expires= and the
Expires header is not set to 0.  This is actually a regression.

Tests were created for this second issue (ASTERISK-22548).  The tests have been
reviewed and a Ship It! was received on those tests.

This patch does the following:

* Do not ignore the Expires header value even when it is set to 0.  The patch
  sets the pvt->expiry earlier on in the function so that it is set properly and
  used.

* If pvt->expiry is 0, do not call update_peer since that means the peer has
  already been un-registered and there is no need to update the database record
  again since nothing has changed.

(closes issue ASTERISK-22428)
Reported by: Ben Smithurst
Tested by: Ben Smithurst, Michael L. Young
Patches:
  asterisk-22428-rt-peer-update-and-expires-header.diff
                                              by Michael L. Young (license 5026)

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

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

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

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

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

9 years agoFixing documentation for the configOption "external_media_address" of both Endpoints...
Rusty Newton [Wed, 25 Sep 2013 18:38:34 +0000 (18:38 +0000)]
Fixing documentation for the configOption "external_media_address" of both Endpoints and Transports

Re-using some of Mark Michelson's text from an E-mail discussion for:

* Modifying synopsis for both options
* Adding description to both options
* Changing name of "external_media_address" for Endpoint configuration to "media_address" in anticipation of the option name being changed. (As it is not really specific to external destinations)

(issue ASTERISK-22405)
(closes issue ASTERISK-22405)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2850/
........

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

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

9 years agoastobj2: Made use OBJ_SEARCH_xxx identifiers as field enum values internally.
Richard Mudgett [Tue, 24 Sep 2013 22:55:06 +0000 (22:55 +0000)]
astobj2: Made use OBJ_SEARCH_xxx identifiers as field enum values internally.

* Made ao2_unlink to protect itself from stray OBJ_SEARCH_xxx values
passed in.
........

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

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

9 years agochan_iax2: Prevent some needless breaking of the native IAX2 bridge.
Richard Mudgett [Tue, 24 Sep 2013 20:37:32 +0000 (20:37 +0000)]
chan_iax2: Prevent some needless breaking of the native IAX2 bridge.

* Clean up some twisted code in the iax2_bridge() loop.

* Add AST_CONTROL_VIDUPDATE and AST_CONTROL_SRCCHANGE to a list of frames
to prevent the native bridge loop from breaking.

* Passing the AST_CONTROL_T38_PARAMETERS frame should also allow FAX over
a native IAX2 bridge.

(issue ABE-2912)

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

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

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

For v12 and above this is really just documentation until IAX2 native
bridging is restored.
........

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

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

9 years agoapp_queue: Don't be quite so aggressive in initializing the array
Matthew Jordan [Tue, 24 Sep 2013 19:22:30 +0000 (19:22 +0000)]
app_queue: Don't be quite so aggressive in initializing the array

We only need the first character.
........

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

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

9 years agoapp_queue: Initialize array holding MixMonitor exec options
Matthew Jordan [Tue, 24 Sep 2013 18:59:05 +0000 (18:59 +0000)]
app_queue: Initialize array holding MixMonitor exec options

If the channel variable MONITOR_EXEC is set, app_queue will pass the specified
execution parameters to the MixMonitor application when a queue is recorded.
If that channel variable is not set, the buffer that holds the escaped value
was not being initialized to NULL, and so would be passed to the MixMonitor
application with garbage. Hilarity ensued as app_mixmonitor attempted to
execute gobeldy-gook.
........

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

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

9 years agoFix a performance problem CDRs
Matthew Jordan [Tue, 24 Sep 2013 18:10:20 +0000 (18:10 +0000)]
Fix a performance problem CDRs

There is a large performance price currently in the CDR engine. We currently
perform two ao2_callback calls on a container that has an entry for every
channel in the system. This is done to create matching pairs between channels
in a bridge.

As such, the portion of the CDR logic that this patch deals with is how we
make pairings when a channel enters a mixing bridge. In general, when a
channel enters such a bridge, we need to do two things:
 (1) Figure out if anyone in the bridge can be this channel's Party B.
 (2) Make pairings with every other channel in the bridge that is not already
     our Party B.

This is a two step process. In the first step, we look through everyone in the
bridge and see if they can be our Party B (single_state_process_bridge_enter).
If they can - yay! We mark our CDR as having gotten a Party B. If not, we keep
searching. If we don't find one, we wait until someone joins who can be our
Party B.

Step 2 is where we changed the logic
(handle_bridge_pairings and bridge_candidate_process). Previously, we would
first find candidates - those channels in the bridge with us - from the
active_cdrs_by_channel container. Because a channel could be a candidate if it
was Party B to an item in the container, the code implemented multiple
ao2_container callbacks to get all the candidates. We also had to store them
in another container with some other meta information. This was rather complex
and costly, particularly if you have 300 Local channels (600 channels!) going
at once.

Luckily, none of it is needed: when a channel enters a bridge (which is when
we're figuring all this stuff out), the bridge snapshot tells us the unique
IDs of everyone already in the bridge. All we need to do is:
 For all channels in the bridge:
   If the channel is us or our Party B that we got in step 1, skip it
   Compare us and the candidate to figure out who is Party A (based on some
       specific rules)
   If we are Party A:
      Make a new CDR for us, append it to our chain, and set the candidate as
          Party B
   If they are Party A:
      If they don't have a Party B:
        Make a new CDR for them, append us to their chain, and us as Party B
      Otherwise:
        Copy us over as Party B on their existing CDR.

This patch does that.

Because we now use channel unique IDs to find the candidates during bridging,
active_cdrs_by_channel now looks up things using uniqueid instead of channel
name. This makes the more complex code simpler; it does, however, have the
drawback that dialplan applications and functions will be slightly slower as
they have to iterate through the container looking for the CDR by name.
That's a small price to pay however as the bridging code will be called a lot
more often.

This patch also does two other minor changes:
 (1) It reduces the container size of the channels in a bridge snapshot to 1.
     In order to be predictable for multi-party bridges, the order of the
     channels in the container must be stable; that is, it must always devolve
     to a linked list.
 (2) CDRs and the multi-party test was updated to show the relationship between
     two dialed channels. You still want to know if they talked - previously,
     dialed channels were always ignored, which is wrong when they have
     managed to get a Party B.

(closes issue ASTERISK-22488)
Reported by: Richard Mudgett

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

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

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

9 years agoFix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip...
Joshua Colp [Mon, 23 Sep 2013 12:03:18 +0000 (12:03 +0000)]
Fix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip and res_pjsip_session.

During load time in res_pjsip if an error occurred the operation would attempt to rollback all
operations done during load. This is not permitted by PJSIP as it will assert if the operation has
not been done. This fix changes the code so it will only rollback what has been initialized already.

Further changes also prevent res_pjsip and res_pjsip_session from being unloaded. This is due to
limitations within PJSIP itself. The library environment can only be changed to a certain extent
and does not provide the ability, currently, to deinitialize certain required functionality.

(closes issue ASTERISK-22474)
Reported by: Corey Farrell
........

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

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

9 years agores_rtp_asterisk: Fix ref leaks in ast_rtcp_read().
Richard Mudgett [Sat, 21 Sep 2013 04:49:26 +0000 (04:49 +0000)]
res_rtp_asterisk: Fix ref leaks in ast_rtcp_read().

Moved rtcp_report RAII_VAR declaration into the loop so it is unref'ed
after every loop.  Moved message_blob to loop and switched it to a regular
variable.  The regular variable was used since message_blob is used in a
very contained way.

(closes issue ASTERISK-22565)
Reported by: Corey Farrell
Patches:
      rtcp_report-leak.patch (license #5909) patch uploaded by Corey Farrell
Tested by: Corey Farrell
........

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

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

9 years agomedia_index: Fix process_description_file() memory leak of file_id_persist.
Richard Mudgett [Sat, 21 Sep 2013 01:46:56 +0000 (01:46 +0000)]
media_index: Fix process_description_file() memory leak of file_id_persist.
........

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

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

9 years agofeatures_config: Fix config ref leak of parkinglots.
Richard Mudgett [Sat, 21 Sep 2013 00:56:52 +0000 (00:56 +0000)]
features_config: Fix config ref leak of parkinglots.

This leak happend for just about every channel created.
........

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

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

9 years agoapp_queue: Fix json blob ref leak.
Richard Mudgett [Sat, 21 Sep 2013 00:23:45 +0000 (00:23 +0000)]
app_queue: Fix json blob ref leak.

The json ref from queue_member_blob_create() was never released.
........

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

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

9 years agojson: Make it obvious that ast_json_unref() is NULL safe.
Richard Mudgett [Sat, 21 Sep 2013 00:17:56 +0000 (00:17 +0000)]
json: Make it obvious that ast_json_unref() is NULL safe.

It looked like the safety check was done after the NULL pointer was used.
........

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

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

9 years agoEnsure global types in the config framework are initialized
Kinsey Moore [Fri, 20 Sep 2013 22:44:11 +0000 (22:44 +0000)]
Ensure global types in the config framework are initialized

If a config object was allocated but one of its global objects was
never encountered, then the global object's defaults were never
applied. Ensure that global objects are initialized properly upon
allocation instead of on configuration.

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

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

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

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

9 years agooriginate/call forwarding: Fix a crash when forwarding a call from originate
Jonathan Rose [Fri, 20 Sep 2013 22:06:07 +0000 (22:06 +0000)]
originate/call forwarding: Fix a crash when forwarding a call from originate

(closes issue ASTERISK-22487)
Reported by: David M. Lee
Review: https://reviewboard.asterisk.org/r/2868/
........

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

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

9 years agoAdd a missing session supplement unregistration in chan_pjsip for ACKs.
Joshua Colp [Fri, 20 Sep 2013 16:18:42 +0000 (16:18 +0000)]
Add a missing session supplement unregistration in chan_pjsip for ACKs.

(closes issue ASTERISK-22453)
Reported by: Corey Farrell
Patches:
chan_pjsip_session_unregister_supplement.patch uploaded by Corey Farrell (license 5909)
........

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

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

9 years agoFix memory leak in logger.
Kevin Harwell [Fri, 20 Sep 2013 14:26:44 +0000 (14:26 +0000)]
Fix memory leak in logger.

Fixed a memory leak discovered in the logger where a temporary string buffer
was not being freed.

(closes issue ASTERISK-22540)
Reported by: John Hardin
........

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

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

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

9 years agooptional_api: Make always use the standard malloc functions even with MALLOC_DEBUG.
Richard Mudgett [Thu, 19 Sep 2013 23:20:43 +0000 (23:20 +0000)]
optional_api: Make always use the standard malloc functions even with MALLOC_DEBUG.
........

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

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

9 years agochan_sip: Make direct media reinvites for T38 put Asterisk in the media path
Jonathan Rose [Thu, 19 Sep 2013 17:01:09 +0000 (17:01 +0000)]
chan_sip: Make direct media reinvites for T38 put Asterisk in the media path

Prior to this patch, Asterisk would incorrectly use the previous endpoint
addresses in SDP in spite of providing its own port. T38 is never meant to
be done through directmedia and Asterisk should always be in the media path
for these streams.

(closes issue ASTERISK-17273)
Reported by: Kevin Stewart

(closes issue ASTERISK-18706)
Reported by: Jeremy Kister

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

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

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

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

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

9 years agoFix jitter buffer log file creation
Kinsey Moore [Wed, 18 Sep 2013 20:04:14 +0000 (20:04 +0000)]
Fix jitter buffer log file creation

This adjusts '/'-to-'#' replacement to replace all instances of '/'
instead of just the first to ensure that the jitter buffer log file
gets the correct name as per Richard Kenner's suggestion.

(closes issue ASTERISK-21036)
Reported by: Richard Kenner
........

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

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

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

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

9 years agoUpdate prep_tarball with new documentation files on the Asterisk wiki
Matthew Jordan [Wed, 18 Sep 2013 17:23:49 +0000 (17:23 +0000)]
Update prep_tarball with new documentation files on the Asterisk wiki

This will now pull both a command reference for the version being prepared,
as well as an Admin Guide that applies to all versions of Asterisk.

(issue ASTERISK-22439)
Reported by: Olle Johansson
........

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

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

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

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

9 years agoAdd a WARNING in bridge_softmix when a timing module isn't loaded
Matthew Jordan [Wed, 18 Sep 2013 17:21:39 +0000 (17:21 +0000)]
Add a WARNING in bridge_softmix when a timing module isn't loaded

If bridge_softmix fails to be created because no timing source is present in
Asterisk, this will currently fail gracefully but with (most likely) a generic
error message by whatever module tried to create the softmix bridge. This
patch adds a more explicit warning so you can actually diagnose and fix the
problem.

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

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

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

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

9 years agoMake config framework able to reload module configs with multiple config files.
Richard Mudgett [Wed, 18 Sep 2013 17:15:53 +0000 (17:15 +0000)]
Make config framework able to reload module configs with multiple config files.

The config framework is supposed to be able to load configs that come from
multiple config files.  The principle example is chan_sip's sip.conf and
users.conf.  Unfortunately, it only does this correctly on initial load.
This patch causes the module's config to be reloaded entirely if any of
the config files change.

(closes issue ASTERISK-22009)
Reported by: Richard Mudgett

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

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

9 years agores_pjsip_messaging: Register message technology as pjsip
Kevin Harwell [Wed, 18 Sep 2013 14:56:22 +0000 (14:56 +0000)]
res_pjsip_messaging: Register message technology as pjsip

pjsip's message technology was being registered as 'sip', which was causing it
to not load due it conflicting with chan_sip's registered 'sip' technology for
messaging.  It now registers as 'pjsip'.  However, due to this change the "to"
field for outgoing pjsip messages need to be prefixed with 'pjsip:' instead of
'sip:'.  Incoming messages to res_pjsip_messaging will automatically have their
"to" fields altered in order to accommodate the change.  Outgoing messages also
handle changing it back to 'sip' before being sent so the pjsip library will
properly handle it.

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

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

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

9 years agoFix Segfault In features-config.c When Application Has No Arguments
Michael L. Young [Wed, 18 Sep 2013 00:13:23 +0000 (00:13 +0000)]
Fix Segfault In features-config.c When Application Has No Arguments

Some applications do not require arguments.  Therefore, when parsing application
maps in features.conf, it is possible that app_data will be set to NULL.

* This patch sets app_data to "" if it is NULL.

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

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

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

9 years agoChange the "external_media_address" PJSIP endpoint option to "media_address".
Mark Michelson [Tue, 17 Sep 2013 23:10:49 +0000 (23:10 +0000)]
Change the "external_media_address" PJSIP endpoint option to "media_address".

The endpoint option does not apply to communication with external entities. Rather,
the option is applied to all communications with the endpoint. The external_media_address
transport configuration option may override the endpoint option if it turns out that
we are going to be communicating with an external entity.

Two things of note:
1) I have not updated the XML documentation. This is being taken care of by Rusty as part
of his work on issue ASTERISK-22405
2) This commit is likely to cause testsuite failures since there are tests that use the
external_media_address endpoint option, and they will need to be changed over. Well, I'm
planning to get that updated ASAP after this commit.

(closes issue ASTERISK-22528)
reported by Rusty Newton
........

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

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

9 years agoRemote console: more output discrepancies
Kevin Harwell [Tue, 17 Sep 2013 18:44:11 +0000 (18:44 +0000)]
Remote console: more output discrepancies

The remote console continued to have issues with its output.  In this case CLI
command output would either not show up (if verbose level = 0) or would contain
verbose prefixes (if verbose level > 0) once log messages were sent to the
remote console.  The fix now now adds verbose prefix data to all new lines
contained in a verbose log string.

(closes issue ASTERISK-22450)
Reported by: David Brillert
(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2825/
........

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

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

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

9 years agoFix doxygen to use correct units of features.conf options.
Richard Mudgett [Tue, 17 Sep 2013 17:55:21 +0000 (17:55 +0000)]
Fix doxygen to use correct units of features.conf options.
........

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

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