How to spy call from another server asterisksu

Hi every body
I have a asterisk server, in my call in dialplan I want to spy channel of customer to my agent

I can spy exactly channel of my agent what i want listen but i don’t any method to listen exactly channel of customer I want

I try use this command:
exten => _88XXXX,1,chanspy(SIP/trunkname,w)
and I use * to next channel, but this method no possible if my asterisk have lots of call as 100 or 1000 call

So please tell me method spy exactly channel of customer I want

Sorry for my english

If I understand you correctly, I think you want ExtenSpy, rather than ChanSpy.

Hi David
I tried with ExtenSpy but it seem not okey
This is my config
exten => _55XXXX,1,extenspy(${EXTEN:2}@trunk52,w)

in my verbose log if i have two call with to my asterisk examble
+channel agent: SIP/1001-00000ab
+channel custormer: SIP/trunkto52-0000ab
+channel agent: SIP/1002-00000cd
+channel custormer: SIP/trunkto52-0000ef
if i want to listen channel customer of call to i can config:
exten => 8888,1,chanspy(SIP/trunkto52-0000ef,w)
but I know this method not true because id of channel alway change so can you tell me a method or write for me a example to resolve my problem???

Thank you very much

You either have a very strange dialplan, or group52 is not the (correct) dialplan context. I’d typically expect something like from-internal.

Also, surely customer numbers are full PSTN numbers.

trunk52 is my context,
I still don’t understand how I spy exactly channel from external server
If you give me a example dialplan for your idea use extenspy, I maybe solve my problem

I may have misunderstood. Do you want to match by caller ID?

If so, I think you would need to set SPYGROUP to the caller ID and use the g option on either ChanSpy or ExtenSpy.

Hi David
Follow your idea, I resolved my problem
For any one need this is my dialplan:

exten => _024731122XX,1,set(SPYGROUP=${CDR(src)})
exten => _700XXXX,1,chanspy(,wg(${EXTEN:3}))

expain:I test on my lab, so my ${CDR(src)} have 4 symbol

Any way, Thanks you very much, David
Best Wishes For You!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.