I want to add to my dialplan the ability to spy on an arbitrary extension whether a call originates at it or is terminated at it. Scenario 1: Given an extension, say 2001, a call comes in on a zap channel and is Dial()ed to the phone that's at extension 2001, I want to be able to pick up a phone and dial (say) *142001 and spy on that call. Scenario 2: Extension 2001 makes a call to, say a zap channel, again, I want to be able to pick up a phone and dial *142001 and spy on that call. ExtenSpy(<exten>@<context>) seems like the obvious first choice but it requires a context and an extension. I think that can work for scenario 2 but not scenario 1, yes? An extension "answering" a call doesn't have a context does it? Alternatively I could use SPYGROUP and assign a SPYGROUP when an outbound call is made but I think I would need some way for Dial to set a SPYGROUP when an extension answers wouldn't I? Does anyone have an implementation of this they'd like to share? b. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080416/610f31e1/attachment.pgp
Brian J. Murrell wrote:> Does anyone have an implementation of this they'd like to share? >I cut out the authentication stuff we do, but this is part of the macro we use to spy and record calls arbitrary calls. All of our users have sip handsets. Asterisk 1.2. exten => s,n(getext),Read(SPY,extension,4) exten => s,n,GotoIf($[ ${LEN(${SPY})} != 4 ]?nospy) exten => s,n(spy),UserEvent(ChanSpy,User ${CALLBACKNUM} spied on ${SPY}) exten => s,n,Chanspy(SIP/${SPY},r(monitor-ext-${SPY})) exten => s,n,Hangup() exten => s,n(nospy),Playback(sorry-cant-let-you-do-that3) exten => s,n,UserEvent(ChanSpy,User ${CALLBACKNUM} failed to spy on ${SPY}) exten => s,n,Hangup()
On Wed, 2008-04-16 at 13:47 -0700, Steven Kurylo wrote:> > exten => s,n(getext),Read(SPY,extension,4) > exten => s,n,GotoIf($[ ${LEN(${SPY})} != 4 ]?nospy) > exten => s,n(spy),UserEvent(ChanSpy,User ${CALLBACKNUM} spied on ${SPY}) > exten => s,n,Chanspy(SIP/${SPY},r(monitor-ext-${SPY})) > exten => s,n,Hangup() > exten => s,n(nospy),Playback(sorry-cant-let-you-do-that3) > exten => s,n,UserEvent(ChanSpy,User ${CALLBACKNUM} failed to spy on ${SPY}) > exten => s,n,Hangup()Ahhh. And this works because your sip.conf entries are of the form: [<exten_num>] ... I see. I name mine more symbolically, but I wonder if I could create some kind of mapping... or take advantage of the "callerid" attribution of a sip.conf entry somehow to map from $callerid_number to $entry_name. Cheers! b. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080416/f403d1b5/attachment.pgp