SIP VoIP 測試交流羣: 323827101javascript
歡迎你們轉載。爲保留做者成果,轉載請註明出處。http://blog.csdn.net/netluoriver,有些文件在資源中也可以下載。假設你沒有積分,可以聯繫我索要!
php
3.6Adding calls to a test(爲測試腳本添加呼叫)html
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.java
加入一個呼叫,在對應的一端使用add a call 連接 (見上圖)和開始建立新的呼叫。mysql
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 firstios
這裏的命令行參數可以設置SIPp(用圓括號規定對應的參數。好比:(-timeout)或(-m)),但首先web
·choose an Executable (the version of SIPp you want to use, defined in config.ini.php. See section Config file for more details).ajax
選擇一個可運行文件(在config.ini.php中定義你想用的SIPp版本號。查看Config file一節得到不少其它具體信息)sql
·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> |