How to fix click-to-call

If you don't want to go into details, contact us. We will quickly help you and answer all questions! Contact us in any convenient way:

First, let's describe how click-to-call works:

  1. User makes a call from Bitrix24 (by clicking phone number in CRM).

  2. Connector receives a command to make a call (originate).

  3. Connector makes a request and sends it to Asterisk.

  4. After that, user's IP-phone or softphone will ring (phone with number which specified in the user profile).

  5. When the user picks up the phone, the call goes to the customer's phone.

Check the following points:

  1. Whether the application is installed on the portal.

  2. Whether Connector is running on the server.

  3. Internal number in user's profile on the portal is specified and matches the one set up on the user's phone (SIP-phone).

  4. “Asterisk-connector Itgrix (free)” must be selected as the default application for outgoing calls. How to check: on the portal, go to Telephony → Configure telephony → Telephony settings, field Default number for outgoing calls should contain “Application: Asterisk-connector Itgrix (free)”. For a specific user go to Telephony → Configure telephony → Telephony users. Setting up of this step is described in the instruction.

  5. A handler must be installed in standalone (self hosted) Bitrix24. Check if the code from the instruction has been added to the dbconn.php file: if($_REQUEST['COMMAND'] === 'startCallViaRest' || $_SERVER['REQUEST_URI'] === '/rest/voximplant.call.startViaRest.json') { define('BITRIXREST_URL', 'ipasterisk:8077'); } here ipasterisk is the address of your Asterisk server with the Connector installed on it.

  6. In the Asterisk console verify if that peer exists and it is online. asterisk -rx ‘sip show peer 123’ here 123 is the internal phone number of the user.

  7. Verify that the request reaches the Connector. Search for event onExternalCallStart (the last one) in the Connector log file /var/log/bx24asterisk.log: grep "onExternalCallStart" /var/log/bx24asterisk.log --max-count=1

Example output:

[2018-12-21 16:45:28.520 +05] debug Start onExternalCallStart event received from user [504] to phone [81234567890]

  1. If nothing is found, then Connector has not received a call request. Then you need to check if the requests come to the server: tcpdump port 8077 After that, make a call with a click from Bitrix24.

    • If the command output did not appear, then the problem may be as follows:

      • Port is not forwarded (Connector behind NAT).

      • Bitrix24 sends data to another address / port.

      • Bitrix24 does not send a request.

    • If there is an output, check firewall settings.

  2. If such a log entry is found, check the customization result: grep "Result of originate params customization" /var/log/bx24asterisk.log

Example output:

[2018-12-21 16:41:18.202 +05] debug Result of originate params customization: QHash((caller_id, Звонок на 81234567890 <81234567890>)(extension, 81234567890)(priority, 1)(context, from-internal)(channel, SIP/123)) Try to execute originate with the received parameters directly in Asterisk (call from 123 to 81234567890): # asterisk -rvvvvv > channel originate SIP/123 extension 81234567890@from-internal In case of success you will see: == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Called 123 -- SIP/123-00001a5e is ringing In case of failure you will see:

  • If the context is incorrect, you will see the message: WARNING[9975][C-00004504]: pbx.c:4461 __ast_pbx_run: Channel 'SIP/123-00001a62' sent to invalid extension but no invalid handler: context,exten,priority=bad-context,81234567890,1

  • If the number is missing: [2018-12-21 17:47:52] ERROR[10555]: chan_pjsip.c:2458 request: Unable to create PJSIP channel - endpoint '123' was not found

  • If the channel type is incorrect: [2018-12-21 17:47:37] WARNING[10527]: channel.c:6083 request_channel: No channel type registered for 'PSSIP'

If this article does not solve the problem, please contact technical support.