Skip to content

Some issues using this library #18

@jorpiell

Description

@jorpiell

I've started to use this library to connect to a SMPP server and I've seen some limitations:

  1. It is not possible to send multiple SMSs using an alphanumerical sender. The Smpp::Pdu::SubmitMulti has constants in the initialize method. Just replacing this code and using the values from the options hash is possible to send messages:
service_type            = options[:service_type]? options[:service_type] :''
source_addr_ton         = options[:source_addr_ton]?options[:source_addr_ton]:0 # network specific
source_addr_npi         = options[:source_addr_npi]?options[:source_addr_npi]:1 # unknown
number_of_dests         = destination_addr_array.length # Max value can be 254
dest_addr_ton           = options[:dest_addr_ton]?options[:dest_addr_ton]:1 # international
dest_addr_npi           = options[:dest_addr_npi]?options[:dest_addr_npi]:1 # unknown
dest_addresses          = build_destination_addresses(destination_addr_array,dest_addr_ton,dest_addr_npi,IS_SMEADDR)
esm_class               = options[:esm_class]
protocol_id             = options[:protocol_id]?options[:protocol_id]:0
priority_flag           = options[:priority_flag]?options[:priority_flag]:0
schedule_delivery_time  = options[:schedule_delivery_time]?options[:schedule_delivery_time]:''
validity_period         = options[:validity_period]?options[:validity_period]:''
registered_delivery     = options[:registered_delivery]?options[:registered_delivery]:1
replace_if_present_flag = options[:replace_if_present_flag]?options[:replace_if_present_flag]:0
data_coding             = options[:dcs]
sm_default_msg_id       = options[:sm_default_msg_id]?options[:sm_default_msg_id]:0
payload                 = udh ? udh + short_message : short_message # this used to be (short_message + "\0")
sm_length               = payload.length
  1. The released version (0.6.0) is far from the master version. The "Transmitter" class doesn't exist and it is not possible to connect to an SMPP server only as a sender.

  2. I'm using the version from the master branch and it is not possible to send multiple SMS's if you are connected as a "Transmiter". The solution is just copy/paste the method from the "Transceiver" class or create an intermediate class that implement both the send_mt and the send_multiple_mt methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions