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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with the responce that a mailbox number is already deleted

Status
Not open for further replies.

jrvilla1

Technical User
Apr 3, 2003
7
US
I have a script that reads an input file that contains voicemail box numbers that need to be deleted.
There can be over 10,000 mailboxes on the system. Only up to 4,000 of those will come and go.
This is an activity that will happen during three different times of the year.
There might be times when voicemail box numbers are deleted one at a time, yet not tracked when the major deletion is required.

Need help with the responce from the voice mail system that an input file record contains a mailbox number that is already deleted. Other than that it works just fine



This is the action section of my script.

;
INTEGER LOOPFLAG
proc main ;Beginning of main procedure
string szFile ;File name to be entered to be opened for data
string szLine ;Variable to store line from file.
string szMbxno ;String for mailbox number
string szUsername ;String for user name, for reference only
;
usermsg "This Script -SD201AM- will DELETE the following mailboxes, the Dorm Shared Extension, Members for Student Dorm and Basic Student."

sdlginput "Input -.txt- File Name Entry" "Enter the whole File name:" szFile
usermsg "the file name entered is :%s!" szFile
;******************************************************************

FOPEN 1 szFile READ TEXT ;OPEN FILE IN READ MODE ONLY
;
IF FAILURE ;IF FILE OPEN FAILS DISPLAY ERR MSG
ERRORMSG "Couldn't open :%s!" szFile "For Input"
EXIT ;EXIT SCRIPT
ENDIF
;
WHILE 1 ;LOOP FOREVER
FFLUSH 1
FGETS 1 szLine ;Get a line from the file and extract the
;
IF FEOF 1 ;IF EOF REACHED ..
EXITWHILE ;JUMP OUT OF WHILE LOOP
ENDIF
; Seperate the field data
;
strtok szMbxno szLine "|" 1 ; Mailbox number
strtok szUsername szLine "|" 1 ;Mailbox User Name
; End of the line of data needed
;
; Now to Delete the mailbox data
;
;
TRANSMIT "adelete " ;QNX batch mode command
TRANSMIT "^M"
WAITFOR "Mailbox to delete :" 1 ; waiting
TRANSMIT szMbxno ;variable from file mailbox NUMBER
TRANSMIT "^M"
;
; Some where in here it needs to get to the end section to read in a new record
; If the mailbox does not exist
;

waitfor "Delete UI Mailbox Mapping(s) ? "
transmit "y^M"
WAITFOR "Delete (y/n) [N]: " 1
TRANSMIT "Y ^M"
waitfor "Delete this block of mappings: (Y/N) [N] "
transmit "y^M"
TRANSMIT "^M" ;SEND CARRIAGE RETURN to force next responce back
WAITFOR "Mailbox to delete :" 1 ; waiting
TRANSMIT "^M" ;SEND 2nd CARRIAGE RETURN to force # back
WAITFOR "#" 1 ;WAIT 5 SECONDS FOR COMMAND COMPLETION
PAUSE 1 ; Pause one second
;
;
;******************************************************************
; Created the required data for a Mailbox, get more data input *
;******************************************************************
; end of the mailbox on to the next
CALL CMD_PMPT ;WAIT FOR # PROMPT LOOP
;
ENDWHILE


Here is what happens. It works fine when it deleted --Mailbox 27321 --
===========================================
# adelete

Mailbox to delete: 27321
Delete UI Mailbox Mapping(s) ? y
MAILBOX: 27321 Created: 08/11/03 3:36 pm
MSGS: 0 UNPLAYED: 0 URGENT: 0 RECEIPT: 0
LCOS: : 4 FCOS: : 68
GCOS: Default GCOS 1 : 1 NCOS: Default : 1
TCOS: Default TCOS 1 : 1 RCOS: : 1
BAD LOGS: 0 LAST LOG: NEVER MINS: 0.0
PASSWD: Y TUTOR: N DAY: 2 NIGHT: 2
SPEECH QUALITY - NAMES/GREETS:0 MESSAGES:0
NAME: ENDO-FELLOWS CODE: 27321
EXTEN: 27321 INDEX: 0
ATTEN DN: 59200 INDEX: 0
ACCESS: NONE NOTIFICATION DISABLED: N
INTERNAL INDEX: NONE BILLED INDEX: NONE NON-BILLED INDEX: NONE
MWI #01: Unified Integrations
FAX RETRIEVAL ACCESS TYPE: NONE
FAX DEFAULT TELEPHONE NUMBER: NONE
CALL PLACEMENT ACCESS TYPE: NONE TIME ZONE OFFSET: 0
DISTRIBUTION LISTS WITH CHANGE RIGHTS:
2 3 4 5 6 7 8 9
DISTRIBUTION LISTS WITH REVIEW RIGHTS:
2 3 4 5 6 7 8 9


Delete (y/n) [N]: Y
Mailbox 27321 deleted.

MAILBOX: 000000000027321 EXTENSION: 000000000027321 SWITCHGROUP: 01
TENANT: 01 IN PERMISSION: YES OUT PERMISSION: YES
NO ANSWER GREETING: 0 BUSY GREETING: 0 ALL CALL GREETING: 0

Delete this block of mappings: (Y/N) [N] y
Block of mappings deleted.

Mailbox to delete:
#
#
# adelete

Mailbox to delete: 12345
Delete UI Mailbox Mapping(s) ? y
**** Mailbox 12345 does not exist.

Mailbox to delete: Y
Enter a number in the range, 1 to 99999999999
or a range of mailboxes separated by a hyphen

Mailbox to delete:
#
======================

I need the script when it sees from the Voicemail system the "does not exist" responce to
not send a "Y" but to send a new read from the input source file.

Some such as.. waitfor "does not exist" 1 (if there is no responce such as this to continue. But if there is a responce to jump to the CALL CMD_PMPT.)

Thanks
 
I've got a script on my site that another user sent to me that may be of use to you (I've used it in a couple scripts I've written). What it does is set up three when target commands (would only want two in your case), then sets a global variable that specifies which string (1, 2, or 3) was received while the procedure was running. Based on that setting, your script would know what response was received and which commands should now be sent. You can find it here:


Another option is just to have two when target commands keying off unique strings returned in the case where a mailbox is deleted and when it does not exist. The two called procedures would have the commands that are currently in your main script, so most of the processing would occur there.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top