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

How deactivate feature code with the modem line?

Status
Not open for further replies.
Dec 19, 2002
28
CA
I'd like to use script to deactivate feature code using the modem line. What I need to is a loop (while or for-next)...
I give you an example in "my word" :

x=20000 ;my first ext number
;I need to go off-hook
WHILE
"dial #43" x
IF x= 29999 THEN ; 29999 is last number
"exit loop"
x=x+1
END

I appreciate a lot this site, it's very useful!
Thanks to every body.

(sorry for my English is not my first language)

Meridian1 (and new Mitel guy)
 
Something like this might get you started:

proc main

integer X

while 1
"dial #43" x
if X == 29999
exitwhile
else
X++
endwhile

endproc

I'm not familiar with the system you are connecting to, so I'm not certain if you mean you have to dial #43 and then the loop counter, or some other (typed) command.


 
Yes, you have exactly the idea... My problem is to transmit the phone number. I can pass it string but not integer.

What I have to do exactly is:
-have diatone
-dial #4320000
-dial #4320001
-dial #4320002
...
My idea is to create a small loop with "#43Poste" and increment the phone number using a variable Poste++...
I'm not sure if I my explanation is clear enough!

A BIG Thanks for your quick reply!!
Here I try to mix what you gave me and what I try!
Can you please again help me ?

Jean-Pierre


;MW clear for all Poste Mitel
proc main
;string Poste = "21502"
integer Poste = 21502

COMMANDMODE ON
PAUSE 1
while 1
transmit "ATDT ,#42"
; transmit "21502"
transmit Poste
transmit ";^M"
WAITFOR "OK"
; PAUSE 1
if Poste == 21999
exitwhile
else Poste ++
endwhile

; pwexit
endproc
 
OK, probably the easiest way to get the loop counter into a string is to use something like this:

strfmt Poste "%d" X

where Poste is defined as a string and not an integer, and X is the integer loop counter.

 
Thanks Knob for your time. I have now something that working for my "application". There is my final version...

;MW clear for all Poste Mitel
proc main
string MWLoff = "#43"
integer num1 = 20101
string poste
clear
while 1
COMMANDMODE ON
pause 3
numtostr num1 poste
transmit "atdt"
transmit MWLoff
transmit poste
transmit " ^M"
COMMANDMODE OFF
num1++
if num1 > 29999
exitwhile
endif
endwhile
endproc

Meridian1Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top