aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-05 23:48:48 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-05 23:48:48 +0000
commit2993593622bec2056db9560074d9aff5609fa59d (patch)
tree5591386be584106884a4ed675d417a70c15fe946 /apps/app_chanspy.c
parent41ca1c9fb93018c5c83aba6816f499f841b41054 (diff)
Merged revisions 41768,41827,41830,41880,41882,41989,42014,42054 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r41768 | file | 2006-09-01 18:49:07 -0400 (Fri, 01 Sep 2006) | 2 lines Only wipe the redirected audio & video IP/port if it's specified, and trigger a reinvite. ........ r41827 | bweschke | 2006-09-03 10:16:08 -0400 (Sun, 03 Sep 2006) | 3 lines Setting a retry of 0 is generally not a good idea and shouldn't be allowed. (#7574 - reported by regin) ........ r41830 | bweschke | 2006-09-03 10:50:59 -0400 (Sun, 03 Sep 2006) | 3 lines Let's NOT spy on Zap/psuedo channels, mmmmmmmmk? ........ r41880 | bweschke | 2006-09-03 13:13:38 -0400 (Sun, 03 Sep 2006) | 3 lines Don't keep trying the same member in certain strategies when members of the queue are unavailable (#7278 - diLLec reported and patched) - This should have been patched here first and then merged into /trunk. My bad! ........ r41882 | bweschke | 2006-09-03 13:38:22 -0400 (Sun, 03 Sep 2006) | 3 lines Make sure the forwarded channel inherits variables appropriately when we receive a call forward in the queue. (#7867 - raarts reported and patched) ........ r41989 | oej | 2006-09-04 11:46:07 -0400 (Mon, 04 Sep 2006) | 2 lines Don't kill the pvt before we have sent ACK on CANCEL (needs more testing before making a release) ........ r42014 | qwell | 2006-09-05 12:27:46 -0400 (Tue, 05 Sep 2006) | 4 lines Small typo in zapata.conf.sample Reported by ppyy in 7881 ........ r42054 | file | 2006-09-05 16:02:48 -0400 (Tue, 05 Sep 2006) | 2 lines Merge in last round of spy fixes. This should hopefully eliminate all the issues people have been seeing by distinctly separating what each component (core/spy) is responsible for. Core is responsible for adding a spy to a channel, feeding frames to the spy, removing the spy from a channel, and telling the spy to stop. Spy is responsible for reading frames in, and cleaning up after itself. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@42081 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 90a8574dd..fe71bbef1 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -131,7 +131,7 @@ static struct ast_channel *local_get_channel_begin_name(char *name)
ast_mutex_lock(&modlock);
chan = local_channel_walk(NULL);
while (chan) {
- if (!strncmp(chan->name, name, strlen(name))) {
+ if (!strncmp(chan->name, name, strlen(name)) && strncmp(chan->name, "Zap/pseudo", 10)) {
ret = chan;
break;
}
@@ -207,21 +207,6 @@ static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, s
return res;
}
-static void stop_spying(struct ast_channel *chan, struct ast_channel_spy *spy)
-{
- /* If our status has changed to DONE, then the channel we're spying on is gone....
- DON'T TOUCH IT!!! RUN AWAY!!! */
- if (spy->status == CHANSPY_DONE)
- return;
-
- if (!chan)
- return;
-
- ast_mutex_lock(&chan->lock);
- ast_channel_spy_remove(chan, spy);
- ast_mutex_unlock(&chan->lock);
-};
-
/* Map 'volume' levels from -4 through +4 into
decibel (dB) settings for channel drivers
*/
@@ -338,7 +323,13 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
}
}
ast_deactivate_generator(chan);
- stop_spying(spyee, &csth.spy);
+
+ if (csth.spy.chan) {
+ csth.spy.status = CHANSPY_DONE;
+ ast_mutex_lock(&csth.spy.chan->lock);
+ ast_channel_spy_remove(csth.spy.chan, &csth.spy);
+ ast_mutex_unlock(&csth.spy.chan->lock);
+ }
if (option_verbose >= 2) {
ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
@@ -347,7 +338,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
running = 0;
}
- ast_mutex_destroy(&csth.spy.lock);
+ ast_channel_spy_free(&csth.spy);
return running;
}