Method: Diameter::Stack#send_answer

Defined in:
lib/diameter/stack.rb

#send_answer(ans, original_cxn) ⇒ Object

Sends a Diameter answer. This is sent over the same connection the request was received on (which needs to be passed into to this method).

This adds this stack’s Origin-Host and Origin-Realm AVPs, if those AVPs don’t already exist.

Parameters:

  • ans (Message)

    The Diameter answer

  • original_cxn (Socket)

    The connection which the request came in on. This will have been passed to the block registered with #add_handler.



257
258
259
260
261
# File 'lib/diameter/stack.rb', line 257

def send_answer(ans, original_cxn)
  fail "Must pass an answer" unless ans.answer
  ans.add_origin_host_and_realm(@local_host, @local_realm) 
  @tcp_helper.send(ans.to_wire, original_cxn)
end