1

I am looking for some help how to make sippy_cup scenario file.

I would like to originate a call by sipp as UAC. An other soft client connected as UAS. An Asterisk server handle the connection between the two client.

---
source: 192.168.0.18
destination: 192.168.0.18
max_concurrent: 1
calls_per_second: 1
number_of_calls: 1
from_user: C001
to_user: 200
steps:
  - invite
  - wait_for_answer
  - ack_answer
  - register 'C001@192.168.0.18', 'password!'
  - invite
  - wait_for_answer
  - ack_answer
  - sleep 3
  - send_digits '200'
  - sleep 5
  - send_digits '#'
  - wait_for_hangup

Package capture does not show any other message after the ACK of 401 message.

So the question is, how need to reply to 401 message with sippy_cup?

Krisz
  • 701
  • 7
  • 23

1 Answers1

1

I haven't found a way to authenticate using the yml file for sippy cup but I did find how to do it with a ruby script that calls the sippy_cup library. Here it goes:

require 'sippy_cup'

scenario = SippyCup::Scenario.new 'Sippy Cup',from_user: 'yourusername' do |s|
  s.invite
  s.proxy_auth_required
  s.ack_answer
  s.invite headers: ["[authentication username=yourusername password=yourpassword realm=asterisk]"]
  s.wait_for_answer
  s.ack_answer
  s.sleep 5
  s.send_digits '3125551234'
  s.sleep 5
  s.send_digits '#'
  s.hangup
end

scenario.compile!

You can save this as test.rb and then compile the scenario by issuing ruby test.rb. This will create a sippy_cup.xml and a sippy_cup.pcap. Then, you can run the scenario by issuing:

sudo sipp -sf sippy_cup.xml -l 10 -m 1 -s thenumberyouwanttocallto -i yourlocalip -trace_logs -trace_err -error_file report.log asterisksip

As it has passed almost a year since your post, let me know if you found a way to use the yml file instead in the meantime.

nikolas
  • 164
  • 7
  • It's worth mentioning that this seems to only work on a forked version of sippy cup at https://github.com/Enflick/sippy_cup I'm not sure why this hasn't been put in the main version, especially since the Scenarios.proxy_auth_required method is so simple, and the mainstream sippy_cup seems to have commits as of a month ago. – Steve Sether Nov 12 '19 at 20:57
  • I've submitted a pull request to add this to the mainline sippy cup. – Steve Sether Nov 15 '19 at 17:11