lib/imperituroard/projects/mhub.rb in imperituroard-1.1.10 vs lib/imperituroard/projects/mhub.rb in imperituroard-1.1.11
- old
+ new
@@ -90,20 +90,15 @@
# end
# else
# output_params = {"code": 503, "result": "Invalid recipients", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
# end
- p params
if params["destinations"].length >= 1
- p params["destinations"]
- p "eeee"
msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
- splitted_parts = msisdn2.each_slice(1).to_a
-
if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
hub_resp = mhub_connector.sk_send_sms_list(msisdn2, static_callback, params["sms"]["text"], sms_alphaname)
elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
hub_resp = mhub_connector.sk_send_viber_list(msisdn2, static_callback, params["viber"]["text"])
elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
@@ -118,14 +113,10 @@
else
output_params = {"code": 503, "result": "Invalid recipients", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
end
-
- p hub_resp
- p mes_data
-
output_params = {"code": 200, "result": "Data processed", "body": {"answer": mes_data[:body][:mess_to_recip], "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
rescue
output_params = {"code": 500, "result": "MhubFunctions_2.get_send_message_2: Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
telegram_connector.telegram_message(output_params)
@@ -136,11 +127,11 @@
end
#for bank dabrabyt for massive nums
- def get_send_message_mass_2(params, ip_src, ip_real, ip_vip)
+ def get_send_message_mass_2(params, ip_src, ip_real, ip_vip, slice_number, time_pause_minutes)
input_params = {:params => params}
output_params = {}
null_statement = [nil, "nil", "", "null"]
@@ -148,23 +139,23 @@
begin
internal_func.printer_texter({:input => params, :procedure => "Mhub_2.get_send_message_mass_2"}, log_level)
if params["destinations"].length >= 1
msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
- splitted_parts = msisdn2.each_slice(100).to_a
+ splitted_parts = msisdn2.each_slice(slice_number).to_a
for part_list in splitted_parts
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)
+ 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"])
+ 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)
+ hub_resp = mhub_connector.sk_send_viber_sms_list(part_list, static_callback, params["sms"]["text"], params["viber"]["text"], sms_alphaname, time_pause_minutes)
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)
@@ -209,14 +200,9 @@
output_params = {"code": 500, "result": "MhubFunctions_2.rec_deliv_report_2: Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
telegram_connector.telegram_message(output_params)
end
internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.recieve_delivery_report"}, log_level)
output_params
- end
-
- def test2
- hh = Infobip_1.new
- hh.test
end
end