Extenspy - works, but whispers on wrong leg of call?

Hi guys

I have this bit of code in my dialplan:

exten=>*41,1,NoOp(Extenspy)
exten=>*41,n,Playback(vm-extension)
exten=>*41,n,Read(ext_digits,,4,,,10)
exten=>*41,n,SayDigits(${ext_digits})
exten=>*41,n,ExtenSpy(${ext_digits}@internal,dbwE)
exten=>*41,n,Hangup()

I have set up a test network to test the above. I call SIP extension 1000 from SIP extension 1001. For testing purposes, 1001 is the external person outside the call center, 1000 is the agent picking up the incoming call.

From a third SIP phone (3916) I then enter *41# - all works as it should, asterisk says “extension”, I type 1000 and asterisk reads the DTMF I input on the phone keypad and then reads the numbers back. Extenspy then comes up in the CLI, the word “sip” is played, and then asterisk reads back the CALLING extension - 1001 - not the agent extension which I entered just previously, which answered the call. If I then whisper, the wrong leg of the call gets the whisper - 1001 - the external party, not 1000, which is the agent - which was specified to extenspy… E. g. I’m whispering to the client who called into the call center, not the agent.

Here’s my CLI flow:

asterisktest*CLI>

== Using SIP RTP CoS mark 5

    -- Executing [1000@internal:1] Dial("SIP/1001-00000000",

"Sip/1000,120,tTg") in new stack

  == Using SIP RTP CoS mark 5
    -- Called Sip/1000

    -- SIP/1000-00000001 is ringing

    -- SIP/1000-00000001 answered SIP/1001-00000000

  == Using SIP RTP CoS mark 5

    -- Executing [*41@internal:1] Goto("SIP/3916-00000002", "special,*41,1")
in new stack

    -- Goto (special,*41,1)

    -- Executing [*41@special:1] NoOp("SIP/3916-00000002", "Extenspy") in
new stack

    -- Executing [*41@special:2] Playback("SIP/3916-00000002",
"vm-extension") in new stack

    -- <SIP/3916-00000002> Playing 'vm-extension.g729' (language 'en')

    -- Executing [*41@special:3] Read("SIP/3916-00000002",
"ext_digits,,4,,,10") in new stack

    -- Accepting a maximum of 4 digits.

    -- User entered '1000'

    -- Executing [*41@special:4] SayDigits("SIP/3916-00000002", "1000") in
new stack

    -- <SIP/3916-00000002> Playing 'digits/1.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/0.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/0.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/0.g729' (language 'en')

    -- Executing [*41@special:5] ExtenSpy("SIP/3916-00000002",
"1000@internal,dbwE") in new stack

    -- <SIP/3916-00000002> Playing 'beep.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'spy-sip.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/1.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/0.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/0.g729' (language 'en')

    -- <SIP/3916-00000002> Playing 'digits/1.g729' (language 'en')

  == Spying on channel SIP/1001-00000000

[May 15 10:17:38] NOTICE[2401]: app_chanspy.c:484 start_spying: Attaching
SIP/3916-00000002 to SIP/1001-00000000

[May 15 10:17:38] NOTICE[2401]: app_chanspy.c:484 start_spying: Attaching
SIP/3916-00000002 to SIP/1001-00000000

[May 15 10:17:38] NOTICE[2401]: app_chanspy.c:484 start_spying: Attaching
SIP/3916-00000002 to SIP/1000-00000001

  == Spawn extension (internal, 1000, 1) exited non-zero on
