lib/imperituroard/projects/mhub/sk.rb in imperituroard-1.1.15 vs lib/imperituroard/projects/mhub/sk.rb in imperituroard-1.1.17
- old
+ new
@@ -146,11 +146,11 @@
end
internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Sksk_2.sk_send_viber_one"}, log_level)
output_params
end
- def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname)
+ def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname, smsttl=600)
input_params = {:msisdn => msisdn, :callback_url => callback_url, :sms_text => sms_text, :viber_txt => viber_txt, :alphaname => alphaname}
output_params = {}
request_message = {}
@@ -186,11 +186,11 @@
],
"channel_options": {
"sms": {
"text": sms_text,
"alpha_name": alphaname,
- "ttl": 600
+ "ttl": smsttl
},
"viber": viber_mess_ans[:body][:to_sk_format]
}
}
@@ -218,11 +218,11 @@
output_params
end
- def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1)
+ def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1, smsttl)
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text, :alphaname => alphaname}
output_params = {}
request_message = {}
@@ -254,11 +254,11 @@
],
"channel_options": {
"sms": {
"alpha_name": alphaname,
"text": text,
- "ttl": 60
+ "ttl": smsttl
}
}
}
req.body = request_message.to_json
@@ -280,21 +280,24 @@
internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Sksk_2.sk_send_sms_list"}, log_level)
output_params
end
- def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes)
+ def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes, viberttl)
+ internal_func.printer_texter({:input => "Fun started", :output => {}, :procedure => "Sksk_2.sk_send_viber_list"}, log_level)
+
+
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text}
output_params = {}
request_message = {}
begin
thr_sk_send_viber_list = Thread.new do
- viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text)
+ viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text, viberttl)
if viber_mess_ans[:code] == 200
uri = URI(sk_url_broadcast)
#8 - client id
@@ -344,20 +347,20 @@
internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Sksk_2.sk_send_viber_list"}, log_level)
output_params
end
- def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes)
+ def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes, viberttl, smsttl)
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :sms_text => sms_text, :viber_text => viber_text, :alphaname => alphaname}
output_params = {}
request_message = {}
begin
thr_sk_send_viber_sms_list = Thread.new do
- viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text)
+ viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text, viberttl)
if viber_mess_ans[:code] == 200
@@ -386,10 +389,10 @@
],
"channel_options": {
"sms": {
"alpha_name": alphaname,
"text": sms_text,
- "ttl": 60
+ "ttl": smsttl
},
"viber": viber_mess_ans[:body][:to_sk_format]
}
}
\ No newline at end of file