line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################################################### |
2
|
|
|
|
|
|
|
# package Net::SIP::Response |
3
|
|
|
|
|
|
|
# subclass from Net::SIP::Packet for managing the response packets |
4
|
|
|
|
|
|
|
########################################################################### |
5
|
|
|
|
|
|
|
|
6
|
44
|
|
|
44
|
|
598
|
use strict; |
|
44
|
|
|
|
|
78
|
|
|
44
|
|
|
|
|
1171
|
|
7
|
44
|
|
|
44
|
|
186
|
use warnings; |
|
44
|
|
|
|
|
85
|
|
|
44
|
|
|
|
|
1791
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Net::SIP::Response; |
10
|
44
|
|
|
44
|
|
275
|
use base 'Net::SIP::Packet'; |
|
44
|
|
|
|
|
82
|
|
|
44
|
|
|
|
|
10129
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
########################################################################### |
13
|
|
|
|
|
|
|
# Redefine methods from Net::SIP::Packet, no need to find out dynamically |
14
|
|
|
|
|
|
|
########################################################################### |
15
|
501
|
|
|
501
|
1
|
1412
|
sub is_request {0} |
16
|
290
|
|
|
290
|
1
|
1641
|
sub is_response {1} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
########################################################################### |
19
|
|
|
|
|
|
|
# Accessors for numerical code and text |
20
|
|
|
|
|
|
|
# (e.g. "407 Authorization required" ) |
21
|
|
|
|
|
|
|
########################################################################### |
22
|
254
|
|
|
254
|
1
|
794
|
sub code { return (shift->as_parts())[0] } |
23
|
63
|
|
|
63
|
1
|
190
|
sub msg { return (shift->as_parts())[1] } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
########################################################################### |
26
|
|
|
|
|
|
|
# get method of original request by parsing CSeq header |
27
|
|
|
|
|
|
|
########################################################################### |
28
|
|
|
|
|
|
|
sub method { |
29
|
216
|
|
50
|
216
|
1
|
847
|
my $cseq = shift->cseq || return; |
30
|
216
|
|
33
|
|
|
1920
|
return $cseq =~m{\d+\s+(\w+)} && $1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |