Prevent crash during synchronous AMI origination by ref bumping returned channel

The originate APIs allow callers to provide a pointer to a channel that will
point to the originated channel if the function call succeeds. This is used by AMI
to provide channel information when the originate is performed synchronously.
Unfortunately, if the originate fails in certain ways, the outbound channel is
already disposed of during the dialing itself. This results in the channel being
improperly dereferenced by the internal originate function in pbx.c.

This patch ref bumps the channel to prevent this from occurring. Callers must now
unlock and unref the channel (which is more in line with general channel management
guidelines anyway).

This only affects manager, as it is the only consumer of this API function that
actually passes in a channel pointer.

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

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@393361 f38db490-d61c-443f-a65b-d21fe96a405b
New SIP Channel Driver - Add CLI/AMI initiated NOTIFY requests

Added the ability to send unsolicited NOTIFY requests to a particular endpoint
with a configured payload.  Added both CLI and AMI support.  For a given
endpoint, this module will iterate over all its contacts sending the appropriate
NOTIFY request to each.

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@393364 f38db490-d61c-443f-a65b-d21fe96a405b