POE::Component::Telephony::CTPortNon-blocking telephony programming in Perl | |
Download |
POE::Component::Telephony::CTPort Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- David Davis
- Publisher web site:
- http://search.cpan.org/~xantus/POE-Component-Proxy-MSN-0.02/lib/POE/Component/Proxy/MSN.pm
POE::Component::Telephony::CTPort Tags
POE::Component::Telephony::CTPort Description
Non-blocking telephony programming in Perl POE::Component::Telephony::CTPort is a non-blocking telephony programming in Perl.SYNOPSIS use POE qw(Compoent::Telephony::CTPort); POE::Session->create( inline_states => { _start => sub { my $kernel = $_; POE::Component::Telephony::CTPort->spawn({ alias => 'ctport', port => 1, }); $kernel->post(ctport => 'connect'); }, connected => sub { my $kernel = $_; print "connected to ctserver on port 1 "; }, input => sub { my ($kernel, $in) = @_; # all events are sent here, this is a good # spot to use Data::Dumper if ($in->{rly} eq 'ring') { $kernel->yield(ring => $in); } }, ring => sub { my $kernel = $_; # pick up phone $kernel->post(ctport => 'off_hook'); # play beep $kernel->post(ctport => play => 'beep'); # record $kernel->post(ctport => record => # to this file 'prompt.wav', # for 15 seconds 15, # or until they hit # '#', # or 3 seconds of silence 3, ); # play it back to them $kernel->post(ctport => play => 'prompt.wav'); # play 3 beeps $kernel->post(ctport => play => 'beep beep beep'); # hangup $kernel->post(ctport => 'on_hook'); # shutdown $kernel->post(ctport => 'disconnect'); $kernel->post(ctport => 'shutdown'); }, } ); Requirements: · Perl
POE::Component::Telephony::CTPort Related Software