02-07-2011 05:54 AM - edited 03-14-2019 07:19 AM
I need to modify a set variable node. What I have now is Call.PeripheralVariable8+".wav" and this works. What I need it to say is Call.PeripheralVariable8+anything+".wav" but when I insert an * for the anything it's seen as a multiplier. What's the syntax to do this? The anything I need to add is _9xxx where xxx are other numbers, but the _9 will be in all, if that helps any. Thanks in advance !!
02-07-2011 08:02 AM
You can use the concatenate() function to build up your string, as you no doubt know.
As far as the wildcard goes ... your intention must be to try to SET the call variable and later on test the call variable with an IF node. Is that right?
You would be able to test parts of the string using the substr() function - which is based on character position. If that is a fixed value that you know, it's easy. If it's not, you can first use the find() function to locate something (like the "_9"), returning the position, and then use the substr() function to pull it off.
Can you write some pseudo-code here to define exactly your intention? You can set up a dummy script and send a dummy call through using Call Tracer and watch the output to see how your code is working.
Regards,
Geoff
02-07-2011 08:35 AM
Right, I'm actually trying to set the call variable to a zipcode wav file name. The original script just named the wav file to zipcode.wav, whatever the 5-digit zip code is. Then the script looked for that peripheral variable, whose value contained the caller-entered zip code. Easy enough for me to understand. However, due to an "upgrade" all the zipcode files must now be named zipcode_9xxx.wav in order to be re-recorded for each year. The _9xxx is used by the recording application to identify the .wav file to be recorded or re-recorded. The script will still look for the peripheral variable for the zipcode so that can stay the same and it won't use the 9xxx for anything. The only effect that I can see in the script is that the variable needs to be set to the new filename structure, which is PeripheralVariable89xxx.wav.
02-07-2011 08:42 AM
I think I understand what you're doing and to be honest it makes no sense.
To start you have a zipcode 90210 and you had a prompth called 90210.wav. Now you have what could be multiple prompts 90210_9000.wav and 90210_90001.wav, 90210.9002.wav, correct? How do you know which on to play?
My recommendation is that you've just made your life a lot more difficult by this upgrade. Can the application you're using just tag the wav file properties? At the end of the day if you're trying to use some wildcard in ICM, it's not going to work. There's way around this, but none will be easy.
david
02-07-2011 08:47 AM
Not quite - I have 90210_9001.wav, 90245_9002.wav, 90283_9003.wav where the 90xxx is the zip code entered by the caller and the _9xxx is the identifier to the recording software.
02-07-2011 08:56 AM
02-07-2011 09:00 AM
Yes
02-07-2011 09:18 AM
why not simply have folders for each year on your media store:
en-us/app/FOO/zipcodes/9001/
en-us/app/FOO/zipcodes/9002/
etc.
Each folder contains files named using the old method - 90210.wav, 95129.wav etc
Set the app_media_lib according to the year.
Regards,
Geoff
02-07-2011 09:53 AM
These are not years, they are identifiers needed by the prompt recording application (AnyPrompt). You have to key in these numbers so AnyPrompt knows which file you're recording. It looks at the number string in the filename, that's why it has to be there. They do not change every year, or at all, but the recording content itself changes every year.
02-07-2011 10:03 AM
02-07-2011 10:19 AM
We're having to add this identifier in order for the new prompt recording application (AnyPrompt) to see it. What you're suggesting is exactly the way we've done it in the past using the Windows Sound Recorder app. And in fact AnyPrompt works just fine for all the other .wav files we use in our scripts that don't do a search based on caller-entered digits. We may just have to do the rename, annoying as it is. At least it only happens once a year.
02-07-2011 11:08 AM
Ruth,
This AnyPrompt sounds a bit strange.
Are you saying if you had a prompt called "main_menu.wav" it can find it and allow you to re-record it, but if there is a prompt called 12345.wav then it cannot find it and allow you to re-record?
Regards,
Geoff
02-08-2011 05:32 AM
No, I'm not saying that - it wouldn't find either of them. The name of the .wav files must contain a number that is known to AnyPrompt. Because we're hosted, we've been assigned the 9000 series of numbers to use for our .wav files. So the name of the file must contain a 9xxx number, hence the zipcode_9xxx.wav naming convention.
02-08-2011 08:38 PM
OK, thanks for the clarification. I'll have to look up the info on AnyPrompt to see how it works.
Regards,
Geoff
02-07-2011 09:23 AM
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