turatel_sms 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/turatel_sms/sms.rb +11 -0
- data/lib/turatel_sms/xml_body.rb +34 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12d2976471f4dcc29ea9c38d185c59552be28973
|
4
|
+
data.tar.gz: 0218ab016e89ce1d7c24ca39dded84a65e23b7f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51068fe2f2bb25d967a1e603725368c34e96b79885fc4b2dcf2740cdd124c73b8236bdc9dbb0e7c80fdd21bdafd4a9a271748a1924d3bd6a59209e62622b236b
|
7
|
+
data.tar.gz: a74e83718ac402acf62a378e9d9fe073e4486e33fc5a6628b80f3c50ee4bcdb69d1f0812012a58eb86528fd86c9b7e18b7fee30eacf3fce98ce0adc5139b5d35
|
data/lib/turatel_sms/sms.rb
CHANGED
@@ -15,6 +15,17 @@ module TuraTEL
|
|
15
15
|
"result = #{result}"
|
16
16
|
end
|
17
17
|
|
18
|
+
def self.check_sms(msg_id)
|
19
|
+
body = TuraTEL::XmlBody.check_sms_body(msg_id)
|
20
|
+
|
21
|
+
puts body if TuraTEL.configuration.debug
|
22
|
+
|
23
|
+
response = send_request(body)
|
24
|
+
|
25
|
+
result = parse_response(response)
|
26
|
+
"result = #{result}"
|
27
|
+
end
|
28
|
+
|
18
29
|
def sms_status
|
19
30
|
'OK status'
|
20
31
|
end
|
data/lib/turatel_sms/xml_body.rb
CHANGED
@@ -1,7 +1,40 @@
|
|
1
1
|
module TuraTEL
|
2
2
|
class XmlBody
|
3
3
|
def self.send_sms_body(recipient, message_text, valid_options)
|
4
|
-
"
|
4
|
+
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
|
5
|
+
<MainmsgBody>
|
6
|
+
<Command>0</Command>
|
7
|
+
<PlatformID>1</PlatformID>
|
8
|
+
<ChannelCode>#{TuraTEL.configuration.channel_code}</ChannelCode>
|
9
|
+
<UserName>#{TuraTEL.configuration.usercode}</UserName>
|
10
|
+
<PassWord>#{TuraTEL.configuration.password}</PassWord>
|
11
|
+
<Mesgbody>#{message_text}</Mesgbody>
|
12
|
+
<Numbers>#{recipient}</Numbers>
|
13
|
+
<Type>1</Type>
|
14
|
+
<Originator>#{valid_options[:from]}</Originator>
|
15
|
+
</MainmsgBody>"
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.check_sms_body(msg_id)
|
19
|
+
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
|
20
|
+
<MainReportRoot>
|
21
|
+
<Command>3</Command>
|
22
|
+
<PlatformID>1</PlatformID>
|
23
|
+
<ChannelCode>#{TuraTEL.configuration.channel_code}</ChannelCode>
|
24
|
+
<UserName>#{TuraTEL.configuration.usercode}</UserName>
|
25
|
+
<PassWord>#{TuraTEL.configuration.password}</PassWord>
|
26
|
+
<MsgID>#{msg_id}</MsgID>
|
27
|
+
</MainReportRoot>"
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.get_credit
|
31
|
+
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
|
32
|
+
<MainReportRoot>
|
33
|
+
<Command>6</Command>
|
34
|
+
<ChannelCode>#{TuraTEL.configuration.channel_code}</ChannelCode>
|
35
|
+
<UserName>#{TuraTEL.configuration.usercode}</UserName>
|
36
|
+
<PassWord>#{TuraTEL.configuration.password}</PassWord>
|
37
|
+
</MainReportRoot>"
|
5
38
|
end
|
6
39
|
end
|
7
40
|
end
|