Created
May 2, 2011 11:00
-
-
Save fguillen/951439 to your computer and use it in GitHub Desktop.
sending SMS by OVH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'soap/wsdlDriver' | |
class SMSSender | |
def self.send( phone, text ) | |
Rails.logger.info( "sending sms [#{phone}]: '#{text}'") | |
wsdl = 'http://www.ovh.com/soapi/soapi-re-1.18.wsdl' | |
soapi = SOAP::WSDLDriverFactory.new( wsdl ).create_rpc_driver | |
session = | |
soapi.login( | |
APP_CONFIG[:sms_user], | |
APP_CONFIG[:sms_pass], | |
'es', | |
false | |
) | |
result = | |
soapi.telephonySmsSend( | |
session, | |
APP_CONFIG[:sms_pack], | |
APP_CONFIG[:sms_phone_from], | |
phone, | |
text, | |
nil, | |
nil, | |
nil, | |
nil, | |
nil, | |
nil | |
) | |
soapi.logout( session ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment