Ulugbek
unread,May 27, 2011, 5:49:55 PM5/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ruby-smpp
Hi Ray,
Here is what I am trying to use the ruby-smpp for: i will register 4-6
digit number with wireless operator and they will forward the text
messages to my gateway from the users. I will process them with rails
app and send back a response sms to user/client that made the sms
query.
I sample_gateway has instructions for sending messages from a queue,
and has methods for MT messages. Is the delegate mo_received where
incoming messages can be captured? How can I differentiate whether the
messages is MO or delivery notification? Lastly, how can I invoke
activerecord object from rails app within the mo_received delegate in
the following way if I manage to daemonize the gateway:
def mo_received(transceiver, pdu)
unless message_is_notification(pdu)
User.find_by_number(pdu.source_addr).incoming_messages.create(:message
=> pdu.short_message)
end
end
My concern is that some_gateway.rb will run separately from the rails
app and most likely won't manage to get hold of User object simply by
virtue of some_gateway.rb being in app/models directory.
Thanks!