imperituroard 1.1.12 → 1.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/lib/imperituroard.rb +8 -7
- data/lib/imperituroard/add_functions/logger/any_functions.rb +1 -1
- data/lib/imperituroard/platforms/cps/cps_mongo_connector.rb +394 -0
- data/lib/imperituroard/platforms/cps/qps_connector.rb +63 -0
- data/lib/imperituroard/platforms/iwag/iwag_database_worker.rb +1 -1
- data/lib/imperituroard/platforms/iwag/iwag_telnet_connector.rb +9 -9
- data/lib/imperituroard/projects/iot.rb +12 -0
- data/lib/imperituroard/projects/iot/add_functions.rb +3 -3
- data/lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb +6 -6
- data/lib/imperituroard/projects/iot/internal_functions.rb +5 -5
- data/lib/imperituroard/projects/iot/mongoconnector.rb +25 -0
- data/lib/imperituroard/projects/mhub.rb +36 -10
- data/lib/imperituroard/projects/mhub/gms.rb +29 -29
- data/lib/imperituroard/projects/mhub/sk.rb +13 -10
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb +35 -14
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +51 -31
- data/lib/imperituroard/projects/oats/fttx_acl/add_acl_fttx.rb +187 -0
- data/lib/imperituroard/projects/ukaz60/belgim.rb +3 -2
- data/lib/imperituroard/projects/ukaz60/ukaz60_add_func.rb +15 -13
- data/lib/imperituroard/projects/wttx/phpipamcps.rb +29 -28
- data/lib/imperituroard/projects/wttx/updatepostcps.rb +2 -2
- data/lib/imperituroard/version.rb +1 -1
- metadata +4 -2
@@ -42,4 +42,67 @@ class Qps_2
|
|
42
42
|
access_interface1 = response.to_hash #[:mts_wifi_portal_get_access_int_response][:accessinterface]
|
43
43
|
end
|
44
44
|
|
45
|
+
def add_avp_acl(username, acl)
|
46
|
+
message1 = {
|
47
|
+
:audit => {:id => "SOAPGW", :comment => "takih ne berut v kosmonavty"},
|
48
|
+
:networkId => username,
|
49
|
+
:newAvp => [
|
50
|
+
{:code =>"IN-ACL", :value => acl}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
response = cps_connector_client.call(:change_subscriber_avps) do
|
54
|
+
message(message1)
|
55
|
+
end
|
56
|
+
response.to_hash
|
57
|
+
end
|
58
|
+
|
59
|
+
def delete_avp_acl(username)
|
60
|
+
mess = {
|
61
|
+
:audit => {:id => 'SOAPGW', :comment => 'some procedure'},
|
62
|
+
:networkId => username,
|
63
|
+
:deletedAvp => [
|
64
|
+
{:code => 'IN-ACL'}
|
65
|
+
]
|
66
|
+
}
|
67
|
+
response = cps_connector_client.call(:change_subscriber_avps) do
|
68
|
+
message(mess)
|
69
|
+
end
|
70
|
+
response.to_hash
|
71
|
+
end
|
72
|
+
|
73
|
+
def stop_session_username(username)
|
74
|
+
params = {
|
75
|
+
audit: { id: 'SOAPGW', comment: 'stop session procedure' },
|
76
|
+
key: {
|
77
|
+
code: 'UserIdKey',
|
78
|
+
primary: false,
|
79
|
+
key_field: { code: 'userId', value: username }
|
80
|
+
}
|
81
|
+
}
|
82
|
+
p params
|
83
|
+
xml = cps_connector_client.call(:stop_session) do
|
84
|
+
message(params)
|
85
|
+
end
|
86
|
+
code = xml.to_hash[:stop_session_response]
|
87
|
+
p code
|
88
|
+
end
|
89
|
+
|
90
|
+
def query_session_username(username)
|
91
|
+
params = {
|
92
|
+
audit: { id: 'SOAPGW', comment: 'query session procedure' },
|
93
|
+
key: {
|
94
|
+
code: 'UserIdKey',
|
95
|
+
primary: false,
|
96
|
+
key_field: { code: 'userId', value: username }
|
97
|
+
}
|
98
|
+
}
|
99
|
+
p params
|
100
|
+
xml = cps_connector_client.call(:query_session) do
|
101
|
+
message(params)
|
102
|
+
end
|
103
|
+
code = xml.to_hash[:query_session_response]
|
104
|
+
p code
|
105
|
+
end
|
106
|
+
|
45
107
|
end
|
108
|
+
|
@@ -19,7 +19,7 @@ class CSRtelnet_1
|
|
19
19
|
#begin
|
20
20
|
|
21
21
|
dump =""
|
22
|
-
connection = Net::Telnet.new( "Host" => iwag1_host, "Timeout" => false, "Prompt" =>
|
22
|
+
connection = Net::Telnet.new( "Host" => iwag1_host, "Timeout" => false, "Prompt" => /.*/ ) { |str| }
|
23
23
|
connection.login({ "Name" => iwag_username, "Password" => iwag_password, "LoginPrompt" => /Username:/ }) { |str| }
|
24
24
|
connection.cmd("show ip dhcp binding #{ipaddress}") {
|
25
25
|
|c|
|
@@ -33,7 +33,7 @@ class CSRtelnet_1
|
|
33
33
|
|
34
34
|
ma = reer[1].to_s.upcase
|
35
35
|
pos = ma[0]+ma[1]
|
36
|
-
if pos==
|
36
|
+
if pos == '01'
|
37
37
|
subscribers_mac = ma[2]+ma[3]+":"+ma[5]+ma[6]+":"+ma[7]+ma[8]+":"+ma[10]+ma[11]+":"+ma[12]+ma[13]+":"+ma[15]+ma[16]
|
38
38
|
else
|
39
39
|
subscribers_mac = ma[0]+ma[1]+":"+ma[2]+ma[3]+":"+ma[5]+ma[6]+":"+ma[7]+ma[8]+":"+ma[10]+ma[11]+":"+ma[12]+ma[13]
|
@@ -44,7 +44,7 @@ class CSRtelnet_1
|
|
44
44
|
# subscribers_mac = "unknown"
|
45
45
|
#end
|
46
46
|
|
47
|
-
|
47
|
+
subscribers_mac
|
48
48
|
|
49
49
|
end
|
50
50
|
|
@@ -69,7 +69,7 @@ class CSRtelnet_1
|
|
69
69
|
|
70
70
|
dump =""
|
71
71
|
begin
|
72
|
-
connection = Net::Telnet.new("Host" => host_iwag, "Timeout" => false, "Prompt" =>
|
72
|
+
connection = Net::Telnet.new("Host" => host_iwag, "Timeout" => false, "Prompt" => /.*/) {|str| print str}
|
73
73
|
connection.login({"Name" => username_iwag, "Password" => password_iwag, "LoginPrompt" => /Username:/}) {|str| print str}
|
74
74
|
connection.cmd("show ip dhcp binding #{ipaddress}") {
|
75
75
|
|c|
|
@@ -82,13 +82,13 @@ class CSRtelnet_1
|
|
82
82
|
access_interface = as[4].gsub!(" ", "").split(" ").last
|
83
83
|
return access_interface
|
84
84
|
else
|
85
|
-
answer =
|
85
|
+
answer = 'false'
|
86
86
|
return answer
|
87
87
|
end
|
88
88
|
rescue
|
89
89
|
begin
|
90
|
-
connection = Net::Telnet.new(
|
91
|
-
connection.login({
|
90
|
+
connection = Net::Telnet.new('Host' => host_iwag, 'Timeout' => false, 'Prompt' => /.*/) {|str| print str}
|
91
|
+
connection.login({'Name' => username_iwag, 'Password' => password_iwag, 'LoginPrompt' => /Username:/}) {|str| print str}
|
92
92
|
connection.cmd("show ip dhcp binding #{ipaddress}") {
|
93
93
|
|c|
|
94
94
|
dump << c
|
@@ -99,11 +99,11 @@ class CSRtelnet_1
|
|
99
99
|
access_interface = as[4].gsub!(" ", "").split(" ").last
|
100
100
|
return access_interface
|
101
101
|
else
|
102
|
-
answer =
|
102
|
+
answer ='false'
|
103
103
|
return answer
|
104
104
|
end
|
105
105
|
rescue
|
106
|
-
return
|
106
|
+
return 'unknown'
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
@@ -1381,6 +1381,18 @@ class IotFunctions_2
|
|
1381
1381
|
end
|
1382
1382
|
|
1383
1383
|
|
1384
|
+
#15
|
1385
|
+
#add service iot
|
1386
|
+
# soapgw_params = {:imei => "43563456", :imsi => "2452345", :unp => "6454127", :description => "test", :note => "test2"}
|
1387
|
+
#{"autorization"=>{"login"=>"login", "token"=>"token"}, "service"=>{"imei"=>"13412341234", "imsi"=>"5645645", "msisdn"=>"3423423", "unp"=>"4564564", "note"=>"test", "descriptiot"=>"test 2"}}
|
1388
|
+
|
1389
|
+
def spa_service_set_2(soapgw_params, real_ip, remote_ip)
|
1390
|
+
input_params = {:soapgw_params => soapgw_params, :real_ip => real_ip, :remote_ip => remote_ip}
|
1391
|
+
output_answ = {:code => 200, :message => 'Request completed successfully', :body => {:to_soap_gw => {}}}
|
1392
|
+
mongo_client.audit_spa_logger('spa_service_set_2', remote_ip, input_params, output_answ, real_ip, {})
|
1393
|
+
end
|
1394
|
+
|
1395
|
+
|
1384
1396
|
################################################
|
1385
1397
|
############technology procedures###############
|
1386
1398
|
################################################
|
@@ -38,12 +38,12 @@ class HuaIot
|
|
38
38
|
refr_token = ""
|
39
39
|
exp_in = ""
|
40
40
|
|
41
|
-
access_token =
|
42
|
-
refresh_token =
|
43
|
-
expires_in =
|
41
|
+
access_token = /"accessToken":"(\S+)"/
|
42
|
+
refresh_token = /"refreshToken":"(.+)"/
|
43
|
+
expires_in = /"expiresIn":(\d+)/
|
44
44
|
|
45
45
|
for i in dd
|
46
|
-
if i.to_s.include?(
|
46
|
+
if i.to_s.include?('accessToken')
|
47
47
|
acc_token = access_token.match(i)
|
48
48
|
elsif i.to_s.include?("refreshToken")
|
49
49
|
refr_token = refresh_token.match(i)
|
@@ -64,7 +64,7 @@ class HuaIot
|
|
64
64
|
data = {}
|
65
65
|
url_string = ""
|
66
66
|
begin
|
67
|
-
path =
|
67
|
+
path = '/iocm/app/sec/v1.1.0/login'
|
68
68
|
url_string = "https://" + platformip + ":" + platformport + path
|
69
69
|
internal_func.printer_texter("get_token: start. Step2, url_string: #{url_string}", "debug")
|
70
70
|
uri = URI.parse url_string
|
@@ -618,7 +618,7 @@ class HuaIot
|
|
618
618
|
|
619
619
|
#######################################
|
620
620
|
|
621
|
-
def test
|
621
|
+
def test
|
622
622
|
|
623
623
|
url_string = "https://134.17.93.4:8743/iocm/app/sec/v1.1.0/login"
|
624
624
|
headers = {
|
@@ -4,7 +4,7 @@ require 'date'
|
|
4
4
|
|
5
5
|
class InternalFunc
|
6
6
|
|
7
|
-
def datetimenow
|
7
|
+
def datetimenow
|
8
8
|
d_curr = DateTime.now
|
9
9
|
time_zone = 'Europe/Minsk'
|
10
10
|
DateTime.new
|
@@ -63,11 +63,11 @@ class InternalFunc
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
if is_string == 0
|
66
|
-
output_params = {:code => 200, :result =>
|
66
|
+
output_params = {:code => 200, :result => 'if_digit_or_string: Request processed. Its digit', :body => {:string => false}}
|
67
67
|
else
|
68
|
-
output_params = {:code => 200, :result =>
|
68
|
+
output_params = {:code => 200, :result => 'if_digit_or_string: Request processed. Its string', :body => {:string => true}}
|
69
69
|
end
|
70
|
-
printer_texter({:input_params => input_params, :output_params => output_params},
|
70
|
+
printer_texter({:input_params => input_params, :output_params => output_params}, 'debug')
|
71
71
|
output_params
|
72
72
|
|
73
73
|
end
|
@@ -193,7 +193,7 @@ class InternalFunc
|
|
193
193
|
end
|
194
194
|
|
195
195
|
|
196
|
-
def test
|
196
|
+
def test
|
197
197
|
p "eeeeeeeeeeeeeeeeeeeeeeee"
|
198
198
|
end
|
199
199
|
|
@@ -66,6 +66,31 @@ class MongoIot
|
|
66
66
|
out_resp
|
67
67
|
end
|
68
68
|
|
69
|
+
def audit_spa_logger(proc_name, url_str, input_json, output_json)
|
70
|
+
out_resp = {}
|
71
|
+
p "iiiiiiiot"
|
72
|
+
p input_json
|
73
|
+
begin
|
74
|
+
current = internal_func.datetimenow
|
75
|
+
collection = client[:audit_spa]
|
76
|
+
doc = {
|
77
|
+
:proc_name => proc_name,
|
78
|
+
:date => current,
|
79
|
+
:url => url_str,
|
80
|
+
:iot_platform_request => input_json,
|
81
|
+
:iot_platform_responce => output_json
|
82
|
+
}
|
83
|
+
p doc
|
84
|
+
result = collection.insert_one(doc)
|
85
|
+
out_resp = {:code => 200, :result => "audit_logger: Request completed successfully", :body => result}
|
86
|
+
rescue
|
87
|
+
out_resp = {:code => 507, :result => "audit_logger: Unknown SDK error"}
|
88
|
+
end
|
89
|
+
internal_func.printer_texter(out_resp, "debug")
|
90
|
+
out_resp
|
91
|
+
end
|
92
|
+
|
93
|
+
|
69
94
|
#:code => 507, :result => "Unknown SDK error"
|
70
95
|
#{:code => 200, :result => "Request completed successfully", :body => result_ps}
|
71
96
|
def get_profiles_by_login(login)
|
@@ -35,7 +35,7 @@ class MhubFunctions_2
|
|
35
35
|
@internal_func = InternalFunc.new
|
36
36
|
@mhub_connector = Sksk_2.new(sk_url_simple, sk_login, sk_password, sk_url_broadcast, telegram_api_url, telegram_chat_id, log_level)
|
37
37
|
@internal_func = InternalFunc.new
|
38
|
-
@dabrab_connecter = Dabrab.new
|
38
|
+
@dabrab_connecter = Dabrab.new(log_level)
|
39
39
|
@telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
|
40
40
|
@static_callback = static_callback
|
41
41
|
@crm_connector = Crm_2.new(crm_callback_url, crm_login, crm_password, telegram_api_url, telegram_chat_id, log_level)
|
@@ -129,7 +129,16 @@ class MhubFunctions_2
|
|
129
129
|
|
130
130
|
|
131
131
|
#for bank dabrabyt for massive nums
|
132
|
-
def get_send_message_mass_2(params,
|
132
|
+
def get_send_message_mass_2(params,
|
133
|
+
ip_src,
|
134
|
+
ip_real,
|
135
|
+
ip_vip,
|
136
|
+
slice_number,
|
137
|
+
time_pause_minutes,
|
138
|
+
viberttl,
|
139
|
+
params_manual_set,
|
140
|
+
smsttl
|
141
|
+
)
|
133
142
|
|
134
143
|
input_params = {:params => params}
|
135
144
|
output_params = {}
|
@@ -148,12 +157,29 @@ class MhubFunctions_2
|
|
148
157
|
|
149
158
|
hub_resp = {}
|
150
159
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
160
|
+
|
161
|
+
viber_param = params["viber"]
|
162
|
+
sms_param = params["sms"]
|
163
|
+
|
164
|
+
if params_manual_set != 0
|
165
|
+
begin
|
166
|
+
if params_manual_set[:viber] == 0
|
167
|
+
viber_param = nil
|
168
|
+
end
|
169
|
+
if params_manual_set[:sms] == 0
|
170
|
+
sms_param = nil
|
171
|
+
end
|
172
|
+
rescue
|
173
|
+
nil
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
if null_statement.include?(viber_param) && !null_statement.include?(sms_param)
|
178
|
+
hub_resp = mhub_connector.sk_send_sms_list(part_list, static_callback, params["sms"]["text"], sms_alphaname, time_pause_minutes, smsttl)
|
179
|
+
elsif !null_statement.include?(viber_param) && null_statement.include?(sms_param)
|
180
|
+
hub_resp = mhub_connector.sk_send_viber_list(part_list, static_callback, params["viber"]["text"], time_pause_minutes, viberttl)
|
181
|
+
elsif !null_statement.include?(viber_param) && !null_statement.include?(sms_param)
|
182
|
+
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)
|
157
183
|
else
|
158
184
|
output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
159
185
|
end
|
@@ -183,14 +209,14 @@ class MhubFunctions_2
|
|
183
209
|
|
184
210
|
|
185
211
|
#for bank dabrabyt
|
186
|
-
def rec_deliv_report_2(params, ip_src, ip_real, ip_vip)
|
212
|
+
def rec_deliv_report_2(params, ip_src, ip_real, ip_vip, crm_slice_num=2)
|
187
213
|
input_params = {:params => params, :ip_src => ip_src, :ip_real => ip_real, :ip_vip => ip_vip}
|
188
214
|
output_params = {}
|
189
215
|
hub_resp = {}
|
190
216
|
|
191
217
|
begin
|
192
218
|
mes_report = dabrab_connecter.delivery_report_transform(params)[:body][:report_to_recip]
|
193
|
-
result = crm_connector.crm_status_2(mes_report)
|
219
|
+
result = crm_connector.crm_status_2(mes_report, crm_slice_num)
|
194
220
|
if result[:body][:res_body]["GetReportsResult"]==""
|
195
221
|
output_params = {"code": 200, "result": "Data processed", "body": {"answer": {"code": 200, "status": "Success"}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
196
222
|
else
|
@@ -24,40 +24,40 @@ class Gmsgms_2
|
|
24
24
|
output = {}
|
25
25
|
|
26
26
|
status_dic = {
|
27
|
-
12033 =>
|
28
|
-
36013 =>
|
29
|
-
36023 =>
|
30
|
-
36033 =>
|
31
|
-
36043 =>
|
32
|
-
36053 =>
|
33
|
-
36063 =>
|
34
|
-
36073 =>
|
35
|
-
36083 =>
|
36
|
-
36093 =>
|
37
|
-
36103 =>
|
38
|
-
36113 =>
|
39
|
-
36123 =>
|
40
|
-
36133 =>
|
41
|
-
36143 =>
|
42
|
-
36153 =>
|
43
|
-
36163 =>
|
44
|
-
36173 =>
|
45
|
-
36183 =>
|
46
|
-
23033 =>
|
47
|
-
35015 =>
|
48
|
-
24013 =>
|
49
|
-
28013 =>
|
50
|
-
-1 =>
|
27
|
+
12033 => 'Sent to Viber',
|
28
|
+
36013 => 'Viber internal failure',
|
29
|
+
36023 => 'Viber invalid service id',
|
30
|
+
36033 => 'Viber invalid data',
|
31
|
+
36043 => 'Viber blocked message type',
|
32
|
+
36053 => 'Viber bad message type',
|
33
|
+
36063 => 'Viber bad parameters',
|
34
|
+
36073 => 'Viber timeout',
|
35
|
+
36083 => 'Viber user blocked',
|
36
|
+
36093 => 'Viber not viber user',
|
37
|
+
36103 => 'Viber no suitable device',
|
38
|
+
36113 => 'Viber unauthorized ip',
|
39
|
+
36123 => 'Viber already sent',
|
40
|
+
36133 => 'Viber not permitted',
|
41
|
+
36143 => 'Viber billing failure',
|
42
|
+
36153 => 'Viber word in black list',
|
43
|
+
36163 => 'Viber internal process error',
|
44
|
+
36173 => 'Viber wrong or missing Label',
|
45
|
+
36183 => 'Viber invalid TTL value',
|
46
|
+
23033 => 'Viber delivered',
|
47
|
+
35015 => 'Viber expired',
|
48
|
+
24013 => 'Viber delivered(seen)',
|
49
|
+
28013 => 'Viber delivered(overdue)',
|
50
|
+
-1 => 'in progress'
|
51
51
|
}
|
52
52
|
|
53
53
|
if gms_answer[:code] == 200
|
54
|
-
dt1 = gms_answer[:body][:res_body][
|
55
|
-
hyber_status = dt1[
|
56
|
-
output = {:code => 200, :result =>
|
54
|
+
dt1 = gms_answer[:body][:res_body]['reports'][0]
|
55
|
+
hyber_status = dt1['hyber_status']
|
56
|
+
output = {:code => 200, :result => 'Processed', :body => {'status_code': hyber_status, 'status': status_dic[hyber_status], 'phone_number': dt1['phone_number'], 'message_id': dt1['extra_id']}}
|
57
57
|
elsif gms_answer[:code] == 404
|
58
|
-
output = {:code => 404, :result =>
|
58
|
+
output = {:code => 404, :result => 'Not found', :body => {'status_code': '', 'status': '', 'phone_number': '', 'message_id': gms_answer[:body][:request_message][:external_id]}}
|
59
59
|
else
|
60
|
-
output = {:code => gms_answer[:code], :result => gms_answer[:result], :body => {
|
60
|
+
output = {:code => gms_answer[:code], :result => gms_answer[:result], :body => {'status_code': '', 'status': '', 'phone_number': '', 'message_id': gms_answer[:body][:request_message][:external_id]}}
|
61
61
|
end
|
62
62
|
output
|
63
63
|
end
|
@@ -14,7 +14,7 @@ class Sksk_2
|
|
14
14
|
@internal_func = InternalFunc.new
|
15
15
|
@sk_url_broadcast = sk_url_broadcast
|
16
16
|
@telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
|
17
|
-
@dabrab_add_func = Dabrab.new
|
17
|
+
@dabrab_add_func = Dabrab.new(log_level)
|
18
18
|
end
|
19
19
|
|
20
20
|
|
@@ -148,7 +148,7 @@ class Sksk_2
|
|
148
148
|
output_params
|
149
149
|
end
|
150
150
|
|
151
|
-
def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname)
|
151
|
+
def sk_send_viber_sms_one(msisdn, callback_url, sms_text, viber_txt, alphaname, smsttl=600)
|
152
152
|
|
153
153
|
input_params = {:msisdn => msisdn, :callback_url => callback_url, :sms_text => sms_text, :viber_txt => viber_txt, :alphaname => alphaname}
|
154
154
|
output_params = {}
|
@@ -188,7 +188,7 @@ class Sksk_2
|
|
188
188
|
"sms": {
|
189
189
|
"text": sms_text,
|
190
190
|
"alpha_name": alphaname,
|
191
|
-
"ttl":
|
191
|
+
"ttl": smsttl
|
192
192
|
},
|
193
193
|
"viber": viber_mess_ans[:body][:to_sk_format]
|
194
194
|
}
|
@@ -220,7 +220,7 @@ class Sksk_2
|
|
220
220
|
end
|
221
221
|
|
222
222
|
|
223
|
-
def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1)
|
223
|
+
def sk_send_sms_list(msisdn_list, callback_url, text, alphaname, time_pause_minutes=1, smsttl)
|
224
224
|
|
225
225
|
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text, :alphaname => alphaname}
|
226
226
|
output_params = {}
|
@@ -256,7 +256,7 @@ class Sksk_2
|
|
256
256
|
"sms": {
|
257
257
|
"alpha_name": alphaname,
|
258
258
|
"text": text,
|
259
|
-
"ttl":
|
259
|
+
"ttl": smsttl
|
260
260
|
}
|
261
261
|
}
|
262
262
|
}
|
@@ -282,7 +282,10 @@ class Sksk_2
|
|
282
282
|
end
|
283
283
|
|
284
284
|
|
285
|
-
def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes)
|
285
|
+
def sk_send_viber_list(msisdn_list, callback_url, text, time_pause_minutes, viberttl)
|
286
|
+
|
287
|
+
internal_func.printer_texter({:input => "Fun started", :output => {}, :procedure => "Sksk_2.sk_send_viber_list"}, log_level)
|
288
|
+
|
286
289
|
|
287
290
|
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :text => text}
|
288
291
|
output_params = {}
|
@@ -292,7 +295,7 @@ class Sksk_2
|
|
292
295
|
|
293
296
|
thr_sk_send_viber_list = Thread.new do
|
294
297
|
|
295
|
-
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text)
|
298
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text, viberttl)
|
296
299
|
|
297
300
|
if viber_mess_ans[:code] == 200
|
298
301
|
uri = URI(sk_url_broadcast)
|
@@ -346,7 +349,7 @@ class Sksk_2
|
|
346
349
|
end
|
347
350
|
|
348
351
|
|
349
|
-
def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes)
|
352
|
+
def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname, time_pause_minutes, viberttl, smsttl)
|
350
353
|
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :sms_text => sms_text, :viber_text => viber_text, :alphaname => alphaname}
|
351
354
|
output_params = {}
|
352
355
|
request_message = {}
|
@@ -355,7 +358,7 @@ class Sksk_2
|
|
355
358
|
thr_sk_send_viber_sms_list = Thread.new do
|
356
359
|
|
357
360
|
|
358
|
-
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text)
|
361
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text, viberttl)
|
359
362
|
|
360
363
|
if viber_mess_ans[:code] == 200
|
361
364
|
|
@@ -388,7 +391,7 @@ class Sksk_2
|
|
388
391
|
"sms": {
|
389
392
|
"alpha_name": alphaname,
|
390
393
|
"text": sms_text,
|
391
|
-
"ttl":
|
394
|
+
"ttl": smsttl
|
392
395
|
},
|
393
396
|
"viber": viber_mess_ans[:body][:to_sk_format]
|
394
397
|
}
|