call.cgi 779 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/perl
  2. use CGI qw(:standard);
  3. use ESL;
  4. my $gateway = "sofia/gateway/my_gateway/";
  5. my $aleg_cid_num = "0987654321";
  6. my $bleg_cid_num = "1234567890";
  7. my $q = new CGI;
  8. my $c = new ESL::ESLconnection("localhost", "8021", "ClueCon");
  9. print $q->header;
  10. if($q->param()) {
  11. my $numbera = $q->param('numbera');
  12. my $numberb = $q->param('numberb');
  13. my $e = $c->sendRecv("api originate {ignore_early_media=true,origination_caller_id_number=$aleg_cid_num,effective_caller_id_number=$bleg_cid_num}$gateway$numbera &bridge($gateway$numberb)");
  14. print "API Sent:" . $e->getBody();
  15. exit;
  16. }
  17. print $q->start_form, $q->h1("Click to Call Example"), br,
  18. "First Party:", $q->textfield('numbera'), br,
  19. "Second Party:", $q->textfield('numberb'),br,
  20. $q->submit, $q->end_form;