Send mixed voice and TTS message via www.smsmatrix.com SMS Gateway using Perl


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. use LWP::UserAgent;
  2. use HTTP::Request::Common;
  3. use JSON();
  4.  
  5. my $msg =
  6. {
  7. username => '[email protected]',
  8. password => 'mypass',
  9. phone => '12502012503', # comma delimited list
  10. language => 'us', # optional
  11. gender => 'male', # optional
  12. callerid => '12501112233', # optional
  13. response => 0, # optional
  14. msg => [ 'http://www.myserver.com/voices/welcome_prompt.wav',
  15. 'This text will be converted to voice by TTS engine.',
  16. 'http://www.myserver.com/voices/segment2.mp3' ]
  17. };
  18. my $ua = new LWP::UserAgent;
  19. my $res = $ua->request
  20. (
  21. POST 'http://www.smsmatrix.com/matrix_vtts',
  22. Content_Type => 'application/json',
  23. Content => JSON::to_json ($msg)
  24. );
  25. if ($res->is_error) { die "HTTP Error\n"; }
  26. print "Matrix API Response:\n" . $res->content . "\n\n";

URL: http://www.smsmatrix.com/?sms-gateway

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.