From 0aeb564dd4069652c98db80c8968a754b500ec0c Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 22 Mar 2010 01:16:35 +0000 Subject: [PATCH] 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 --- scripts/applescript/FreeSWITCH Dialer.scpt | Bin 0 -> 3954 bytes scripts/perl/rpc.cgi | 28 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 scripts/applescript/FreeSWITCH Dialer.scpt create mode 100755 scripts/perl/rpc.cgi diff --git a/scripts/applescript/FreeSWITCH Dialer.scpt b/scripts/applescript/FreeSWITCH Dialer.scpt new file mode 100644 index 0000000000000000000000000000000000000000..6f9060df0ef7027cde9f36bc44242fd4ae920b5f GIT binary patch literal 3954 zcmb_ecbHVw75}|A!?1hb-r1c61VvyVhETWAAt)UeDT@?c!HBc7v+Tm`&M-4e^Pha5 zB{8x0#EKeQLVT5@I=#J<-h2NB8wABxT?lL zRa`f7#^5=#Cj}=rhoX^0urZbh&J2ZvwR3}Y!3hlwiAXXToEVEORoo7K6v0}D;sA11Zx9nn8N*U2 z8$L=>a5RCvBCR;p)tVrCKEF*}Y?Pu*6WGlznFj%sYXZ+Sqbwlb$+z;2lJC&1BDA`y zDztj|$kw)KROFX1!>ld&7O>?TW59A)Gu)kQbkgVqtHs4EboQgOIe3==>&Au1hjHm>QVVxzOv*fV9D18d_@W9%FzucY64eZFFkM)x@&^0zDMLsoUG(X zPTx_5`hE$T=wx{0Kj?v;ij!A`R*$IGM6H;sG2{zJzCckGyzxjPX&8Ev;os;bpDRu- z!w`*LIfl<1`OIZ#jI~C{AfFqHbkA8NsOhGxMSA-Hd4FaT1tPY_dG z_eSXQvoQ_x7#=k?PNWrnf>Sg>)?S~=VL4>Ur^Zx=4LD@%bqdE%(N`0=_9}vdpP`>7 z$lB|m96*012XposU1+ZZ=J@@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ripts/perl/rpc.cgi new file mode 100755 index 0000000000..87ee8b6591 --- /dev/null +++ b/scripts/perl/rpc.cgi @@ -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;