CRM integration via the CRM Command Line API
The CRM API is designed to allow customers and developers to easily integrate with CRM applications. Essentially using this API you can do the following:
- Launch calls from your application
- Get notifications about the duration of a call
- Get notifications about inbound calls and pop up customer records based on Caller ID
The API uses 3CX MyPhone, and as such requires it to be locally installed (including desktop components) on the machine on which you wish to use the CRM API.
Communication between 3CX MyPhone and your application is done by launching an executable with various options. These are documented below.
Inbound Call Notification
The command line syntax that 3CX MyPhone uses to call the CRM executable for call notification is the following:
<crm program>.exe /N:NotificationType [/C:CallerId] [/T:CallType] /I:CallId
where <crm program>.exe is the full path to your application.
This path has to be configured in the registry to be called by 3CX MyPhone. The registry value to create is “HKLM\Software\3CX\CRM\CallNotifierPath” (value type REG_SZ).
NotificationTypes:
- S = Call Started
- C = Call Connected
- E = Call Ended
CallType:
- I = Inbound Call
- O = Outbound Call
CallerId is mandatory when NotificationType=Call Started
CallType is mandatory when NotificationType=Call Connected or Call Ended
For inbound calls, 3CX MyPhone would launch the executable 2 or 3 times:
- When the inbound call arrives: <crm program>.exe /N:S /C:CallerId /T:I /I:CallId
- Note: The CallerId is identical to the string that was received from the telco.
- Note: The CallId is the call identifier generated by 3CX Phone System.
- When the inbound call is answered (optional): <crm program>.exe /N:C /T:I /I:CallId
- Note: The Callid is the same that was informed upon arrival of the inbound call.
- When the inbound call is terminated, both if answered or not answered:
<crm program>.exe /N:E /T:I /I:CallId
Note: The Callid is the same that was informed upon arrival of the inbound call.
Launching Outbound Calls
To make outgoing calls, 3CX MyPhone must be called by command line to instruct the PBX to make a call on behalf of the currently logged in extension. For example, to call a number 12345678 you need to launch:
<myphone call notifier>.exe -cmd makecall:12345678
where <myphone call notifier>.exe is the full path to the MyPhone Call Notifier application, which you can read from the registry from “HKLM\Software\3CX\MyPhone\CallNotifier” (value type REG_SZ).
Notes:
- “makecall:” is case-sensitive and should be lower-case.
- MyPhone must be open or else an error message will be displayed.
- This works only on non-free versions.
This will instruct the PBX to dial the registered SIP phone and then connect the phone to the number specified. The user will hear ‘Your call is being transferred’.
Outbound Calls Notification
3CX MyPhone will notify the CRM application on the result of the outbound call as follows:
- When the outbound call is dialing: <crm program>.exe /N:S /T:O /I:CallId
- Note: The CallId is the call identifier or number dialed generated by the 3CX Phone System.
- When the outbound call is answered (optional): <crm program>.exe /N:C /T:O /I:CallId
- Note: The CallId is the same that was informed in the outbound call dialing status.
- When the outbound call is terminated (answered or not) <crm program>.exe /N:E /T:O /I:CallId
- Note: The CallId is the same that was informed in the outbound call dialing status.