Class: SmscManager::SmscStompConnection
- Inherits:
-
Object
- Object
- SmscManager::SmscStompConnection
- Defined in:
- lib/smsc_manager/smsc_stomp_connection.rb
Constant Summary collapse
- @@timeout_max =
use block for timers etc
10
Instance Attribute Summary collapse
-
#hostname ⇒ Object
10 second timeout to contact sms server.
-
#password ⇒ Object
10 second timeout to contact sms server.
-
#port ⇒ Object
10 second timeout to contact sms server.
-
#topic ⇒ Object
10 second timeout to contact sms server.
-
#url ⇒ Object
10 second timeout to contact sms server.
-
#username ⇒ Object
10 second timeout to contact sms server.
Instance Method Summary collapse
- #intialize(args) ⇒ Object
- #send(sms) ⇒ Object
-
#sms_send(sms) ⇒ Object
asssumes http post — can be modified for other messaging of course.
- #test(sms) ⇒ Object
Instance Attribute Details
#hostname ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def hostname @hostname end |
#password ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def password @password end |
#port ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def port @port end |
#topic ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def topic @topic end |
#url ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def url @url end |
#username ⇒ Object
10 second timeout to contact sms server
9 10 11 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 9 def username @username end |
Instance Method Details
#intialize(args) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 10 def intialize(args) self.url="/TopicSMS/TopicSMS" self.topic = 'sms' self.hostname = 'x.x.x.x' self.port='8161' end |
#send(sms) ⇒ Object
17 18 19 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 17 def send(sms) sms_send(sms) end |
#sms_send(sms) ⇒ Object
asssumes http post — can be modified for other messaging of course
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 24 def sms_send(sms) puts "create stomp message" m=SmscManager::SmsSendTopic.(sms.text,sms.destination,sms.source) puts "message is #{m.to_xml}" # original puts "hostname: #{arg_hash[:host]} port #{arg_hash[:port]}" arg_hash={} arg_hash[:host]=self.hostname argh_hash[:port]=self.port puts "hostname: #{self.hostname} port #{arg_hash[:port]}" url="#{arg_hash[:topic]}?m.to_xml" arg_hash[:url]=self.url arg_hash[:topic]=self.topic msg_sender=StompMessage::StompSendTopic.new(arg_hash) msg_sender.post_stomp(m, {}) end |
#test(sms) ⇒ Object
20 21 22 |
# File 'lib/smsc_manager/smsc_stomp_connection.rb', line 20 def test(sms) send(sms) end |