Intercepting incoming messages

59 views
Skip to first unread message

Ulugbek

unread,
May 27, 2011, 5:49:55 PM5/27/11
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!

Ray Krueger

unread,
May 27, 2011, 6:23:18 PM5/27/11
to ruby...@googlegroups.com
Sorry,
You're going to have to write some code and try it out. If you have problems with the library let me know :)

-Ray

Reply all
Reply to author
Forward
0 new messages