ExtenSpy random channel issue

I am using ExtenSpy to spy on CC Agents calls but I am experiencing some problems using it. First here is my configuration:

exten => _*12*[1-9].,1,Answer exten => _*12*[1-9].,2,ExtenSpy(${EXTEN:4},bq) exten => _*12*[1-9].,3,Hangup

Please notice that every agent has SIP account registered to SIP proxy (opensips).

1st problem: Asterisk is picking up random channels for me when I call the "spy number"
2nd problem: When spied agent finishes his/her call Asterisk is switching me to another random channel, yet It should hang me up(?)

Any help will be appreciated!

As you are using option “b” which means to spy only bridged extensions so make sure the extension you are dialing to spy on is in bridged state. As the other issue of extenspy going to random extension when current extension exits, it is default behavior of the extenspy and chanspy applications. As I think this is not changeable and you will have to hangup to stop spying.