SCRIPT CHANGE RENVOI EXT

REMI01
Member
Posts: 26
Joined: 08 Jun 2012 09:52

Re: SCRIPT CHANGE RENVOI EXT

Post by REMI01 » 07 Apr 2016 09:59

Here vbs script

set sh=WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
sh.SendKeys "~"
WScript.Sleep 1000
sh.SendKeys "mtcl"
sh.SendKeys "~"
WScript.Sleep 2500
sh.SendKeys "~"
WScript.Sleep 2000
sh.SendKeys "mgr -nodico -X VD.txt"
sh.SendKeys "~"
WScript.Sleep 4000
sh.SendKeys "exit"
sh.SendKeys "~"
WScript.Sleep 4000

bat for run vd.vbs

@start /realtime C:\Logiciels\kitty.exe -telnet mtcl@172.16.100.3
@cscript //logo y:\Telecom_Tph\documentation\script\VD.vbs


and make vd.txt in /DHS3bin/mtcl

SET Dynamic_State_Subscriber "0": "1686": "1"
{
Forward = "RV_IMD",
Number_Forward = "22991"
}


you can automatise with clock of task planner with .bat

good luck !

User avatar
stryk
Member
Posts: 5
Joined: 15 May 2017 06:59

Re: SCRIPT CHANGE RENVOI EXT

Post by stryk » 14 Sep 2017 15:59

Hi,

to forward or other, you can use an integrated mgr script on bash script, as my exemple:
if it can give ideas ;)

Code: Select all

#!/bin/sh
# Script by STRYK
# Example of use of MGR -NODICO
# Forward to number 03699 and cancel forward to subscriber list

### --- Forward number
### - Here for the example the french speaking clock
ForwardNum=03699

### ------ List ------
### Subscriber to forward
### - here only change numbers
### - you can add or cancel lines
#_ 12345
#_ 25487
#_ 96587
#_ 12784
#_ 96578
#_ 33333
#_ 88201
### ---- End List ----

# Function to build site number
SiteNumber () {
NetNum=$(siteid | grep 'Network number' | cut -d ':' -f2 | cut -d ' ' -f2)
NodeNum=$(siteid | grep 'Node number' | cut -d ':' -f2 | cut -d ' ' -f2)
if [[ $NetNum -lt 1 ]]; then SiteNum=$NodeNum; else SiteNum=$NetNum$NodeNum; fi
}

Main () {
clear
CountOk=
if [ -f ScriptMgr ]; then rm ScriptMgr; fi
echo 'Choix 1 - Forward subscribers'
echo 'Choix 2 - Cancel foward'
echo 'Choix 3 - Scheduled forward'
echo 'Choix 4 - Cancel Scheduled forward'
echo 'q - Quit'
echo ' '
read -p "Please make a choice (1 2 3 4 or q) \> " Select
case $Select in
[1234]*) Sub$Select;;
[qQ]*) echo 'Bye-Bye'
exit 0;;
*) echo 'Input ERROR, please wait'
sleep 2
Main;;
esac
}

Sub1 () {
clear
if [ -f ScriptMgr ]; then rm ScriptMgr; fi
for List in `cat $0 | grep $Key | grep -v Key | cut -d " " -f2`; do
echo 'SET Dynamic_State_Subscriber "'$SiteNum'": "'$List'": "1"' >> ScriptMgr
echo '{' >> ScriptMgr
echo 'Forward = "RV_IMD",' >> ScriptMgr
echo 'Number_Forward = "'$ForwardNum'"' >> ScriptMgr
echo '}' >> ScriptMgr
CountOk=$(($CountOk + 1))
done
mgr -nodico -X ScriptMgr
rm ScriptMgr
if [ $CountOk -gt 1 ]; then S=s; else S=; fi
echo "$CountOk Forward$S done - press any key to continue"
read _Wait
Main
}

Sub2 () {
clear
if [ -f ScriptMgr ]; then rm ScriptMgr; fi
for List in `cat $0 | grep $Key | grep -v Key | cut -d " " -f2`; do
echo 'SET Dynamic_State_Subscriber "'$SiteNum'": "'$List'": "1"' >> ScriptMgr
echo '{' >> ScriptMgr
echo 'Forward = "NO_RV",' >> ScriptMgr
echo 'Number_Forward = "'$List'"' >> ScriptMgr
echo '}' >> ScriptMgr
CountOk=$(($CountOk + 1))
done
mgr -nodico -X ScriptMgr
rm ScriptMgr
if [ $CountOk -gt 1 ]; then S=s; else S=; fi
echo "$CountOk Cancel forwad$S done - press any key to continue"
read _Wait
Main
}

Sub3 () {
clear
if [ -f ScriptMgr ]; then rm ScriptMgr; fi
read -p "Forward time (hh:mm format) \> " SelTime
for List in `cat $0 | grep $Key | grep -v Key | cut -d " " -f2`; do
echo 'SET Dynamic_State_Subscriber "'$SiteNum'": "'$List'": "1"' >> ScriptMgr
echo '{' >> ScriptMgr
echo 'Forward = "RV_IMD",' >> ScriptMgr
echo 'Number_Forward = "'$ForwardNum'"' >> ScriptMgr
echo '}' >> ScriptMgr
done
at $SelTime <<< "mgr -nodico -X ScriptMgr"
echo 'Scheduled forward to' $SelTime
echo 'if you run this utility again, the foward will be aborted.'
exit
}

Sub4 () {
clear
if [ -f ScriptMgr ]; then rm ScriptMgr; fi
read -p "Cancellation foward time (hh:mm format) \> " SelTime
for List in `cat $0 | grep $Key | grep -v Key | cut -d " " -f2`; do
echo 'SET Dynamic_State_Subscriber "'$SiteNum'": "'$List'": "1"' >> ScriptMgr
echo '{' >> ScriptMgr
echo 'Forward = "NO_RV",' >> ScriptMgr
echo 'Number_Forward = "'$List'"' >> ScriptMgr
echo '}' >> ScriptMgr
CountOk=$(($CountOk + 1))
done
at $SelTime <<< "mgr -nodico -X ScriptMgr"
echo 'Scheduled cancellation foward to' $SelTime
echo 'if you run this utility again, cancellation foward will be aborted.'
exit
}

Key='#_'
SiteNumber
Main 

Post Reply

Return to “Linux tricks”