Click-to-call Software In A Hosted Environment

Home » Asterisk Users » Click-to-call Software In A Hosted Environment
Asterisk Users 2 Comments

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.

2 thoughts on - 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@lists.digium.com [mailto:asterisk-users-bounces@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.

  • 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