I was recently talking to someone that was looking at running Capsule CRM.
In Capsule you can create a “Task” which is something that has happened or will happen. These “Tasks” can then be assigned to a customer or contact.
Capsule has an API that allows automating posting of these tasks and we can use CURL in Asterisk to post the call details.This guide was written using Asterisk 11. If this doesn’t work for you ensure you have curl compiled in to Asterisk with “core show function CURL”.
First we need to tell Asterisk to run a command when a call ends. We are going to do it at the end so that we can get the length of the call. FreePBX allows for this using a hangup-handler.
We are going to add the following lines to – /etc/asterisk/extensions_custom.conf
After changing the dial plan we will either need to restart Asterisk or run “dialplan reload”.
That will call a web page on the local server called capsule.php, now we need to create that file. On my server it will look here for the file – /var/www/html/capsule.php
You will need to change the 2 settings at the top of the script to match your Capsule settings.
Now when a call is made we should get something similar generated in Capsule CRM –
If your task doesn’t get generated then check in the Asterisk logs to ensure the Curl request is being made, and check in the web server logs to ensure there are no errors when the script runs.
Many ideas from this post were taken from here – http://www2.cyber-cottage.co.uk/?p=836