imperituroard 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +74 -26
- data/lib/imperituroard/projects/mhub.rb +157 -0
- data/lib/imperituroard/version.rb +1 -1
- data/lib/imperituroard.rb +4 -93
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7099d271ae8850c9fe1799ef6a1aa26191a8041
|
4
|
+
data.tar.gz: aa800c9ed06865ae2e11b6e46441208c98763273
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d81c1af75860e3815ee8e258bdaeacb3ac68f85086ff4a4a5cb20dd1304dbf924a51c9a6458ce15991c4ad6d8fea2f0e67f12d07375ff094a23ce88410caf87
|
7
|
+
data.tar.gz: 35036f5a002e190af58383c5e85e0d93213954c959de3801ac0a86703419940e4aa0b6c6fd832c0f1850617a9f86c65aa3563e79cd5fa1beb1b62f93e0f9b424
|
@@ -70,34 +70,82 @@ end
|
|
70
70
|
def delivery_report_transform(hub_report)
|
71
71
|
#{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber", "controller"=>"reports", "action"=>"delivery", "report"=>{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber"}}
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
"groupName": "DELIVERED",
|
85
|
-
"id": 5,
|
86
|
-
"name": "DELIVERED_TO_HANDSET",
|
87
|
-
"description": "Message delivered to handset"
|
88
|
-
},
|
89
|
-
"error": {
|
90
|
-
"groupId": 0,
|
91
|
-
"groupName": "Ok",
|
92
|
-
"id": 0,
|
93
|
-
"name": "NO_ERROR",
|
94
|
-
"description": "No Error",
|
95
|
-
"permanent": false
|
96
|
-
}
|
97
|
-
}
|
98
|
-
]
|
73
|
+
p hub_report
|
74
|
+
p "hub_report"
|
75
|
+
|
76
|
+
data_for_status = {
|
77
|
+
|
78
|
+
23011 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by SMS",
|
79
|
+
:error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name=> "NO_ERROR", :error_descr => "No Error", :error_permanent => false
|
80
|
+
},
|
81
|
+
23033 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by Viber",
|
82
|
+
:error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name=> "NO_ERROR", :error_descr => "No Error", :error_permanent => false
|
83
|
+
}
|
99
84
|
}
|
100
85
|
|
86
|
+
if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
|
87
|
+
report_to_recip = {
|
88
|
+
"results": [
|
89
|
+
{
|
90
|
+
|
91
|
+
"bulkId": "00000000-0000-0000-0000-000000000000",
|
92
|
+
"messageId": hub_report[:report][:message_id],
|
93
|
+
"to": hub_report[:report][:number],
|
94
|
+
# "sentAt": "2020-05-05T20:00:00.000+0000",
|
95
|
+
# "doneAt": "2020-05-05T20:00:00.000+0000",
|
96
|
+
"status": {
|
97
|
+
"groupId": data_for_status[hub_report[:msg_status]][:status_grid],
|
98
|
+
"groupName": data_for_status[hub_report[:msg_status]][:status_grname],
|
99
|
+
"id": data_for_status[hub_report[:msg_status]][:status_id],
|
100
|
+
"name": data_for_status[hub_report[:msg_status]][:status_name],
|
101
|
+
"description": data_for_status[hub_report[:msg_status]][:status_descr]
|
102
|
+
},
|
103
|
+
"error": {
|
104
|
+
"groupId": data_for_status[hub_report[:msg_status]][:error_grid],
|
105
|
+
"groupName": data_for_status[hub_report[:msg_status]][:error_grname],
|
106
|
+
"id": data_for_status[hub_report[:msg_status]][:error_id],
|
107
|
+
"name": data_for_status[hub_report[:msg_status]][:error_name],
|
108
|
+
"description": data_for_status[hub_report[:msg_status]][:error_descr],
|
109
|
+
"permanent": data_for_status[hub_report[:msg_status]][:error_permanent]
|
110
|
+
}
|
111
|
+
}
|
112
|
+
]
|
113
|
+
}
|
114
|
+
|
115
|
+
else
|
116
|
+
|
117
|
+
report_to_recip = {
|
118
|
+
"results": [
|
119
|
+
{
|
120
|
+
|
121
|
+
"bulkId": "00000000-0000-0000-0000-000000000000",
|
122
|
+
"messageId": hub_report[:report][:message_id],
|
123
|
+
"to": hub_report[:report][:number],
|
124
|
+
# "sentAt": "2020-05-05T20:00:00.000+0000",
|
125
|
+
# "doneAt": "2020-05-05T20:00:00.000+0000",
|
126
|
+
"status": {
|
127
|
+
"groupId": 2,
|
128
|
+
"groupName": "UNDELIVERABLE_NOT_DELIVERED",
|
129
|
+
"id": 9,
|
130
|
+
"name": "UNDELIVERED",
|
131
|
+
"description": "Unknown error"
|
132
|
+
},
|
133
|
+
"error": {
|
134
|
+
"groupId": 1,
|
135
|
+
"groupName": "HANDSET_ERRORS",
|
136
|
+
"id": 32,
|
137
|
+
"name": "EC_SM_DELIVERY_FAILURE",
|
138
|
+
"description": "Unknown error",
|
139
|
+
"permanent": false
|
140
|
+
}
|
141
|
+
}
|
142
|
+
]
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
101
149
|
{:code => 200, :result => "Data processed", :body => {:report_to_recip => report_to_recip}}
|
102
150
|
end
|
103
151
|
|
@@ -0,0 +1,157 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../projects/mhub", __dir__)
|
2
|
+
$LOAD_PATH.unshift File.expand_path("../projects/mhub/subs/dabrab", __dir__)
|
3
|
+
|
4
|
+
|
5
|
+
require 'imperituroard/projects/mhub/infobip'
|
6
|
+
require 'imperituroard/projects/mhub/sk'
|
7
|
+
require 'imperituroard/projects/mhub/subs/dabrab/dabrab_proced'
|
8
|
+
require 'imperituroard/projects/mhub/subs/dabrab/dabrab_platform'
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
require 'ipaddr'
|
12
|
+
require 'date'
|
13
|
+
require 'net/http'
|
14
|
+
require 'uri'
|
15
|
+
|
16
|
+
|
17
|
+
class MhubFunctions_2
|
18
|
+
attr_accessor :sk_url,
|
19
|
+
:sk_login,
|
20
|
+
:sk_password,
|
21
|
+
:mhub_connector,
|
22
|
+
:internal_func,
|
23
|
+
:dabrab_connecter,
|
24
|
+
:static_callback,
|
25
|
+
:crm_connector
|
26
|
+
|
27
|
+
def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password)
|
28
|
+
@sk_url = sk_url_simple
|
29
|
+
@sk_login = sk_login
|
30
|
+
@sk_password = sk_password
|
31
|
+
@internal_func = InternalFunc.new
|
32
|
+
@mhub_connector = Sksk_1.new(sk_url_simple, sk_login, sk_password, sk_url_broadcast)
|
33
|
+
@internal_func = InternalFunc.new
|
34
|
+
@dabrab_connecter = Dabrab.new
|
35
|
+
@add_functions_connector = AdditionalFunc.new(telegram_api_url, telegram_chat_id)
|
36
|
+
@static_callback = static_callback
|
37
|
+
@crm_connector = Crm_1.new(crm_callback_url, crm_login, crm_password)
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
#{"destinations"=>[{"to"=>{"phoneNumber"=>"375297116638", "emailAddress"=>nil}}],
|
42
|
+
# "scenarioKey"=>"1", "viber"=>nil, "sms"=>{"text"=>"карточка готова"},
|
43
|
+
# "sendAt"=>"2019-08-15T08:40:00.000", "notifyUrl"=>"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports",
|
44
|
+
# "notifyContentType"=>"application/json", "controller"=>"bank", "action"=>"api",
|
45
|
+
# "bank"=>{"destinations"=>[{"to"=>{"phoneNumber"=>"375297116638", "emailAddress"=>nil}}], "scenarioKey"=>"1",
|
46
|
+
# "viber"=>nil, "sms"=>{"text"=>"карточка готова"}, "sendAt"=>"2019-08-15T08:40:00.000",
|
47
|
+
# "notifyUrl"=>"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports",
|
48
|
+
# "notifyContentType"=>"application/json"}}
|
49
|
+
|
50
|
+
|
51
|
+
def get_send_message_2(params, ip_src, ip_real, ip_vip)
|
52
|
+
|
53
|
+
input_params = {:params => params}
|
54
|
+
output_params = {}
|
55
|
+
hub_resp = {}
|
56
|
+
null_statement = [nil, "nil", "", "null"]
|
57
|
+
|
58
|
+
begin
|
59
|
+
|
60
|
+
# if params["destinations"].length == 1
|
61
|
+
# msisdn = params["destinations"][0]["to"]["phoneNumber"]
|
62
|
+
# if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
63
|
+
# hub_resp = mhub_connector.sk_send_sms_one(msisdn, params["notifyUrl"], params["sms"]["text"], "TEST")
|
64
|
+
# elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
65
|
+
# hub_resp = mhub_connector.sk_send_viber_one(msisdn, params["notifyUrl"], params["viber"]["text"])
|
66
|
+
# elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
67
|
+
# hub_resp = mhub_connector.sk_send_viber_sms_one(msisdn, params["notifyUrl"], params["sms"]["text"], params["viber"]["text"], "TEST")
|
68
|
+
# else
|
69
|
+
# output_params = {"code": 501, "result": "Invalid input data st1", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
70
|
+
# end
|
71
|
+
# elsif params["destinations"].length > 1
|
72
|
+
#
|
73
|
+
# msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
|
74
|
+
#
|
75
|
+
# if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
76
|
+
# hub_resp = mhub_connector.sk_send_sms_list(msisdn2, params["notifyUrl"], params["sms"]["text"], "TEST")
|
77
|
+
# elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
78
|
+
# hub_resp = mhub_connector.sk_send_viber_list(msisdn2, params["notifyUrl"], params["viber"]["text"])
|
79
|
+
# elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
80
|
+
# hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, params["notifyUrl"], params["sms"]["text"], params["viber"]["text"], "TEST")
|
81
|
+
# else
|
82
|
+
# output_params = {"code": 502, "result": "Invalid input data st2", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
83
|
+
# end
|
84
|
+
# else
|
85
|
+
# output_params = {"code": 503, "result": "Invalid recipients", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
86
|
+
# end
|
87
|
+
|
88
|
+
if params["destinations"].length >= 1
|
89
|
+
|
90
|
+
msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
|
91
|
+
|
92
|
+
if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
93
|
+
hub_resp = mhub_connector.sk_send_sms_list(msisdn2, static_callback, params["sms"]["text"], "TEST")
|
94
|
+
elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
95
|
+
hub_resp = mhub_connector.sk_send_viber_list(msisdn2, static_callback, params["viber"]["text"])
|
96
|
+
elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
97
|
+
p "vibersms"
|
98
|
+
p msisdn2
|
99
|
+
hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, static_callback, params["sms"]["text"], params["viber"]["text"], "TEST")
|
100
|
+
else
|
101
|
+
output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
102
|
+
end
|
103
|
+
else
|
104
|
+
output_params = {"code": 503, "result": "Invalid recipients", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
105
|
+
end
|
106
|
+
|
107
|
+
mes_data = dabrab_connecter.send_responce_formatter(hub_resp)
|
108
|
+
p hub_resp
|
109
|
+
|
110
|
+
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}}}
|
111
|
+
|
112
|
+
rescue
|
113
|
+
output_params = {"code": 500, "result": "Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
114
|
+
end
|
115
|
+
|
116
|
+
internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.get_send_message"}, "debug")
|
117
|
+
output_params
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
def rec_deliv_report_2(params, ip_src, ip_real, ip_vip)
|
123
|
+
input_params = {:params => params, :ip_src => ip_src, :ip_real => ip_real, :ip_vip => ip_vip}
|
124
|
+
output_params = {}
|
125
|
+
hub_resp = {}
|
126
|
+
null_statement = [nil, "nil", "", "null"]
|
127
|
+
|
128
|
+
begin
|
129
|
+
|
130
|
+
mes_report = dabrab_connecter.delivery_report_transform(params)[:body][:report_to_recip]
|
131
|
+
|
132
|
+
p "mes_report"
|
133
|
+
p mes_report
|
134
|
+
p "mes_report"
|
135
|
+
|
136
|
+
result = crm_connector.crm_status_1(mes_report)
|
137
|
+
|
138
|
+
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}}}
|
139
|
+
|
140
|
+
rescue
|
141
|
+
output_params = {"code": 500, "result": "Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
142
|
+
end
|
143
|
+
|
144
|
+
internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.recieve_delivery_report"}, "debug")
|
145
|
+
output_params
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
|
150
|
+
def test2
|
151
|
+
hh = Infobip_1.new
|
152
|
+
hh.test
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
end
|
data/lib/imperituroard.rb
CHANGED
@@ -16,6 +16,7 @@ require 'imperituroard/projects/mhub/infobip'
|
|
16
16
|
require 'imperituroard/projects/mhub/sk'
|
17
17
|
require 'imperituroard/projects/mhub/subs/dabrab/dabrab_proced'
|
18
18
|
require 'imperituroard/projects/mhub/subs/dabrab/dabrab_platform'
|
19
|
+
require 'imperituroard/projects/mhub'
|
19
20
|
require 'imperituroard/projects/iot'
|
20
21
|
require 'imperituroard/platforms/cps/qps_connector'
|
21
22
|
require 'json'
|
@@ -274,6 +275,7 @@ class Mhub_2
|
|
274
275
|
@add_functions_connector = AdditionalFunc.new(telegram_api_url, telegram_chat_id)
|
275
276
|
@static_callback = static_callback
|
276
277
|
@crm_connector = Crm_1.new(crm_callback_url, crm_login, crm_password)
|
278
|
+
@mhub_connector = MhubFunctions_2.new(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback, crm_callback_url, crm_login, crm_password)
|
277
279
|
end
|
278
280
|
|
279
281
|
|
@@ -288,103 +290,12 @@ class Mhub_2
|
|
288
290
|
|
289
291
|
|
290
292
|
def get_send_message(params, ip_src, ip_real, ip_vip)
|
291
|
-
|
292
|
-
input_params = {:params => params}
|
293
|
-
output_params = {}
|
294
|
-
hub_resp = {}
|
295
|
-
null_statement = [nil, "nil", "", "null"]
|
296
|
-
|
297
|
-
begin
|
298
|
-
|
299
|
-
# if params["destinations"].length == 1
|
300
|
-
# msisdn = params["destinations"][0]["to"]["phoneNumber"]
|
301
|
-
# if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
302
|
-
# hub_resp = mhub_connector.sk_send_sms_one(msisdn, params["notifyUrl"], params["sms"]["text"], "TEST")
|
303
|
-
# elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
304
|
-
# hub_resp = mhub_connector.sk_send_viber_one(msisdn, params["notifyUrl"], params["viber"]["text"])
|
305
|
-
# elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
306
|
-
# hub_resp = mhub_connector.sk_send_viber_sms_one(msisdn, params["notifyUrl"], params["sms"]["text"], params["viber"]["text"], "TEST")
|
307
|
-
# else
|
308
|
-
# output_params = {"code": 501, "result": "Invalid input data st1", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
309
|
-
# end
|
310
|
-
# elsif params["destinations"].length > 1
|
311
|
-
#
|
312
|
-
# msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
|
313
|
-
#
|
314
|
-
# if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
315
|
-
# hub_resp = mhub_connector.sk_send_sms_list(msisdn2, params["notifyUrl"], params["sms"]["text"], "TEST")
|
316
|
-
# elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
317
|
-
# hub_resp = mhub_connector.sk_send_viber_list(msisdn2, params["notifyUrl"], params["viber"]["text"])
|
318
|
-
# elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
319
|
-
# hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, params["notifyUrl"], params["sms"]["text"], params["viber"]["text"], "TEST")
|
320
|
-
# else
|
321
|
-
# output_params = {"code": 502, "result": "Invalid input data st2", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
322
|
-
# end
|
323
|
-
# else
|
324
|
-
# output_params = {"code": 503, "result": "Invalid recipients", "answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}
|
325
|
-
# end
|
326
|
-
|
327
|
-
if params["destinations"].length >= 1
|
328
|
-
|
329
|
-
msisdn2 = dabrab_connecter.num_formatter(params["destinations"], params["notifyUrl"].split(":")[2])
|
330
|
-
|
331
|
-
if null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
332
|
-
hub_resp = mhub_connector.sk_send_sms_list(msisdn2, static_callback, params["sms"]["text"], "TEST")
|
333
|
-
elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
334
|
-
hub_resp = mhub_connector.sk_send_viber_list(msisdn2, static_callback, params["viber"]["text"])
|
335
|
-
elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
336
|
-
p "vibersms"
|
337
|
-
p msisdn2
|
338
|
-
hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, static_callback, params["sms"]["text"], params["viber"]["text"], "TEST")
|
339
|
-
else
|
340
|
-
output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
341
|
-
end
|
342
|
-
else
|
343
|
-
output_params = {"code": 503, "result": "Invalid recipients", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
344
|
-
end
|
345
|
-
|
346
|
-
mes_data = dabrab_connecter.send_responce_formatter(hub_resp)
|
347
|
-
p hub_resp
|
348
|
-
|
349
|
-
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}}}
|
350
|
-
|
351
|
-
rescue
|
352
|
-
output_params = {"code": 500, "result": "Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
353
|
-
end
|
354
|
-
|
355
|
-
internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.get_send_message"}, "debug")
|
356
|
-
output_params
|
357
|
-
|
293
|
+
mhub_connector.get_send_message_2(params, ip_src, ip_real, ip_vip)
|
358
294
|
end
|
359
295
|
|
360
296
|
|
361
297
|
def recieve_delivery_report(params, ip_src, ip_real, ip_vip)
|
362
|
-
|
363
|
-
output_params = {}
|
364
|
-
hub_resp = {}
|
365
|
-
null_statement = [nil, "nil", "", "null"]
|
366
|
-
|
367
|
-
begin
|
368
|
-
|
369
|
-
mes_report = dabrab_connecter.delivery_report_transform(params)[:body][:report_to_recip]
|
370
|
-
|
371
|
-
result = crm_connector.crm_status_1(mes_report)
|
372
|
-
|
373
|
-
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}}}
|
374
|
-
|
375
|
-
rescue
|
376
|
-
output_params = {"code": 500, "result": "Unknown SDK error", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
377
|
-
end
|
378
|
-
|
379
|
-
internal_func.printer_texter({:input => input_params, :output => output_params, :hub_resp => hub_resp, :procedure => "Mhub_2.recieve_delivery_report"}, "debug")
|
380
|
-
output_params
|
381
|
-
|
382
|
-
end
|
383
|
-
|
384
|
-
|
385
|
-
def test2
|
386
|
-
hh = Infobip_1.new
|
387
|
-
hh.test
|
298
|
+
mhub_connector.rec_deliv_report_2(params, ip_src, ip_real, ip_vip)
|
388
299
|
end
|
389
300
|
|
390
301
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imperituroard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dzmitry Buynovskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb
|
167
167
|
- lib/imperituroard/projects/iot/internal_functions.rb
|
168
168
|
- lib/imperituroard/projects/iot/mongoconnector.rb
|
169
|
+
- lib/imperituroard/projects/mhub.rb
|
169
170
|
- lib/imperituroard/projects/mhub/infobip.rb
|
170
171
|
- lib/imperituroard/projects/mhub/sk.rb
|
171
172
|
- lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb
|