This document will explain how to integrate Salesfore CRM with PBXware. Test system in this case is running PBXware v7.3.0.2
Prerequisites:
In order to be able to use Salesforce integration, you would need to purchase Salesforce CRM through the Bicom store. The procedure is the same as for purchasing gloCOM licenses. Once done, you will see CRM licenses in PBXware GUI -> Home -> About.
Under extension, you would need to enable CRM under Extensions and Modules.
Salesforce integration setup:
Log into your Salesforce account and click on Settings button as shown below:
Click on Open Advanced setup:
Navigate to Apps -> Connected apps -> Manage Connected Apps.
In case you are using Salesforce Lightning mode, you will maybe need to switch to Salesforce Classic.
In my case I needed to switch to Salesforce classic.
In Build section click on Create -> Apps
Click on New button to Create New Connected app:
Add Connected App Name, API Name and Contact Email.
Enable Oauth Settings and enter Callback URL which will be for example like this:
https://flow-velocity-7392.my.salesforce.com/services/oauth2/token
You will need to change flow-velocity-7392 with your own prefix which you can find in URL in your web browser.
Next, In Selected OAuth Scopes click on Full access and add it to Selected OAuth Scopes.
Scroll down to the bottom of the page and click on Save to create the connected app.
Next, open your PBXware GUI -> Settings -> CRM -> Integration and choose Salesforce.
We will need to enter Consumer Key and Consumer Secret. To get them, open again Salesforce account and under Connected apps Click on Manage Consumer Details:
Copy Consumer Key and Consumer Secret and add them to PBXware.
In Login URL add Salesforce Login URL (example: https://login.salesforce.com), select Log options and CRM Behavior options.
CRM Behavior options
Users can decide whether to automatically create new Leads, Contacts, or Accounts based on whether caller ID information is available.
With 'Create a new item if it doesn't exist' enabled: If the caller ID is unknown, the system will open the creation page in the CRM based on the 'Default module' selected. For example, if 'Leads' is selected as the default module, it will open a new Lead creation page.
When 'Create a new item if it doesn't exist' is turned off: If caller ID is missing, the CRM won't activate or create a new record. But, if caller ID is recognized, the system will directly open that specific contact's page.
This setting ensures that users have control over the automatic creation of records in the system based on the availability of caller ID.
Default module
Select one of the modules supported by CRM.
(E.g. Leads)
Create a new item if it doesn't exist:
Running Test:
Once done, click Test to confirm if integration is successful.
In Username field enter the username (username will be sent in email), in Password field enter password followed by token. To get token get back to Salesforce -> open your user profile settings page and under Personal menu find Reset my security token. Security token will be sent to email.
Once done, enter Password + Token in Password field, enter Caller ID and run Test. This is how successful Test looks like:
If Test is successful in crm log, we will see:
tail -f /opt/pbxware/pw/var/log/crmiservice/crmiservice.log -> command to check crm log
2024-12-25 16:48:08 - VARS --> string(137) "Lookup Query: WHERE Phone LIKE '%1202666555' OR Phone LIKE '%(120) 266-6555' OR Phone LIKE '%120-266-6555' OR Phone LIKE '%120 266 6555'"
2024-12-25 16:48:08 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone+from+Account+WHERE+Phone+LIKE+%27%251202666555%27+OR+Phone+LIKE+%27%25%28120%29+266-6555%27+OR+Phone+LIKE+%27%25120-266-6555%27+OR+Phone+LIKE+%27%25120+266+6555%27
2024-12-25 16:48:08 - VARS --> string(417) "Lookup Query: WHERE Phone LIKE '%1202666555' OR Phone LIKE '%(120) 266-6555' OR Phone LIKE '%120-266-6555' OR Phone LIKE '%120 266 6555' OR MobilePhone LIKE '%1202666555' OR MobilePhone LIKE '%(120) 266-6555' OR MobilePhone LIKE '%120-266-6555' OR MobilePhone LIKE '%120 266 6555' OR HomePhone LIKE '%1202666555' OR HomePhone LIKE '%(120) 266-6555' OR HomePhone LIKE '%120-266-6555' OR HomePhone LIKE '%120 266 6555'"
2024-12-25 16:48:08 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+HomePhone%2C+Email+from+Contact+WHERE+Phone+LIKE+%27%251202666555%27+OR+Phone+LIKE+%27%25%28120%29+266-6555%27+OR+Phone+LIKE+%27%25120-266-6555%27+OR+Phone+LIKE+%27%25120+266+6555%27+OR+MobilePhone+LIKE+%27%251202666555%27+OR+MobilePhone+LIKE+%27%25%28120%29+266-6555%27+OR+MobilePhone+LIKE+%27%25120-266-6555%27+OR+MobilePhone+LIKE+%27%25120+266+6555%27+OR+HomePhone+LIKE+%27%251202666555%27+OR+HomePhone+LIKE+%27%25%28120%29+266-6555%27+OR+HomePhone+LIKE+%27%25120-266-6555%27+OR+HomePhone+LIKE+%27%25120+266+6555%27
2024-12-25 16:48:08 - VARS --> string(281) "Lookup Query: WHERE Phone LIKE '%1202666555' OR Phone LIKE '%(120) 266-6555' OR Phone LIKE '%120-266-6555' OR Phone LIKE '%120 266 6555' OR MobilePhone LIKE '%1202666555' OR MobilePhone LIKE '%(120) 266-6555' OR MobilePhone LIKE '%120-266-6555' OR MobilePhone LIKE '%120 266 6555'"
2024-12-25 16:48:08 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+Email+from+Lead+WHERE+Phone+LIKE+%27%251202666555%27+OR+Phone+LIKE+%27%25%28120%29+266-6555%27+OR+Phone+LIKE+%27%25120-266-6555%27+OR+Phone+LIKE+%27%25120+266+6555%27+OR+MobilePhone+LIKE+%27%251202666555%27+OR+MobilePhone+LIKE+%27%25%28120%29+266-6555%27+OR+MobilePhone+LIKE+%27%25120-266-6555%27+OR+MobilePhone+LIKE+%27%25120+266+6555%27
2024-12-25 16:48:08 - DEBUG --> Route - GET /customers/search returns: [{"id":"00QJ9000002ZkUsMAK","webpage":"https:\/\/flow-velocity-7392.my.salesforce.com\/00QJ9000002ZkUsMAK","name":"Test TESTIC","workphone":"1202666555","mobilephone":null,"homephone":null,"fax":" ","email":null,"company":" ","type":"Lead","calllogid":null,"calllogurl":null}]
Common issues when running test:
Email being used to run Test instead of username:
In that case we will see in log:
2024-12-25 16:01:40 - INFO --> SalesforceConnector - Connecting to Salesforce CRM...
2024-12-25 16:01:40 - ERROR --> SalesforceConnector - Error: call to URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"authentication failure"}, curl_error
2024-12-25 16:01:40 - VARS --> NULL
Only password being used in Password field, instead of Password+security token
In that case we will see in log:
2024-12-25 16:01:40 - INFO --> SalesforceConnector - Connecting to Salesforce CRM...
2024-12-25 16:01:40 - ERROR --> SalesforceConnector - Error: call to URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"authentication failure"}, curl_error
2024-12-25 16:01:40 - VARS --> NULL
Allow OAuth Username-Password flows not enabled
In that case we will see in log:
2024-12-25 16:01:40 - INFO --> SalesforceConnector - Connecting to Salesforce CRM...
2024-12-25 16:01:40 - ERROR --> SalesforceConnector - Error: call to URL https://login.salesforce.com/services/oauth2/token failed with status 400, response {"error":"invalid_grant","error_description":"authentication failure"}, curl_error
2024-12-25 16:01:40 - VARS --> NULL
To enable this:
Navigate to Setup > Settings > Identity > Oauth and OpenID Connect Settings. A list of flows is displayed.
Turn on the Allow OAuth Username-Password Flows setting, if it is not enabled.
4. HomePhone/Mobile phone field not enabled
In this case we will see in log:
2024-12-25 16:05:03 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone+from+Account
2024-12-25 16:05:03 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+HomePhone%2C+Email+from+Contact
2024-12-25 16:05:03 - DEBUG --> SalesforceConnector - https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+Email+from+Lead
2024-12-25 16:05:03 - ERROR --> SalesforceConnector - Error: call to URL https://flow-velocity-7392.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+Email+from+Lead failed with status 400, response [{"message":"\nSELECT Name, Id, Phone, MobilePhone, Email from Lead\n ^\nERROR at Row:1:Column:25\nNo such column 'MobilePhone' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.","errorCode":"INVALID_FIELD"}], curl_error
2024-12-25 16:05:03 - DEBUG --> Route - GET /customers returns: {"id":null,"httpcode":400,"description":"Error: call to URL https:\/\/flow-velocity-7392.my.salesforce.com\/services\/data\/v42.0\/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+Email+from+Lead failed with status 400, response [{\"message\":\"\\nSELECT Name, Id, Phone, MobilePhone, Email from Lead\\n ^\\nERROR at Row:1:Column:25\\nNo such column 'MobilePhone' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.
Please reference your WSDL or the describe call for the appropriate names.\",\"errorCode\":\"INVALID_FIELD\"}], curl_error "}
To resolve this, open Salesforce and Go to Setup → Object Manager → Lead → Fields & Relationships.
Look for the field MobilePhone:
If it exists, confirm its exact API name (e.g., it might be a custom field like Mobile_Phone__c).
If it does not exist, determine whether you need to create it.
If Mobile_Phone field exists, check if it is visible for administrator:
Object Manager -> Fields & Relationships -> Edit Contact Field -> Set Field level security -> Make it Visible for the profile used (System Administrator in this case)
The procedure would be the same for Home_Phone field.
Integration with gloCOM:
Log into your gloCOM app and navigate to Tools -> Preferences -> Modules -> CRM -> Enable CRM integration.
In Authentication section enter username and password. In Username field enter the username (username will be sent in email), in Password field enter password followed by token.
Define Popup options and Logging options. (By default Logging options are set to ‘Use settings from server’)
If everything is successful, under Contacts (tab by clicking on Sync button CRM contacts will appear. (In my case I have added only one Lead on CRM side)
Testing calls
Make a call from the Contacts tab by clicking on the contact -> Call popup should appear and Salesforce will open contact information. In my case, this is what I got:
And in gloCOM Diagnostic logs -> CRM we will see:
Make a call to the number which does not exist in Salesforce.
With 'Create a new item if it doesn't exist' enabled: If the caller ID is unknown, the system will open the creation page in the CRM based on the 'Default module' selected. For example, if 'Leads' is selected as the default module, it will open a new Lead creation page.
When 'Create a new item if it doesn't exist' is turned off: If caller ID is missing, the CRM won't activate or create a new record. But, if caller ID is recognized, the system will directly open that specific contact's page.
When this option is enabled in PBXware GUI, when you make a call to the number which does not exist in CRM, you will get Create new lead popup window:
In gloCOM Diagnostic logs -> CRM we will see:
The same applies to incoming calls as well.
Salesforce reported issues:
CRM Integration Test Undefined error
Description
There is a problem when we want to test the CRM service that we previously added. If we go on the test page, fill all required fields, and press RUN, we get msg Undefined and the circle in RUN field is just turning around and nothing else is happening.
JIRA task: https://bicomsystems.atlassian.net/browse/PBXW-7476
Fix: 7.0.0
Disable Leads as search object
Description:
Having Leads disabled as search object in the database for Salesforce CRM, once the integration is done test in the PBXware GUI is successful, however once it is integrated with gloCOM and on contact sync the following error is received:
ERROR --> SalesforceConnector - Error: call to URL https://equitynowinc2.my.salesforce.com/services/data/v42.0/query?q=SELECT+Name%2C+Id%2C+Phone%2C+MobilePhone%2C+Email+from+Lead failed with status 400, response
JIRA task: https://bicomsystems.atlassian.net/browse/PBXW-7395
FIX: 6.7.4
Disable opening new blank lead window on Salesforce
Description: When customers receives incoming call and number is not implemented, on fields (mobile, phone) it opens new blank lead window
JIRA task: https://bicomsystems.atlassian.net/browse/PBXW-5339
FIX: 7.0.0, 6.7.7