Show different for incoming calls vs transfered calls

I was just tinkering around and if your deskphones are supporting the diversion header like our Yealink phones you could add a diversion header like the following.
Use it in production at your own risk !

globals_custom.conf:

TRANSFER_CONTEXT = blind-transfer-diversion

extensions_custom.conf:

[blind-transfer-diversion]
exten => _X.,1,NoOp(Entering blind-transfer-diversion)
exten => _X.,n,NoOp(Blindtransfer: ${BLINDTRANSFER})
; Strip out the number which transfers the call.
exten => _X.,n,Set(sourceExt=${CUT(CUT(BLINDTRANSFER,-,1),/,2)})
exten => _X.,n,Set(sourceName=${DB(AMPUSER/${sourceExt}/cidname)})
exten => _X.,n,Set(REDIRECTING(from-num,i)=${sourceExt})
exten => _X.,n,Set(REDIRECTING(from-name,i)=${sourceName})
exten => _X.,n,Set(REDIRECTING(count,i)=1)
exten => _X.,n,Set(REDIRECTING(reason,i)=cf_dte)
exten => _X.,n,Dial(Local/${EXTEN}@from-internal)
exten => _X.,n,Hangup()

So on the target phone there will be displayed the transferred number (“Von:” means “From:”) and the persons name and extension number who is transfering the call (“Via:”).

diversion header