[asterisk-users] Stopping chanspy followup

Jim Dickenson dickenson at cfmc.com
Wed Feb 4 12:39:16 CST 2009


I am still trying to figure out a reasonable way to exit the chanspy
application in a dialplan.

For the most part I understand how things are working and there is one
change I would like to propose.

The way the 1.4.23.1 code seems to work is that if there are no channels
that match the chanprefix argument the chanspy code stays in a loop waiting
for a new channel to come into being that matches chanprefix and spying will
start.

I would like it if there are no channels to spy on that the chanspy
application exit.

This can be done by changing line 673 of chanspy.c in the following way

Old:
                if (res == -1 || ast_check_hangup(chan))


New:
                if (res == -1 || ast_check_hangup(chan) || !peer_chanspy_ds)

Otherwise, as best I can tell, unless there is some error chanspy never
exits unless the channel running the chanspy application hangs up, which I
do not particularly want to do.

-- 
Jim Dickenson
mailto:dickenson at cfmc.com

CfMC
http://www.cfmc.com/






More information about the asterisk-users mailing list