8 |
__PACKAGE__->mk_accessors( qw/ |
__PACKAGE__->mk_accessors( qw/ |
9 |
port |
port |
10 |
store |
store |
|
default_queue |
|
11 |
background |
background |
12 |
debug |
debug |
13 |
|
|
15 |
/ ); |
/ ); |
16 |
|
|
17 |
use CWMP::Session; |
use CWMP::Session; |
18 |
|
use CWMP::Queue; |
19 |
|
|
20 |
use Carp qw/confess/; |
use Carp qw/confess/; |
21 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
34 |
module => 'DBMDeep', |
module => 'DBMDeep', |
35 |
path => 'var/', |
path => 'var/', |
36 |
}, |
}, |
|
default_queue => [ qw/GetRPCMethods GetParameterNames/ ], |
|
37 |
background => 1, |
background => 1, |
38 |
debug => 1 |
debug => 1 |
39 |
}); |
}); |
51 |
hash with key C<module> with value C<DBMDeep> if L<CWMP::Store::DBMDeep> |
hash with key C<module> with value C<DBMDeep> if L<CWMP::Store::DBMDeep> |
52 |
is used. Other parametars are optional. |
is used. Other parametars are optional. |
53 |
|
|
|
=item default_queue |
|
|
|
|
|
commands which will be issued to every CPE on connect |
|
|
|
|
54 |
=back |
=back |
55 |
|
|
56 |
=cut |
=cut |
70 |
CWMP::Server::Helper->new({ |
CWMP::Server::Helper->new({ |
71 |
proto => 'tcp', |
proto => 'tcp', |
72 |
port => $self->port, |
port => $self->port, |
|
default_queue => $self->default_queue, |
|
73 |
store => $self->store, |
store => $self->store, |
74 |
debug => $self->debug, |
debug => $self->debug, |
75 |
background => $self->background, |
background => $self->background, |
113 |
} |
} |
114 |
|
|
115 |
# new multi-value options |
# new multi-value options |
116 |
foreach my $p ( qw/ default_queue / ) { |
# foreach my $p ( qw/ default_queue / ) { |
117 |
$prop->{ $p } ||= []; |
# $prop->{ $p } ||= []; |
118 |
$template->{ $p } = $prop->{ $p }; |
# $template->{ $p } = $prop->{ $p }; |
119 |
} |
# } |
120 |
} |
} |
121 |
|
|
122 |
|
|
132 |
my $sock = $prop->{client}; |
my $sock = $prop->{client}; |
133 |
confess "no sock in ", ref( $self ) unless $sock; |
confess "no sock in ", ref( $self ) unless $sock; |
134 |
|
|
|
warn "default CPE queue ", dump( $prop->{default_queue} ), "\n" if defined($prop->{default_queue}); |
|
|
|
|
135 |
eval { |
eval { |
136 |
my $session = CWMP::Session->new({ |
my $session = CWMP::Session->new({ |
137 |
sock => $sock, |
sock => $sock, |
|
queue => $prop->{default_queue}, |
|
138 |
store => $prop->{store}, |
store => $prop->{store}, |
139 |
debug => $prop->{debug}, |
debug => $prop->{debug}, |
140 |
}) || confess "can't create session"; |
}) || confess "can't create session"; |