asterisk/asterisk.git
6 years agores_parking: Fix some simple bugs
Jonathan Rose [Thu, 23 May 2013 20:48:41 +0000 (20:48 +0000)]
res_parking: Fix some simple bugs

Both of them are covered in the dynamic parking review on
https://reviewboard.asterisk.org/r/2550 - Remove unref against
parking lot that the bridge did on dissolve since the reference
wasn't taken in the first place. On a swap, reapply bridge roles
in order to get music on hold and such playing on the channel that
swaps into the bridge.

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

6 years agoFix a crash due to the INVITE session being destroyed before the session.
Joshua Colp [Thu, 23 May 2013 20:25:48 +0000 (20:25 +0000)]
Fix a crash due to the INVITE session being destroyed before the session.

This change ensures that the INVITE session remains valid for the lifetime
of the session object itself by increasing the session count on the dialog that
the INVITE session is allocated from. Once this reaches zero (normally as a result
of decrementing it within the session destructor) the dialog, and INVITE session,
are destroyed.

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

6 years agoThis patch adds support for controlling a playback operation from the
David M. Lee [Thu, 23 May 2013 20:21:16 +0000 (20:21 +0000)]
This patch adds support for controlling a playback operation from the
Asterisk REST interface.

This adds the /playback/{playbackId}/control resource, which may be
POSTed to to pause, unpause, reverse, forward or restart the media
playback.

Attempts to control a playback that is not currently playing will
either return a 404 Not Found (because the playback object no longer
exists) or a 409 Conflict (because the playback object is still in the
queue to be played).

This patch also adds skipms and offsetms parameters to the
/channels/{channelId}/play resource.

(closes issue ASTERISK-21587)
Review: https://reviewboard.asterisk.org/r/2559

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

6 years agoThis patch implements the REST API's for POST /channels/{channelId}/play
David M. Lee [Thu, 23 May 2013 20:11:35 +0000 (20:11 +0000)]
This patch implements the REST API's for POST /channels/{channelId}/play
and GET /playback/{playbackId}.

This allows an external application to initiate playback of a sound on a
channel while the channel is in the Stasis application.

/play commands are issued asynchronously, and return immediately with
the URL of the associated /playback resource. Playback commands queue up,
playing in succession. The /playback resource shows the state of a
playback operation as enqueued, playing or complete. (Although the
operation will only be in the 'complete' state for a very short time,
since it is almost immediately freed up).

(closes issue ASTERISK-21283)
(closes issue ASTERISK-21586)
Review: https://reviewboard.asterisk.org/r/2531/

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

6 years agoFix inverted test preventing DTMF disconnect from working.
Richard Mudgett [Thu, 23 May 2013 18:40:50 +0000 (18:40 +0000)]
Fix inverted test preventing DTMF disconnect from working.

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

6 years agoFix a bug where the DTMF mode was not set on newly created RTP instances in the res_s...
Joshua Colp [Thu, 23 May 2013 18:39:05 +0000 (18:39 +0000)]
Fix a bug where the DTMF mode was not set on newly created RTP instances in the res_sip_sdp_rtp module.

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

6 years agoFix a bug with applying the end result of the codec negotiation to the Asterisk channel.
Joshua Colp [Thu, 23 May 2013 18:19:27 +0000 (18:19 +0000)]
Fix a bug with applying the end result of the codec negotiation to the Asterisk channel.

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

6 years agoFix a bug where the codec order as configured was not being obeyed.
Joshua Colp [Thu, 23 May 2013 15:51:05 +0000 (15:51 +0000)]
Fix a bug where the codec order as configured was not being obeyed.

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

6 years agoFixed startup race condition which caused occasional stasis_mwi_state_type assertions.
David M. Lee [Wed, 22 May 2013 19:15:16 +0000 (19:15 +0000)]
Fixed startup race condition which caused occasional stasis_mwi_state_type assertions.

The caching topic (which refers to the message type) was created before the
message type. If the initial subscription message gets processed before
the type can be initialized, the assertion about using an uninitialized type
fires.

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

6 years agoRemove bad props, before anybody notices.
Jason Parker [Wed, 22 May 2013 18:20:53 +0000 (18:20 +0000)]
Remove bad props, before anybody notices.

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

6 years agoAdd dial events to app_queue and app_followme.
Jason Parker [Wed, 22 May 2013 18:11:57 +0000 (18:11 +0000)]
Add dial events to app_queue and app_followme.

Also fixes an issue in app_dial, where the channels were swapped on dial events.

(closes issue ASTERISK-21551)
(closes issue ASTERISK-21550)

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

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

6 years agoFix destruction order assert for stasis_bridging
David M. Lee [Tue, 21 May 2013 22:49:23 +0000 (22:49 +0000)]
Fix destruction order assert for stasis_bridging

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

6 years agoConditional out more app_queue logging that needs to be reworked.
Richard Mudgett [Tue, 21 May 2013 21:08:19 +0000 (21:08 +0000)]
Conditional out more app_queue logging that needs to be reworked.

Fixes crash because app_queue was unconditionally freeing a datastore that
was still on a channel.

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

6 years agoRaise the ConfBridgeMute/Unmute events when a CLI or AMI action triggers the change
Matthew Jordan [Tue, 21 May 2013 18:45:57 +0000 (18:45 +0000)]
Raise the ConfBridgeMute/Unmute events when a CLI or AMI action triggers the change

