LogoLogo
  • What is Itgrix
  • Contacts
  • Our story
  • Connector installation
    • System requirements
    • Itgrix for Bitrix24 and Asterisk
      • How to perform offline authorization
      • How to obtain a license offline
      • Configuring the connector to work in a closed network
      • Call tests
    • Itgrix for Kommo and Asterisk
      • Restricted mode setting features
      • Call card
      • Call tests
  • Additional functions
    • Automatic call transfer to responsible manager
    • Setting up click-to-call features
      • Features of customization after Bitrix24 23.300.0 update
    • Autoreplacement for phone numbers
    • How to view employee call statistics in Bx24
    • FMC number recognition
    • Configuring WebRTC in Asterisk (FreePBX)
    • Itgrix AsterPhone for Bitrix24
    • Itgrix AsterPhone for Kommo
  • For admins
    • Running an additional copy of the module
    • Deploying a module backup
    • Call processing for the period
    • Examples of the structure of registered calls from CEL
    • Wrong time in created cases in Bitrix24
    • SSH access
    • Useful commands
    • Script to test the module service
    • Changing login and password to enter the admin panel
    • Module files
    • Status monitoring
    • Application update
    • In the CEL table, there is no internal employee number in the cid_num column
    • How to fix click-to-call
    • Custom SSL certificates for https requests
    • Examples of configuring WSS connections
    • Converting recordings to MP3 before sending to Bitrix24
    • How to fix call recording problems
    • Install and configure CEL
    • B24 authorization bugfix
  • Useful customizations (any CRM)
    • Audio file name customization
    • Call data (call_full) in customizations
    • Change the number / context for calling to asterisk
    • Change phone number before sending data to CRM
    • Black and white lists
  • Useful customizations itgrix_bx (Bitrix24)
  • Useful customizations itgrix_kmo (Kommo)
  • FAQ
    • How to pay
    • How to check licence status
    • Differences in connection to B24 via SIP-connector and Itgrix
    • How to turn off the display of calls in the calendar
    • How to view statistics on employee calls
    • Updating the app
    • Offline install (only for Bitrix24)
    • Offline update
    • Reliable softphones for Asterisk
    • Detail-call-statuses
  • Changelog Itgrix_bx
  • Changelog Itgrix_kommo
  • Policy of interaction with Asterisk
Powered by GitBook
On this page

Was this helpful?

  1. Useful customizations (any CRM)

Change phone number before sending data to CRM

PreviousChange the number / context for calling to asteriskNextBlack and white lists

Last updated 1 year ago

Was this helpful?

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

If necessary, you can change the phone number received from the PBX before sending data to CRM.

This will be useful if you want:

This will be useful if you want to:

  • Automatically add the area code to short numbers dialed by employees;

  • Replace 7 with 8 at the beginning of the number, if incoming calls are recorded from 7;

  • Add 8 at the beginning of the number, if incoming calls come without 8...

Editing the file /opt/itgrix_bx/customizer/actions/process_phone_number.php.

Example of trimming a number and substituting 8 at the beginning

In the following example, for all numbers of 10 characters or more, CRM will get a number at the beginning of which will be 8, and at the end - the last 10 digits of the original phone number:

  • 4991234567 will be replaced with 84991234567

  • 1234567 will be unchanged

  • 39974991234567 will be replaced with 84991234567

  • 74991234567 will be replaced with 84991234567

  • +74991234567 will be replaced with 84991234567

$phone = $params['phone'];

// Getting the last 10 digits of the number
if(preg_match('/([0-9]{10})$/', $phone, $match)){
// if the number has 10 digits at the end, then add an eight to the beginning
    $phone = '8' . $match[1];
}

return array(
    'state' => 'success',
    'data' => array(
        'phone' => $phone,
    ),
);
Contact us