Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech-notes:scripts:dial-peer-config [2019/03/05 15:17] – [Batch file] gerardorourketech-notes:scripts:dial-peer-config [2019/03/05 16:51] (current) – [Batch file] gerardorourke
Line 33: Line 33:
 REM            START OF MAIN SCRIPT REM            START OF MAIN SCRIPT
 REM *************************************************** REM ***************************************************
 +
 set runningconfig=MyRouterConfigFile.txt set runningconfig=MyRouterConfigFile.txt
 echo . echo .
Line 45: Line 46:
  
 REM Print Header REM Print Header
-echo "dial-peer","description","translation-profile","preference","destination-pattern","session protocol","session target","voice-class codec","voice-class h323","dtmf-relay","fax","vad","direct-inward-dial","incoming","service" > %outputfile%+echo "Filename","dial-peer","description","translation-profile incoming","direct-inward-dial","incoming called-num","destination-pattern","service","preference","session protocol","session target","voice-class codec","voice-class h323","dtmf-relay","fax","vad" > %outputfile% 
 + 
  
 REM For Loop for each Dial-peer and create a temp file for just that dial-peer REM For Loop for each Dial-peer and create a temp file for just that dial-peer
Line 81: Line 84:
 SET service=. SET service=.
  
-FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "dial-peer"`) DO (SET dial-peer=%%F)+FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "dial-peer voice"`) DO (SET dial-peer=%%F)
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "description"`) DO (SET description=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "description"`) DO (SET description=%%F)
-FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "translation-profile"`) DO (SET translation-profile="%%F") +FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "translation-profile incoming"`) DO (SET translation-profile="%%F")
-REM echo my translation profile is: translation-profile+
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "preference"`) DO (SET preference=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "preference"`) DO (SET preference=%%F)
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "destination-pattern"`) DO (SET destination-pattern=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "destination-pattern"`) DO (SET destination-pattern=%%F)
Line 95: Line 97:
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "vad"`) DO (SET vad=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "vad"`) DO (SET vad=%%F)
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "direct-inward-dial"`) DO (SET direct-inward-dial=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "direct-inward-dial"`) DO (SET direct-inward-dial=%%F)
-FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "incoming"`) DO (SET incoming=%%F)+FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "incoming called-number"`) DO (SET incoming=%%F)
 FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "service"`) DO (SET service=%%F) FOR /F "tokens=* USEBACKQ" %%F IN (`type %tempfile% ^| find "service"`) DO (SET service=%%F)
  
-echo "%dial-peer%","%description%","%translation-profile%","%preference%","%destination-pattern%","%session-protocol%","%session-target%","%voice-class-codec%","%voice-class-h323%","%dtmf-relay%","%fax%","%vad%","%direct-inward-dial%","%incoming%","%service%" >> %outputfile%+echo "%runningconfig%","%dial-peer%","%description%","%translation-profile%","%direct-inward-dial%","%incoming%","%destination-pattern%","%service%","%preference%","%session-protocol%","%session-target%","%voice-class-codec%","%voice-class-h323%","%dtmf-relay%","%fax%","%vad%" >> %outputfile%
 exit /b exit /b
-</code>+</file>
  
  • tech-notes/scripts/dial-peer-config.1551799053.txt.gz
  • Last modified: 2019/03/05 15:17
  • by gerardorourke