line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
41
|
|
|
41
|
|
2746912
|
use strict; |
|
41
|
|
|
|
|
441
|
|
|
41
|
|
|
|
|
1244
|
|
2
|
41
|
|
|
41
|
|
240
|
use warnings; |
|
41
|
|
|
|
|
73
|
|
|
41
|
|
|
|
|
1091
|
|
3
|
41
|
|
|
41
|
|
1214
|
use 5.010; |
|
41
|
|
|
|
|
152
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Net::SIP; |
6
|
|
|
|
|
|
|
our $VERSION = '0.823'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# this includes nearly everything else |
9
|
41
|
|
|
41
|
|
19462
|
use Net::SIP::Simple (); |
|
41
|
|
|
|
|
142
|
|
|
41
|
|
|
|
|
1051
|
|
10
|
41
|
|
|
41
|
|
22229
|
use Net::SIP::Simple::Call (); |
|
41
|
|
|
|
|
151
|
|
|
41
|
|
|
|
|
1154
|
|
11
|
41
|
|
|
41
|
|
308
|
use List::Util 'first'; |
|
41
|
|
|
|
|
98
|
|
|
41
|
|
|
|
|
2461
|
|
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
|
41
|
|
|
41
|
|
270
|
use base 'Exporter'; |
|
41
|
|
|
|
|
90
|
|
|
41
|
|
|
|
|
8858
|
|
21
|
|
|
|
|
|
|
our (@EXPORT_OK, %EXPORT_TAGS); |
22
|
|
|
|
|
|
|
BEGIN { |
23
|
41
|
|
|
41
|
|
180
|
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
|
861
|
|
|
|
|
1245
|
my $pkg = $_; # copy from alias |
48
|
861
|
|
|
|
|
955
|
my $sub; |
49
|
861
|
50
|
|
|
|
2890
|
if ( $pkg =~m{^Net::SIP::(.*)} ) { |
|
|
0
|
|
|
|
|
|
50
|
861
|
|
|
|
|
2282
|
( $sub = $1 ) =~s{::}{_}g; |
51
|
|
|
|
|
|
|
} elsif ( $pkg =~m{::(\w+)$} ) { |
52
|
0
|
|
|
|
|
0
|
$sub = $1; |
53
|
|
|
|
|
|
|
} |
54
|
861
|
50
|
|
|
|
1690
|
if ( $sub ) { |
55
|
41
|
|
|
41
|
|
322
|
no strict 'refs'; |
|
41
|
|
|
|
|
116
|
|
|
41
|
|
|
|
|
3773
|
|
56
|
861
|
|
|
|
|
4555
|
*{ $sub } = sub () { $pkg }; |
|
861
|
|
|
|
|
4537
|
|
|
0
|
|
|
|
|
0
|
|
57
|
861
|
|
|
|
|
2003
|
push @EXPORT_OK,$sub; |
58
|
861
|
|
|
|
|
1079
|
push @{ $EXPORT_TAGS{alias} },$sub; |
|
861
|
|
|
|
|
15069
|
|
59
|
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub import { |
65
|
45
|
|
|
45
|
|
431
|
my $class = shift; |
66
|
45
|
|
|
|
|
172
|
my @tags = @_; |
67
|
45
|
|
|
|
|
703
|
while ( my $tag = shift(@tags)) { |
68
|
104
|
100
|
|
|
|
622
|
if ( $tag eq ':all' ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
69
|
23
|
|
|
|
|
107
|
push @tags,':alias',':util',':debug'; |
70
|
|
|
|
|
|
|
} elsif ( $tag eq ':util' ) { |
71
|
23
|
|
|
|
|
3202
|
Net::SIP::Util->export_to_level(1,$class,':all') |
72
|
|
|
|
|
|
|
} elsif ( $tag eq ':debug' ) { |
73
|
27
|
|
|
|
|
29429
|
Net::SIP::Debug->export_to_level(1,$class,':DEFAULT') |
74
|
|
|
|
|
|
|
} elsif ( $tag eq ':alias' ) { |
75
|
27
|
|
|
|
|
4889
|
$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
|
|
|
|
|
260
|
Net::SIP::Util->export_to_level(1,$class,$tag) |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |