SupportTeam Report post Posted 02/05/2003 12:35 AM 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
SupportTeam Report post Posted 02/05/2003 12:35 AM 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
SupportTeam Report post Posted 02/05/2003 12:36 AM 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
greiner Report post Posted 02/12/2003 10:58 PM 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