发布新日志

  • SIPp场景文件

    2007-12-07 14:38:04

    刚刚98群里的朋友说在看我的MSN,最近都没有新文文发布,有点汗颜地说~
    就来贴个最近研究的东西,各位有问题可以联系我。
    PS:贴的时候觉得没有个注释什么的有点对不住各位了~下次再补吧,今天工作排成排了呵呵
    一、注册(Register)
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE scenario SYSTEM "sipp.dtd">
    <!-- This program is free software; you can redistribute it and/or      -->
    <!-- modify it under the terms of the GNU General Public License as     -->
    <!-- published by the Free Software Foundation; either version 2 of the -->
    <!-- License, or (at your option) any later version.                    -->
    <!--                                                                    -->
    <!-- This program is distributed in the hope that it will be useful,    -->
    <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
    <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
    <!-- GNU General Public License for more details.                       -->
    <!--                                                                    -->
    <!-- You should have received a copy of the GNU General Public License  -->
    <!-- along with this program; if not, write to the                      -->
    <!-- Free Software Foundation, Inc.,                                    -->
    <!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
    <!--                                                                    -->
    <!--                 Sipp default 'branchc' scenario.                   -->
    <!--                                                                    -->
    <scenario name="branch_client">
      <send retrans="500">
        <![CDATA[
          REGISTER sip:[remote_ip] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
          Call-ID: [call_id]
          CSeq: 1 REGISTER
          Contact: sip:[field0]@[local_ip]:[local_port]
          Content-Length: 0
          Expires: 3600
        ]]>
       </send>
     
       <recv response="100">
      </recv>
     
      <recv response="401" auth="true" next="1">
      </recv>
       
      <!--  send invite with authentication messages -->
      <label id="1"/>
      <send retrans="500">
      <![CDATA[
          REGISTER sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field0] <sip:[field0]@[remote_ip]:[remote_port]>
          Call-ID: [call_id]
          CSeq: 2 REGISTER
          Contact: sip:[field0]@[local_ip]:[local_port]
          [field2]
          Content-Length: [len]
          Expires: 3600
        ]]>
      </send>
     
       <recv response="100">
      </recv>
      <recv response="200"  >
      </recv>
       <pause milliseconds="1000"/>
      
      <!-- definition of the response time repartition table (unit is ms)   -->
      <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
      <!-- definition of the call length repartition table (unit is ms)     -->
      <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
    </scenario>
     
    二、呼叫事件(发起invite)
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE scenario SYSTEM "sipp.dtd">
    <!-- This program is free software; you can redistribute it and/or      -->
    <!-- modify it under the terms of the GNU General Public License as     -->
    <!-- published by the Free Software Foundation; either version 2 of the -->
    <!-- License, or (at your option) any later version.                    -->
    <!--                                                                    -->
    <!-- This program is distributed in the hope that it will be useful,    -->
    <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
    <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
    <!-- GNU General Public License for more details.                       -->
    <!--                                                                    -->
    <!-- You should have received a copy of the GNU General Public License  -->
    <!-- along with this program; if not, write to the                      -->
    <!-- Free Software Foundation, Inc.,                                    -->
    <!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
    <!--                                                                    -->
    <!--                 Sipp default 'uac' scenario.                       -->
    <!--                                                                    -->
    <scenario name="Basic Sipstone UAC">
      <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
      <!-- generated by sipp. To do so, use [call_id] keyword.                -->
      <send retrans="500">
        <![CDATA[
          INVITE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
          Call-ID: [call_id]
          CSeq: 1 INVITE
          Contact: sip:[field0]@[local_ip]:[local_port]
          Max-Forwards: 70
          Subject: Performance Test
          Content-Type: application/sdp
          Content-Length: [len]
          v=0
          o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
          s=-
          c=IN IP[media_ip_type] [media_ip]
          t=0 0
          m=audio [media_port] RTP/AVP 0
          a=rtpmap:0 PCMU/8000
        ]]>
      </send>
      <recv response="407" auth="true">
      </recv>
      <!-- Packet lost can be simulated in any send/recv message by         -->
      <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
      <send>
        <![CDATA[
          ACK sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
          Call-ID: [call_id]
          CSeq: 1 ACK
          Contact: sip:[field0]@[local_ip]:[local_port]
          Max-Forwards: 70
          Subject: Performance Test
          Content-Length: 0
        ]]>
      </send>
      <!-- This delay can be customized by the -d command-line option       -->
      <!-- or by adding a 'milliseconds = "value"' option here.             -->
     
      <!-- Send 407 Authentication messages                                 -->
      <send retrans="500">
      <![CDATA[
          INVITE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
          Call-ID: [call_id]
          CSeq: 2 INVITE
          Contact: sip:[field0]@[local_ip]:[local_port]
          [field2]
          Max-Forwards: 70
          Subject: Performance Test
          Content-Type: application/sdp
          Content-Length: [len]
          v=0
          o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
          s=-
          t=0 0
          c=IN IP[media_ip_type] [media_ip]
          m=audio [media_port] RTP/AVP 0
          a=rtpmap:0 PCMU/8000
        ]]>
      </send>
     
      <recv response="100" >
      </recv>
      <recv response="180" ōptional="true">
     </recv>
     <recv response="200" >
     </recv>
      <pause milliseconds="5000"/>
      <!-- The 'crlf' option inserts a blank line in the statistics report. -->
      <send retrans="500">
        <![CDATA[
          BYE sip:[field1]@[remote_ip]:[remote_port] SIP/2.0
          Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
          From: [field0] <sip:[field0]@[local_ip]:[local_port]>;tag=[call_number]
          To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
          Call-ID: [call_id]
          CSeq: 2 BYE
          Contact: sip:[field0]@[local_ip]:[local_port]
          Max-Forwards: 70
          Subject: Performance Test
          Content-Length: 0
        ]]>
      </send>
     
      <recv response="200" crlf="true">
      </recv>
      <!-- definition of the response time repartition table (unit is ms)   -->
      <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
      <!-- definition of the call length repartition table (unit is ms)     -->
      <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
    </scenario>

    三、遇到的问题
    目前还在解决如何能用SIPp实现接听电话,以便双方能真正建立通话。
    已经可以确定的是该软件不只像load runner那样模拟实现,而是现实意义上的按场景文件实现,因为我曾经用它发送到座席号码后,已经登录的座席真的被呼叫了,接听后双方可以通话,遇到的问题也正在于此:如何能实现接收~做过一些实践都没有成功,发送200OK总是失败的,显示累积值为0~

    四、对应.CSV文件
    3599;71001;[authentication username=3599 password=000000]
    3598;71002;[authentication username=3598 password=000000]
    3597;71003;[authentication username=3597 password=000000]
    3596;71004;[authentication username=3596 password=000000]
    3595;71005;[authentication username=3595 password=000000]
    3594;71006;[authentication username=3594 password=000000]
    3593;71000;[authentication username=3593 password=000000]
    3592;72001;[authentication username=3592 password=000000]
    3591;72002;[authentication username=3591 password=000000]
    3590;72003;[authentication username=3590 password=000000]
    3589;72004;[authentication username=3589 password=000000]
    3588;72005;[authentication username=3588 password=000000]
    3587;73000;[authentication username=3587 password=000000]
    3586;73001;[authentication username=3586 password=000000]
    3585;73002;[authentication username=3585 password=abc124]
    3584;73003;[authentication username=3584 password=000000]
    3583;73004;[authentication username=3583 password=000000]
    五、注意
         1、被叫必须要登录
         2、每个公司的SIP协议栈都不尽相同,需要按需配置
  • SIPp安装初探

    2007-12-07 14:09:38

    在一堆英文单词中,终于找到跟win32下SIPp安装相关的: http://sipp.sourceforge.net/wiki/index.php/Compilation
    但是,其中除了部分链接已过期外有的设置也不符合我的实际情况,遂写个文文留待以后使用。
     
    声明,本文是针对在WIN32下的用户安装方案。
    安装SIPp,
    一、首先要安装好Cygwin,说实话这个东西并不难,难的是下的慢,而且刚开始不懂的时候总要白装几次。
    Cygwin是一个用于在Windows上模拟Linux环境的软件,对于只用来使用SIPP的用户而言,只安装以下几个包就可以了
       ☼ gcc-core
       ☼ gcc-g++
       ☼ libncurses-devel
       ☼ libncurses8
       ☼ openssl-devel
       ☼ make
    MM比较懒,都选了install
    至于有其它需要的用户可以定制安装其它包。
    运行setup.exe
    这方面的文很多,这里只大概谈一下需要注意的地方:
         1、下载时前面都是下一步就OK,按默认就好。到选择镜像站点的时候建议选择http://mirrors.kernel.org,据一个安装多次的哥们儿说,除了小日本的站点外就这个速度还不错,希望大家不要浪费时间去试验;
         2、到选择安装方式——Select Packages页面时,一定要注意每个包后面的状态:
             Keep,意思就是说保持目前已经安装的版本不动。不会替换目前已有的版本,下次安装包的时候尽量使用此选项,因为它不会把你已经有的包重新安装一次;
             Curr,意思就是说把最新的版本统统下载下来安装
             其它2个没试过。
             而且应该注意一下名为Category的一列,该列后面写的是安装的方式,有安装、卸载、重新安装等,不用说,第一次当然是安装。
             好了,剩下的就是等待了,相信我,这是相当漫长地。。。
    Cygwin就安装完毕,大家一定要记住安装的路径。
    二、下面要下载IPV6
    1、将其解压出来的3个文件夹:/bin,/lib,/usr复制到刚刚Cygwin的安装目录下即:../Cygwin/这里,以替换已有的文件夹。
    2、将Cygwin/lib/cygwin1.dll删除,并为new_cygwin1.dll(也有可能叫做new-cygwin1.dll)重命名为cygwin1.dll
    三、安装Winpcap
    1.1rc8以后的SIPP都需要安装winpcap,否则会找不到一个名为Wpcap.dll的文件
    下载安装版地址:http://www.winpcap.org/install/default.htm
    另外在http://www.winpcap.org/devel.htm下载其源代码版,将解压后的代码复制到cygwin/lib/WdpPack,如果下载的版本较旧的话,会在cygwin/lib/WdpPack/include/下删除文件Pthread.h,因为它会影响cygwin的pthread.h
    以上是所有准备工作,下面开始安装SIPP了
    四、安装SIPP
    我安装的是2.0.1版的.exe,从SIPP官网上下载最新的win32 EXE版本,安装时注意要把目录先择为cygwin/home/username/,这里的username是进入cygwin中显示的名字,也就是Windows的用户名,例如MM的就是mmhao_54^^
    好了,到这里安装就完成了。
    五、使用
    进入cygwin,第一次使用前需要等待一段时间,当出现 $符号时,意味着至少cygwin可以正常使用了。
    1、这时候我们可以在windows自带的命令行语句中使用:
    找到sipp的安装目录后,写入sipp后回车即可,要想调用uac和uas,只要在相应目录下键入
    sipp -sn uas
    sipp -sn uac 127.0.0.1
    即可。
    2、也可以找到sipp安装在开始菜单中的,start sipp shell或uas和uac。使用以上命令效果相同。
     
    在这里,强烈推荐有问题的朋友一定要去sipp的官网上去找答案,这个安装过程看似简单,也是MM花费了不少时间找资料的结果。其中尤以官网的资料效率最高,请大家克服一下英文的困难~~
    有任何安装的问题可以随时给MM留言,一定第一时间跟大家学习。
Open Toolbar