line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
43
|
|
|
43
|
|
2750568
|
use strict; |
|
43
|
|
|
|
|
406
|
|
|
43
|
|
|
|
|
1112
|
|
2
|
43
|
|
|
43
|
|
187
|
use warnings; |
|
43
|
|
|
|
|
61
|
|
|
43
|
|
|
|
|
1246
|
|
3
|
43
|
|
|
43
|
|
909
|
use 5.010; |
|
43
|
|
|
|
|
129
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Net::SIP; |
6
|
|
|
|
|
|
|
our $VERSION = '0.822'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# this includes nearly everything else |
9
|
43
|
|
|
43
|
|
18345
|
use Net::SIP::Simple (); |
|
43
|
|
|
|
|
125
|
|
|
43
|
|
|
|
|
898
|
|
10
|
43
|
|
|
43
|
|
20096
|
use Net::SIP::Simple::Call (); |
|
43
|
|
|
|
|
113
|
|
|
43
|
|
|
|
|
1061
|
|
11
|
43
|
|
|
43
|
|
289
|
use List::Util 'first'; |
|
43
|
|
|
|
|
77
|
|
|
43
|
|
|
|
|
2223
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# do not include these, because they are only |
14
|
|
|
|
|
|
|
# used when we do NAT |
15
|
|
|
|
|
|
|
# use Net::SIP::NATHelper::Base; |
16
|
|
|
|
|
|
|
# use Net::SIP::NATHelper::Local; |
17
|
|
|
|
|
|
|
# use Net::SIP::NATHelper::Client; |
18
|
|
|
|
|
|
|
# use Net::SIP::NATHelper::Server; |
19
|
|
|
|
|
|
|
|
20
|
43
|
|
|
43
|
|
232
|
use base 'Exporter'; |
|
43
|
|
|
|
|
90
|
|
|
43
|
|
|
|
|
7443
|
|
21
|
|
|
|
|
|
|
our (@EXPORT_OK, %EXPORT_TAGS); |
22
|
|
|
|
|
|
|
BEGIN { |
23
|
43
|
|
|
43
|
|
159
|
foreach ( qw( |
24
|
|
|
|
|
|
|
Net::SIP::Request |
25
|
|
|
|
|
|
|
Net::SIP::Response |
26
|
|
|
|
|
|
|
Net::SIP::Packet |
27
|
|
|
|
|
|
|
Net::SIP::SDP |
28
|
|
|
|
|
|
|
Net::SIP::Simple |
29
|
|
|
|
|
|
|
Net::SIP::Simple::RTP |
30
|
|
|
|
|
|
|
Net::SIP::Dispatcher |
31
|
|
|
|
|
|
|
Net::SIP::Dispatcher::Eventloop |
32
|
|
|
|
|
|
|
Net::SIP::Redirect |
33
|
|
|
|
|
|
|
Net::SIP::Registrar |
34
|
|
|
|
|
|
|
Net::SIP::StatelessProxy |
35
|
|
|
|
|
|
|
Net::SIP::Blocker |
36
|
|
|
|
|
|
|
Net::SIP::ReceiveChain |
37
|
|
|
|
|
|
|
Net::SIP::Authorize |
38
|
|
|
|
|
|
|
Net::SIP::Endpoint |
39
|
|
|
|
|
|
|
Net::SIP::NATHelper::Client |
40
|
|
|
|
|
|
|
Net::SIP::NATHelper::Server |
41
|
|
|
|
|
|
|
Net::SIP::NATHelper::Local |
42
|
|
|
|
|
|
|
Net::SIP::Debug |
43
|
|
|
|
|
|
|
Net::SIP::Dropper |
44
|
|
|
|
|
|
|
Net::SIP::Leg |
45
|
|
|
|
|
|
|
)) { |
46
|
|
|
|
|
|
|
|
47
|
903
|
|
|
|
|
1233
|
my $pkg = $_; # copy from alias |
48
|
903
|
|
|
|
|
849
|
my $sub; |
49
|
903
|
50
|
|
|
|
2588
|
if ( $pkg =~m{^Net::SIP::(.*)} ) { |
|
|
0
|
|
|
|
|
|
50
|
903
|
|
|
|
|
2208
|
( $sub = $1 ) =~s{::}{_}g; |
51
|
|
|
|
|
|
|
} elsif ( $pkg =~m{::(\w+)$} ) { |
52
|
0
|
|
|
|
|
0
|
$sub = $1; |
53
|
|
|
|
|
|
|
} |
54
|
903
|
50
|
|
|
|
1371
|
if ( $sub ) { |
55
|
43
|
|
|
43
|
|
266
|
no strict 'refs'; |
|
43
|
|
|
|
|
79
|
|
|
43
|
|
|
|
|
3218
|
|
56
|
903
|
|
|
|
|
4192
|
*{ $sub } = sub () { $pkg }; |
|
903
|
|
|
|
|
3589
|
|
|
0
|
|
|
|
|
0
|
|
57
|
903
|
|
|
|
|
1739
|
push @EXPORT_OK,$sub; |
58
|
903
|
|
|
|
|
916
|
push @{ $EXPORT_TAGS{alias} },$sub; |
|
903
|
|
|
|
|
12899
|
|
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub import { |
65
|
47
|
|
|
47
|
|
337
|
my $class = shift; |
66
|
47
|
|
|
|
|
130
|
my @tags = @_; |
67
|
47
|
|
|
|
|
604
|
while ( my $tag = shift(@tags)) { |
68
|
112
|
100
|
|
|
|
498
|
if ( $tag eq ':all' ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
69
|
25
|
|
|
|
|
83
|
push @tags,':alias',':util',':debug'; |
70
|
|
|
|
|
|
|
} elsif ( $tag eq ':util' ) { |
71
|
25
|
|
|
|
|
3012
|
Net::SIP::Util->export_to_level(1,$class,':all') |
72
|
|
|
|
|
|
|
} elsif ( $tag eq ':debug' ) { |
73
|
29
|
|
|
|
|
28790
|
Net::SIP::Debug->export_to_level(1,$class,':DEFAULT') |
74
|
|
|
|
|
|
|
} elsif ( $tag eq ':alias' ) { |
75
|
29
|
|
|
|
|
4420
|
$class->export_to_level(1,$class,$tag); |
76
|
|
|
|
|
|
|
} elsif ( $tag =~m{rtp[=:](\d+)-(\d+)}i ) { |
77
|
0
|
|
|
|
|
0
|
$Net::SIP::Util::RTP_MIN_PORT = $1; |
78
|
0
|
|
|
|
|
0
|
$Net::SIP::Util::RTP_MAX_PORT = $2; |
79
|
|
|
|
|
|
|
} elsif ( $tag =~m{^debug[=:](.*)}i ) { |
80
|
0
|
|
|
|
|
0
|
Net::SIP::Debug->level($1); |
81
|
84
|
|
|
84
|
|
104
|
} elsif ( first { $_ eq $tag } @EXPORT_OK ) { |
82
|
|
|
|
|
|
|
# from the predefined list |
83
|
0
|
|
|
|
|
0
|
$class->export_to_level(1,$class,$tag); |
84
|
|
|
|
|
|
|
} else { |
85
|
|
|
|
|
|
|
# default try to import from Net::SIP::Util |
86
|
4
|
|
|
|
|
257
|
Net::SIP::Util->export_to_level(1,$class,$tag) |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |