Silent Click2Call Script

matstone99
Posts: 4
Member Since:
2008-08-18

I've spent the last 3 years mastering trixbox and relying heavily on the great community of developers for help when things go wrong and I'm now in a position to give something back in the form of my first custom script for trixbox, which was designed to help my call centre improve their dialling rate by removing the need to physically dial the telephone number (which we worked out takes around 6 seconds to do on each call) by implementing a click2call script via a link on our database system. I had a look at the various scripts and they all had one problem, the phone itself has to ring and be answered before the call is connected. This is frustrating for our call centre staff due to the noise of 20 ringing phones and having to answer the incoming call each time, so I looked into how I could silently make the click2call script work for us and the result is can be downloaded with full instructions from here:

http://support.insightdata.co.uk/downloads/click2call-2010.zip

The script basically works by using the built in paging system to page the connecting call to the users phone, the script is adapted from the one found at http://nerdvittles.com/index.php?p=168 and the custom code for extensions_custom.conf is not very clever and I'm sure someone will come up with a better way to create the virtual extensions dynamically rather than having to insert each of the extensions manually.

Instuctions are included in the zip file but also below for your convienience, if you need any help setting up this script I am by no means a trixbox guru but have 3 years experience building and maintaining the system at my business so should be able to solve any problems people may encounter. I can be contacted at matstone99@gmail.com

Installation Instructions for Silent Click2Call Script by Matthew Stone (matstone99@gmail.com)
-------------------------------------------------------------------------------------------------------------

files: clicktocall.php, instructions.txt

1. Copy the clicktocall.php script to your webroot (normally /var/www/html/)
2. SSH into your trixbox as the root (or a user with admin privileges) and type the following:

cd /var/www/html/
chmod 777 clicktocall.php
chown clicktocall.php

3. Still in your SSH session we now need to check that asterisk manager user has the correct permissions:

nano /etc/asterisk/manager.conf

You should see a section [admin], this is the admin user specified in the clicktocall.php script. Make a note of the password, and make sure that read and write look as follows:

read = system,call,log,verbose,command,agent,user,originate
write = system,call,log,verbose,command,agent,user,originate

On newer versions of Trixbox the originate command appears to be missing. If it is edit the file and add it onto both of the lines and save the file.

4. Using the Edit Config file options in PBX Settings on the web interface in your web browser open extensions_custom.conf and look for [from-internal-custom] and add the following lines of code duplicating it for each one of your handsets (if someone knows a better way that doesn't require duplicating the code for each extension please let me know as I'm not a trixbox expert yet!) where 322 in this example is the virtual extension number for 224, replace the IP address with the local IP address of your trixbox:

exten => 322,1,Set(__SIPADDHEADER=Call-Info:<sip:192.168.1.200>\; answer-after=0)
exten => 322,2,Dial(sip/222)
exten => 322,3,Hangup
exten => 322,102,Hangup

Save the config file and reload asterisk.

5. The final thing to do is to check your handsets settings and make sure its set to auto answer pages, and all you need to do is call up the clicktocall script in your web browser passing the Name Number and Extension:

http://yourtrixboxip/clicktocall.php?name=NametoShow&number=01234...

N.B. The above script was written for Trixbox 2.8 but should work on most similar asterisk based systems, the handsets used in this example are Linksys SPA942. If you are using Polycom or Snoms or other handsets you may or may not need to add the follow code to the extensions_custom.conf example above.

exten => 322,1,SIPAddHeader(Call Info: Answer-After=0)
exten => 322,1,Set(_ALERT_INFO="RA")

If you get stuck or need any help just email me on the address above and I will be happy to help.

--

Matt
~'Hello, IT, have you tried turning it off and on again?'~