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
|
|
622
|
use strict; |
|
44
|
|
|
|
|
73
|
|
|
44
|
|
|
|
|
1178
|
|
7
|
44
|
|
|
44
|
|
187
|
use warnings; |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
1483
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Net::SIP::Response; |
10
|
44
|
|
|
44
|
|
238
|
use base 'Net::SIP::Packet'; |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
10184
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
########################################################################### |
13
|
|
|
|
|
|
|
# Redefine methods from Net::SIP::Packet, no need to find out dynamically |
14
|
|
|
|
|
|
|
########################################################################### |
15
|
507
|
|
|
507
|
1
|
1340
|
sub is_request {0} |
16
|
291
|
|
|
291
|
1
|
1509
|
sub is_response {1} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
########################################################################### |
19
|
|
|
|
|
|
|
# Accessors for numerical code and text |
20
|
|
|
|
|
|
|
# (e.g. "407 Authorization required" ) |
21
|
|
|
|
|
|
|
########################################################################### |
22
|
255
|
|
|
255
|
1
|
876
|
sub code { return (shift->as_parts())[0] } |
23
|
65
|
|
|
65
|
1
|
214
|
sub msg { return (shift->as_parts())[1] } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
########################################################################### |
26
|
|
|
|
|
|
|
# get method of original request by parsing CSeq header |
27
|
|
|
|
|
|
|
########################################################################### |
28
|
|
|
|
|
|
|
sub method { |
29
|
217
|
|
50
|
217
|
1
|
842
|
my $cseq = shift->cseq || return; |
30
|
217
|
|
33
|
|
|
1949
|
return $cseq =~m{\d+\s+(\w+)} && $1; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |