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

Script for Siemens PBX

Status
Not open for further replies.

icetea

Technical User
Nov 28, 2002
45
US
Hi all,
I've got another one I'd like your thoughts on. This one changes the phantom number in a 6.6 switch. But I need it to report any errors when it's done.

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

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


transmit "cha-scsu^M"
waitfor "STNO = "
transmit sExtOne
transmit "^M"
waitfor "LOCODE = "
transmit "^M"
waitfor "NEWNO = "
transmit sExtTwo
transmit "^M"
waitfor "DPLN = "
transmit "^M"
waitfor "ITR = "
transmit "^M"
waitfor "COS1 = "
transmit "^M"
waitfor "COS2 = "
transmit "^M"
waitfor "COSX = "
transmit "^M"
waitfor "PUBSCR = "
transmit "^M"
waitfor "NTYPE = "
transmit "^M"
waitfor "ACTCDE = "
transmit "^M"
waitfor "DCFWBUSY = "
transmit "^M"
waitfor "HTLNIDX = "
transmit "^M"
waitfor "EVMSIDX = "
transmit "^M"
waitfor "DEVFUNC = "
transmit "phantom^M"
waitfor "EVMS = "
transmit ";^M"
endwhile
endif
fclose 0
endproc


TEST1.txt

"2871","11871","";"
"2840","11840","";"
"2841","11841","";"
"2842","11842","";"
"5756","16756","";"
 
The only way I know how to handle error are to use the WHEN TARGET Commands and write them to a file. This way once you script has finished is provides and out put file with the orignal number, New Number and either Completed or the Error Received.

WHEN TARGET 1 "NUMBER OF LINKED VALUES TOO SMALL (4 TO 4 VALUES ADMISSIBLE) call ErrScript

Hope this is somewhat helpful. If not let me know I have a few scripts.
 
Hey icetea,

I'm in the UK where Siemens have the Rolm badged up as Hicom.
I'm still using Comtes (a program Siemens no longer support)to connect and make changes to the PBX.
Of course Siemens would much prefer you to buy CMWin, a windows based gui Specifically for the Hicom PBX.

I did check with a number of Siemen's engineers about using Procomm but none of them ever used it or knew how connect.
I know you helped me out with the Phone mail set up, any chance you could with the PBX ?
It would be usfull as i use Procomm all the time with a Definity PBX.

Cheers for any help,

lever.
 
IceTea & Lever,

Here is a Script File I use for PhoneMail. You should be able to make the Appropiate changes for the HiCom.

I use ProComm to access Everything, Rolm (9004/5, HiCom, Nortel Avaya). If I can be of any assistance let me Know.

string DisplayStringB = "Verify that the File is in the following directory: C:\Temp Data Files\Raw Data\ Directory."
string szNewPswd,szSiteName,sTok1,sLine
string fName = "C:\Temp Completed Reports\Completed "
string sEnter = "^M"
string sPurgeDone = " PURGE DONE"
string sPurgeProblem = " NOT PURGED"
string sPswdDone = " HAS NEW PASSWORD"
string sPswdProblem = " PSWD NOT CHANGED"
string fEnd = ".txt"
integer iLen

usermsg DisplayStringA
pause 5
usermsg DisplayStringB

; Assigns Site Name to the Variable szSiteName
sdlginput "Site Name" "Enter Site Name:" szSiteName
pause 1

; Assigns Password to szNewPswd
sdlginput "New Password" "Enter the New DEFAULT Password:" szNewPswd
pause 1
strcat szNewPswd sEnter
strcat fName szSiteName
strcat fName fEnd
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 " Enter T or F for each field): " call Announce
when Target 4 "Group Name :" call Press_Enter
when Target 5 "Referral Extension : " call Press_Enter
when Target 6 "Volume Level : " call Press_Enter
when Target 7 "Speed level : " call Press_Enter
when Target 8 "Abbreviated Prompts?: " call Press_Enter
when Target 9 "Cannot find this form." call Exit_MailBox
when Target 10 "Alt Greeting Active?: (Previous =" call Press_Enter
when Target 11 "Software Mailbox ? : (Previous =" call Press_Enter
when Target 12 "Failed Acc Attempt : (Previous =" call Press_Zero

