One of the biggest issues when using SMPP to send text messages is that you want the output request from your application to be able to send text in UCS2 format especially if you are sending text in Arabic language
You Can solve this issue in ROR by the following:
After installing your SMPP plugin, you have to change your data encoding to int 8 by adding this line to the configuration file :
editing the following file
RAILS_ROOT/vendor/plugins/ruby_smpp/lib/pdu/submit_sm.rb
got to line 30 and change the code to the following
@data_coding options[:data_coding]?options[:data_coding]:8
changing the data_coding to 8 means that the output format will be UCS2 which is a 16 data bit coding
after changing the data coding you have to change the text encoding to UTF-16 so as any mobile device can understand it
go to your Model and add the following method
def self.send_notification(mobile,message) sms = SMSWrapper.new string= Iconv.conv('UTF-16BE','UTF-8',message) r = sms.sendSMS(mobile, string) RAILS_DEFAULT_LOGGER.info "===>SMS successfully sent"
end
all what we did is that we converted the text From UTF- 8 to UTF- 16 Big Endian so as to be supported by the UCS2 format