Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Perl version Helper for Plivo
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Net
README.md

README.md

Plivo-Perl-Helper

  • Overview
    Perl version Helper for Plivo
    This is a Perl version of Helper for Plivo, to make Plivo easier to use.

  • Require
    use LWP::UserAgent;
    use HTTP::Request;
    use JSON;
    use XML::Simple;

  • Example
    To call Plivo api

    use Net::Plivo;
    my $object = Net::Plivo->new({ auth_id=>your_auth_id, auth_token=>your_auth_token });
    my $args = {
        from       => '18888888888',
        to         => '15101121122',
        answer_url => 'https://sample.com/',
    };
    $boject->call( $args );
    return;
    

    Server Resopnd XML

    use Net::Plivo;
    my $object = Net::Plivo->new({ auth_id=>your_auth_id, auth_token=>your_auth_token });
    my $params = {
        action => "https://www.sample.com/?params=1",
        speak  => 'Hello World',
        finishonkey => '#',
    };
    /*
    speak could also be passed in as array
    push (@{$params->{speak}}, 'test1');
    push (@{$params->{speak}}, 'test2');
    push (@{$params->{speak}}, 'test2');
    */
    $object->add_getdigits( $params );
    $object->add_speak({ speak=>'Input not received. Thank you' });
    my $xml = $object->respond();
    
    print "Content-Type: text/xml\n\n";
    print $xml;
    return;
    

Supporting Documentation

Use perldoc to get more info from the code.

Something went wrong with that request. Please try again.