07-11-2012 05:18 PM - edited 03-14-2019 10:12 AM
Is there a Cisco UC product that can announce the caller when the phone rings? Can you pick and choose when to announce caller ID? We just want to announce calls that are delivered to the IPCC extension only based on the incoming DNIS. Environment is CUCM 7.1.3.31900-1; UCCX is 8.0.2.11004-12 Enhanced nonHA; and Unity is 7.0.(2).
Solved! Go to Solution.
07-12-2012 11:54 AM
Yep, here is a solution using a disctionary object within the script to map phones number to company names:
filename tts.vbs
dim args
set args = wscript.arguments
if args.count < 1 then wscript.quit(1)
dim tts, sentence, regex, number_matches, number_match, number_exploded, customers
set tts = createobject("sapi.spvoice")
set regex = new regexp
regex.global = true
regex.pattern = "\d+"
set customers = createobject("scripting.dictionary")
' Your company number to name mappings go here:
customers.add "6125551212", "ABC Widget Company"
sentence = ""
for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next
set number_matches = regex.execute(sentence)
for each number_match in number_matches
if customers.exists(number_match.value) then
sentence = replace(sentence, number_match.value, customers.item(number_match.value))
else
number_exploded = ""
for i = 1 to len(number_match.value)
number_exploded = number_exploded & mid(number_match.value, i, 1) & " "
next
number_exploded = left(number_exploded, len(number_exploded) - 1)
sentence = replace(sentence, number_match.value, number_exploded)
end if
next
wscript.echo sentence
tts.speak sentence
set tts = nothing
wscript.quit(0)
With that new script, it turns this:
cscript tts.vbs "Call from 6125551212"
In to this:
Call from ABC Widget Company
But keeps this:
cscript tts.vbs "Call from 6125551313"
Looking like this:
Call from 6 1 2 5 5 5 1 3 1 3
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-13-2012 09:47 AM
I don't think you can time it to coincide with the ringing, but if you simply want to play it more than once, you can use this updated version.
filename tts.vbs
dim args
set args = wscript.arguments
if args.count < 1 then wscript.quit(1)
dim tts, sentence, regex, number_matches, number_match, number_exploded, customers
set tts = createobject("sapi.spvoice")
set regex = new regexp
regex.global = true
regex.pattern = "\d+"
set customers = createobject("scripting.dictionary")
customers.add "6125551212", "ABC Widget Company"
sentence = ""
for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next
set number_matches = regex.execute(sentence)
for each number_match in number_matches
if customers.exists(number_match.value) then
sentence = replace(sentence, number_match.value, customers.item(number_match.value))
else
number_exploded = ""
for i = 1 to len(number_match.value)
number_exploded = number_exploded & mid(number_match.value, i, 1) & " "
next
number_exploded = left(number_exploded, len(number_exploded) - 1)
sentence = replace(sentence, number_match.value, number_exploded)
end if
next
wscript.echo sentence
' Adjust the second number, the 1, to a value of your choosing.
' At 1, it will only play once. At 2, it will play twice, and so on...
for i = 1 to 1
tts.speak sentence
wscript.sleep 1000
next
set tts = nothing
wscript.quit(0)
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-11-2012 06:30 PM
None that I know of.
But depending on what you are looking for in such a solution, you could use UCCX to use the Place Call step after the Select Resource Step, and before the Connect step to call the Selected Agent, and play the caller ID to the Agent, hang up, then Connect the Caller to the Agent.
Some people have used this before to mimic a whisper function.
Another option would be to leverage a CAD worflow action to launch an external application and play the caller ID through the PC speakers using something like this:
filename: tts.vbs
dim args set args = wscript.arguments if args.count < 1 then wscript.quit(1) dim tts, sentence set tts = createobject("sapi.spvoice") sentence = "" for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next tts.speak sentence set tts = nothing wscript.quit(0)
where you would call it like so:
c:\winnt\system32\cscript.exe c:\scripts\tts.vbs
Choosing the Calling Number as the only argument to pass to the script.
Happy whispering!
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-12-2012 07:54 AM
Anthony,
Thanks for the suggestion. I am currently utilizing CAD workflows to launch wave and Word documents from the customer's network drive and I'm finding that in 8.0.2 SU3 that they break every 3-4 months which is unacceptable for my customer (24/7 emergency center). I've had to fix this issue going on the 3rd time now with no real root cause or resolution as to why this occurs.
Given that I'm not a VBS expert I'm not sure what each line in the code above will do or where I refer to my wave files. Would you mind giving me details? I have created the file and stored locally and would like to test this out today. I'm assuming that the lines where sentence is mentioned that may be my file?
Thanks.
07-12-2012 08:50 AM
The script takes a command line parameter, and vocalizes it.
Example:
cscript tts.vbs "Hello, my name is Anthony."
This script does not play a wav file, rather it generates text to speach on the fly.
So if you wanted it to play the caller information, you could pass it the ANI as the parameter. The Run External Application action provides you the ability to pass the Calling Number to the application as a parameter. Unfortunately, it's limited to passing the parameters at the end of the exec string, so things like this would not be possible without script modification:
Example of what will not work:
cscript tts.vbs "A caller at " ani " is calling you."
That will not work, because the CAD action does not let you specify the parameter for ANI at an arbitrary location within the exec string. It only let's you use it at the end, like this:
Example of what will work:
cscript tts.vbs "Call from " ani
What I noticed during my testing is that the default behavoir of the tts engine is to read the phone number like a number and not like a string of digits.
Here's a patched version that fixes that:
filename tts.vbs
dim args
set args = wscript.arguments
if args.count < 1 then wscript.quit(1)
dim tts, sentence, regex, number_matches, number_match, number_exploded
set tts = createobject("sapi.spvoice")
set regex = new regexp
regex.global = true
regex.pattern = "\d+"
sentence = ""
for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next
set number_matches = regex.execute(sentence)
for each number_match in number_matches
number_exploded = ""
for i = 1 to len(number_match.value)
number_exploded = number_exploded & mid(number_match.value, i, 1) & " "
next
number_exploded = left(number_exploded, len(number_exploded) - 1)
sentence = replace(sentence, number_match.value, number_exploded)
next
tts.speak sentence
set tts = nothing
wscript.quit(0)
Now that new version would turn this:
cscript tts.vbs "Call from 6125551212"
Into this:
"Call from 6 1 2 5 5 5 1 2 1 2"
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-12-2012 10:55 AM
Thanks. What I would prefer to announce the name of the caller. If DNIS is xxxxx then announce "Call From ABC Widget Company" and to repeat a maximum of 3 times. Is that possible?
07-12-2012 11:54 AM
Yep, here is a solution using a disctionary object within the script to map phones number to company names:
filename tts.vbs
dim args
set args = wscript.arguments
if args.count < 1 then wscript.quit(1)
dim tts, sentence, regex, number_matches, number_match, number_exploded, customers
set tts = createobject("sapi.spvoice")
set regex = new regexp
regex.global = true
regex.pattern = "\d+"
set customers = createobject("scripting.dictionary")
' Your company number to name mappings go here:
customers.add "6125551212", "ABC Widget Company"
sentence = ""
for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next
set number_matches = regex.execute(sentence)
for each number_match in number_matches
if customers.exists(number_match.value) then
sentence = replace(sentence, number_match.value, customers.item(number_match.value))
else
number_exploded = ""
for i = 1 to len(number_match.value)
number_exploded = number_exploded & mid(number_match.value, i, 1) & " "
next
number_exploded = left(number_exploded, len(number_exploded) - 1)
sentence = replace(sentence, number_match.value, number_exploded)
end if
next
wscript.echo sentence
tts.speak sentence
set tts = nothing
wscript.quit(0)
With that new script, it turns this:
cscript tts.vbs "Call from 6125551212"
In to this:
Call from ABC Widget Company
But keeps this:
cscript tts.vbs "Call from 6125551313"
Looking like this:
Call from 6 1 2 5 5 5 1 3 1 3
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-12-2012 11:59 AM
Awesome. I will try this out as well.
07-12-2012 12:14 PM
You made me write way more vbscript today than I wanted to!!!
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-12-2012 12:25 PM
Well, I've been told that I can draw out water from a stone without really trying . Thank you again for my 101 on VBS.
07-13-2012 09:40 AM
Anthony,
I got the file to work but how to I get it to repeat more than once while the phone is ringing?
07-13-2012 09:47 AM
I don't think you can time it to coincide with the ringing, but if you simply want to play it more than once, you can use this updated version.
filename tts.vbs
dim args
set args = wscript.arguments
if args.count < 1 then wscript.quit(1)
dim tts, sentence, regex, number_matches, number_match, number_exploded, customers
set tts = createobject("sapi.spvoice")
set regex = new regexp
regex.global = true
regex.pattern = "\d+"
set customers = createobject("scripting.dictionary")
customers.add "6125551212", "ABC Widget Company"
sentence = ""
for i = 0 to args.length - 1: sentence = sentence & args.item(i) & " ": next
set number_matches = regex.execute(sentence)
for each number_match in number_matches
if customers.exists(number_match.value) then
sentence = replace(sentence, number_match.value, customers.item(number_match.value))
else
number_exploded = ""
for i = 1 to len(number_match.value)
number_exploded = number_exploded & mid(number_match.value, i, 1) & " "
next
number_exploded = left(number_exploded, len(number_exploded) - 1)
sentence = replace(sentence, number_match.value, number_exploded)
end if
next
wscript.echo sentence
' Adjust the second number, the 1, to a value of your choosing.
' At 1, it will only play once. At 2, it will play twice, and so on...
for i = 1 to 1
tts.speak sentence
wscript.sleep 1000
next
set tts = nothing
wscript.quit(0)
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
07-13-2012 10:06 AM
THANK YOU!!!!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide