Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collect digits in variables and pass them no matter how many they are 4

Status
Not open for further replies.

JuanAvaya

Technical User
Jul 27, 2015
83
AR
Hi everyone,
Need help on this scneario(CM 6.3):

Callers fell into a vector where they are requested to enter their ID that can vary between 8 and 10 digits. that information is sent via TSAPI to another application.
I have set up a variable asaiuui that accepts 10 digits and created a vector as follows...

CALL VECTOR

Number: 2002 Name: Encuesta?
Multimedia? n Attendant Vectoring? n Meet-me Conf? n Lock? n
Basic? y EAS? y G3V4 Enhanced? y ANI/II-Digits? y ASAI Routing? y
Prompting? y LAI? y G3V4 Adv Route? y CINFO? y BSR? y Holidays? y
Variables? y 3.0 Enhanced? y
01 wait-time 2 secs hearing silence
02 collect 10 digits after announcement 56321 for none
03 set J = none CATR digits
04 route-to number V1 with cov y if unconditionally
05 goto step 2 if unconditionally
06 stop


When I call and enter 10 digits, the whole number is passed with no problem. However, if I enter 8 digits followed by # the call connects successfully but the collected digits are not sent. It seems it always expects 10 digits.


Regards
 
Silly question, but will the other application accept anything other than 10 digits?

How is variable J defined? Is it set for 10 digits?
If so, what is probably happening is that J is being set to your collected digits with zeros at the front to make a full 10-digits.
When callers enter 12345678 then J becomes "0012345678". Can your application figure out the ID from that or do you need to just send the correct digits?

If you want to just pass 8, 9, or 10 digits without extra zeros then the simplest way is to collect the digits directly into J:

02 collect 10 digits after announcement 56321 for J

and remove line 3. Variable J will then only be the dialed digits without extra zeros.

Now if you want to collect a totally random number of digits....

I wrote a vector that looks at Caller ID (ANI) and will read back the digits. It works for any length extension or full number (up to 16 digits). It uses system variables so you must have the appropriate CM licenses. You're already using system variable so you should be all set.

The vector can count how many digits were entered and can be modified to look at a specific digit, if you really want to. In this vector the ANI is stored in a global vector BK but probably don't need to do that.

It works because of how the variables are defined and how select (SEL) works with the SET command.
Variable BH is a single digit. When you try to assign a value that is larger, then BH will only accept the first digit.
So when BK is "23456" and we SET BH = BK SEL 3, the digits are selected from the RIGHT, giving us a value of 456. Only three digits were selected.
But BH is only a single digit so it stores the FIRST assigned digit, 4.
BI is then assigned our base announcement value (921000) plus BH to yield 921004, which, when played, is a recording saying "four".

Code:
                              VARIABLES FOR VECTORS

Var Description                 Type    Scope Length Start Assignment       VAC
BC  
BD
BE  
BF
BG
BH  Digit Collect Digit         collect L     1      1
BI  Digit Collect Digit Ann     collect L     6      1
BJ  Digit Collect Total Digits  collect L     2      1
BK  Digit Collect Full Number   collect G     16     1     
BL  Digit Copy of Full Number   collect L     16     1
BM  Digit ANI (Caller ID)       ani     L     16     1

Code:
    Number: 5051             Name: Speak Caller ID                              
Multimedia? n      Attendant Vectoring? n    Meet-me Conf? n           Lock? n  
     Basic? y   EAS? y   G3V4 Enhanced? y   ANI/II-Digits? y   ASAI Routing? y  
 Prompting? y   LAI? y  G3V4 Adv Route? y   CINFO? y   BSR? y   Holidays? y     
 Variables? y   3.0 Enhanced? y                                                 
01 #    Reads the Caller ID (ANI)                                               
02 #                                                                            
03 #    ----------------------------------------------------------------------- 
04 #                                                                            
05 goto step    10            if BM               >=     0                      
06 #    Did not get any Caller ID Info.                                         
07 announcement V5                                                              
08 stop                                                                         
09 #    ----------------------------------------------------------------------- 
10 #    Find Number of Digits (BJ)                                              
11 set          BJ     = none   ADD   17                                        
12 set          BJ     = BJ     SUB   1                                         
13 #    Starting with 16 Digits, compare to original to find the actual Number  
14 #    of digits.                                                              
15 set          BK     = BM     SEL   BJ                                        
16 goto step    12            if BM               <>     BK                     
17 #    Once BK = the entered Digits, we know the total number of digits.       
18 #    At this point, BJ = total digits.                                       
19 #    ----------------------------------------------------------------------- 
20 announcement V2                                                              
21 #    Begin Loop for reading back Digits                                      
22 set          BH     = BM     SEL   BJ                                        
23 #    Make the Single Digit into the Appropriate Announcement Extension        
24 set          BI     = BH     ADD   921000                                    
25 announcement BI                                                              
26 set          BJ     = BJ     SUB   1                                         
27 goto step    21            if BJ               >      0                      
28 #    End Loop for reading back digits                                        
29 #    ----------------------------------------------------------------------- 
30 stop

VDN Variables
V2 - announcement "The number is"
V5 - announcement "No Caller ID was found"

The announcements used for the individual digits:
Code:
                           ANNOUNCEMENTS/AUDIO SOURCES
Announcement                                                  Source      Num of
Extension             Type       Name                        Pt/Bd/Grp    Files
921000                integrated Digit_Zero                   G2          14
921001                integrated Digit_One                    G2          14
921002                integrated Digit_Two                    G2          14
921003                integrated Digit_Three                  G2          14
921004                integrated Digit_Four                   G2          14
921005                integrated Digit_Five                   G2          14
921006                integrated Digit_Six                    G2          14
921007                integrated Digit_Seven                  G2          14
921008                integrated Digit_Eight                  G2          14
921009                integrated Digit_Nine                   G2          14

 
Thanks for the answer.

I tried collecting directly to the variable as you said, but digits are not sent that way. Besides, I do not see that the number is completed with zeros when they are not 10 digits. That would work I believe...

I need to take a deep look to your vector and see if something comes up.


Variable J is set to 10 digits

Below is the vector configuration
Number: 2004 Name: prueba colecta
Multimedia? n Attendant Vectoring? n Meet-me Conf? n Lock? n
Basic? y EAS? y G3V4 Enhanced? y ANI/II-Digits? y ASAI Routing? y
Prompting? y LAI? y G3V4 Adv Route? y CINFO? y BSR? y Holidays? y
Variables? y 3.0 Enhanced? y
01 wait-time 2 secs hearing silence
02 collect 10 digits after announcement 56321 for none
03 set J = none CATR digits
04
05 route-to number 56998 with cov n if unconditionally
06 goto step 2 if unconditionally
07 stop
08


This is a trace of it working as intended, entering 10 digits
LIST TRACE VDN

vec
time prt st data

11:34:28 TRACE STARTED 09/30/2015 CM Release String cold-03.0.124.0-21106
11:34:30 0 0 ENTERING TRACE cid 378
11:34:30 2004 1 vdn e6199 bsr appl 0 strategy 1st-found override y
11:34:30 2004 1 wait 2 secs hearing silent
11:34:33 2004 2 collect 10 digits after annc 56321 for none
11:34:33 2004 2 announcement: board 001V9 ann ext: 56321
11:34:39 2004 3 set J = none CATR digits
11:34:39 2004 3 operand = []
11:34:39 2004 3 digits = [1234567895]
11:34:39 2004 3 ========= CATR =========
11:34:39 2004 3 variable J = [1234567895] asaiuui local
11:34:39 2004 3 asaiuui chg from [] to [1234567895]
11:34:39 2004 4 <blank>
11:34:39 2004 5 route-to number 56998 cov n if unconditionally




...and here an example with 7 digits, not sending them

vec
time prt st data

11:41:52 TRACE STARTED 09/30/2015 CM Release String cold-03.0.124.0-21106
11:41:55 0 0 ENTERING TRACE cid 533
11:41:55 2004 1 vdn e6199 bsr appl 0 strategy 1st-found override y
11:41:55 2004 1 wait 2 secs hearing silent
11:41:57 2004 2 collect 10 digits after annc 56321 for none
11:41:57 2004 2 announcement: board 001V9 ann ext: 56321
11:42:02 2004 3 set J = none CATR digits
11:42:02 2004 3 operand = []
11:42:02 2004 3 digits = [1234567]
11:42:02 2004 3 ========= CATR =========
11:42:02 2004 3 variable J = [] asaiuui local
11:42:02 2004 3 variable J = [] NO CHG!-ASAIUUI VAR LENGTH?
11:42:02 2004 4 <blank>
11:42:02 2004 5 route-to number 56998 cov n if unconditionally





 
Oh, right. You did say asaiuui for the variable, didn't you. Oops.

In that case you must assign 10 digits to variable J. That's what the "NO CHG!-ASAIUUI VAR LENGTH?" in the trace is telling you. The value length isn't the same as the variable length.

Change line 3 to Set J = digits sel 10. That will force leading zeros into the dial string if there are less than 10 digits.
 
That did the trick!!!

Thanks a lot mate, we are good to go now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top