| |||||||||
![]() | | ||||||||
| |||||||||||||||
| |||||||||||||||
| Siemens / Rolm Ask Questions and Find Answers: MD110, HiCom, HiPath, 7000, 8000, and 9000 Series Systems |
| Tags: mail, phone, rolm, scripts |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #11 (permalink) | ||||||||
| Junior Member ![]() icetea has no status.
Location: Radford Va. Rep Power: 7 ![]() | CORPORATE DIRECTORY Ok here is what I've got so far. It has six error's that I haven't figured out yet. Hoping someone out there can help. This script is writen for Rolm/Siemens PhoneMail ver 6.4 it is used to change the phatom number of a phone. The first is the script the second is the txt file that is used. File 1 proc main string sLine ;Line read from text file integer iLen ;Integer to hold length of read string string sExtOne ;First extension from line read from text file string sExtTwo ;Second extension if fopen 0 "test1.txt" READ ;Open text file while not feof 0 ;While there is data to be read from the text file fgets 0 sLine ;Get line of data strlen sLine iLen ;Find length of line if iLen == 0 ;If zero, then we have read a blank line and are at the end exitwhile ;Exit while loop endif strtok sExtOne sLine "," ;Get data before the comma strreplace sExtOne "`"" "" ;Delete quotes from the string sExtTwo = sLine strreplace sExtTwo "`"" "" ;Delete quotes from remaining data strreplace sExtTwo "," "" ;Get rid of extra comma strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too endwhile endif fclose 0 endproc integer flag=0 string sEnter = "^M" string Fname = "TESTING1.txt" ; File name to be opened. integer nJumps string sLine string sTok1 when Target 0 "Extension [" call Press_Enter when Target 1 "Name (last first) :" call Press_Enter when Target 2 "Class Number :" call Press_Enter When Target 3 "Extension 1" Call Press_Enter When Target 4 "Extension 2" ; set txpace=100 setjmp 0 nJumps ; This is a Jump Mark Point fgets 0 sLine ; Get line from file. strtok sTok1 sLine " " 1 ; Assigns Text in First Field (From Text File) to Variable sTok1. strreplace sLine " " "" waitfor "Subscriber Name or Extension: " 10 transmit sTok1 ; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System. transmit "^M" if waitfor "Function: " transmit "PROFILE^M" waitfor "Action: " transmit "MODIFY^M" waitfor "Subscriber Name or Extension: " transmit sTok1 ; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System. transmit "^M" else ; do nothing? let Target handle it? endif endwhile setjmp 1 nJumps fclose 0 ; Close file opened for read. ; Logout Procedure ---------- waitfor "Subscriber Name or Extension: " transmit ";^M" waitfor "Function: " transmit "logo^M" waitfor "Action: " transmit "logo^M" else errormsg "Couldn't open file `"%s`"." Fname endif proc Announce ;pause 1 transmit "T T T^M" endproc proc Exit_MailBox ;pause 1 transmit ";^M" endproc proc Press_Enter ;pause 1 transmit "^M" endproc File 2 "2871","11871","","","","","TEST ONEONE",;" "2840","11840","","","","","TEST TWOOne",";" "2841","11841","","","","","TEST Two",";" "2842","11842","","","","","TEST Three",";" "5756","16756","","","","","TEST FOUR",";" | ||||||||
| | |
| | #12 (permalink) | ||||||||
| Junior Member ![]() icetea has no status.
Location: Radford Va. Rep Power: 7 ![]() | Upgrade Opt. 11c 25.30 to 25.40 Here is the finnished script if anyone wants it. string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened. proc main string sLine ;Line read from text file integer iLen ;Integer to hold length of read string string sExtOne ;First extension from line read from text file string sExtTwo ;Second extension transmit "pro^M" waitfor "Action: " transmit "mod^M" if fopen 0 "test1.txt" READ ;Open text file while not feof 0 ;While there is data to be read from the text file fgets 0 sLine ;Get line of data strlen sLine iLen ;Find length of line if iLen == 0 ;If zero, then we have read a blank line and are at the end exitwhile ;Exit while loop endif strtok sExtOne sLine "," ;Get data before the comma strreplace sExtOne "`"" "" ;Delete quotes from the string sExtTwo = sLine strreplace sExtTwo "`"" "" ;Delete quotes from remaining data strreplace sExtTwo "," "" ;Get rid of extra comma strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too waitfor "Subscriber Name or Extension: " transmit sExtOne transmit "^M" waitfor "Name (last first) : " transmit "^M" waitfor "Class Number : " transmit "^M" waitfor "Extension [1]" transmit sExtOne transmit "^M" waitfor "Would you like to disable network access for this subscriber?[Y/N]" transmit "n^M" waitfor "Extension [2]" transmit sExtTwo transmit "^M" waitfor "Extension [3] " transmit ";^M" endwhile endif fclose 0 endproc TEST1.txt "2871","11871","";" "2840","11840","";" "2841","11841","";" "2842","11842","";" "5756","16756","";" | ||||||||
| | |
| | #13 (permalink) | ||||||||
| Junior Member ![]() icetea has no status.
Location: Radford Va. Rep Power: 7 ![]() | home wiring - Star or not start :casstet: Any I need help when I run this script it gives me the following error Error 5: Invalid identifier Here is the scipt string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened. proc main string sLine ;Line read from text file integer iLen ;Integer to hold length of read string string sExtOne ;First extension from line read from text file string sExtTwo ;Second extension transmit "pro^M" waitfor "Action: " transmit "mod^M" if fopen 0 "test1.txt" READ ;Open text file while not feof 0 ;While there is data to be read from the text file fgets 0 sLine ;Get line of data strlen sLine iLen ;Find length of line if iLen == 0 ;If zero, then we have read a blank line and are at the end exitwhile ;Exit while loop endif strtok sExtOne sLine "," ;Get data before the comma strreplace sExtOne "`"" "" ;Delete quotes from the string sExtTwo = sLine strreplace sExtTwo "`"" "" ;Delete quotes from remaining data strreplace sExtTwo "," "" ;Get rid of extra comma strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too waitfor "Subscriber Name or Extension: " transmit sExtOne transmit "^M" waitfor "Name (last first) : " transmit "^M" waitfor "Class Number : (Previous = 311): " transmit "^M" waitfor "Extension [1]" transmit sExtOne transmit "^M" waitfor "Would you like to disable network access for this subscriber?[Y/N]" transmit "n^M" waitfor "Extension [2]" transmit sExtTwo transmit "^M" waitfor "Extension [3] " transmit ";^M" endwhile endif fclose 0 endproc Here is the text file "2871","11871"," "2840","11840"," "2841","11841"," "2842","11842"," "5756","16756"," | ||||||||
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VoIP Phone Systems Buyer's Guide | rixride | VOIP Talk | 3 | 02-17-2006 01:44 PM |
| ....VoIP Phone Advantages & Drawbacks.... | FreedomFireCom | VOIP Talk | 0 | 01-21-2005 02:51 PM |