res_stasis_snoop: Spying on a single direction continually increases CPU
authorKevin Harwell <kharwell@digium.com>
Wed, 6 May 2015 22:37:51 +0000 (17:37 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 6 May 2015 22:37:51 +0000 (17:37 -0500)
commit1f5db1c7e31a76aa9223dfa22030fec0a45c5552
treee835335edaea911ee525dc0f962dafdb93ee7a8b
parenta4d16c182221b1796485a45b523275601aafe5bb
res_stasis_snoop: Spying on a single direction continually increases CPU

Creating a snoop channel in ARI and spying only on a single direction (in or
out) results in CPU utilization continually increasing until the CPU is fully
consumed. This occurs because frames are being put in the opposing direction's
slin factory queue, but not being removed.

Fixed the problem by always reading and disposing of frames from the opposite
queue of the direction selected.

ASTERISK-24938 #closes

Change-Id: I935bfd15f1db958f364d9d6b3b45582c0113dd60
res/res_stasis_snoop.c