SIPp web frontend(2)
SIP VoIP 測试交流群: 323827101
欢迎大家转载。为保留作者成果,转载请注明出处。http://blog.csdn.net/netluoriver。有些文件在资源中也能够下载。假设你没有积分。能够联系我索要!
3.6Adding calls to a test(为測试脚本添加呼叫)
To add a call, use the add a call link of the corresponding party (see in the figure above) and get to the Create new call screen.
加入一个呼叫,在对应的一端使用add a call 链接 (见上图)和開始创建新的呼叫。
Here the command line parameters to pass to SIPp can be set up (the corresponding parameters are stated in round brackets, e.g., -timeout) or (-m), but first
这里的命令行參数能够设置SIPp(用圆括号规定对应的參数。比如:(-timeout)或(-m)),但首先
·choose an Executable (the version of SIPp you want to use, defined in config.ini.php. See section Config file for more details).
选择一个可运行文件(在config.ini.php中定义你想用的SIPp版本号。
查看Config file一节获得很多其它具体信息)
·choose a Scenario defined earlier in the Manage scenarios tab (Section Manage scenarios).
在管理场景选项卡中选择一个前面定义的场景
·if a client scenario is used, enter a Remote host. This is where SIPp addresses its messages to.
假设已经用了一个client场景,输入一个远程主机地址。
这个地址就是SIPp要发送给对端的消息地址。
·check the Monitor call checkbox, if during the test execution realtime feedback of the test progress should be displayed. In that case the tester can also influence the test by pausing it, or by adjusting the packet rate (See section Run a test for more details).
检查监视呼叫复选框,假设在測试脚本时,会实时显示測试过程。在那种情况下測试者通过暂停或调整包的速率也会影响測试效果(查看执行一个測试一节获得更加具体信息)
·check the Log checkbox, if log files (-trace_err, -trace_logs, -trace_rtt, -trace_stat) should be stored in the database.
检查日志复选框,日志文件(-trace_err, -trace_logs, -trace_rtt, -trace_stat)是否存储到数据库中。
If the given configuration options are not enough, the Extended parameters text field can be used to pass any command line parameters to SIPp. The Extended parameters are not evaluated or modified in any way. It is up to the administrator to use a correct syntax. There may be some command line options that do not work, or even cause SIPp to hang (i.e. -bg).
假设所给的配置选项不够用。Extended parameters 文本框能够给SIPp传递不论什么命令行參数。 Extended parameters由管理员使用正确的语法。
它并不以不论什么方式评估或改动。或许会有一些命令行选项不可用或引起SIPp挂起(比如-bg选项)
If a parameter is specified in the form and also as extended parameter, the extended parameter has the higher priority, and overwrites the other.
假设在表格中指定了一个參数,而且也作为扩展參数,那么扩展參数会有更高的优先权,并重写还有一个
Global parameters (applied to any call) can be defined in the AVP Section of the config.ini.php. These have the lowest priority.
在 config.ini.php中的AVP Section能定义全局參数(应用于不论什么呼叫)。这些有最低优先权。
3.7Modify a test / create a new test version(改动/创建一个新的測试脚本)
Tests and calls can be modified at any time. If a test has already runs, a crucial modification of the test would mean that test information belonging to these runs is lost, and thus the run is not reproducible anymore. To avoid this, a new version is created automatically.
測试脚本和呼叫可能在不论什么时候都能够被改动。
假设一个測试脚本已经执行了。改动測试脚本意味着属于这些执行的測试信息会丢失,从而执行不再重现了。为了避免这样的情况,会自己主动创建一个新的版本号。
Simply switch between the versions of a test by clicking the version numbers. A version can even be deleted by using the remove this version link, but then all its runs are lost too.
通过点击版本号号能够实现两个版本号的简单切换。以致能够用 remove this version链接来删除一个版本号。但这样做,所有有关这个版本号的測试消息也会删除。
If a test is duplicated using the duplicate test link, the currently displayed version of the test is copied into version 1 of the duplicate. The new name of the duplicate is composed with the original name followed by the word copy. A duplicate initially has no runs.
假设用duplicate test链接复制了一个測试脚本,当前显示的測试版本号被复制到副本的版本号1中。用原来的名称加上单词copy来显示新副本的名称。副本初始化不会执行
In the System information tab, the page is split in 3 areas. First a list of currently running SIPp instances is displayed. Then the available free disk space is stated. Finally there is a list with the versions of SIPp that are defined in the config.ini.php file, along with their verbose screens.
在System information标签页。分成了3个区域。currently running SIPp instances显示在第一个。然后规定了可用的磁盘空间。
最后的一个列表显示了在 config.ini.php文件中定义的SIPp版本号号,连同他们的具体的屏幕。
3.10Kill a hanging SIPp instance(杀死一个挂起的SIPp实例)
An admin can try to kill an instance of SIPp by pressing the corresponding red X button in the list of currently running SIPp instances. Although SIPp runs that are not started through the web frontend are also in the list, they cannot be killed.
在当前执行的SIPp列表中通过点击红色 X button来杀死一个SIPp实例。不是从web页面执行的SIPp实例,在web页面不能杀死。
A line in the config file with a leading ; is a comment and has no effect to the configuration.
在配置文件的开头部分是一个描写叙述,不会影响到配置。
The configuration file is divided in three sections respectively tagged with
[EXECUTABLES], [AVP], and [CONFIG].
配置文件被分成三部分,分别用[EXECUTABLES], [AVP]和[CONFIG]来标记。
·In the [EXECUTABLES]-section SIPp executables and their versions can be specified. At least one executable is mandatory.
在[EXECUTABLES]部分是SIPp可运行文件,能够指定运行实例。
当中至少有一个SIPp可运行文件。
·In the [AVP]-section global command line parameters for SIPp can be specified in form of attribute-value pairs (attribute = value).
在[AVP]部分以属性-值对的形式(属性=值)指定了SIPP全局命令行參数。
I.e. most parameters of SIPp (without the leading -) will be accepted (see sipp -h for more details).
比如,接受SIPp(參数中没有-)的大多数參数(用命令“sip -h”获得很多其它信息)
These parameters can be overwritten in each individual call by using the Extended parameters textarea in the web tool. Take care that you only use parameters that work with every version of SIPp you are using with this tool. If a attribute has no value, but is a switch, use TRUE as a value (e.g., aa = TRUE). If a value contains non-alphanumeric characters it needs to be enclosed in double-quotes (").
在web中通过用Extended parameters 文本区在每一个独立的呼叫中重写这些參数。注意,你仅能在正在用的SIPp的版本号中用这个參数(也就是说此版本号中有的命令才干用。毕竟每一个SIPp的版本号功能不一样,新的版本号功能比較多一些嘛),除非是一个开关,用TRUE作为一个值(比如,aa = TRUE),假设值包括非字母数字的字符须要用双引號(")括起来。
Parameters not allowed are: 參数不同意是:
i, m, nd, nr, t, p, r, timeout, pause_msg_ign, v, bind_local, inf, sd, sf, sn, stf, trace_msg, trace_shortmsg, trace_screen, trace_err, linebreak trace_timeout, trace_stat, trace_rtt, trace_logs
·In the [CONFIG]-section you will find program specific parameters, like admin password or MySQL-database connection information...
在[CONFIG]部分你会找到程序指定參数。如管理password或MYSQL-database连接信息……
Refer to the config file config.ini.php to get more detailed information about the specific parameters.
关于指定參数请參数配置文件里的config.ini.php获得很多其它具体信息。
There is a list of available tests in the Manage tests. If there are many tests, it may be useful to sort the tests by clicking one of the column headings.
在Manage tests中是測试脚本列表。
假设有非常多測试脚本,通过点击列头能够自己主动分类。
Click on a test to get a more detailed view. There choose a version and click on the run this version link to open the test popup.
在一个測试项中点击。会得到一个具体的界面。
选择一个版本号并点击run this version链接会弹出測试页面。
Click on Run test now to begin testing. Both parties start to process their queues. On the left hand side of each call there is a small image showing the actual state of the call.
在Run test now单击開始进行測试。两方開始处理队列。在每个呼叫的左手边有一个小图像显示呼叫的实际状态。
If monitoring is turned on, the test progress can be influenced by using key commands (this is the same as in the command line). First set the focus to the corresponding monitoring screen by clicking on it. When the border of the screen turns red, use the key commands on your keyboard.
假设打开了监控。用keyword命令会影响測试进展(用命令行測试也一样会影响)。首先通过点击keyword命令,设置焦点到对应的监视屏幕。当屏幕的边界变为红色,使用你的键盘键入命令。
·0-9 to switch between screens
0-9 切换屏幕
·+ , - , * , / to adjust packet rate
+ , - , * , / 调整包速率
·q to soft exit
q软退出
·p to pause/resume execution
p暂停/恢复运行
4.4Abort a call / test(停止一个呼叫/測试)
Never close the test window without the test finished, because there may reside SIPp processes running on the server. If for some reason a call does not terminate by itself, there are three possibilities to finish the test anyway:
仅仅有測试完毕后才会关闭測试窗体,因为在服务器中可能驻留SIPp进程。假设因为一些原因一个呼叫没有自己挂断,完毕这个測试有三种可能:
·If the call has monitoring turned on, try to end the call with the key command q (soft exit).
假设打开了监控功能。试试用软命令q键退出(软退出)
·A call that hangs can be terminated by pressing the red X on its right hand side.
通过点击右側红色 X button结束挂起的呼叫。
·The whole test can be stopped with the Abort test link at the top of the window.
点击接窗体顶部的Abort test链接来停止结束測试
After a test has finished, the test window is closed automatically and the created run is displayed. The exit and the std error column may contain important information (roll the mouse over the columns for more details in a tooltip box). Click the grey eye buttons to download the log files created during the test.
測试完毕后,測试窗体自己主动关闭并创建执行过程中的显示參数。列exit和std error或许包括重要的信息(在悬浮框中滚动鼠标轴获得更具体的信息)。点击灰色眼睛button来下载在測试过程中创建的日志文件。
It is possible to return to this page, or to another run, any time. Just navigate to the corresponding test in the Manage tests tab, choose the right version and click on a run at the bottom of the page.
可能会返回这个页面。或返回至还有一个执行页面,仅在Manage tests选项卡中导航到对应的測试中就可以,选择一个正确的版本号并在页面底部点击就可以执行。
5.1Database (ER Diagram)(数据库(ER图表))
·add_call.php is responsible for the add/modify call screen. Adds/modifies calls in the database.
·add_call.php在屏幕中代表add/modify call 。在数据库中代表Adds/modifies 呼叫。
·authentication.php: checks if admin is logged in. It is included everywhere, where admin should have special permissions.
authentication.php:选择是否admin登录。它包括了admin訪问权限的不论什么地方。
·Call_Data.php: class Call_Data: contains call specific data (process-id, log filenames...) of a currently running call. It has methods to store log files in the database, delete the log files and determine the exit code after execution. When a call is about to be executed, an object of this class is generated and stored in a session variable.
Call_Data.php:类Call_Data:包括一个当前执行呼叫中调用指定的数据(process-id, log filenames...)。
它有把日志文件存储到数据库、删除日志文件和决定运行完后退出的代码。当运行一个呼叫时,会生成这个类的一个对象并保存一个会话变量。
·config.ini.php: configuration file
config.ini.php:配置文件
·create_run.php: is called from run_progress.php via ajax. It creates a run in the database with the current timestamp.
create_run.php:通过ajax从run_progress.php中调用。在数据库中创建一个执行的当前时间戳。
·dbHelper.php: is where the SQL happens. For each table in the database, there is a corresponding class that handles database communication.
dbHelper.php: SQL处理的地方,对数据库中的每一个表来说。都有一个对应的类处理数据库通信。
·db.php: generates the MySQL database connection object.
db.php:生成MySQL数据库连接对象
·exec_call.php: is called from run_progress.php via ajax. The basic function of this file is to build up the command line, create the XML-scenario file and the CSV-injection file in the system's temporary folder, execute the call and return its process id (pid).
exec_call.php:通过ajax从run_progress.php调用。
这个文件的基本功能是构造命令行,在系统的暂时目录中创建XML场景文件和CSV注入文件。运行呼叫并返回它的进程id(pid).
·garbagecollector.php: removes all SIPp directories in the system's temp folder that have not been modified for a specific time (defined in config.ini.php). Further all SIPp processes older than a specific time get killed.
garbagecollector.php: (暂不会翻译)
·get_screen.php: During execution of a call this file is requested periodically via ajax. Here the actual monitor-screen is extracted from the screen file, and returned to status_screen.php (if monitoring is turned on). Further this file checks if the SIPp process is still running, and if not, it returns exit-code and standard-error tostatus_screen.php.
get_screen.php:在执行呼叫期间,通过ajax这个文件会周期的向server进行请求。实际上是从screen文件里导出监控屏幕,并将结束输入至 status_screen.php(假设打开了监控功能)。
进一步讲。这个文件检查SIPp进程是否仍在执行,假设没有。tostatus_screen.php会返回的退出代码和标准错误
·helper.php: just some useful functions.
helper.php:仅是一些实用的功能说明
·index.php: redirect to tests.php.
index.php:重定向到test.php
·info.php: represents the System information tab.
info.php:代表System information标签
·kill_process.php: is called from run_progress.php via ajax, if the user wants to kill a SIPp process.
kill_process.php: 假设用户想杀死SIPp进程。会通过ajax从run_progress.php中调用此文件。
·read_config.php: reads the config file in the three arrays $executables, $avp, and $config. Default values are set if necessary, and there is a function getConfig-Parameters that assembles command line parameters from the AVP section.
read_config.php:在$executables, $avp, 和$config中读取配置文件。
假设有必要能够设置默认值。有一个得到配置參数(getConfig-Parameters)功能是从AVP部分中收集命令行參数。
·run_detail.php: represents the show run page.
run_detail.php:代表show run页面
·run_progress.php: represents the run test popup. This is where all the ajax happens. Refer to the file itself for detailed information.
run_progress.php:代表run test 弹出窗。这是全部ajax执行的地方,參考此文件获得至多信息
·scenario_detail.php: represents the create/modify scenario screen. Inserts or updates scenario data in the database.
scenario_detail.php:代表create/modify scenario屏幕,在数据库中插入或场景数据。
·scenarios.php: represents the Manage scenarios tab.
scenarios.php:代表Manage scenarios 标签。
·send_key.php: is called via ajax from status_screen.php when the user presses a key on the keyboard.
send_key.php:当用户在键盘中按下一个键时,从 status_screen.php 中通过ajax调用send_key.php。
·status_screen.php: is displayed in a iframe in run_progress.php during test. Here the status monitor screen of a running SIPp instance is displayed by polling it from the server frequently. Further, keyboard action is sent to send_key.php, that forwards it to the running SIPp instance.
status_screen.php:測试过程中在一个内嵌框架中显示 run_progress.php 。会从server频繁地轮循它来显示执行SIPp实例的监控屏幕的状态。进一步讲,键盘的动作发送到send_key.php,驱动它来执行SIPp实例。
·stop_sipp.php: has a function that tries to stop a running SIPp instance. It takes care that the pid belongs to a SIPp process.
stop_sipp.php:尝试停止一个执行的SIPp实例。它负责pid属于一个SIP进程。
·sys_get_temp_dir.php: provides functions that determine the working directory and the systems temp directory.
sys_get_temp_dir.php:提供限定工作文件夹和系统时时文件夹的功能。
·test_detail.php: represents the create/modify test screen.
test_detail.php:代表create/modify test 屏幕
·tests.php: represents the Manage tests tab.
tests.php:代表Manage tests 标签页。
·view_csv.php: is for downloading CSV files (log files etc.) that are stored in the database.
view_csv.php:下载保存在数据库中CSV文件(日志文件等)
·view_messages.php: is for downloading the file created by the command line option -trace_messages. The trace_messages file is not stored in the database because it may be very large, but it is left for a short time in the systems temp folder until the garbage collector removes it.
view_messages.php:下载通过命令行 -trace_messages选项创建的文件。trace_messages文件不会存到数据库中,因为它或许会很大,可是在系统暂时目录中一直保留。除非到达垃圾设置值才会被删除。
·view_text.php: is for downloading text files (log files etc.) that are stored in the database.
view_text.php:下载存在数据库中的txt文件(日志文件等)
·view_xml.php: is for downloading XML files (scenario files) that are stored in the database.
view_xml.php: 下载存在数据库中的XML文件(场景文件)
·/js/ajaxConnection.js: crossbrowser function to create an ajax request object in javascript.
/js/ajaxConnection.js:在javascript中跨浏览器函数来创建一个ajax的请求对象
·/js/helper.js: some useful javascript functions.
/js/helper.js:一些实用的javascript函数。
·/js/run.js: opens a window for a test run.
/js/run.js:为一个測试执行打开一个窗体。
·/js/tooltip.js: provides functions to display tooltip texts.
/js/tooltip.js:提供函数来显示工具提示文本
·/navigation/pagehead.php: If you want to add a new tab to the navigation, do it here.
/navigation/pagehead.php:假设你想在导航栏中加入一个新的标签页,在这里进行操作。
·/navigation/register.php: Here the navigation of the webfrontend is created.
/navigation/register.php:创建webfrontend的导航栏
5.3Command flow during test process(測试过程中的命令流)
by Mario SMERITSCHNIG [code/documentation]
Mario SMERITSCHNIG【代码/文档】
在网上找了一个安装文档。地址是:
http://opensource.telkomspeedy.com/wiki/index.php/VoIP_Cookbook:_Installation_of_SIPp_Webfrontend
拷贝 &提取
mkdir /var/www/sipp cp sipp_webfrontend_v1.2.tgz /var/www/sipp/ cd /var/www/sipp/ tar zxvf sipp_webfrontend_v1.2.tgz mv /var/www/sipp/src/* /var/www/sipp/ |
创建数据库
mysql -u root -p password: CREATE DATABASE SIPpDB; USE SIPpDB; \. /var/www/sipp/tables.sql quit |
编辑config.ini.php
vi /var/www/sipp/config.ini.php |
如:
[EXECUTABLES] 3.0 = "/usr/bin/sipp"
[CONFIG] db_host = "localhost" db_user = "root" db_pwd = "123456" db_name = "SIPpDB" admin_pwd = "" |
为了更加easy訪问网页,清空admin_pwd字段。能够通过
来訪问SIPp Webfrontend 。用
username admin password <no password> |