DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Send Voice Call Via Www.smsmatrix.com Gateway Using Mp3 File URL

08.23.2010
| 3246 views |
  • submit to reddit
        Send mp3 or wave file as a phone call, using <A HREF="http://www.smsmatrix.com/">
SMS and Voice Gateway</A>.

use LWP::UserAgent;
use HTTP::Request::Common;

my $ua = LWP::UserAgent->new();
my $res = $ua->request
(
 POST 'http://www.smsmatrix.com/matrix_voicew',
      Content      => [ username  => 'user@hotmail.com',
                        password  => 'pass8988',
                        phone     => '12502771720',  ## comma delimited list
                        voiceurl  => 'http://www.myweb.de/s/welcome.mp3',
                        response  => 0,  ## optional
                        callerid  => '16307791722'  ## optional
                      ]
);

if ($res->is_error) { die "HTTP Error\n"; }
print "Matrix API Response1: " . $res->content . "\n\n";