I want to do something similar in that I want to manipulate the Caller ID Name field to show the department the caller has rung. I have a number of different telephone numbers coming in and a small number of actual phones which serve multiple uses, ie. a phone could be phone tech support or sales so the person answering needs to know what number was rung, or at least what dept.
The way I have done this in the past is to overwrite the Caller ID name field as it is rarely supported or used so that their phone will display first the department required and then the caller's number, ie. SALES: 1234 5678
I cannot get this to work with SAIL. I have tried using the tags in the Trunk definitions but it only seems to append the text and if the caller is unknown it won't seem to do it at all.
So I have written a small custom app which is where the calls go first and it manipulates the Caller ID Name field but I must be making a dumb mistake, at the end it just tells me the extension is unavailble and quotes the telephone number not the extension number. How do I pass it back?
This is what I have:
[macro-CallerName]
; ARG1 = Caller ID Name to display on phone
exten => s,1,Set(BLOCKED=$[${CALLINGPRES} / 32])
exten => s,2,GotoIf($["${CALLERIDNUM}" = ""]?4:6)
exten => s,3,GotoIf($[${BLOCKED} = 0]?6)
exten => s,4,SetCallerPres(allowed)
exten => s,5,Set(CALLERID(number)=private)
exten => s,6,Set(CALLERID(name)=${ARG1})
[inSales]
; exten => s,1,Wait(1)
exten => s,1,Macro(CallerName, 'SALES:') ; Set caller display information
exten => s,2,agi(selintra,Inbound,${EXTEN})