diff options
author | Kinsey Moore <kmoore@digium.com> | 2014-12-08 15:43:14 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2014-12-08 15:43:14 +0000 |
commit | 55c9a46abdec10fec5210622b4508ee5e7791a65 (patch) | |
tree | 064347f283fa99e8d478713350e54b385eaccd4c /main/channel_internal_api.c | |
parent | 7fd1227202a9f04e5c11817840cf637fe568c168 (diff) |
Stasis: Fix StasisStart/End order and missing events
This corrects several bugs that currently exist in the stasis
application code.
* After a masquerade, the resulting channels have channel topics that
do not match their uniqueids
** Masquerades now swap channel topics appropriately
* StasisStart and StasisEnd messages are leaked to observer
applications due to being published on channel topics
** StasisStart and StasisEnd publishing is now properly restricted
to controlling apps via app topics
* Race conditions exist where StasisStart and StasisEnd messages due to
a masquerade may be received out of order due to being published on
different topics
** These messages are now published directly on the app topic so this
is now a non-issue
* StasisEnds are sometimes missing when sent due to masquerades and
bridge swaps into and out of Stasis()
** This was due to StasisEnd processing adjusting message-sent flags
after Stasis() had already exited and Stasis() had been re-entered
** This was corrected by adjusting these flags prior to sending the
message while the initial Stasis() application was still shutting
down
Review: https://reviewboard.asterisk.org/r/4213/
ASTERISK-24537 #close
Reported by: Matt DiMeo
........
Merged revisions 429061 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@429062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel_internal_api.c')
-rw-r--r-- | main/channel_internal_api.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index c62812ea7..624bdd1cb 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -1534,6 +1534,15 @@ void ast_channel_internal_swap_uniqueid_and_linkedid(struct ast_channel *a, stru b->linkedid = temp; } +void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel *b) +{ + struct stasis_cp_single *temp; + + temp = a->topics; + a->topics = b->topics; + b->topics = temp; +} + void ast_channel_internal_set_fake_ids(struct ast_channel *chan, const char *uniqueid, const char *linkedid) { ast_copy_string(chan->uniqueid.unique_id, uniqueid, sizeof(chan->uniqueid.unique_id)); |