cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2014
Views
0
Helpful
15
Replies

Please help with an ICM script editor syntax question.

rehdancer
Level 1
Level 1

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 !!

15 Replies 15

geoff
Level 10
Level 10

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

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.

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

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.

If you wanted to record a new prompt for 90210 would the new name be 90210_9002.wav based on your example?

david

Yes

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

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.

I'm assuming there is just some background stuff we don't know as this solution is making less and less sense.  Why do you have to use a new identifier (9xxx) why couldn't you just identify the prompt by the zipcode and replace the old file with the new one named the same.

david

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.

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

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.

OK, thanks for the clarification. I'll have to look up the info on AnyPrompt to see how it works.

Regards,

Geoff

How high can this 9XXX number go?  How often do they change?  I still think the long term solution is to go back to the way it was.

david