File: test_registrar_and_proxy.pl

package info (click to toggle)
libnet-sip-perl 0.46-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 720 kB
  • ctags: 328
  • sloc: perl: 7,312; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 697 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
use strict;
use warnings;
use Net::SIP;

# This is a simple registrar + proxy which listens on 192.168.178.2
# for requests. Anybody can register with any address and if somebody
# invites somebody using over this proxy it will first check if the
# target address is locally registered and in this case forward the
# invitation to the registered party. Otherwise it will try to resolve
# the target using DNS and forward the request.
#
# Because it accepts any registration w/o passwords it's good for testing
# but don't use it in production

my $ua = Net::SIP::Simple->new( leg => '192.168.178.2:5060' );
$ua->create_chain([
	$ua->create_registrar,
	$ua->create_stateless_proxy, 
]);
$ua->loop;