MyFlight
Technical User
- Feb 4, 2002
- 193
Hello,
I am working with a brand New Siemens switch via Telnet and need to list out all of my trunks. The list gives the Port addresses in hyphen seperated format. I then need to take these numbers (from 3 seperate files and send them in a comma seperated format with a virtual trunk number assigned.
The virtual trunk number would need to count up from XX. Where XX is defined by the user and can be a number from 3 to 10 digits in length.
I beleive there are one of two way s of doing this. First the files are downloaded via ProCom. Then I have the option of formatting these files using MS-Excel or of leaving it all to ProComm. I need to seperate these number to individual place holders Example: 1-1-91-1 becomes 1,1,91,1
Next and a ",0,"
then add the Virtual Trunk Number ,XX
finish off with a Semicolon and an Enter so I end up with the following:
ADD-FBTN:TRKNO,1,1,91,2,0,5101001;
ADD-FBTN:TRKNO,1,14,121,23,0,5101002;
Download file Examples (the Three Files Downloaded)
TDCSU.txt EXAMPLE
ADD -TACSU: 1-1-91-1, , 8, 8, 0, 0, 40, 1, 1,
, 8, 0," ",ADD-
0, , 2,1,EMPTY,0 ,
NONE, NONE, 0,EC&G729 &G711 ,
" ", 0, GDTR,
0, CO,Y ,TC ,LPSTR ,
0, ,0,0, 1, 1, 1, 0, DTMF-DTMF , 0-0 , 0;
ADD -TACSU: 1-14-121-23, , 8, 8, 0, 0, 40, 1, 1,
, 8, 0," ",
0, , 2,1,EMPTY,0 ,
NONE, NONE, 0,EC&G729 &G711 ,
" ", 0, GDTR,
0, CO,Y ,TC ,LPSTR ,
0, ,0,0, 1, 1, 1, 0, DTMF-DTMF , 0-0 , 0;
TDCSU.txt EXAMPLE
ADD-TDCSU:NEW ,1-02-049-0,92,91,0,0,90,25,1," ",91
,PSS1V2,8,,NONE,,,,GDTR,Y,TIE,NONE,N,0,
,,,,,
,31,MANY,91,0,1,1,EMPTY,92,5,N,
,,,,,16,8,1,10,,EC&G711&G729
,"",91,CIR,Y,S0CONN,
,Y,Y,0,N;
ADD-TDCSU:NEW ,1-02-049-1,92,91,0,0,90,25,1," ",91
,PSS1V2,8,,NONE,,,,GDTR,Y,TIE,NONE,N,0,
,,,,,
,31,MANY,91,0,1,1,EMPTY,92,5,N,
,,,,,16,8,1,10,,EC&G711&G729
,"",91,CIR,Y,S0CONN,
,Y,Y,0,N;
TSCSU.txt EXAMPLE
NONE AVAILABLE at this time
I started working on a script based on previous use, but got way out of my element. Here is what I have so far.
#define WorkDir "C:\Temp Data Files\Raw Data\"
#define SaveDir "C:\Temp Completed Reports\"
#define OldFname "TACSU.txt"
#define sEnter "^M"
#define svTrunkDone " NEW VIRTUAL TRUNK ASSIGNED "
#define svTrunkProblem " NO VIRTUAL TRUNK NUMBER "
Proc main
integer iLen, ivar, cVtrunk, iVtrunk, vTrkNum
string fName = "Completed V Trunks.txt "
string sTok1, sLine, svTrkNum
if $CONNECTOPEN
; check for connection...
sdlginput "Starting Virtual Trunk Number" "Enter the FIRST Virtual Trunk Number:" svTrkNum
atoi svTrkNum vTrkNum
chdir WorkDir
isfile OldFname ivar ; Verifies that File does Exist.
if SUCCESS
fopen 1 OldFname READWRITE TEXT
chdir SaveDir
fopen 2 fName CREATE TEXT
pause 2
transmit "^M"
cVtrunk = 0
iVtrunk = 0
while not feof 1
fgets 1 sLine
strlen sLine iLen
; Assigns Text in First Field (From Text File) to Variable sTok1.
strtok sTok1 sLine " " 1
waitfor " <" 3
endproc
Any and all help would be greatly appreciated.
I am working with a brand New Siemens switch via Telnet and need to list out all of my trunks. The list gives the Port addresses in hyphen seperated format. I then need to take these numbers (from 3 seperate files and send them in a comma seperated format with a virtual trunk number assigned.
The virtual trunk number would need to count up from XX. Where XX is defined by the user and can be a number from 3 to 10 digits in length.
I beleive there are one of two way s of doing this. First the files are downloaded via ProCom. Then I have the option of formatting these files using MS-Excel or of leaving it all to ProComm. I need to seperate these number to individual place holders Example: 1-1-91-1 becomes 1,1,91,1
Next and a ",0,"
then add the Virtual Trunk Number ,XX
finish off with a Semicolon and an Enter so I end up with the following:
ADD-FBTN:TRKNO,1,1,91,2,0,5101001;
ADD-FBTN:TRKNO,1,14,121,23,0,5101002;
Download file Examples (the Three Files Downloaded)
TDCSU.txt EXAMPLE
ADD -TACSU: 1-1-91-1, , 8, 8, 0, 0, 40, 1, 1,
, 8, 0," ",ADD-
0, , 2,1,EMPTY,0 ,
NONE, NONE, 0,EC&G729 &G711 ,
" ", 0, GDTR,
0, CO,Y ,TC ,LPSTR ,
0, ,0,0, 1, 1, 1, 0, DTMF-DTMF , 0-0 , 0;
ADD -TACSU: 1-14-121-23, , 8, 8, 0, 0, 40, 1, 1,
, 8, 0," ",
0, , 2,1,EMPTY,0 ,
NONE, NONE, 0,EC&G729 &G711 ,
" ", 0, GDTR,
0, CO,Y ,TC ,LPSTR ,
0, ,0,0, 1, 1, 1, 0, DTMF-DTMF , 0-0 , 0;
TDCSU.txt EXAMPLE
ADD-TDCSU:NEW ,1-02-049-0,92,91,0,0,90,25,1," ",91
,PSS1V2,8,,NONE,,,,GDTR,Y,TIE,NONE,N,0,
,,,,,
,31,MANY,91,0,1,1,EMPTY,92,5,N,
,,,,,16,8,1,10,,EC&G711&G729
,"",91,CIR,Y,S0CONN,
,Y,Y,0,N;
ADD-TDCSU:NEW ,1-02-049-1,92,91,0,0,90,25,1," ",91
,PSS1V2,8,,NONE,,,,GDTR,Y,TIE,NONE,N,0,
,,,,,
,31,MANY,91,0,1,1,EMPTY,92,5,N,
,,,,,16,8,1,10,,EC&G711&G729
,"",91,CIR,Y,S0CONN,
,Y,Y,0,N;
TSCSU.txt EXAMPLE
NONE AVAILABLE at this time
I started working on a script based on previous use, but got way out of my element. Here is what I have so far.
#define WorkDir "C:\Temp Data Files\Raw Data\"
#define SaveDir "C:\Temp Completed Reports\"
#define OldFname "TACSU.txt"
#define sEnter "^M"
#define svTrunkDone " NEW VIRTUAL TRUNK ASSIGNED "
#define svTrunkProblem " NO VIRTUAL TRUNK NUMBER "
Proc main
integer iLen, ivar, cVtrunk, iVtrunk, vTrkNum
string fName = "Completed V Trunks.txt "
string sTok1, sLine, svTrkNum
if $CONNECTOPEN
; check for connection...
sdlginput "Starting Virtual Trunk Number" "Enter the FIRST Virtual Trunk Number:" svTrkNum
atoi svTrkNum vTrkNum
chdir WorkDir
isfile OldFname ivar ; Verifies that File does Exist.
if SUCCESS
fopen 1 OldFname READWRITE TEXT
chdir SaveDir
fopen 2 fName CREATE TEXT
pause 2
transmit "^M"
cVtrunk = 0
iVtrunk = 0
while not feof 1
fgets 1 sLine
strlen sLine iLen
; Assigns Text in First Field (From Text File) to Variable sTok1.
strtok sTok1 sLine " " 1
waitfor " <" 3
endproc
Any and all help would be greatly appreciated.