quaff 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/call.rb +1 -5
  3. data/lib/endpoint.rb +12 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74ddf7205f6389ce8025f6f4603efcb2c96802bf
4
- data.tar.gz: 53d6859c95082cfb58a6aa1f65641041f2a9db32
3
+ metadata.gz: 20c9f3e778c12a6af9fbef86b334bc7708c47c34
4
+ data.tar.gz: 723bc3efb24e71e50b51fa0a45c7e70a04dc791a
5
5
  SHA512:
6
- metadata.gz: 4c2bd36727ba79e1c1108938d944fa1a0907a3bb3e139541aab08fdf8f785eac5c645017fb980adfa1f8c9c762c6432c5848da73ac30af9561d2eba9e6edcc0b
7
- data.tar.gz: 67a217de9d2bcf196f5cdc910ea7fb6c2065492180abd68d9134356960999057487d47fedfb98c3bfccb54195744ba2b812835359476b022462e9c2e19a72837
6
+ metadata.gz: 310387f9435b9692b61ac26cdf62cc5d335edca91ef98409d117b157a0d78a98610bd0e389cb5a8f16dc3916e30cae1c928172b6bb62716f1d7a9d3b4a670d11
7
+ data.tar.gz: 06c032f15eea07f990b2af515061edf05742e720dfa80a6603c4b1cf42e6cff021e52e437e936330e2e4b9b686b0d76b134a61ae41ff535ecdc5e1b2ed470794
@@ -283,13 +283,9 @@ class Call
283
283
  "Max-Forwards" => "70",
284
284
  "Content-Length" => "0",
285
285
  "User-Agent" => "Quaff SIP Scripting Engine",
286
- "Contact" => "<sip:quaff@#{Utils::local_ip}:#{@cxn.local_port};transport=#{@cxn.transport};ob>",
286
+ "Contact" => @cxn.contact_header
287
287
  }
288
288
 
289
- if @instance_id
290
- defaults["Contact"] += ";+sip.instance=\"<urn:uuid:"+@instance_id+">\""
291
- end
292
-
293
289
  is_request = code.nil?
294
290
  if is_request
295
291
  defaults['Route'] = @routeset
@@ -11,8 +11,8 @@ require 'digest/md5'
11
11
 
12
12
  module Quaff
13
13
  class BaseEndpoint
14
- attr_accessor :msg_trace, :uri, :sdp_port, :sdp_socket, :instance_id
15
- attr_reader :msg_log, :local_port
14
+ attr_accessor :msg_trace, :uri, :sdp_port, :sdp_socket, :contact_header
15
+ attr_reader :msg_log, :local_port, :instance_id
16
16
 
17
17
  # Creates an SDP socket bound to an ephemeral port
18
18
  def setup_sdp
@@ -36,6 +36,11 @@ module Quaff
36
36
  def add_sock sock
37
37
  end
38
38
 
39
+ def instance_id= id
40
+ @instance_id = id
41
+ @contact_header += ";+sip.instance=\"<urn:uuid:"+@instance_id+">\""
42
+ end
43
+
39
44
  # Retrieves the next unhandled call for this endpoint and returns
40
45
  # a +Call+ object representing it
41
46
  def incoming_call
@@ -91,6 +96,7 @@ module Quaff
91
96
  @outbound_connection = new_connection(outbound_proxy, outbound_port)
92
97
  end
93
98
  @hashes = []
99
+ @contact_header = "<sip:quaff@#{Utils::local_ip}:#{@local_port};transport=#{@transport};ob>"
94
100
  initialize_queues
95
101
  start
96
102
  end
@@ -171,6 +177,10 @@ module Quaff
171
177
  Timeout::timeout(time_limit) { @call_ids.deq }
172
178
  end
173
179
 
180
+ def no_new_calls?
181
+ return @call_ids.empty?
182
+ end
183
+
174
184
  # Sets up the internal structures needed to handle calls for a new Call-ID.
175
185
  def add_call_id cid
176
186
  @messages[cid] ||= Queue.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quaff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Day
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter