This repository has been archived by the owner on Feb 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
offnet.rb
78 lines (56 loc) · 1.68 KB
/
offnet.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# @file offnet.rb
#
# Copyright (C) Metaswitch Networks 2015
# If license terms are provided to you in a COPYING file in the root directory
# of the source code repository by which you are accessing this code, then
# the license outlined in that COPYING file applies to your use.
# Otherwise no rights are granted except for those provided to you by
# Metaswitch Networks in a separate written agreement.
TestDefinition.new("Off-net calls - tel: URI") do |t|
t.skip_unless_offnet_tel
caller = t.add_endpoint
as = t.add_as 5072
t.add_quaff_setup do
caller.register
end
t.add_quaff_scenario do
call = caller.outgoing_call("tel:#{ENV['OFF_NET_TEL']}")
call.send_request("MESSAGE", "hello world\r\n",
{"Content-Type" => "text/plain"})
call.recv_response("200")
call.end_call
end
t.add_quaff_scenario do
call2 = as.incoming_call
call2.recv_request("MESSAGE")
call2.send_response("200", "OK")
call2.end_call
end
t.add_quaff_cleanup do
caller.unregister
end
end
TestDefinition.new("Off-net calls - sip: URI") do |t|
t.skip_unless_offnet_tel
caller = t.add_endpoint
as = t.add_as 5072
t.add_quaff_setup do
caller.register
end
t.add_quaff_scenario do
call = caller.outgoing_call("sip:#{ENV['OFF_NET_TEL']}@#{t.deployment};user=phone")
call.send_request("MESSAGE", "hello world\r\n",
{"Content-Type" => "text/plain"})
call.recv_response("200")
call.end_call
end
t.add_quaff_scenario do
call2 = as.incoming_call
call2.recv_request("MESSAGE")
call2.send_response("200", "OK")
call2.end_call
end
t.add_quaff_cleanup do
caller.unregister
end
end