POE::Filter::FSSocket

POE::Filter::FSSocket is a POE filter that parses FreeSWITCH events into hashes.
Download

POE::Filter::FSSocket Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Paul Tinsley
  • Publisher web site:
  • http://search.cpan.org/~ptinsley/POE-Filter-FSSocket-0.07/lib/POE/Filter/FSSocket.pm

POE::Filter::FSSocket Tags


POE::Filter::FSSocket Description

POE::Filter::FSSocket is a POE filter that parses FreeSWITCH events into hashes. POE::Filter::FSSocket is a POE filter that parses FreeSWITCH events into hashes.SYNOPSIS #!/usr/bin/perl use warnings; use strict; use POE qw(Component::Client::TCP Filter::FSSocket); use Data::Dumper; POE::Component::Client::TCP->new( 'RemoteAddress' => '127.0.0.1', 'RemotePort' => '8021', 'ServerInput' => &handle_server_input, 'Filter' => 'POE::Filter::FSSocket', ); POE::Kernel->run(); exit; my $auth_sent = 0; my $password = "ClueCon"; sub handle_server_input { my ($heap,$input) = @_; print Dumper $input; if($input->{'Content-Type'} eq "auth/request") { $auth_sent = 1; $heap->{'server'}->put("auth $password"); } elsif ($input->{'Content-Type'} eq "command/reply") { if($auth_sent == 1) { $auth_sent = -1; #do post auth stuff $heap->{'server'}->put("events plain all"); } } }POE::Filter::FSSocket parses output from FreeSWITCH into hashes. FreeSWITCH events have a very wide range of keys, the only consistant one being Content-Type. The keys are dependant on the type of events. You must use the plain event type as that is what the filter knows how to parse. You can ask for as many event types as you like or all for everything. You specify a list of event types by putting spaces between them ex: "events plain api log talk"Currently known event types (Event-Name): CUSTOM CHANNEL_CREATE CHANNEL_DESTROY CHANNEL_STATE CHANNEL_ANSWER CHANNEL_HANGUP CHANNEL_EXECUTE CHANNEL_BRIDGE CHANNEL_UNBRIDGE CHANNEL_PROGRESS CHANNEL_OUTGOING CHANNEL_PARK CHANNEL_UNPARK API LOG INBOUND_CHAN OUTBOUND_CHAN STARTUP SHUTDOWN PUBLISH UNPUBLISH TALK NOTALK SESSION_CRASH MODULE_LOAD DTMF MESSAGE CODEC BACKGROUND_JOB ALLCurrently handled FreeSWITCH messages (Content-Type): auth/request command/response text/event-plain api/response (data in __DATA__ variable) log/data (data in __DATA__ variable)POE::Filter::FSSocket is a POE filter that parses FreeSWITCH events into hashes. Requirements: · Perl


POE::Filter::FSSocket Related Software