Hiding the Caller’s Number from Employees



Last updated
Was this helpful?
Was this helpful?
load => func_md5.so[dial_create_chan-custom]
exten => s,1,NoOp()
; Only for incoming calls
same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local" || "${FROM_DID}x" == "x"]?return)
; No processing required if an internal number is calling
same => n,ExecIf(${DIALPLAN_EXISTS(internal,${CONNECTEDLINE(num)},1)}?return)
; No processing required if the number is not in the list
same => n,ExecIf($[${DIALPLAN_EXISTS(bluring-extensions,${CHANNEL(endpoint)},1)} == 0]?return)
; Retrieve the cached number
same => n,Set(blNumber=${CONNECTEDLINE(num):-4}*${MD5(${CONNECTEDLINE(num)})})
same => n,Set(DB(bluring/${blNumber})=${CONNECTEDLINE(num)})
; Replace the caller ID
same => n,Set(CONNECTEDLINE(num)=${blNumber})
same => n,Set(CONNECTEDLINE(name)=${blNumber})
same => n,return
[bluring-extensions]
; Allow number substitution for extension 201
exten => 201,1,NoOp()
; Allow substitution for all four-digit extensions
exten => _XXXX,1,NoOp()[all_peers](+)
exten => _XXXX*.,1,Set(number=${DB(bluring/${EXTEN})})
same => n,ExecIf($["${number}x" == "x"]?hangup)
same => n,Goto(all_peers,${number},1)