mojolingo / sippy_cup

Create SIP load test scenarios the easy way
http://mojolingo.github.io/sippy_cup
MIT License
218 stars 78 forks source link

Variable substitution ads extra quotes and fails to execute #113

Open royalpinto opened 1 year ago

royalpinto commented 1 year ago

The extra quotes added around From and <action> for variables in XML throws syntax error on SIPp As explained in the SIPp documentation and an example image here, it should have any quotes around the field variables.

Scenario file

source: 192.168.0.1 # Masked
destination: 192.168.0.2:5060 # Masked
max_concurrent: 120
calls_per_second: 2
number_of_calls: 1000
to_user: 2156546
from_user: [field0]
dtmf_mode: 'info'
scenario_variables: variables.csv
steps:
  - invite
  - wait_for_answer
  - ack_answer
  - sleep 10
  - send_digits 3
  - sleep 1000
  - send_bye

Run

sippy_cup -r 1000calls.yml
.
.
2022-12-22  05:17:15.292803 1671686235.292803: Unsupported keyword '"field0"' in xml scenario file
2022-12-22  05:17:15.292803 1671686235.292803: Unsupported keyword '"field0"' in xml scenario fileI, [2022-12-22T05:17:15.294324 #23710] INFO -- : Test completed successfully but some calls failed.

Compile

sippy_cup --compile 1000calls.yml

Extra quotes and &quot; in two sections:

From: "["field0"]" <sip:["field0"]@[local_ip]:[local_port]>;tag=[call_number]
.
.
.
<action>
  <assignstr assign_to="remote_addr" value="[service]@[remote_ip]:[remote_port]"/>
  <assignstr assign_to="local_addr" value="[&quot;field0&quot;]@[local_ip]:[local_port]"/>
  <assignstr assign_to="call_addr" value="[service]@[remote_ip]:[remote_port]"/>
</action>

NOTE: When compiled and manually cleaned up the quotes and given to SIPp, it works perfectly fine.