I want to originate ChanSpy on calling channel after call is answered by agent. I have written a dialplan with hardcoded extensions and my logs are showing chanspy application has launched but i am not getting any sound on the Spying channel.
Can someone please help me understand where i am getting things wrong. Also i need help in spying only callers channel dynamically.
I am calling from 1005 to 1006 and i want 1007 to spy on 1005.
My Dialplan is -
[from-internal]
exten => _X.,1,Answer()
same => n,Dial(PJSIP/{EXTEN},20,tU(jump_to_here^{EXTEN}))
[jump_to_here]
exten => s,1,verbose({ARG1})
same => n,set(EXTEN={ARG1})
same => n,Originate(PJSIP/1007,app,ChanSpy,(,be(PJSIP/1005)Eqo))
My CLI Output is,
> Launching ChanSpy((,be(PJSIP/1005)Eqo)) on PJSIP/1007-0000006b
I tried with ${CALLERID(num) but it returns number of called extension.
Here in my scenario caller is calling on PRI line and landing on some extension and i want to spy on callers extension/channel. So, how would i retrieve it and spy on it.
Use case is,
user is calling on 4000, which is inturn picked up by PJSIP/1006.
and I want to spy on what 4000 is talking on extension PJSIP/1007
That may be the result of running it on the outgoing channel.
You could capture it on the incoming channel, before the Dial, using an exported variable, or you could IMPORT the value from the incoming side, using the bridge peer variable, or you use g to allow code on both channels, followed by Bridge. You may find you can use the connected line functions to get the other party from the outgoing side.