diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-07-07 02:15:00 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-07-07 02:15:00 +0000 |
commit | d4b436d0ea766d51d7743a874df441d40fdcd226 (patch) | |
tree | 955ebd4c8cf179d6dcdcdbfa6a32ac654f3600a9 /contrib/upstart | |
parent | edcaa54019a14cdfd2d5e8453b15a52819cecb36 (diff) |
ARI/res_stasis: Subscribe to both Local channel halves when originating to app
This patch fixes two bugs:
1. When originating a channel into a Stasis application, we already create a
subscription for the channel that is going into our Stasis app.
Unfortunately, when you create a Local channel and pass it off to a Stasis
app, you really aren't creating just one channel: you're creating two. This
patch snags the second half of the Local channel pair (assuming it is a
Local channel pair, but luckily core_local is kind about such assumptions)
and subscribes to it as well.
2. Subscriptions are a bit sticky right now. If a subscription is made, the
'interest' count gets bumped on the Stasis subscription - but unless
something explicitly unsubscribes the channel, said subscription sticks
around. This is not much of a problem is a user is creating the subscription
- if they made it, they must want it. However, when we are creating
implicit subscriptions, we need to make sure something clears them out.
This patch takes a pessimistic approach: it watches the cache updates
coming from Stasis and, if we notice that the cache just cleared out an
object, we delete our subscription object. This keeps our ao2 container of
Stasis forwards in an application from growing out of hand; it also is a
bit more forgiving for end users who may not realize they were supposed to
unsubscribe from that channel that just hung up.
Review: https://reviewboard.asterisk.org/r/3710/
#ASTERISK-23939 #close
........
Merged revisions 418089 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/upstart')
0 files changed, 0 insertions, 0 deletions