From 065dec4baa50c53bfc6dff396466bd93293734e7 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 17 Feb 2009 02:23:03 +0000 Subject: [PATCH] example click to call using new ESL lib in perl git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12079 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- scripts/call.cgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/call.cgi diff --git a/scripts/call.cgi b/scripts/call.cgi new file mode 100755 index 0000000000..d433e1d782 --- /dev/null +++ b/scripts/call.cgi @@ -0,0 +1,25 @@ +#!/usr/bin/perl +use CGI qw(:standard); +use ESL; + +my $gateway = "sofia/gateway/my_gateway/"; +my $aleg_cid_num = "0987654321"; +my $bleg_cid_num = "1234567890"; + +my $q = new CGI; +my $c = new ESL::eslConnection("localhost", "8021", "ClueCon"); +print $q->header; + +if($q->param()) { + my $numbera = $q->param('numbera'); + my $numberb = $q->param('numberb'); + 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)"); + print "API Sent:" . $e->getBody(); + exit; +} + +print $q->start_form, $q->h1("Click to Call Example"), br, + "First Party:", $q->textfield('numbera'), br, + "Second Party:", $q->textfield('numberb'),br, + $q->submit, $q->end_form; +