'SIP/1001-00000000'

    -- Executing [h@internal:1] NoOp("SIP/1001-00000000", "Call Hungup
INTERNAL") in new stack

  == Done Spying on channel SIP/1001-00000000

    -- Executing [*41@special:6] Hangup("SIP/3916-00000002", "") in new
stack

  == Spawn extension (special, *41, 6) exited non-zero on
'SIP/3916-00000002'

asterisktest*CLI>

If I enter 1001 as the extension I want to spy on, I get the beep, and then just silence:

-- Executing [*41@special:5] ExtenSpy("SIP/3916-00000002",
"1001@internal,dbwE") in new stack

    -- <SIP/3916-00000002> Playing 'beep.g729' (language 'en')

asterisktest*CLI>

No errrors are reported at verbosity 99.

What am I doing wrong - any idea why asterisk, when I want to spy on extension SIP/1000 - the agent - reads back extension SIP/1001 - the caller? And then, whispers to that read-back leg - the caller leg - the caller at SIP/1001 - while the agent is at SIP/1000 and I want to whisper to him…

How can I whisper to the agent leg on SIP/1000 - NOT the caller leg at 1001?

Thanks

Stefan

Hi again guys

I think I’ve solved the “whisper to wrong leg” issue I posted about in this thread.

Here’s the extensions.conf code that causes me to whisper to the wrong leg, as described above:

exten=>*41,1,NoOp(Extenspy) exten=>*41,n,Playback(vm-extension) exten=>*41,n,Read(ext_digits,,4,,,10) exten=>*41,n,SayDigits(${ext_digits}) exten=>*41,n,ExtenSpy(${ext_digits}@internal,dbwE) exten=>*41,n,Hangup()

However, if I change this line

exten=>*41,n,ExtenSpy(${ext_digits}@internal,dbwE)

to

exten=>*41,n,ExtenSpy(SIP/${ext_digits},dbwE)

I get the correct channel. It seems if you feed to ExtenSpy in asterisk 1.8.11.0 the first parameter as ${ext_digits}@your-context , instead of an absolute SIP/${ext_digits}, it can confuse the ExtenSpy app and it might whisper on the wrong call leg.

Hope this helps somebody else…

Regards

Stefan

Hi,

In your code can I know what is ${ext_digits} is it a separate context?

Regards.

I’m also having the same issue. I did try the methodology of adding “SIP/” to the extension to be spied on but still I’m whispering to the incorrect call leg.

An external phone “0550000002” (or the client in my case client) dials an agent at “0550010092”. On another phone I input the code 92 and the number of the agent phone which I wish to spy upon. I then use the asterisk DTMF 5 to whisper. At this point I can whisper but its to the client not the agent.

My CLI flow is as follows:

-- Executing [920550010092@callspy:1] NoOp("SIP/0550010090-00000206", "**********CallSpy Context *******") in new stack -- Executing [920550010092@callspy:2] AGI("SIP/0550010090-00000206", "agi://127.0.0.1:4574/CallSpy.allocate") in new stack -- AGI Script Executing Application: (Set) Options: (callSpy=0) -- AGI Script Executing Application: (Set) Options: (callSpy=1) -- <SIP/0550010090-00000206>AGI Script agi://127.0.0.1:4574/CallSpy.allocate completed, returning 0 -- Executing [920550010092@callspy:3] Wait("SIP/0550010090-00000206", "1") in new stack -- Executing [920550010092@callspy:5] GotoIf("SIP/0550010090-00000206", "0?500") in new stack -- Executing [920550010092@callspy:6] ExtenSpy("SIP/0550010090-00000206", "SIP/0550010092,dE") in new stack > 0x188f5170 -- Probation passed - setting RTP source address to 10.168.110.137:10142 -- <SIP/0550010090-00000206> Playing 'beep.gsm' (language 'en') -- <SIP/0550010090-00000206> Playing 'spy-sip.gsm' (language 'en') == Spying on channel SIP/NewTestHPBX1-00000204 [Jan 7 07:16:32] NOTICE[26650][C-0000013d]: app_chanspy.c:501 start_spying: Attaching SIP/0550010090-00000206 to SIP/NewTestHPBX1-00000204 [Jan 7 07:16:32] NOTICE[26650][C-0000013d]: app_chanspy.c:501 start_spying: Attaching SIP/0550010090-00000206 to SIP/NewTestHPBX1-00000204 -- Setting spy volume on SIP/0550010090-00000206 to 1 -- Channel SIP/NewTestHPBX1-00000204 left 'simple_bridge' basic-bridge <bbaa680c-d3c7-428c-98e9-048dfcbe80bd> == Spawn extension (hostedpbx, 0550010092, 13) exited non-zero on 'SIP/NewTestHPBX1-00000204' -- Channel SIP/0550010092-00000205 left 'simple_bridge' basic-bridge <bbaa680c-d3c7-428c-98e9-048dfcbe80bd> == Done Spying on channel SIP/NewTestHPBX1-00000204 -- Auto fallthrough, channel 'SIP/0550010090-00000206' status is 'UNKNOWN'