forked from Mirrors/freeswitch
545b561379
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16926 d0543943-73ff-0310-b7d9-9358b9ac24b2
34 lines
558 B
Perl
34 lines
558 B
Perl
#!/usr/bin/perl
|
|
|
|
use ESL::Dispatch;
|
|
use Data::Dumper;
|
|
my $daemon = init ESL::Dispatch({});
|
|
|
|
$| = 1;
|
|
|
|
sub worker {
|
|
my $self = shift;
|
|
print "I'm a worker\n";
|
|
}
|
|
|
|
sub heartbeat {
|
|
my $self = shift;
|
|
my $event = shift;
|
|
print Dumper $event;
|
|
}
|
|
|
|
sub channel_hangup {
|
|
my $self = shift;
|
|
my $event = shift;
|
|
print Dumper $event;
|
|
print "DO SQL GOODIES HERE!\n";
|
|
}
|
|
|
|
$0 = "ESL::Dispatch rocks!";
|
|
|
|
$daemon->set_worker(\&worker, 2000);
|
|
$daemon->set_callback("heartbeat", \&heartbeat);
|
|
$daemon->set_callback("channel_hangup", \&channel_hangup);
|
|
|
|
$daemon->run;
|