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
|
42
|
|
|
42
|
|
747
|
use strict; |
|
42
|
|
|
|
|
81
|
|
|
42
|
|
|
|
|
1290
|
|
7
|
42
|
|
|
42
|
|
215
|
use warnings; |
|
42
|
|
|
|
|
76
|
|
|
42
|
|
|
|
|
1607
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Net::SIP::Response; |
10
|
42
|
|
|
42
|
|
230
|
use base 'Net::SIP::Packet'; |
|
42
|
|
|
|
|
81
|
|
|
42
|
|
|
|
|
10848
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
########################################################################### |
13
|
|
|
|
|
|
|
# Redefine methods from Net::SIP::Packet, no need to find out dynamically |
14
|
|
|
|
|
|
|
########################################################################### |
15
|
502
|
|
|
502
|
1
|
1357
|
sub is_request {0} |
16
|
281
|
|
|
281
|
1
|
1357
|
sub is_response {1} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
########################################################################### |
19
|
|
|
|
|
|
|
# Accessors for numerical code and text |
20
|
|
|
|
|
|
|
# (e.g. "407 Authorization required" ) |
21
|
|
|
|
|
|
|
########################################################################### |
22
|
245
|
|
|
245
|
1
|
791
|
sub code { return (shift->as_parts())[0] } |
23
|
66
|
|
|
66
|
1
|
211
|
sub msg { return (shift->as_parts())[1] } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
########################################################################### |
26
|
|
|
|
|
|
|
# get method of original request by parsing CSeq header |
27
|
|
|
|
|
|
|
########################################################################### |
28
|
|
|
|
|
|
|
sub method { |
29
|
213
|
|
50
|
213
|
1
|
887
|
my $cseq = shift->cseq || return; |
30
|
213
|
|
33
|
|
|
2629
|
return $cseq =~m{\d+\s+(\w+)} && $1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |