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: http://svn.asterisk.org/svn/asterisk/trunk@389587 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.asterisk.org/svn/asterisk/trunk@389603 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.asterisk.org/svn/asterisk/trunk@389609 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.asterisk.org/svn/asterisk/trunk@389618 f38db490-d61c-443f-a65b-d21fe96a405b