New in 12 are the ConfBridgeMute/Unmute events, which are triggered when a user
changes their mute/unmute state. This was typically triggered when a user hit a
DTMF key that triggered the mute/unmute menu handler. Forgotten in this is when an
AMI action or CLI command triggers the mute/unmute. This patch now raises the
events in those situations as well.

(closes issue ASTERISK-21802)
Reported by: Birger "WIMPy" Harzenetter

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

6 years agoMerge in the bridge_construction branch to make the system use the Bridging API.
Richard Mudgett [Tue, 21 May 2013 18:00:22 +0000 (18:00 +0000)]
Merge in the bridge_construction branch to make the system use the Bridging API.

Breaks many things until they can be reworked.  A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers

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

6 years agoFixed some extra field assertion when the event WebSocket is connected
David M. Lee [Tue, 21 May 2013 14:17:24 +0000 (14:17 +0000)]
Fixed some extra field assertion when the event WebSocket is connected

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

6 years agoSet the AST_CDR_FLAG_ORIGINATED flag on originated channel's CDRs
Matthew Jordan [Mon, 20 May 2013 19:24:16 +0000 (19:24 +0000)]
Set the AST_CDR_FLAG_ORIGINATED flag on originated channel's CDRs

This may alleviate some of the CDR woes with originated channels, as CDRs
do like to know when a channel was originated. Eventually this will get
converted to be a channel flag, so its location is still good to know
post the great CDR shakeup of 2013.

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

6 years agoFixup svn:keywords in all *.c and *.h files.
Richard Mudgett [Mon, 20 May 2013 18:03:22 +0000 (18:03 +0000)]
Fixup svn:keywords in all *.c and *.h files.

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

6 years agoFixup svn:keywords in all *.c and *.h files.
Richard Mudgett [Mon, 20 May 2013 17:53:24 +0000 (17:53 +0000)]
Fixup svn:keywords in all *.c and *.h files.

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

6 years agoAdd doxygen.log to svn:ignore property.
Jason Parker [Mon, 20 May 2013 17:44:41 +0000 (17:44 +0000)]
Add doxygen.log to svn:ignore property.
........

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

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

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

6 years agoAdd missing exports file
Kinsey Moore [Mon, 20 May 2013 14:21:39 +0000 (14:21 +0000)]
Add missing exports file

This exposes stasis_app_control_answer and allows
res_stasis_http_channels to load properly.

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

6 years agoIn Sorcery pass the name of the object being allocated to the allocator.
Joshua Colp [Mon, 20 May 2013 14:02:37 +0000 (14:02 +0000)]
In Sorcery pass the name of the object being allocated to the allocator.

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

6 years agoAdd documentation for record_file_append
Kinsey Moore [Mon, 20 May 2013 13:45:50 +0000 (13:45 +0000)]
Add documentation for record_file_append

When this option was added, it was noted in CHANGES, but was missing
the XML documentation that this patch adds.

(closes issue ASTERISK-21780)
Patch-by: Brad Latus (snuffy)

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

6 years agoadd ast_publish_channel_state according new event framework
Alexandr Anikin [Sun, 19 May 2013 20:52:34 +0000 (20:52 +0000)]
add ast_publish_channel_state according new event framework

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

6 years agoAdd transfer softkey to ringout state to enable blond transfers.
Damien Wedhorn [Sun, 19 May 2013 19:45:14 +0000 (19:45 +0000)]
Add transfer softkey to ringout state to enable blond transfers.

(closes issue ASTERISK-21327)
Reported by: wedhorn
Tested by: myself
Patches:
    skinny-blindxfer01.diff uploaded by wedhorn (license 5019)

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

6 years agoAdd base XML documentation for res_sip
Kinsey Moore [Sun, 19 May 2013 17:45:42 +0000 (17:45 +0000)]
Add base XML documentation for res_sip

Thanks to Brad Latus, this patch adds a significant amount much-needed
documentation to res_sip. It should cover all existing configuration
options currently in Asterisk trunk.

Patch-by: Brad Latus (snuffy)
Review: https://reviewboard.asterisk.org/r/2471/

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

6 years agoDon't hold the outgoing lock for a prolonged period of time as it may block the origi...
Joshua Colp [Sun, 19 May 2013 02:21:44 +0000 (02:21 +0000)]
Don't hold the outgoing lock for a prolonged period of time as it may block the originator.

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

6 years agoIf the caller of the originate API calls wants the channel ensure it has been request...
Joshua Colp [Sun, 19 May 2013 00:49:15 +0000 (00:49 +0000)]
If the caller of the originate API calls wants the channel ensure it has been requested and dialed.

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

6 years agoAdd call forward no answer to skinny and cleanup general callfwd handling.
Damien Wedhorn [Sat, 18 May 2013 23:20:53 +0000 (23:20 +0000)]
Add call forward no answer to skinny and cleanup general callfwd handling.

CallforwardNoAnswer uses a sched to determine when to forward the call.
Defaults to 20secs but configurable in skinny.conf.

Adds dialType to each subchannel structure to be used to differentiate
between normal dials that result in a call being placed (default) and
other uses for the skinny_dialer (such as cfwd digit collection).
Restructured all cfwd handling to use this new arrangement.

(closes issue ASTERISK-21292)
Reported by: wedhorn
Tested by: myself
Patches:
    skinny-callfwdnoans03.diff uploaded by wedhorn (license 5019)

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

6 years agoFix a bug where synchronous origination (oddly enough triggered by doing an async...
Joshua Colp [Sat, 18 May 2013 22:49:14 +0000 (22:49 +0000)]
Fix a bug where synchronous origination (oddly enough triggered by doing an async manager Originate) would not work properly.

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

6 years agoMove origination to use the dialing API and send Stasis messages on dial begin and...
Joshua Colp [Sat, 18 May 2013 19:47:24 +0000 (19:47 +0000)]
Move origination to use the dialing API and send Stasis messages on dial begin and end.

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

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

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

6 years agoFix shutdown assertions in stasis-core
David M. Lee [Fri, 17 May 2013 21:10:32 +0000 (21:10 +0000)]
Fix shutdown assertions in stasis-core

In r388005, macros were introduced to consistently define message
types. This added an assert if a message type was used either before
it was initialized or after it had been cleaned up. It turns out that
this assertion fires during shutdown.

This actually exposed a hidden shutdown ordering problem. Since
unsubscribing is asynchronous, it's possible that the message types
used by the subscription could be freed before the final message of
the subscription was processed.

This patch adds stasis_subscription_join(), which blocks until the
last message has been processed by the subscription. Since joining was
most commonly done right after an unsubscribe, a
stasis_unsubscribe_and_join() convenience function was also added.

Similar functions were also added to the stasis_caching_topic and
stasis_message_router, since they wrap subscriptions and have similar
problems.

Other code in trunk was refactored to join() where appropriate, or at
least verify that the subscription was complete before being
destroyed.

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

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

6 years agoRemove Character Limit On "inkeys" For IAX2
Michael L. Young [Fri, 17 May 2013 20:24:56 +0000 (20:24 +0000)]
Remove Character Limit On "inkeys" For IAX2

Currently, the buffer for processing "inkeys" is limited to 256 characters.  If
the user has many keys and the names of those key files are long, the 256
character limit is not enough.

* Change inkeys buffer to be dynamic

(closes issue ASTERISK-21398)
Reported by: Pavel Kopchyk
Tested by: Pavel Kopchyk, Michael L. Young
Patches:
    asterisk-21398-iax2-inkeys-dynamic-buffer_v3.diff
by Michael L. Young (license 5026)

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

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

6 years agoPublish the outbound channel's application/data when dialing
Matthew Jordan [Fri, 17 May 2013 17:43:58 +0000 (17:43 +0000)]
Publish the outbound channel's application/data when dialing

This patch does two things:
* It fixes a bug where the outbound channel's application/data set by the
  dialing API/app_dial is not communicated until the channel is hung up.
  If that happens, AMI would incorrectly send a NewExten event immediately
  after a Hangup. This isn't really AMI's fault, as the dialing APIs never
  communicated the 'helpful' app/data on the outbound channel until it was
  hungup.
* It makes public sending a stasis message about a change in channel state.
  This is useful enough that - for now at least - it should be public. If
  operations on a channel go to being more coarse-grained, this function
  could be made private again.

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

Note that this problem was found and reported by Matt DiMeo.

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

6 years agoStasis: Update security events to use Stasis
Jonathan Rose [Fri, 17 May 2013 17:36:10 +0000 (17:36 +0000)]
Stasis: Update security events to use Stasis

Also moves ACL messages to the security topic and gets rid of the
ACL topic

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

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

6 years agoFixed inverted logic in app_add_channel().
David M. Lee [Wed, 15 May 2013 21:13:29 +0000 (21:13 +0000)]
Fixed inverted logic in app_add_channel().

Also added some missing doc comments for stasis/app.h.

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

6 years agoFix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
Kevin Harwell [Wed, 15 May 2013 15:58:56 +0000 (15:58 +0000)]
Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS

If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying
to access a possible NULL t->track object.  A NULL check has been added before
trying to access the memory.

(closes issue ASTERISK-21724)
Reported by: Corey Farrell
Fixed by: Corey Farrell
Patches:
ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909)
........

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

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

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

6 years agoFix VM snapshot handling for combined INBOX.
Jason Parker [Wed, 15 May 2013 15:03:40 +0000 (15:03 +0000)]
Fix VM snapshot handling for combined INBOX.

The snapshot API contains an option that allow for combining of new
and old messages within a single snapshot. New messages, however,
include options beyond just 'INBOX' - it also includes the Urgent
folder. A previous patch that combined INBOX and Urgent accidentally
impacted snapshots that attempted to gain messages from just the Old
folder. This patch fixes the snapshot gathering such that the API
returns the appropriate messages for the folder selected, with and
without the combine option.

This should make it more clear about what's happening.

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

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

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

6 years agoUse srtp_shutdown when available
Kinsey Moore [Wed, 15 May 2013 12:42:04 +0000 (12:42 +0000)]
Use srtp_shutdown when available

This allows the SRTP library to be shut down properly when the
functionality is offered by libsrtp.

Review: https://reviewboard.asterisk.org/r/2538/
(closes issue ASTERISK-21719)
........

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

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

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

6 years agoRefactored the rest of the message types to use the STASIS_MESSAGE_TYPE_*
David M. Lee [Wed, 15 May 2013 02:37:22 +0000 (02:37 +0000)]
Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_*
macros.

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

6 years agoBreak res_stasis into smaller files.
David M. Lee [Tue, 14 May 2013 21:45:08 +0000 (21:45 +0000)]
Break res_stasis into smaller files.

When implementing playback for stasis-http, the monolithicedness of
res_stasis really started to get in my way.

This patch breaks the major components of res_stasis.c into individual
files.

 * res/stasis/app.c - Stasis application tracking
 * res/stasis/control.c - Channel control objects
 * res/stasis/command.c - Channel command object

This refactoring also allows res_stasis applications to be loaded as
independent modules, such as the new res_stasis_answer module.

The bulk of this patch is simply moving code from one file to another,
adjusting names and adding accessors as necessary.

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

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

6 years agoMake ao2 global objects not always use the debug version of the ao2_ref() calls.
Richard Mudgett [Tue, 14 May 2013 19:03:26 +0000 (19:03 +0000)]
Make ao2 global objects not always use the debug version of the ao2_ref() calls.

The debug versions of ao2_ref() should only be used if REF_DEBUG is
enabled so nothing is written to /tmp/refs unexpectedly.

(closes issue ASTERISK-21785)
Reported by: abelbeck
Patches:
      jira_asterisk_21785_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: abelbeck
........

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

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

6 years agoMove JSON event generators into separate modules
Kinsey Moore [Tue, 14 May 2013 12:47:52 +0000 (12:47 +0000)]
Move JSON event generators into separate modules

This moves the JSON event generators out of the Stasis-HTTP modules and
into standalone JSON-related counterparts so that Stasis-HTTP and
res_stasis can depend on them without creating dependency cycles. This
also provides a future location for Swagger Model validator functions
once the generators for that code are written.

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

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

6 years agoFix Missing CALL-ID When Logging Through Syslog
Michael L. Young [Mon, 13 May 2013 21:21:03 +0000 (21:21 +0000)]
Fix Missing CALL-ID When Logging Through Syslog

The CALL-ID (ie [C-00000074]) is missing when logging to syslog.  This was just
an oversight when this feature was added.

* Add CALL-IDs when using syslog

(closes issue ASTERISK-21430)
Reported by: Nikola Ciprich
Tested by: Nikola Ciprich, Michael L. Young
Patches:
    asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026)

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

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

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

6 years agoFix Crash Caused By One-way Audio With auto_* NAT Settings Fix
Michael L. Young [Mon, 13 May 2013 21:07:02 +0000 (21:07 +0000)]
Fix Crash Caused By One-way Audio With auto_* NAT Settings Fix

The prior code committed, r385473, failed to take into consideration that not
all outgoing calls will be to a peer.  My fault.

This patch does the following:

* Check if there is a related peer involved.  If there is, check and set NAT
  settings according to the peer's settings.

* Fix a problem with realtime peers.  If the global setting has auto_force_rport
  set and we issued a "sip reload" while a peer is still registered, the peer's
  flags for NAT are reset to off.  When this happens, we were always setting the
  contact address of the peer to that of the full contact info that we had.

(closes issue ASTERISK-21374)
Reported by: jmls
Tested by: Michael L. Young
Patches:
   asterisk-21374-fix-crash-and-rt-peers.diff by Michael L. Young (license 5026)

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

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

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

6 years agoRevert r388529 for now
Kinsey Moore [Mon, 13 May 2013 20:37:11 +0000 (20:37 +0000)]
Revert r388529 for now

Adding the cleanup function needs some deeper thought since it
apparently doesn't exist for all variants of libsrtp.
........

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

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

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

6 years agopbx: Fix lack of cleanup on macrolock and context_table
Jonathan Rose [Mon, 13 May 2013 19:29:56 +0000 (19:29 +0000)]
pbx: Fix lack of cleanup on macrolock and context_table

(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)
........

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

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

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

6 years agoClose libsrtp properly
Kinsey Moore [Mon, 13 May 2013 18:10:22 +0000 (18:10 +0000)]
Close libsrtp properly

Ensure that libsrtp is shutdown properly when res_srtp is unloaded.

(closes issue ASTERISK-21719)
Reported by: Corey Farrell
Patches:
    res_srtp-library-shutdown.patch uploaded by Corey Farrell
........

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

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

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

6 years agochan_gulp: Minor readability Improvements to chan_gulp
Jonathan Rose [Mon, 13 May 2013 17:20:33 +0000 (17:20 +0000)]
chan_gulp: Minor readability Improvements to chan_gulp

(closes issue ASTERISK-21670)
Reported by: Snuffy
Review: https://reviewboard.asterisk.org/r/2473/
Patches:
    gulp-coding-guide.diff uploaded by snuffy (license 5024)

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

6 years agoFix SendText AMI action to never return non-zero.
Richard Mudgett [Mon, 13 May 2013 14:28:50 +0000 (14:28 +0000)]
Fix SendText AMI action to never return non-zero.

AMI actions must never return non-zero unless they intend to close the AMI
connection.  (Which is almost never.)

(closes issue ASTERISK-21779)
Reported by: Paul Goldbaum
........

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

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

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

6 years agoAllow mISDN to send PROGRESS messsage.
Richard Mudgett [Fri, 10 May 2013 22:12:52 +0000 (22:12 +0000)]
Allow mISDN to send PROGRESS messsage.

* Made isdn_msg_parser.c build a progress message with the mandatory
progress indicator IE.  (The mISDNuser NT state machine rejected sending
the incomplete message.)

Note: The associated mISDN and mISDNuser patches respectively are viewable
here:
http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
http://svnview.digium.com/svn/thirdparty?view=rev&rev=201

(closes issue AST-1153)
Reported by: Guenther Kelleter
Patches:
      progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
      progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
      progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter
........

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

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

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

6 years agoFix memory leak in pbx_dundi
Mark Michelson [Fri, 10 May 2013 20:50:53 +0000 (20:50 +0000)]
Fix memory leak in pbx_dundi

pbx_dundi added an io context without removing
it. This caused a memory leak when the module was
unloaded.

(closes ASTERISK-21718)
Reported by Corey Farrell
Patches:
pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)
........

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

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

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

6 years agoFix Finding Extensions With Patterns Using ODBC Realtime
Michael L. Young [Fri, 10 May 2013 20:28:18 +0000 (20:28 +0000)]
Fix Finding Extensions With Patterns Using ODBC Realtime

After the merge of support for the realtime sorcery module, extensions that
contained a pattern were not being found through odbc realtime.  It was tracked
down to this one line that was advancing to the next variable list before it
should have been.  The removal of this one line fixes this.

Tested this fix on my machine.

Received confirmation that this is the right fix from file on IRC.

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

6 years agoAddress unload order issues for res_stasis* modules
David M. Lee [Fri, 10 May 2013 17:12:57 +0000 (17:12 +0000)]
Address unload order issues for res_stasis* modules

I've noticed when doing a graceful shutdown that the res_stasis_http.so
module gets unloaded before the modules that use it, which causes some
asserts during their unload.

While r386928 was a quick hack to get it to not assert and die, this
patch increases the use counts on res_stasis.so and res_stasis_http.so
properly. It's a bigger change than I expected, hence the review instead
of just committing it.

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

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

6 years agoAvoided __ast names for the private variables created by the
David M. Lee [Fri, 10 May 2013 15:55:42 +0000 (15:55 +0000)]
Avoided __ast names for the private variables created by the
STASIS_MESSAGE_TYPE_*() macros.

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

6 years agoAdd channel events for res_stasis apps
Kinsey Moore [Fri, 10 May 2013 13:13:06 +0000 (13:13 +0000)]
Add channel events for res_stasis apps

This change adds a framework in res_stasis for handling events from
channel topics. JSON event generation and validation code is created
from event documentation in rest-api/api-docs/events.json to assist in
JSON event generation, ensure consistency, and ensure that accurate
documentation is available for ALL events that are received by
res_stasis applications.

The userevent application has been refactored along with the code that
handles userevent channel blob events to pass the headers as key/value
pairs in the JSON blob. As a side-effect, app_userevent now handles
duplicate keys by overwriting the previous value.

Review: https://reviewboard.asterisk.org/r/2428/
(closes issue ASTERISK-21180)
Patch-By: Kinsey Moore <kmoore@digium.com>

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

6 years agoFix copy/paste error in one-touch-recording implementation.
Sean Bright [Fri, 10 May 2013 11:47:04 +0000 (11:47 +0000)]
Fix copy/paste error in one-touch-recording implementation.
........

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

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

6 years agoDon't expect to pack three tuples when you only have two
Matthew Jordan [Thu, 9 May 2013 14:41:38 +0000 (14:41 +0000)]
Don't expect to pack three tuples when you only have two

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

6 years agoFix The Payload Being Set On CN Packets And Do Not Set Marker Bit
Michael L. Young [Thu, 9 May 2013 04:11:59 +0000 (04:11 +0000)]
Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit

When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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

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

6 years agoFix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime
Michael L. Young [Thu, 9 May 2013 03:35:25 +0000 (03:35 +0000)]
Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime

When the "ignorebusy" setting was deprecated, we added some code to allow us to
be compatible with older setups that are still using the "ignorebusy" setting
instead of "ringinuse".  We set a char *variable with the column name to use,
which helps the realtime functions to use the correct column in their SQL
queries.  When "persistentmembers" is enabled, we are not setting this variable
before the realtime functions were called to load members.  This results in the
variable being NULL and therefore causing a segfault when loading members during
the module's process of loading.

The solution was to move the code that sets that variable to be before these
realtime functions are called during the loading of the module.

(closes issue ASTERISK-21738)
Reported by: JoshE
Tested by: JoshE
Patches:
    asterisk-21738-rt-ringinuse-field-not-set.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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

6 years agoFixed MODFLAG for res_stasis_websocket
David M. Lee [Wed, 8 May 2013 22:00:53 +0000 (22:00 +0000)]
Fixed MODFLAG for res_stasis_websocket

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

6 years agoAdd development flag to disable the inline API.
David M. Lee [Wed, 8 May 2013 21:01:33 +0000 (21:01 +0000)]
Add development flag to disable the inline API.

A GCC bug[1] can, in some cases, pop up an unsuppressible pedwarn when
using a static inline standard library function from a non-static
inline function.

This normally doesn't show up, but can occur if you're running an
upgrade version of GCC (such as GCC 4.8 on OS X, which normally runs
GCC 4.2).

 [1]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47816

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

6 years agoRemoved #if checks for crazy old versions of OS X.
David M. Lee [Wed, 8 May 2013 20:25:28 +0000 (20:25 +0000)]
Removed #if checks for crazy old versions of OS X.

The <arpa/nameser_compat.h> was introduced way back in OS X Panther, which
itself was end-of-lifed back in 2007. We can assume that any OS X machine
we build on will need that header file :-)

Why bother removing it? The flag we're checking (__APPLE_CC__) is actually
Apple's build number. Self-compiled versions of GCC (such as installing the
latest version of GCC from homebrew) sets the value to 0, making it useless
for this sort of compile flaggery.

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

6 years agoFixed set-but-not-used warning caught by newer GCC
David M. Lee [Wed, 8 May 2013 19:00:55 +0000 (19:00 +0000)]
Fixed set-but-not-used warning caught by newer GCC

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

6 years agoDon't perform a realtime lookup with a NULL keyword
Matthew Jordan [Wed, 8 May 2013 18:36:21 +0000 (18:36 +0000)]
Don't perform a realtime lookup with a NULL keyword

Previously, a call to ast_load_realtime_multientry could get away with
passing a NULL parameter to the function, even though it really isn't
supposed to do that. After the change over to using ast_variable instead
of variadic arguments, the realtime engine gets unhappy if you do this.

This was always an unintended function call in app_directory anyway - now,
we just don't call into the realtime function calls if we don't have anything
to query on.

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

6 years agoRemove required type field from channel blobs
David M. Lee [Wed, 8 May 2013 18:34:50 +0000 (18:34 +0000)]
Remove required type field from channel blobs

When we first introduced the channel blob types, the JSON blobs were
self identifying by a required "type" field in the JSON object
itself. This, as it turns out, was a bad idea.

When we introduced the message router, it was useless for routing based
on the JSON type. And messages had two type fields to check: the
stasis_message_type() of the message itself, plus the type field in the
JSON blob (but only if it was a blob message).

This patch corrects that mistake by removing the required type field
from JSON blobs, and introducing first class stasis_message_type objects
for the actual message type.

Since we now will have a proliferation of message types, I introduced a
few macros to help reduce the amount of boilerplate necessary to set
them up.

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

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

6 years agoAdd version.c to list of ignored files in the utils directory.
Richard Mudgett [Wed, 8 May 2013 16:58:04 +0000 (16:58 +0000)]
Add version.c to list of ignored files in the utils directory.

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

6 years agoInitial support for endpoints.
David M. Lee [Wed, 8 May 2013 13:39:08 +0000 (13:39 +0000)]
Initial support for endpoints.

An endpoint is an external device/system that may offer/accept
channels to/from Asterisk. While this is a very useful concept for end
users, it is surprisingly not a core concept within Asterisk itself.

This patch defines ast_endpoint as a separate object, which channel
drivers may use to expose their concept of an endpoint. As the channel
driver creates channels, it can use ast_endpoint_add_channel() to
associate channels to the endpoint. This updated the endpoint
appropriately, and forwards all of the channel's events to the
endpoint's topic.

In order to avoid excessive locking on the endpoint object itself, the
mutable state is not accessible via getters. Instead, you can create a
snapshot using ast_endpoint_snapshot_create() to get a consistent
snapshot of the internal state.

This patch also includes a set of topics and messages associated with
endpoints, and implementations of the endpoint-related RESTful
API. chan_sip was updated to create endpoints with SIP peers, but the
state of the endpoints is not updated with the state of the peer.

Along for the ride in this patch is a Stasis test API. This is a
stasis_message_sink object, which can be subscribed to a Stasis
topic. It has functions for blocking while waiting for conditions in
the message sink to be fulfilled.

(closes issue ASTERISK-21421)
Review: https://reviewboard.asterisk.org/r/2492/

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

6 years agochan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries...
Alec L Davis [Wed, 8 May 2013 07:21:09 +0000 (07:21 +0000)]
chan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries fail

RFC6665 4.2.2: ... after a failed State NOTIFY transaction remove the subscription

The problem is that the State Notify requests rely on the 200OK reponse for pacing control
and to not confuse the notify susbsystem.
The issue is, the pendinginvite isn't cleared if a response isn't received,
thus further notify's are never sent.

The solution, follow RFC 6665 4.2.2's 'SHOULD' and remove the subscription after failure.

(closes issue ASTERISK-21677)

Reported by: Dan Martens
Tested by: alecdavis
alecdavis (license 585)

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

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

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

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

6 years agoFixed up \example marker in lock.h Doxygen comment.
David M. Lee [Tue, 7 May 2013 18:32:34 +0000 (18:32 +0000)]
Fixed up \example marker in lock.h Doxygen comment.

The \example tags marks an entire file as an example, not a code snippet.

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

6 years agoMinor fixups to Doxygen comments.
David M. Lee [Tue, 7 May 2013 18:30:55 +0000 (18:30 +0000)]
Minor fixups to Doxygen comments.

The \example tags marks an entire file as an example, not a code snippet.
........

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

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

6 years agoBetter explained the depths of reference stealing.
David M. Lee [Tue, 7 May 2013 18:12:26 +0000 (18:12 +0000)]
Better explained the depths of reference stealing.

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

