[Home]

Summary:ASTERISK-17543: Can't spy direct channel while spying in a group
Reporter:Maciej Krajewski (jamicque)Labels:
Date Opened:2011-03-11 09:37:48.000-0600Date Closed:2011-05-10 14:29:43
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_chanspy
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) full
( 1) log+cap.zip
( 2) mk.cap
Description:When I want to run chanspy defining direct channel I want to spy, and a group to cycle through I hear nothing.
here is a sample dialplan:
exten => 556,1,Set(SPYGROUP=TEST)
exten => 556,n,ChanSpy(test002,g(TEST)d)

if I run it: like that:
exten => 556,n,ChanSpy(,g(TEST)d)
or that:
exten => 556,n,ChanSpy(test002,d)
it works ok. But defining the channel and the extension is no possible.
On the other hand using ExtenSpy works ok:
exten => 556,n,ExtenSpy(test002,g(TEST)d)


Beneath is the log from connection:
 == Using SIP RTP CoS mark 5
   -- Executing [12@phones:1] Goto("SIP/test004-00000080", "internal,12,1") in new stack
   -- Goto (internal,12,1)
   -- Executing [12@internal:1] Set("SIP/test004-00000080", "SPYGROUP=TEST") in new stack
   -- Executing [12@internal:2] Dial("SIP/test004-00000080", "SIP/test002,10") in new stack
 == Using SIP RTP CoS mark 5
   -- Called test002
   -- SIP/test002-00000081 is ringing
   -- SIP/test002-00000081 answered SIP/test004-00000080
   -- Packet2Packet bridging SIP/test004-00000080 and SIP/test002-00000081
 == Using SIP RTP CoS mark 5
   -- Executing [556@phones:1] Goto("SIP/test003-00000082", "queue,556,1") in new stack
   -- Goto (queue,556,1)
   -- Executing [556@queue:1] Set("SIP/test003-00000082", "SPYGROUP=TEST") in new stack
   -- Executing [556@queue:2] ChanSpy("SIP/test003-00000082", "test002,g(TEST)d") in new stack
   -- <SIP/test003-00000082> Playing 'beep.gsm' (language 'en')
Comments:By: Leif Madsen (lmadsen) 2011-03-31 12:26:51

You're using ChanSpy() wrong. The chanprefix option (which you've filled in which test002) is incorrect. You should being using a channel prefix, such as Agent, SIP, IAX2, DAHDI, etc...

By: Maciej Krajewski (jamicque) 2011-04-08 05:35:23

the new dialplan is as follow:
exten => 556,1,Set(SPYGROUP=TEST)
exten => 556,n,ChanSpy(SIP/test002,g(TEST)d)

And here are the logs - after connecting to extension 556 i hear nothing.

   -- Executing [11@phones:1] Goto("SIP/test004-00000025", "internal,11,1") in new stack
   -- Goto (internal,11,1)
   -- Executing [11@internal:1] Set("SIP/test004-00000025", "SPYGROUP=TEST") in new stack
   -- Executing [11@internal:2] Dial("SIP/test004-00000025", "SIP/test001,10") in new stack
 == Using SIP RTP CoS mark 5
   -- Called test001
   -- SIP/test001-00000026 is ringing
kristoff*CLI> core set debug 100
Core debug was 10 and is now 100
kristoff*CLI>
kristoff*CLI>
   -- SIP/test001-00000026 answered SIP/test004-00000025
   -- Packet2Packet bridging SIP/test004-00000025 and SIP/test001-00000026
 == Using SIP RTP CoS mark 5
   -- Executing [12@phones:1] Goto("SIP/test005-00000027", "internal,12,1") in new stack
   -- Goto (internal,12,1)
   -- Executing [12@internal:1] Set("SIP/test005-00000027", "SPYGROUP=TEST") in new stack
   -- Executing [12@internal:2] Dial("SIP/test005-00000027", "SIP/test002,10") in new stack
 == Using SIP RTP CoS mark 5
   -- Called test002
   -- SIP/test002-00000028 is ringing
   -- SIP/test002-00000028 answered SIP/test005-00000027
   -- Packet2Packet bridging SIP/test005-00000027 and SIP/test002-00000028
 == Using SIP RTP CoS mark 5
   -- Executing [556@phones:1] Goto("SIP/test003-00000029", "queue,556,1") in new stack
   -- Goto (queue,556,1)
   -- Executing [556@queue:1] Set("SIP/test003-00000029", "SPYGROUP=TEST") in new stack
   -- Executing [556@queue:2] ChanSpy("SIP/test003-00000029", "SIP/test002,g(TEST)d") in new stack
   -- <SIP/test003-00000029> Playing 'beep.gsm' (language 'en')

By: Leif Madsen (lmadsen) 2011-04-12 15:13:58

Can you provide a SIP trace along with a pcap that shows the RTP flow?

By: Maciej Krajewski (jamicque) 2011-04-13 08:32:46

log+cap.zip is the file with captured rtp and SIP + full debug log.

By: Leif Madsen (lmadsen) 2011-05-10 14:15:00

Please don't attach debugging as a compressed file. It makes it difficult to work with. Please attach as a text file only.

By: Leif Madsen (lmadsen) 2011-05-10 14:29:05

You must still be doing something wrong, because I just tested it here and everything works fine as I'd expect.

This is on trunk, so perhaps you should update to the latest 1.6.2 branch and test there. If that doesn't work, please verify this is still an issue on the 1.8 branch as the 1.6.2 branch is now in security fix only mode.

Here is my simply dialplan that works for me:


<pre>
exten => 556,1,Answer()
same => n,ChanSpy(SIP/0004f2,g(TEST)d)

exten => 557,1,NoOp()
same => n,Set(SPYGROUP=TEST)
same => n,Playback(tt-monkeys)
</pre>


Dialplan output:

<pre>
   -- Executing [556@internal:1] Answer("SIP/w7-0000003b", "") in new stack
   -- Executing [556@internal:2] ChanSpy("SIP/w7-0000003b", "SIP/0004f2,g(TEST)d") in new stack
   -- <SIP/w7-0000003b> Playing 'beep.ulaw' (language 'en')
 == Using UDPTL CoS mark 5
 == Using SIP RTP CoS mark 5
   -- Executing [557@internal:1] NoOp("SIP/0004f2297d42-0000003c", "") in new stack
   -- Executing [557@internal:2] Set("SIP/0004f2297d42-0000003c", "SPYGROUP=TEST") in new stack
   -- Executing [557@internal:3] Playback("SIP/0004f2297d42-0000003c", "tt-monkeys") in new stack
   -- <SIP/0004f2297d42-0000003c> Playing 'tt-monkeys.g722' (language 'en')
   -- <SIP/w7-0000003b> Playing 'spy-sip.ulaw' (language 'en')
   -- <SIP/w7-0000003b> Playing 'digits/4.ulaw' (language 'en')
 == Spying on channel SIP/0004f2297d42-0000003c
[2011-05-10 15:27:03] NOTICE[27645]: app_chanspy.c:483 start_spying: Attaching SIP/w7-0000003b to SIP/0004f2297d42-0000003c
[2011-05-10 15:27:03] NOTICE[27645]: app_chanspy.c:483 start_spying: Attaching SIP/w7-0000003b to SIP/0004f2297d42-0000003c
 == Spawn extension (internal, 557, 3) exited non-zero on 'SIP/0004f2297d42-0000003c'

</pre>