forked from signalwire/freeswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
7c4f013
commit 0aeb564
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |