File: Redirect.pod

package info (click to toggle)
libnet-sip-perl 0.59-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 856 kB
  • ctags: 338
  • sloc: perl: 7,864; makefile: 7
file content (63 lines) | stat: -rw-r--r-- 1,339 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

=head1 NAME

Net::SIP::Redirect - Send redirect to Requests based on lookup at a registrar

=head1 SYNOPSIS

  my $reg = Net::SIP::Registrar->new(...);
  my $redir = Net::SIP::Redirect(
	dispatcher => $dispatcher,
	registrar => $reg,
  );

=head1 DESCRIPTION

This package implements a simple redirection of Requests using the information
provided by a registrar.

=head1 CONSTRUCTOR

=over 4

=item new ( %ARGS )

This creates a new redirect object, %ARGS can have the following keys:

=over 8

=item dispatcher

L<Net::SIP::Dispatcher> object manging the registar. Mandatory.

=item registrar

Registrar object. This is an object like a L<Net::SIP::Registrar>, which
has a C<query(address)> method which returns a list of contacts.

=back

=back

=head1 METHODS

=over 4

=item receive ( PACKET,LEG,FROM )

PACKET is the incoming packet,
LEG is the L<Net::SIP::Leg> where the packet arrived and FROM
is the C<< "ip:port" >> of the sender. Responses will be send
back to the sender through the same leg.

Called from the managing L<Net::SIP::Dispatcher> object if a new
packet arrives. Will return C<()> and ignore the packet if it's
an REGISTER request.

For Requests it will query the registrar and return either
C<< 302 Moved Temporarily >> with the list of contacts or
C<< 404 Not found >> if the address is not registered.



=back