forked from Mirrors/freeswitch
simple address book dialer for use with Mac OS X Address Book using xml_rpc to issue the request to your web server... the rest is up to you
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17063 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
7c4f013f48
commit
0aeb564dd4
Binary file not shown.
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
use Frontier::Responder;
|
||||||
|
use Data::Dumper;
|
||||||
|
require ESL;
|
||||||
|
#For use with FreeSWITCH Dialer.scpt in applescripts
|
||||||
|
#
|
||||||
|
# Install FreeSWITCH Dialer.scpt into ~/Library/Address Book Plug-Ins/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
sub MakeCall {
|
||||||
|
my $hash = shift;
|
||||||
|
my $c = new ESL::ESLconnection("localhost", "8021", "ClueCon");
|
||||||
|
my $number = $hash->{phoneNumber};
|
||||||
|
my $user = $hash->{userExtension};
|
||||||
|
my $gateway = $hash->{useGateway};
|
||||||
|
$number =~ s/\D//g; # Remove nasties.
|
||||||
|
my $e = $c->sendRecv("bgapi originate {ignore_early_media=true,origination_caller_id_number=$number,effective_caller_id_number=19183029101}$user &bridge({ignore_early_media=false,sip_authorized=true}$gateway/$number)");
|
||||||
|
$e->getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
my $res = Frontier::Responder->new(
|
||||||
|
methods => {
|
||||||
|
MakeCall => \&MakeCall,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
print $res->answer;
|
Loading…
Reference in New Issue