Class: Sipgate::Fax

Inherits:
Base
  • Object
show all
Defined in:
lib/rsipgate/fax.rb

Constant Summary

Constants inherited from Base

Base::PATH

Instance Method Summary collapse

Methods inherited from Base

#call, #initialize, #my_api_host, #rubyized_hash, #status

Constructor Details

This class inherits a constructor from Sipgate::Base

Instance Method Details

#send(number, pdf_message) ⇒ Object

send a fax



5
6
7
8
9
10
11
12
# File 'lib/rsipgate/fax.rb', line 5

def send(number, pdf_message)
  number.gsub!(/^(\+)/, "")
  number.gsub!(/\s+/, "")
  call "samurai.SessionInitiate",
       'RemoteUri' => "sip:#{number}@sipgate.net",
       'TOS'       => 'fax',
       'Content'   => ::Base64.encode64(pdf_message)
end