Hi Philippe,
For inbound calls i use a custom context in extension_custom.conf
‘extensions.conf’
[from-internal]
include => chanspy-group
‘extensions_custom.conf’
[chanspy-group]
exten => 585044706,1,Set(SPYGROUP=Techsupport)
exten => 585044706,n,Set(__FROM_DID=${EXTEN})
exten => 585044706,n,GotoIf($[ “${CALLERID(name)}” != “” ] ?cidok)
exten => 585044706,n,Set(CALLERID(name)=${CALLERID(num)})
exten => 585044706,n(cidok),Noop(CallerID is ${CALLERID(all)})
exten => 585044706,n,SetMusicOnHold(dbd)
exten => 585044706,n,Set(__MOHCLASS=dbd)
exten => 585044706,n,Set(FAX_RX=disabled)
exten => 585044706,n,Playback(for-quality-purposes&this-call-may-be&recorded)
exten => 585044706,n,Goto(from-did-direct,44706,1))
this works fine. this for testing. in future i will use a pattern to select the needed extensions.
for incomming outgoing calls i tried this
‘extensions_custom.conf’
[from-internal-custom]
exten => _0ZXXX.,1,GotoIf($"[${CALLERID(num)}" = “_44.]”?SPYGROUP:weiter)
exten => _0ZXXX.,n(SPYGROUP),Set(SPYGROUP=Techsupport)
exten => _0ZXXX.,n(weiter),Macro(dialout-trunk,2,${EXTEN},)