Spy incoming call without answering it

hi,

I am just eager to know is this scenario possible or not ? Any help and comment will be appreciated.

Inbound call comes in to my asterisk server, the caller hears the ringing tone. Meanwhile my asterisk server calls me in and prompts me for the accept the call or decline ? if i choose decline i want to hear what is caller is saying on the phone without answering the call?

[local-exten]

exten => _XX.,1,NooP
exten => _XX.,n,Dial(SIP/19010|TtroM(accept-decline))
exten => _XX.,n,hangup

[macro-accept-decline]

exten => s,1,NooP
exten => s,n,Read(ACCEPT|incoming-call|1)
exten => s,n,GotoIf($["${ACCEPT}" = “1” ] ?yes:no)
exten =>s,n(no),MACROEXIT
exten => s,n(yes),SET(MACRO_RESULT=) ; call connects

now how can i listen to the caller without answering the incoming call?

How do you intend to get the caller’s legal consent, which would be a legal requirement in many countries and an ethical one in the rest?

In any case most networks would not allow any inbound speech before the call is formally answered, because it would allow people to make free calls.

this is a similar function that google voice offers to it’s users, you can screen the call while they are leaving a voice mail.

That’s post answer.

Thank you guys ! i was just eager to know was the possible or not ! Thanks for the information appreciated !!