{"id":648,"date":"2020-02-22T21:32:52","date_gmt":"2020-02-22T21:32:52","guid":{"rendered":"http:\/\/james-batchelor.com\/?p=648"},"modified":"2020-02-22T21:41:59","modified_gmt":"2020-02-22T21:41:59","slug":"testing-a-new-pbx","status":"publish","type":"post","link":"https:\/\/james-batchelor.com\/index.php\/2020\/02\/22\/testing-a-new-pbx\/","title":{"rendered":"Testing a New PBX"},"content":{"rendered":"\n<p>Recently\nI\u2019ve had the opportunity to deploy and test a call centre PBX product to gauge\nif its viable to offer as a product and how it will sit within our\ninfrastructure.<\/p>\n\n\n\n<p>Installing and poking around the GUI is all well and good but to really find out how a PBX behaves it needs some traffic, to find outs its performance in regards to resources but also to find out what a vendor\u2019s interpretation of an advertised feature actually is.<\/p>\n\n\n\n<p>To generate sample calls, instead of registering handsets\/softphones and dialling manually it would be better to automate this, and <a href=\"http:\/\/sipp.sourceforge.net\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"SIPp (opens in a new tab)\">SIPp<\/a> is the perfect tool for this.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"193\" src=\"https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/Call-Stats.png\" alt=\"\" class=\"wp-image-651\" srcset=\"https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/Call-Stats.png 574w, https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/Call-Stats-300x101.png 300w\" sizes=\"auto, (max-width: 574px) 85vw, 574px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<p>SIPp is an\nopen source SIP testing tool for stress testing PBX\u2019s, but it can also be used\nmore modestly so it can generate more real-world scenarios to simulate typical calls.\nThis can also be beneficial when testing and reviewing complex call flows\nthrough a system before deploying.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Environment<\/strong><\/h3>\n\n\n\n<p>In this\nexample I would be using a local CentOS 7 Virtual Machine to host the SIPp\napplication, with the PBX sitting remotely and network access via VPN for the\ntesting period.<\/p>\n\n\n\n<p>The PBX\nwill also have a trunk set to allow calls in from the CentOS box and a DDI assigned.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Installation<\/strong><\/h3>\n\n\n\n<p>Installation\non CentOS is easiest via yum and the EPEL repositories.<\/p>\n\n\n\n<p>From a clean install run:<\/p>\n\n\n\n<pre class=\"wp-block-verse\">yum update<br>yum install epel-release<br>yum install sipp <\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Operation<\/strong><\/h3>\n\n\n\n<p>Once installed its as easy to run as running the program from the command line, but getting the results you are looking for requires a lot of switches and a scenario file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"809\" height=\"495\" src=\"https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/sipp.png\" alt=\"\" class=\"wp-image-652\" srcset=\"https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/sipp.png 809w, https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/sipp-300x184.png 300w, https:\/\/james-batchelor.com\/wp-content\/uploads\/2020\/02\/sipp-768x470.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption>SIPp in action<\/figcaption><\/figure>\n\n\n\n<p>The simplest\nway to look at this is the switches take care of the targeting and rate of the calls,\nwhere the scenario file simulates the calling person, and can be set to imitate\nspeech (RTP streams), dtmf inputs and even introduce packet loss to measure quality\nof calls. Essentially a profile of a call is contained within the scenario file.<\/p>\n\n\n\n<p>As an example,\nthis is a typical command I use for testing a very modest call load:<\/p>\n\n\n\n<p><em>sipp -sf file.xml\n-trace_err -trace_msg -i 10.20.30.40 -r 1 -rp 10000 -l 100 -m 50 -s 12345678901\n10.100.100.100<\/em><\/p>\n\n\n\n<p>To break down\nthis command and make it more understandable:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>-sf {FILENAME} &#8211; Scenario file.<\/li><li>-trace_err &#8211; Print errors to file, for troubleshooting.<\/li><li>-trace_msg &#8211; Print verbose log to file, for troubleshooting.<\/li><li>-i {IPADDRESS} &#8211; RTP stream (Audio) source.<\/li><li>-r {NUMBER} &#8211; Call Rate &#8211; Rate that calls are attempted.<\/li><li>-rp {NUMBER} &#8211; Rate Period &#8211; Number defined in Call Rate are spread over the Rate Period.<\/li><li>-l {NUMBER} &#8211; Max number of concurrent calls.<\/li><li>-m {NUMBER} &#8211; Total number of calls to attempt.<\/li><li>-s {NUMBER}- SIP number to dial and server.<\/li><li>&#8220;10.100.100.100&#8221; &#8211; PBX server IP<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Scenario File<\/strong><\/h3>\n\n\n\n<p>As mentioned, the scenario file contains the simulation of a call from a calling\nparty.<\/p>\n\n\n\n<p>SIPp has a number of template scenario files in XML format available on their <a href=\"http:\/\/sipp.sourceforge.net\/doc\/reference.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Sourceforge (opens in a new tab)\">Sourceforge<\/a> page, these can be download and modified as needed.<\/p>\n\n\n\n<p>For example, below is my modification of the uac_pcap.xml template, this is a simple file that connects and plays an RTP stream (from a pcap file) for two minutes before hanging up:<\/p>\n\n\n\n<pre class=\"wp-block-verse\">  &lt;scenario name=\"UAC with media\"><br> &lt;!-- CALL SETUP\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --><br> \u00a0 &lt;send retrans=\"500\"><br> \u00a0\u00a0\u00a0 &lt;![CDATA[<br> \u00a0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 INVITE sip:[service]@[remote_ip]:[remote_port] SIP\/2.0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Via: SIP\/2.0\/[transport] [local_ip]:[local_port];branch=[branch]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 From: 01234567890 &lt;sip:01234567890@[local_ip]:[local_port]>;tag=[call_number]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 To: sut &lt;sip:[service]@[remote_ip]:[remote_port]><br> \u00a0\u00a0\u00a0\u00a0\u00a0 Call-ID: [call_id]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 CSeq: 1 INVITE<br> \u00a0\u00a0\u00a0\u00a0 \u00a0Contact: sip:sipp@[local_ip]:[local_port]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Max-Forwards: 70<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Subject: Performance Test<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Content-Type: application\/sdp<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Content-Length: [len]<br> \u00a0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 v=0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 s=-<br> \u00a0\u00a0\u00a0\u00a0\u00a0 c=IN IP[local_ip_type] [local_ip]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 t=0 0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 m=audio [auto_media_port] RTP\/AVP 8<br> \u00a0\u00a0\u00a0\u00a0\u00a0 a=rtpmap:8 PCMA\/8000<br> \u00a0\u00a0\u00a0\u00a0\u00a0 a=rtpmap:101 telephone-event\/8000<br> \u00a0\u00a0\u00a0\u00a0\u00a0 a=fmtp:101 0-11,16<br> \u00a0<br> \u00a0\u00a0\u00a0 ]]><br> \u00a0 &lt;\/send><br> \u00a0<br> \u00a0 &lt;recv response=\"100\" optional=\"true\"><br> \u00a0 &lt;\/recv><br> \u00a0<br> \u00a0 &lt;recv response=\"180\" optional=\"true\"><br> \u00a0 &lt;\/recv><br> \u00a0<br> \u00a0 &lt;send><br> \u00a0\u00a0\u00a0 &lt;![CDATA[<br> \u00a0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 ACK sip:[service]@[remote_ip]:[remote_port] SIP\/2.0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Via: SIP\/2.0\/[transport] [local_ip]:[local_port];branch=[branch]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 From: sipp &lt;sip:sipp@[local_ip]:[local_port]>;tag=[call_number]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 To: sut &lt;sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Call-ID: [call_id]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 CSeq: 1 ACK<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Contact: sip:sipp@[local_ip]:[local_port]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Max-Forwards: 70<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Subject: Performance Test<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Content-Length: 0<br> \u00a0<br> \u00a0\u00a0\u00a0 ]]><br> \u00a0 &lt;\/send><br> \u00a0 &lt;!-- PLAY RTP STREAM\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --><br> \u00a0 &lt;nop><br> \u00a0\u00a0\u00a0 &lt;action> <br> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;exec play_pcap_audio=\"pcap\/g711a_600.pcap\"\/><br> \u00a0\u00a0\u00a0 &lt;\/action><br> \u00a0 &lt;\/nop><br> \u00a0<br> \u00a0 &lt;!-- SET CALL LENGTH\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --><br> \u00a0 &lt;pause milliseconds=\"120000\"\/><br> \u00a0<br> \u00a0 &lt;send retrans=\"500\"><br> \u00a0\u00a0\u00a0 &lt;![CDATA[<br> \u00a0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 BYE sip:[service]@[remote_ip]:[remote_port] SIP\/2.0<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Via: SIP\/2.0\/[transport] [local_ip]:[local_port];branch=[branch]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 From: sipp &lt;sip:sipp@[local_ip]:[local_port]>;tag=[call_number]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 To: sut &lt;sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Call-ID: [call_id]<br> \u00a0\u00a0\u00a0\u00a0\u00a0 CSeq: 2 BYE<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Contact: sip:sipp@[local_ip]:[local_port]<br> \u00a0 \u00a0\u00a0\u00a0\u00a0Max-Forwards: 70<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Subject: Performance Test<br> \u00a0\u00a0\u00a0\u00a0\u00a0 Content-Length: 0<br> \u00a0<br> \u00a0\u00a0\u00a0 ]]><br> \u00a0 &lt;\/send><br> \u00a0<br> \u00a0 &lt;recv response=\"200\" crlf=\"true\"><br> \u00a0 &lt;\/recv><br> \u00a0<br> \u00a0 &lt;!-- definition of the response time repartition table (unit is ms)\u00a0\u00a0 --><br> \u00a0 &lt;ResponseTimeRepartition value=\"10, 20, 30, 40, 50, 100, 150, 200\"\/><br> \u00a0<br> \u00a0 &lt;!-- definition of the call length repartition table (unit is ms)\u00a0\u00a0\u00a0\u00a0 --><br> \u00a0 &lt;CallLengthRepartition value=\"10, 50, 100, 500, 1000, 5000, 10000\"\/><br> \u00a0<br> &lt;\/scenario> <\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Personal Observations<\/strong><\/h3>\n\n\n\n<p>This is a great tool for automation in the testing phase of a new platform\ndeployment, and you can easily generate calls in numbers considered unfeasible when\nusing traditional desk and soft phones, plus this method allows all phones in\nthe test bed to become call recipients, increasing the user base to more accurately\ntest a platform.<\/p>\n\n\n\n<p>In addition to the PBX this tool also tests the network that provides connectivity\nto the phone system, this was highlighted to me when testing with traffic going\nover a VPN, and discovered that the VPN gateway could not cope with more than 10\nconcurrent calls despite having enough bandwidth available.<\/p>\n\n\n\n<p>As a final note I recommend to start a test with minimal call volume ad scale from there. Whilst SIPPp can simulate calls, these aren\u2019t as organic as the real world. I managed to knock a live system offline with as little as 100 generated calls, due in part to 100 SIP invites being sent within one second.<\/p>\n\n\n\n<p>Oh, and don&#8217;t introduce a load of test calls to a flow where the final destination is a voicemail, I found that out the hard way!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I\u2019ve had the opportunity to deploy and test a call centre PBX product to gauge if its viable to offer as a product and how it will sit within our infrastructure. Installing and poking around the GUI is all well and good but to really find out how a PBX behaves it needs some &hellip; <a href=\"https:\/\/james-batchelor.com\/index.php\/2020\/02\/22\/testing-a-new-pbx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Testing a New PBX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[280,5,247],"tags":[278,276,279,275,277,248],"class_list":["post-648","post","type-post","status-publish","format-standard","hentry","category-cent-os","category-servers","category-voip","tag-automation","tag-pbx","tag-servers","tag-sipp","tag-testing","tag-voip"],"_links":{"self":[{"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/posts\/648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/comments?post=648"}],"version-history":[{"count":4,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/posts\/648\/revisions"}],"predecessor-version":[{"id":656,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/posts\/648\/revisions\/656"}],"wp:attachment":[{"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/media?parent=648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/categories?post=648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/james-batchelor.com\/index.php\/wp-json\/wp\/v2\/tags?post=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}