Linux-SIPp3.3测试FreeSwitch-(三)UAC-1

上一篇 / 下一篇  2013-11-28 16:03:18 / 个人分类:sipp

# Author:fairylly

SIPp测试的时候需要准备以下几个文件:

UAC端:uac.sh,  uac.xml,  uac.csv

uac.sh:调用sipp命令,并传入相应参数脚本文件,模拟UAC(例如主叫),当然也可不准备此文件直接输入sipp命令执行程序,但是写成文件执行更加方便可靠

uac.xml:根据需要编写的uac侧的sip信号流程

uac.csv:用于uac.xml需要引入的相应数据;

 

UAS端:reg.sh,  reg.xml,  uas_noreg.sh,  uas_noreg.xml,  uas.csv

reg.sh:调用sipp命令,并传入相应参数的脚本文件,模拟UAS注册,当然也可不准备此文件直接输入sipp命令执行程序,但是写成文件执行更加方便可靠

reg.xml:根据需要编写的注册流程,主要配合uas流程使用;

uas_noreg.sh:调用sipp命令,并传入相应参数的脚本文件,模拟UAS(例如被叫),当然也可不准备此文件直接输入sipp命令执行程序,但是写成文件执行更加方便可靠。

uas_noreg.xml:根据需要编写的uas侧的sip信号流程。

uas.csv:用于reg.xmluas.xml中需要引入的相应数据。

 

注意:uas中,reg.xmluas_noreg.xml中的内容不能合并在同一个xml中,或者会导致收不到invite


使用下述命令,可以直接导出场景模板,再进行二次修改;

./sipp -sd branchc > branchc.xml

1、UAC

调试uac流程时,推荐调试方案:uac主叫+eyebeam被叫(或其它VOIP工具);

uacuas单方都确认调试通过后,再使用:uac主叫+uas被叫;

 

uac.xml流程:

 

 

uac.sh文件内容如下:

./sipp -i 192.168.146.17 -sf uac.xml -inf uac.csv 192.168.146.11:5060 -l 1 -trace_msg -trace_screen -trace_err -p 12345 -m 1 -aa

参数解释:

-i: Set the local IP address for 'Contact:','Via:', and 'From:' headers. 

Default is primary host IP address.

'Contact:','Via:',  'From:' 头部信息设置本地IP在脚本中用[local_ip]引入

 

-sf: Loads an alternate xml scenario file.  

To learn more about XML scenario syntax, use the -sd option to dump embedded scenarios.

 They contain all the necessary help.

引入脚本文件,根据需要模拟的呼叫流程编写

 

-inf: Inject values from an external CSV file during calls into the scenarios.

First line of this file say whether the data is to be read in sequence (SEQUENTIAL), random (RANDOM), or user(USER) order.

Each line corresponds to one call and has one or more ';' delimited data fields. Those fields can be referred as [field0], [field1], ... in the xml scenario file. 

Several CSV files can be used simultaneously (syntax:-inf f1.csv -inf f2.csv ...)

在通话场景中使用外部csv文件引入数据;

文件的第一行说明了后面数据的读入方式,常用的有:顺序 (SEQUENTIAL), 随机 (RANDOM), 或用户(USER)顺序;

第一行对应一个通话,它们由一个或多个;分隔数据字段,这些字段可以在xml场景文件中使用[field0], [field1], ...来调用;

多个csv文件,可以同时使用(语法:-inf f1.csv -inf f2.csv ...

 

192.168.146.11:5060

Freeswitch服务端IPfreeswitch使用的端口;

 

-l: Set the maximum number of simultaneous calls. 

Once this limit is reached, traffic is decreased until the number of open calls goes down. 

Default:(3 * call_duration (s) * rate).

设置同时呼叫的最大数目;

一旦达到此值,流量将被限制直到打开的通话数下降;

默认值:3*call_duration(s)*rate

 

-p: Set the local port number.  Default is a random free port chosen by the system.

设置本地端口号,默认是由系统随机选择空闲的端口号;

 

-m:Stop the test and exit when 'calls' calls are processed

当设置的通话数完成时,停止测试并退出;

 

-aa: Enable automatic 200 OK answer for INFO, UPDATE and NOTIFY messages.

针对INFO, UPDATE 和 NOTIFY消息,进行200 OK自动回复应答;

 

-trace_msg:

Displays sent and received SIP messages in <scenario file name>_<pid>_messages.log

<场景文件名>_<pid>_messages.log中显示发送和接收的SIP消息;调试时可增加,正试性能测试时,可取消,以免日志量太大影响本地性能;

 

-trace_screen:

Dump statistic screens in the<scenario_name>_<pid>_screens.log file when quitting SIPp. 

Useful to get a final status report in background mode (-bg option).

在退出SIPp时,把屏蔽上的统计信息写入<场景名>_<pid>_screens.log文件中;

在后台模式(-bq选项)时,这对于得到最终状态报告很有用;

 

-trace_err:

Trace all unexpected messages in <scenario filename>_<pid>_errors.log.

跟踪所有非期望的消息到<场景文件名>_<pid>_errors.log

 

测试时,有可能要指定发送呼叫频率,可以指定参数:

-r 1 -rp 3000:每三秒钟发一个呼,如果不指定,默认为1秒加载10用户;

 

性能测试过程中,一直要修改测试用户数,可考虑参照如下修改uac.sh脚本,-l-m参数使用变更代替:

#!/bin/bash

# Author:fairylly

#执行脚本时,未输入参数,提示:please input call number!,并退出

if [[ $# -eq 0 ]]

then

        echo "please input call number!"

        exit 1

fi

#m变量使用命令行传递的第一个位置参数

m=$1

 

./sipp -i 192.168.146.17 -sf uac.xml -inf uac.csv 192.168.146.11:5060 -l $m -trace_screen -trace_err -p 12345 -m $m -aa

 

使用方法:./uac.sh 100,表示最大同时呼叫100个用户;

 

 


TAG: freeswitch Linux linux sipp SIPP uac 测试

不断的前进ING。。。 引用 删除 fairylly   /   2013-12-06 11:33:32
原帖由linneiwei于2013-12-05 20:29:07发表
还在用SIPP,我们都该用kylinPET啦,操作方便

刚查了下,这个还是比较新的测试工具
这种新工具,没有足够的时间积淀下,还是不太成熟哦!工具稳定性等,都待考验!
引用 删除 linneiwei   /   2013-12-05 20:29:07
还在用SIPP,我们都该用kylinPET啦,操作方便
sparkwoif的个人空间 引用 删除 sparkwoif   /   2013-11-29 15:02:55
5
 

评分:0

我来说两句

Open Toolbar