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

Sending a CR until recognised text received

Status
Not open for further replies.

norlee

Technical User
Feb 14, 2007
41
GB
Hello, I need some help with a script for building phones on a Nortel phone system, hopefuly it's not too difficult, but I'm not a scripter so am struggling now.

The problem is that some prompts only appear for some types of phone, any recorded script can only cope with the same type of phone otherwise the lack of (or inclusion of) extra prompts throws the script out.

I can get the script to read variables (phone type, hardware address etc) from a csv file, but for all other prompts I simply want to send a CR.

Here's an example:


REQ: new
TYPE: 2616 <<< from csv file
TN 0 1 3 7 <<< from csv file
DES test <<< from csv file
CUST 0
AOM
ERL
FDN 7000 <<< from csv file
TGAR
LDN
NCOS 5 <<< from csv file
RNPG

REQ: new
TYPE: 3904 <<< from csv file
TN 0 1 3 7 <<< from csv file
DES sale <<< from csv file
CUST 0
KBA
DBA
ERL
FDN 7000 <<< from csv file
TGAR
LDN
NCOS 3 <<< from csv file
RNPG
SSU

As you can see entering phone type 2616 means the next prompt is 'AOM' whereas if the phone type was a 3904 then next prompt would be 'KBA'

Can anyone suggest a way to have my script just send CR's to all received text until a desired bit of text is received?
 
I'm not 100% clear on the problem without your recorded script, but there are two possible solutions. One is that you could use a couple when target commands to search for each string then the procedure that is called could use transmit "^M" to clear that particular prompt. The second option would be to use the waitlist code that another user here came up with some time back to look for multiple prompts and let the calling procedure know which, if any, was received first. You can find it at the link below and there is some discussion of it on the thread just previous to this one if you have any questions.


 
Thanks knob, as wlways helpful and quick, you're a star.

I'll have a crack at this early next week and let you know how it goes.

Cheers!
 
I don't think there is much point in tunkering with my 2nd rate script when firebirdscrambler has just posted what looks to be a monster of a script that does all I want and probably a whole lot more!

This is the thread that applies:
Brilliant stuff firebirdscrambler!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top