[asterisk-users] ChanSpy on asterisk 1.6

DHAVAL INDRODIYA dhaval.it01034 at gmail.com
Wed Oct 14 06:44:53 CDT 2009


hey In 1.6 version actually not wrote any code for option 'o'
you need to add following line into file

Index: apps/app_chanspy.c
===================================================================
--- apps/app_chanspy.c	(revision 215998)
+++ apps/app_chanspy.c	(working copy)
@@ -427,7 +427,12 @@
 		return -1;
 	}

-	f = ast_audiohook_read_frame(&csth->spy_audiohook, samples,
AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+	if (ast_test_flag(chan, OPTION_READONLY)) {
+		/* Option 'o' was set, so don't mix channel audio */
+		f = ast_audiohook_read_frame(&csth->spy_audiohook, samples,
AST_AUDIOHOOK_DIRECTION_READ, AST_FORMAT_SLINEAR);
+	} else {
+		f = ast_audiohook_read_frame(&csth->spy_audiohook, samples,
AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+	}

 	ast_audiohook_unlock(&csth->spy_audiohook);



regards
Dhaval

2009/10/14 Jorge Gutiérrez <jgutierrez at palosanto.com>

>
> I have read about that on asterisk 1.6, there will be a parameter "o" (Only
> listen to audio coming from this channel), I have tried, but I still get
> inbound and outbound audio from the spied channel.
> Has anyone used this feature? Is it working? Is there any work-around?
> I will like to only spy the outbound audio from a channel, I dont want to
> hear the incomming audio of that channel.
> I have used the following context:
>
> [Conf]
> exten => s,1,Answer
> exten => s,2,Background(custom/menu_test)
> exten => s,3,ChanSpy(,qoX)
> exten => 1,1,Goto(Conf,s,2)
> exten => 2,1,AGI(conf.php,${CALLERID(num)},${SPY_CHANNEL})
> exten => 2,n,Goto(s,3)
> exten => s,n,Goto(test2,s,1)
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091014/931f1164/attachment.htm 


More information about the asterisk-users mailing list