Barge into a phone call

Add below snippet to extensions_custom.conf. Reload asterisk and you’re good to go. To listen on extension 123, simply dial *222123.

[ext-local-custom]

;listen
exten => _*222x.#,1,Macro(user-callerid,)
exten => _*222x.#,2,Answer
exten => _*222x.#,3,NoCDR
exten => _*222x.#,4,Wait(1)
exten => _*222x.#,5,ChanSpy(sip/${EXTEN:4},q)
exten => _*222x.#,6,Hangup

;whisper
exten => _*223x.#,1,Macro(user-callerid,)
exten => _*223x.#,2,Answer
exten => _*223x.#,3,NoCDR
exten => _*223x.#,4,Wait(1)
exten => _*223x.#,5,ChanSpy(sip/${EXTEN:4},qw)
exten => _*223x.#,6,Hangup

;barge
exten => _*224x.#,1,Macro(user-callerid,)
exten => _*224x.#,2,Answer
exten => _*224x.#,3,NoCDR
exten => _*224x.#,4,Wait(1)
exten => _*224x.#,5,ChanSpy(SIP/${EXTEN:4},qB)
exten => _*224x.#,6,Hangup

If you required password authentication use the below code
exten => _*222x.#,n,Authenticate(8888)

You can replace 8888 with the pin you want to use to authenticate.

2 Likes