[SOLVED] ChanSpy crashes after second call?


I am trying to setup ChanSpy on Asterisk

exten => 999,1,Answer()
exten => 999,2,Authenticate(12345)
exten => 999,3,Playback(beep)
exten => 999,4,Read(digits,3)
exten => 999,5,ChanSpy(SIP/${digits})
exten => 999,6,Playback(tt-monkeys)
exten => 999,7,Hangup

I want to be able to listen in on any given SIP-channel. It works, I am connected to SIP/xxx and can listen in, but Asterisk hangs up on me whenever the agent on SIP/xxx finishes her second call and starts a third one.

Agents call out via DAHDI.

Calls are started with call files for the agents.

Am I missing something?

[Agent SIP/xxx call1 ]

I attach myself with ChanSpy

[Agent SIP/xxx call2 ]

the moment call2 ends, Asterisk hangs up on me, i never hear tt-monkeys.

I can see the following in the CLI:

== Spawn extension (incoming, 999, 5) exited non-zero on ‘DAHDI/26-1’

Any idea?


OK i solved it.

Now i dynamically add an agent to his own $SPYGROUP when she starts a call. Chanspying on that Spygroup works flawlesly.