if isfile "C:\Temp Data Files\Raw Data\Sterling Forest.txt" ; Verifies that File does Exist.

; Opens Text File
fopen 1 "C:\Temp Data Files\Raw Data\Sterling Forest.txt" READWRITE TEXT

; Creates a New Text File With the Name: Completed + the SiteName User Provides
fopen 2 fName CREATE TEXT
pause 20
transmit "^M"

; Logs you into the PhoneMail System and gets you to the Function Prompt.
Execute "Log-SA.wax"
while not feof 1
fgets 1 sLine
strlen sLine iLen
if iLen == 0
exitwhile
endif

; Assigns Text in First Field (From Text File) to Variable sTok1.
strtok sTok1 sLine " " 1
waitfor "Function: " FOREVER
transmit "PROFILE^M"
waitfor "Action: "
transmit "PURGE^M"
waitfor "Subscriber Name or Extension: "

; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System.
transmit sTok1
transmit "^M"

if waitfor "Function: " 10
fwrite 2 sTok1 6
finsblock 2 11
fwrite 2 sPurgeProblem 11
transmit "PROFILE^M"
waitfor "Action: "
transmit "MODIFY^M"
waitfor "Subscriber Name or Extension: "

; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System.
transmit sTok1
transmit "^M"
if waitfor "PhoneMail Password : (Previous = ##########): " 10
transmit szNewPswd
finsblock 2 17
fputs 2 sPswdDone
else
transmit ";^M"
finsblock 2 17
fputs 2 sPswdProblem
endif
else
transmit ";^M"
fwrite 2 sTok1 6
finsblock 2 11
fwrite 2 sPurgeDone 11
waitfor "Function: "
transmit "PROFILE^M"
waitfor "Action: "
transmit "MODIFY^M"
waitfor "Subscriber Name or Extension: "

; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System.
transmit sTok1
transmit "^M"
if waitfor "PhoneMail Password : (Previous = ##########): " 10
transmit szNewPswd
finsblock 2 17
fputs 2 sPswdDone
else
transmit ";^M"
finsblock 2 17
fputs 2 sPswdProblem
endif
endif
endwhile
endif
fclose 1
fclose 2
transmit ";^M"
waitfor "Function: " forever
transmit "LOG^M"
waitfor "Action: " forever
transmit "LOG^M"
capture OFF
hangup
endproc
proc Announce
pause 1
transmit "F F F^M"
endproc
proc Exit_MailBox
pause 1
transmit ";^M"
endproc
proc New_MailBox
integer sNext = 0
sNext = 0
longjmp 0 sNext
endproc
proc Press_Enter
pause 1
transmit "^M"
endproc
proc Press_Zero
pause 1
transmit "0;^M"
pause 1
transmit ";^M"
endproc


Siemens Tech
 
Thanks Myflight. From what you posted I have made five scripts that will do the changes that I need. I have one that I just finnished for changing the phantom number on a 6.6 if you want let me know. I'll be happy to post it.

Lever,

Give me your email and I'll send all the ones that I have. Also Comtes is still used here hevely, but is hard to get a copy of unless you work for siemens. Anything you have would be welcome.

icetea2@bellsouth.net


icetea
 
Thanks icetea & MyFlight,

I'll put some of those script to good use.

I'm using Procomm for the Definity G3 and Octel 250/300 voice mail server. But still rely on Comtes for the Hicom 300e. So it would be nice to use Procom for that too.

Can't find any forums on the Hicom, and beleive me I've tried. So if i can help with any Hicom 300 issues let me know.

lever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top