thevoipman
thevoipman

Reputation: 1833

asterisk phpagi dial into chanspy

I am trying to use phpagi with asterisk to send into chanspy but looks like it's not working. Please help if you can, thank you in advance:

Here's what I got so far:

    if($keys=="8888") {
        $agi->exec("DIAL","Chanspy(SIP/,q)");
}

Upvotes: 0

Views: 1968

Answers (1)

MichelV69
MichelV69

Reputation: 1212

You do not "Dial()" to "Chanspy". Chanspy is it's own application and handles the call bridging itself. You have to set a "group" to spy on, or address a specific channel.

Here's a simple way to it with security on the Barge/Spy:

[macro-jkl5_barge_code]
;   ${ARG1} - Extension that is monitoring
    exten =>s,1, NoOp(Extension Barge & Whisper)
     same => n, Answer()
     same => n, NoCDR
     same => n, Authenticate(12345)
     same => n, Wait(1)
     same => n, NoOp(** DEBUG: [${SPYGROUP}] )
     same => n, ChanSpy(SIP/${ARG1}|qg(${SPYGROUP}))  
     same => n, Hangup()

... be sure to set "SPYGROUP" somewhere in your call path. Then just call this macro where ever you need it from.

You'll have to do your own reading on how to use it from inside an AGI. The above code is just to give you a sense of how it's used within a dialplan.

Further Reading: http://www.the-asterisk-book.com/unstable/applikationen-chanspy.html

Upvotes: 1

Related Questions