📄 readme
字号:
** CallScriptThe program CallScript executes a file of simple commands to make SIPcalls. Commands are lines read from standard input.Lines whose first non-whitespace character is '#' are comment areignored, as are lines that are entirely whitespace.CallScript is not built by default, but the Makefiles to build it are.To build CallScript, first build sipXcallLib with ./configure -enable-tapi,then do: make -C sipXcallLib/examples/CallScript/srcThe commands to CallScript are:* call URLInitiate a call to the specified SIP URL. Note that this only startsthe call, it does not wait for the call to connect.* tones STRINGEmit a sequence of DTMF tones. STRING is a string of charactersspecifying the tones (0 through 9, *, and #). A comma (,) can be usedto represent a 2 second pause in the sequence of DTMF tomes. Thiscommand is synchronous.* file FILEStarts the asynchronous output of the contents of a WAV file namedFILE.* pause MSMS is the decimal representation of a number of milliseconds to pause.* pause random MSPause a random number of milliseconds between 0 and MS.* hangupDisconnect the call.If CallScript finds "${var}" in a command line, it will look for anargument to itself of form "var=value", and substitute "value". (Thisvariable substitution happens before the line is parsed into tokens.)If two arguments substitute for the same variable name, the *last*argument takes precedence. This allows overriding of pre-setsubstitutions.Currently, CallScript is very stupid. Among its restrictions are:- It can make only one call per run.- It does not disconnect the call automatically at the end of the run.- It does not listen for response from the other end of the call.** CallScriptDriver.plA Perl script that operates many instances of CallScript. It alsoprovides them with -p and -r arguments so they do not use the sameports for SIP and RTP.(The file's #! line specifies Perl as "/bin/perl". If that does notwork on your system, you will have to specify Perl explicitly. E.g.,"perl CallScriptDriver.pl ..." or"/usr/local/bin/perl CallScriptDriver.pl ...")Commands can be given as arguments, or read from files which are givenas arguments. The commands have similar syntax rules as forCallScript. Variable substitutions can be given in the form"var=value", and must precede any command or file name that referencesthem.(An argument is considered a command if it contains a space before thefirst "/". The two cases can always be made unambiguous: Allcommands can have whitespace after their verb, and all filenames canbe started with either "/" or "./". The only common case where thiscauses trouble are commands that take no arguments -- Express themwith a trailing space, as 'noduplicates ' or 'nonrandom '. Variablenames may not contain whitespace or "/", which allows substitutions tobe distinguished unambiguously.)Sending CallScriptDriver.pl HUP causes it to shut down gracefully bythinking the time limit has expired. It waits for all outstandingjobs to terminate, then prints the run statistics. Sending it QUITcauses it to shut down immediately by sending "kill -KILL" to alloutstanding jobs, then printing the run statistics.The commands are:* jobs NNNKeep NNN copies of CallScript running at a time. The default is 1.* time NNNAfter NNN seconds, stop initiating new instances of CallScript andthen exit when the last CallScript exits. The time can have a suffixof 's', 'm', 'h', or 'd' to express time in seconds, minutes, hours,or days. The default is 1 day.* script NNN FFF AAARecord FFF as a control script for instances of CallScript. IntegerNNN is this script's relative weight for selection. Additionalarguments AAA to CallScript can be supplied as fourth and later tokenson the line. These are usually "var=value" specifications forCallScript to substitute into its commands.* randomize NNNInserts an effective "pause random NNN" before executing each job.Since CallScriptDriver uses sleep() to implement this, NNN should be amultiple of 1000 (1 second).* program NAMEBy default, CallScriptDriver.pl invokes "CallScript" to executescripts. (It will do a path search.) This command changes theexecutor to NAME. NAME must be the name of an executable file.* noduplicatesBy default, a single script can be run by any number of jobs at thesame time. If "noduplicates" is specified, a job will not be startedrunning the same script as one that is already running.* nonrandomBy default, when a subjob ends, it selects a new script to run atrandom, with the relative probability of each script being the weightspecified for it. If "nonrandom" is specified, each subjob slot willrun only one script. In this case, the weights of scripts are thenumber of slots that will run that script. It is an error to havefewer scripts (accounting for weights) specified than there are subjobslots. If there are more scripts, the later scripts will not beexecuted. "noduplicates" has no effect if "nonrandom" is specified.** log-analyzeLog-analyze can be used to determine the effective number of virtualports used (on the average) during a run of CallScriptDriver.pl. Ittotals the time spent in "pause random" statements and deducts it fromthe total run time. Log-analyze has two arguments, the number of jobsand the number of seconds for the run. The run output fromCallScriptDriver.pl must be the standard input.** sample scriptsIn this directory there are sample scripts for CallScript:* driver-1* driver-2* hanging-call* leave-message* leave-retrieve* retrieve-message
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -