click to call

Home » Asterisk Users » click to call
Asterisk Users 7 Comments

hello list

i need to create a call files in order to do a click to call with

i want to use sip 223 in order to call phone number

i have created a in var/spool/asterisk/tmp and i move it to

but there is no call

please tell me if there is any worng

Channel: SIP/223

MaxRetries: 2

RetryTime: 60

WaitTime: 30

Context: call-file-test

Extension: 223



exten => 223,1,Dial(SIP/223,tT)

exten => 223,2,hangup

thanks and regards

7 thoughts on - click to call

  • dear is there any study material for implementing click to call in asterisk. plz help.

    thanks regards

  • This capability is implanted in Vtiger CRM and some other packages. If you wanted to do it in a “stand-alone” fashion, it’s a relatively simple task. I did it in PERL using the Asterisk::Manager package. AFAIK there are PHP
    equivalents for this as well.

    [] On Behalf Of alok srivastava Sent: Wednesday, July 11, 2012 2:36 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: [asterisk-users] click to call

    dear is there any study material for implementing click to call in asterisk. plz help.

    thanks regards

  • On the subject of click to call – admittedly not necessarily what the OP
    was after – I had some marketing blurb from VMware about Zimbra 8 this morning. Apparently one of the new shiny features is integrated C2C (and other unified comms stuff).

    Has anyone had a chance to play with the SDK as yet? Would be quite fun to see if Asterisk could be integrated (visual voicemail and the like).

    Kind regards,


  • Dead simple! You need to install Apache on the Asterisk server if you haven’t already. Then use a CGI script like this;

    ############### 8< ############### #!/usr/bin/perl -w use strict; my ($web, $input_buffer, $name, $value, %parameters); my ($ext, $tel); 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”} || “”; $ext = $parameters{“ext”} || “”; 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

  • Hopefully it doesn’t need to be said, but if you are going to put this solution in place, please protect it with both strong authentication and authorization. Not to do so would inevitably lead to some sort of toll fraud.

  • Yes indeed. Note the 192.168 address I used in my other example — the Asterisk server here is on the LAN side of the router, and there is no firewall rule anywhere forwarding to its port 80.

    If for some reason you have to run Asterisk on a box facing the Internet, then make sure that any CGI script that can place outside calls is locked down in the Apache configuration so as *only* to be reachable from LAN addresses.