Carlos Alvarez
2012-Aug-29 17:17 UTC
[asterisk-users] Click-to-call software in a hosted environment
For any of you doing hosted PBX service on Asterisk, do you have a reliable and secure click to dial solution? Particularly for Outlook, but since about 20% of our customers use Mac OS, I'd love to hear about some that work on that too. -- Carlos Alvarez TelEvolve 602-889-3003 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120829/6e5c3dc0/attachment.htm>
Andrew White
2012-Aug-29 23:52 UTC
[asterisk-users] Click-to-call software in a hosted environment
I usually custom code it. I've got a PHP interface set up on one of our asterisk boxes (locked down via IP range) that allows calls to be initiated via the script. I can interface with this via standard HTTP requests from anything I want. I've written solutions as Chrome/Firefox addons, local applications, even built them into web pages. Outlook uses VBA if I remember correctly, and I think Apple Mail is Objective C (handy language to learn - also used for iOS devices like iPhones and iPads). Best of luck, Andrew From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Carlos Alvarez Sent: Thursday, 30 August 2012 3:17 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Click-to-call software in a hosted environment For any of you doing hosted PBX service on Asterisk, do you have a reliable and secure click to dial solution? Particularly for Outlook, but since about 20% of our customers use Mac OS, I'd love to hear about some that work on that too. -- Carlos Alvarez TelEvolve 602-889-3003 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120829/c9c479af/attachment.htm>
A J Stiles
2012-Aug-30 08:29 UTC
[asterisk-users] Click-to-call software in a hosted environment
On Wednesday 29 August 2012, Carlos Alvarez wrote:> For any of you doing hosted PBX service on Asterisk, do you have a reliable > and secure click to dial solution? Particularly for Outlook, but since > about 20% of our customers use Mac OS, I'd love to hear about some that > work on that too.This is my generic "works-anywhere" click-to-call script. It should work in conjunction with any software that allows you to specify an external command to call a number (we have tried it with Kontact and it works beautifully). You just have to issue a wget command to fire a CGI script on the server. Place this in your Asterisk server's /usr/lib/cgi-bin folder, call it "make_call.pl" and chmod 755 make_call.pl: #################### 8< #################### #!/usr/bin/perl -w use strict; use DBI; my ($web, $input_buffer, $name, $value, %parameters); my ($ip, $ext, $tel); my $dbh = DBI->connect("DBI:mysql:database=phonestuff;host=localhost", "root", ""); my $sth_get_ext = $dbh->prepare("SELECT ext FROM extensions WHERE pc_ip LIKE ?"); foreach (split/&/, $ENV{'QUERY_STRING'}) { # GET items tr/+/ /; ($name,$value) = split /=/, $_; $name =~ s/%(..)/pack'c', hex $1/eg; $value =~ s/%(..)/pack'c', hex $1/eg; $parameters{"$name"} = "$value"; }; read STDIN, $input_buffer, $ENV{"CONTENT_LENGTH"}; # POST items foreach (split/&/, $input_buffer) { tr/+/ /; ($name,$value) = split /=/, $_; $name =~ s/%(..)/pack 'c', hex $1/eg; $value =~ s/%(..)/pack 'c', hex $1/eg; $parameters{"$name"} = "$value"; }; print "Content-type: text/plain\n\n"; $tel = $parameters{"tel"} || ""; unless ($ext = $parameters{"ext"}) { $sth_get_ext->execute($ENV{"REMOTE_ADDR"}); if ($sth_get_ext->rows) { ($ext) = $sth_get_ext->fetchrow_array; }; $sth_get_ext->finish; }; if ($ext) { print "Calling from '$ext' to '$tel'.\n"; open CALLFILE, ">/tmp/asterisk_$$.call"; print CALLFILE <<"--STOP--"; Channel: SIP/$ext Context: outgoing extension: $tel Priority: 1 CallerId: $ext --STOP-- close CALLFILE; system "mv /tmp/asterisk_$$.call /var/spool/asterisk/outgoing/${ext}_${tel}.call"; } else { print "Go away, we don't know who you are. (try &ext=something)\n"; }; $dbh->disconnect; exit; #################### >8 #################### You also need a database `phonestuff` with a table `extensions` relating PC IP addresses (in `pc_ip`) to extension numbers (in `ext`). Now if your software works anything like Kontact, it will want you to specify a command to place a call and can substitute placeholders in this command. So, give this as the command: wget -o /dev/null http://ip.of.asterisk.server/cgi-bin/make_call.pl?tel=%N (Test it in an xterm, omitting the -o /dev/null, with something like your mobile number or another extension.) Licence: This program is copyright (C) 2012 by A J Stiles. You are permitted and even encouraged to distribute this program, modified or unmodified, in Source Code form whether or not accompanied by a binary executable version provided that this notice accompanies every copy. Binary distribution without Source Code constitutes a violation of copyright. -- AJS Answers come *after* questions.