如何使用吸杯与密码认证

问题描述 投票:1回答:1

我在寻找一些帮助如何使sippy_cup场景文件。

我想通过发起SIPP呼叫作为UAC。另一软客户端连接为UAS。一个Asterisk服务器处理两个客户端之间的连接。

---
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 '[email protected]', 'password!'
  - invite
  - wait_for_answer
  - ack_answer
  - sleep 3
  - send_digits '200'
  - sleep 5
  - send_digits '#'
  - wait_for_hangup

401消息的ACK包后捕获不显示任何其他消息。

所以,问题是,如何需要sippy_cup回复401消息?

asterisk sip voip sipp
1个回答
1
投票

我还没有找到一种方法,使用吸杯的YML文件进行认证,但我没有找到如何与调用sippy_cup库的Ruby脚本做到这一点。这里有云:

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!

您可以将此保存为test.rb,然后通过发出ruby test.rb编译的情况。这将创建一个sippy_cup.xmlsippy_cup.pcap。然后,您可以通过发出运行方案:

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

因为已经快一年了,因为你的帖子过去了,让我知道,如果你发现了一种使用YML文件中,而不是同时。

© www.soinside.com 2019 - 2024. All rights reserved.