Friday 15 March 2013


Twilio integration with salesforce

Following are the steps to integrate twilio with salesforce: -
1      First of all we have to create an account on twilio website. Twilio website provides two type of account .
a.) Free account:-   In this type account you can call to any number around the world, but the number  from which you call should be registered with twilio.
b.) Paid account:-  In this type account you can purchase new number, can port your number with twilio and can send sms also. With this account you can also use many other premium facilities like you can create client app and can use interactive deshboard etc.
But for now we will create only free account as follow:-
a.) Open  https://www.twilio.com/try-twilio and create an account
b.) Verify Your number by request a call or sms and then enter code which you get from call
c.)   Now the twilio will give you a chance to select a number.
That’s it we have created our account.
2         Now install apache-ant-1.8.2-bin fromhttp://apache.techartifact.com/mirror//ant/binaries/apache-ant-1.9.0-bin.zip
3      Extract this zip folder.
4      Make sure you have a Java environment installed.
5      create two variable ANT_HOME and JAVA_HOME
ANT_HOME =  D:\apache-ant-1.8.2-bin\apache-ant-1.8.2 (if your ant folder is in D- drive)         JAVA_HOME  = C:\Program Files\Java\jdk1.6.0_25 (give path of jdk)
PATH %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\ProgramFiles\Java\jdk1.6.0_25\jre\bin;D:\apache-ant-1.8.2-bin\apache-ant-1.8.2\bin;
(if path variable is alreadyavailable then append this also other wise create new Path variable)
6       from the ANT_HOME(for ex. D:\apache-ant-1.8.2-bin\apache-ant-1.8.2  ) directory run ant -f fetch.xml -Ddest=system in command prompt to get the library dependencies of most of the Ant tasks that require them. If you don’t do this, many of the dependent Ant tasks will not be available.
7      Now open your salesforce org and nevigate Set up>-App Setup>Develop > Tool> force.comMigrationTool download this and extract it in a folder and copy ant-salesforce.jar  file from it and paste in your ANT_HOME/lib folder (ex.  E:\apache-ant-1.8.4-bin\apache-ant-1.8.4\lib).
8      Now  download twilio liabreary for salesforce from
9      Unzip it and edit the Build.property file which you will found in install folder of twilio library folder as follow
a)   sf.username = your id of org
b)   sf.password = your password+token(may be required)
10   now open command prompt at install folder and run ant deployTwilio .This will install twilio liabrary in your org.
How To Add dialler side component to your Home Page
11   Now we are going to add a side narrow component like below
12   Above component can be Imageused to dial any no as well as it also receive call and notify user about incomming call.
13   To create this component we will create a Visualforce page which you can download from link below:-
14   We will also create a controller for this page which you can download from this link
15   Now we have a ready to dial page by which you can dial any number.
16   Now we will add this component to our home page.
To do this go to setup|customize|Home|Home Page Component click new button to create a new component.
17   Now select click next button and give a name to your component and select  HTML Areacheckbox.
18   Now select Narrow (Left) Column  checkbox and in editor select show HTML checkbox
19   Now paste following code in this area

Here we just calling our created page in a iframe  so be sure your page name is correct.
20   Now click your Home page tabe and voilla!!!! Your page have a dialler component by which you can call and receive calls.
How To add Dial and Sms buttons to your contacts page
21   Now we are going to add call and sms buttons at your contact page like below
Image
22   Now create a apex class whose purpose is to provide capability code for our call button scrip. You can get this apex class code from following Link
23   To do this go to setup|customize|contacts|Button and Links.
24   Now click on New Button .
25   Now Enter Call in label and name field and select Detail Page  radio button and  for Behavior select Execute JavaScript  and for content source select onclick JavaScript.
26   Now Download  script code from following link and paste it in script editor of call button.
27   Save it and go to your contact page and select any one of your contact and woooo!!!! You have a call button over there by which you can call to this contact.
28   Now its turn to create SMS button for this contact. To do this first follow the steps for call button you followed earlier.
29   You can download script for this code from following link
30   Now copy this code and paste it in script editor of newly created sms button.
31   And That’s it we have done creating new call and Sms buttons.

1 comment:

  1. Sorry, but there is no code available in 19th point, Please arrange link ASAP.

    ReplyDelete

    Links