VoiceGuide IVR Software Main Page
Jump to content

Split Callerid Information Into Components

Recommended Posts

My telephone service (Vonage) is sending 11 digits (1-XXX-XXX-XXXX) as the calling number in the callerid string.

 

I would like to be able to split the calling number into it's North American fields (NPA, NXX, Station) for database queries.

 

I beleive the evaluate module may be the way to go here, but I'm not familiar with it's expressions.

Share this post


Link to post

You'll need to write a VB Script in th eRun VBS module and in it use the right(), left() and mid() functions to extract the 3 fields - then you can seave them in the results file so that they will be available as "result variables" throughout the rest of the script.

Share this post


Link to post

Thanks for pointing me in the right direction.

 

 

I'm more of a Unix guy, so I used some cygwin utilities to do virtually the same thing.

 

This example just strips the leading "1".

 

In the run program module I use this command:

C:\splitdn.bat $RV_CIDNUMBER > c:\shlreslt.txt

 

The splitdn.bat file looks like this:

@echo %1 | c:\cygwin\bin\gawk '{print "[dn]{"substr($0,2,3) substr($0,5,3) substr($0,8,4)"}"}'

 

The output in the shlreslt.txt file looks like this:

[dn]{6123625800}

Share this post


Link to post

If you are using VB there is a better function than right, left, mid. It's called split.

 

Example:

 

 

Dim x() as string

dim y as string

 

 

y="1-888-555-1212"

 

x = split(y,"-")

 

 

Results:

 

x(0) = "1"

x(1) = "888"

x(2) = "555"

x(3) = "1212"

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×