lib/imperituroard/projects/mhub.rb in imperituroard-1.1.15 vs lib/imperituroard/projects/mhub.rb in imperituroard-1.1.17
- old
+ new
@@ -127,11 +127,20 @@
end
#for bank dabrabyt for massive nums
- def get_send_message_mass_2(params, ip_src, ip_real, ip_vip, slice_number, time_pause_minutes)
+ def get_send_message_mass_2(params,
+ ip_src,
+ ip_real,
+ ip_vip,
+ slice_number,
+ time_pause_minutes,
+ viberttl,
+ params_manual_set,
+ smsttl
+ )
input_params = {:params => params}
output_params = {}
null_statement = [nil, "nil", "", "null"]
@@ -146,15 +155,32 @@
internal_func.printer_texter({:input => part_list, :procedure => "Mhub_2.get_send_message_mass_2"}, log_level)
hub_resp = {}
- if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
- hub_resp = mhub_connector.sk_send_sms_list(part_list, static_callback, params["sms"]["text"], sms_alphaname, time_pause_minutes)
- elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
- hub_resp = mhub_connector.sk_send_viber_list(part_list, static_callback, params["viber"]["text"], time_pause_minutes)
- elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
- hub_resp = mhub_connector.sk_send_viber_sms_list(part_list, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname, time_pause_minutes)
+
+ viber_param = params["viber"]
+ sms_param = params["sms"]
+
+ if params_manual_set != 0
+ begin
+ if params_manual_set[:viber] == 0
+ viber_param = nil
+ end
+ if params_manual_set[:sms] == 0
+ sms_param = nil
+ end
+ rescue
+ nil
+ end
+ end
+
+ if null_statement.include?(viber_param) && !null_statement.include?(sms_param)
+ hub_resp = mhub_connector.sk_send_sms_list(part_list, static_callback, params["sms"]["text"], sms_alphaname, time_pause_minutes, smsttl)
+ elsif !null_statement.include?(viber_param) && null_statement.include?(sms_param)
+ hub_resp = mhub_connector.sk_send_viber_list(part_list, static_callback, params["viber"]["text"], time_pause_minutes, viberttl)
+ elsif !null_statement.include?(viber_param) && !null_statement.include?(sms_param)
+ hub_resp = mhub_connector.sk_send_viber_sms_list(part_list, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname, time_pause_minutes, viberttl, smsttl)
else
output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
end
mes_data = dabrab_connecter.send_responce_formatter(hub_resp)