line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# MODULE: NetSDS::Feature::Kannel |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# DESCRIPTION: Kannel application feature |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# AUTHOR: Michael Bochkaryov (RATTLER), <misha@rattler.kiev.ua> |
8
|
|
|
|
|
|
|
# COMPANY: Net.Style |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
#=============================================================================== |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
NetSDS::Feature::Kannel - kannel application feature |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ***************************************** |
19
|
|
|
|
|
|
|
# Configuration file fragment |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
<feature smsgw> |
22
|
|
|
|
|
|
|
class = NetSDS::Feature::Kannel |
23
|
|
|
|
|
|
|
sendsms_url = http://10.0.1.2:13013/cgi-bin/sendsms |
24
|
|
|
|
|
|
|
sendsms_user = netsds |
25
|
|
|
|
|
|
|
sendsms_passwd = topsecret |
26
|
|
|
|
|
|
|
</feture> |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# ***************************************** |
30
|
|
|
|
|
|
|
# Application |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
SMSApp->run( |
33
|
|
|
|
|
|
|
auto_features => 1, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
package SMSApp; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub process { |
39
|
|
|
|
|
|
|
... |
40
|
|
|
|
|
|
|
$self->sms->send( |
41
|
|
|
|
|
|
|
from => '1234', |
42
|
|
|
|
|
|
|
to => '380501234567', |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
C<NetSDS::Feature::Kannel> module provides pluggable API to Kannel |
51
|
|
|
|
|
|
|
from NetSDS application. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
package NetSDS::Feature::Kannel; |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
2
|
|
13478
|
use 5.8.0; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
91
|
|
58
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
86
|
|
59
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
60
|
|
|
|
|
|
|
|
61
|
2
|
|
|
2
|
|
100
|
use NetSDS::Kannel; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use base qw(NetSDS::Class::Abstract); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
use version; our $VERSION = "1.300"; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#=============================================================================== |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 CLASS API |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=over |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item B<new([...])> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Constructor |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my $object = NetSDS::SomeClass->new(%options); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
#----------------------------------------------------------------------- |
81
|
|
|
|
|
|
|
sub init { |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my ( $class, $app, $conf ) = @_; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $kannel = NetSDS::Kannel->new(%{$conf}); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$app->log("info", "Kannel feature loaded..."); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return $kannel; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
}; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=back |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=over |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * L<NetSDS::Kannel> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * L<NetSDS::Feature> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * L<NetSDS::App> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item * L<http://www.kannel.org/> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=back |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 TODO |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
None |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Michael Bochkaryov <misha@rattler.kiev.ua> |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 LICENSE |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Copyright (C) 2008-2009 Net Style Ltd. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
127
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
128
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
129
|
|
|
|
|
|
|
(at your option) any later version. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
132
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
133
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
134
|
|
|
|
|
|
|
GNU General Public License for more details. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
137
|
|
|
|
|
|
|
along with this program; if not, write to the Free Software |
138
|
|
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
|