6 years agoFix build breakage, from LOW_MEMORY fix.
Jason Parker [Tue, 7 May 2013 17:53:50 +0000 (17:53 +0000)]
Fix build breakage, from LOW_MEMORY fix.

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

6 years agoUpdate ao2_destructor_fn doxygen.
Richard Mudgett [Mon, 6 May 2013 17:15:20 +0000 (17:15 +0000)]
Update ao2_destructor_fn doxygen.

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

6 years agoMake a log NOTICE more explicit that the event comes from DAHDI and not PRI.
Richard Mudgett [Mon, 6 May 2013 17:09:50 +0000 (17:09 +0000)]
Make a log NOTICE more explicit that the event comes from DAHDI and not PRI.

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

6 years agoFix building with LOW_MEMORY defined.
Jason Parker [Mon, 6 May 2013 17:01:41 +0000 (17:01 +0000)]
Fix building with LOW_MEMORY defined.

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

6 years agoMake SLA reload more paranoid.
Russell Bryant [Mon, 6 May 2013 15:58:32 +0000 (15:58 +0000)]
Make SLA reload more paranoid.

Reload support was originally not included for SLA.  It was added later,
but in a fairly non-traditional way.  It basically sets a flag
indicating that a reload is pending, and then waits for a time where it
thinks everything SLA related is idle and unused, and *then* executes
the reload.  It does this because the reload process is destructive.  It
starts by throwing everything away and starting over.

There are a number of problems with this approach.  One of them is that
the check to see if anything in use was incomplete.  This patch makes it
more complete and thus less likely for a crash to occur during reload
processing.  However, this approach still has problems so some much more
significant reworking of this code will need to come in as a next step.

Patch credit and testing by CoreDial, LLC.
........

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

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

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

6 years agoAdd support for observers and JSON objectset creation to sorcery.
Joshua Colp [Mon, 6 May 2013 13:04:08 +0000 (13:04 +0000)]
Add support for observers and JSON objectset creation to sorcery.

This change adds the ability for modules to add themselves as observers
to sorcery object types. Observers can be notified when objects are
created, updated, or deleted as well as when the object type is loaded or
reloaded. Observer notifications are done using a thread pool in a serialized
fashion so the caller of the sorcery API calls is minimally impacted.

This also adds the ability to create JSON changesets of a sorcery object.

Tests are also present to confirm all of the above functionality.

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

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

6 years agoClean up documentation; prevent ref leak on exit
Matthew Jordan [Sat, 4 May 2013 16:00:46 +0000 (16:00 +0000)]
Clean up documentation; prevent ref leak on exit

This patch:
 * Cleans up some doxygen
 * Prevents leaking the system level Stasis topics and messages
   on exit (users of valgrind will be happier)

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

6 years agoMigrate SHARED's use of the VarSet AMI event to Stasis-Core
Matthew Jordan [Sat, 4 May 2013 15:24:31 +0000 (15:24 +0000)]
Migrate SHARED's use of the VarSet AMI event to Stasis-Core

This patch removes the direct call to AMI from the SHARED function
and instead call Stasis-Core. Stasis-Core delivers the notification
that a shared variable has changed on a channel to all interested
consumers.

(issue ASTERISK-21462)

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

6 years agoStasis: Convert network change events into network change stasis messages
Jonathan Rose [Fri, 3 May 2013 18:03:26 +0000 (18:03 +0000)]
Stasis: Convert network change events into network change stasis messages

(issue ASTERISK-21103)
Review: https://reviewboard.asterisk.org/r/2490/

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

6 years agoUse the configured formats for Gulp sessions if there are no joint formats between...
Joshua Colp [Fri, 3 May 2013 11:35:14 +0000 (11:35 +0000)]
Use the configured formats for Gulp sessions if there are no joint formats between requested formats and configured formats.

(closes issue ASTERISK-21756)

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

6 years agoMigrate AMI VarSet events raised by GoSub local variables
Matthew Jordan [Thu, 2 May 2013 20:59:20 +0000 (20:59 +0000)]
Migrate AMI VarSet events raised by GoSub local variables

This patch moves VarSet events for local variables raised by GoSub
over to Stasis-Core. It also tweaks up the post-processing documentation
scripts to not combine parameters if both parameters are already documented.

(issue ASTERISK-21462)

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

6 years agoRemove the ABI compatability ast_channel_alloc(). It is no longer needed.
Richard Mudgett [Thu, 2 May 2013 19:06:53 +0000 (19:06 +0000)]
Remove the ABI compatability ast_channel_alloc().  It is no longer needed.

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

6 years agoUpdate utils Makefile to handle r387294
Matthew Jordan [Thu, 2 May 2013 17:15:46 +0000 (17:15 +0000)]
Update utils Makefile to handle r387294

Alec's patch that added the Asterisk version to 'core show locks' angered the
items in utils, as they exist somewhat outside of the Asterisk build system.
Some day, this Makefile should get nuked from high orbit, but for now, include
version.c in its list of stuff to pile in.
........

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

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

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

6 years agoPutting all event defs and names back for now due to res_corosync dependency
Jonathan Rose [Thu, 2 May 2013 16:39:28 +0000 (16:39 +0000)]
Putting all event defs and names back for now due to res_corosync dependency

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

6 years agochan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval...
Alec L Davis [Thu, 2 May 2013 08:24:31 +0000 (08:24 +0000)]
chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher

RFC 4028 Section 10
if the side not performing refreshes does not receive a
session refresh request before the session expiration, it SHOULD send
a BYE to terminate the session, slightly before the session
expiration.  The minimum of 32 seconds and one third of the session
interval is RECOMMENDED.

Prior to this asterisk would refresh at 1/2 the Session-Expires interval,
or if the remote device was the refresher, asterisk would timeout at interval end.

Now, when not refresher, timeout as per RFC noted above.

(closes issue ASTERISK-21742)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

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

6 years agochan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk...
Alec L Davis [Thu, 2 May 2013 07:25:33 +0000 (07:25 +0000)]
chan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher.

RFC 4028 Section 7.2
 "UACs MUST be prepared to receive a Session-Expires header field in a
 response, even if none were present in the request."

What changed
  After ASTERISK-20787, inbound calls to asterisk with no Session-Expires in the INVITE are now are offered
  a Session-Expires (1800 asterisk default) in the response, with asterisk as the refresher.

Symptom:
  After 900 seconds (asterisk default refresher period 1800), asterisk RE-INVITEs the device, the device
   may respond with a much lower Session-Expires (180 in our case) value that it is now using.

  Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE.

  After 180 seconds the device times out and sends BYE (hangs up), asterisk is still working with the
  refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response.

Fix:
handle_response_invite() when 200OK, remove check for outbound and reinvite.

(closes issue ASTERISK-21664)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

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

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

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

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

6 years agochan_dahdi: fix lower bound check with -ve integer conversion from a float
Alec L Davis [Thu, 2 May 2013 06:57:04 +0000 (06:57 +0000)]
chan_dahdi: fix lower bound check with -ve integer conversion from a float

Lower bound of a 16bit signed int is -32768 not -32767

(closes issue ASTERISK-21744)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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

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

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

6 years agoAdd Asterisk Version to core show locks
Alec L Davis [Thu, 2 May 2013 06:47:16 +0000 (06:47 +0000)]
Add Asterisk Version to core show locks

Assist with reporting 'core show locks' when submitting bug reports.

Example below:

===========================
== SVN-branch-1.8-...
== Currently Held Locks
===========================

(closes issue ASTERISK-21743)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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

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

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

6 years agoSimplify chan_local.c:manager_optimize_away() using ao2_find().
Richard Mudgett [Wed, 1 May 2013 21:55:53 +0000 (21:55 +0000)]
Simplify chan_local.c:manager_optimize_away() using ao2_find().

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

6 years agoCleanup chan_local.c:local_new().
Richard Mudgett [Wed, 1 May 2013 21:35:53 +0000 (21:35 +0000)]
Cleanup chan_local.c:local_new().

* Remove t and ama local variables.  There is no way they could be
anything other than default because p->owner can only be NULL at this
point.

* Rename tmp and tmp2 to owner and chan respectively.

* Remove redundant initialization of channel context, exten, priority.

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

6 years agoClear the DTMF sending digit tracking on off nominal paths
Matthew Jordan [Wed, 1 May 2013 21:18:24 +0000 (21:18 +0000)]
Clear the DTMF sending digit tracking on off nominal paths

In certain situations, when the RTP engine goes to send a DTMF end digit
it may be in a situation where the remote address is no longer available,
or the digit that was supposed to be sent is invalid. In such cases, we
need to clear the RTP counters appropriately. Otherwise, when the RTP
source is set again, we'll continue to think that we're in the middle of
sending a DTMF digit, which can confuse the remote party (signficantly).

(closes issue ASTERISK-21522)
Reported by: Corey Farrell
patches:
  rtp_dtmf_process_end.patch uploaded by Corey Farrell (License 5909)
........

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

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

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

6 years agoTrivial changes. Comments, parentheses, spelling, wording.
Richard Mudgett [Wed, 1 May 2013 21:09:14 +0000 (21:09 +0000)]
Trivial changes. Comments, parentheses, spelling, wording.

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

6 years agoMake chan_local locals container an explicit list container.
Richard Mudgett [Wed, 1 May 2013 20:59:29 +0000 (20:59 +0000)]
Make chan_local locals container an explicit list container.

Pretending that chan_local locals container can have more than one bucket
is silly.  The container has no key to help search.

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

6 years agoWhitespace changes.
Richard Mudgett [Wed, 1 May 2013 20:53:30 +0000 (20:53 +0000)]
Whitespace changes.

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

6 years agoMake mod_load_cmp() not as klunky.
Richard Mudgett [Wed, 1 May 2013 20:35:25 +0000 (20:35 +0000)]
Make mod_load_cmp() not as klunky.

There is a reason the heap comparison functions like qsort(), and other
comparison functions specify <0, >0, and =0 for the return values.

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

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_unistim.c
Richard Mudgett [Wed, 1 May 2013 20:01:43 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_unistim.c

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

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c
Richard Mudgett [Wed, 1 May 2013 20:01:27 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c

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

6 years agoRemove some unnecessary calls to ast_bridged_channel() in chan_skinny.c
Richard Mudgett [Wed, 1 May 2013 20:01:10 +0000 (20:01 +0000)]
Remove some unnecessary calls to ast_bridged_channel() in chan_skinny.c

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