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
  • Contact us instead of reading the instructions
  • Initializing a call from CRM may not work for the following reasons:

Was this helpful?

  1. Useful customizations (any CRM)

Change the number / context for calling to asterisk

PreviousCall data (call_full) in customizationsNextChange phone number before sending data to CRM

Last updated 1 year ago

Was this helpful?

Contact us instead of reading the instructions

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

Initializing a call from CRM may not work for the following reasons:

  • A phone number in CRM starts with a +;

  • Asterisk is configured with special dialing, for example, you can call only after 9.

The logic of this refinement will be as follows: we will receive the last 10 characters (for Russia) and add the desired prefix to the result. In the example, the prefix will be the number 8.

To configure customization, you must include the customizer file in the module settings. Editing the file /opt/itgrix_bx/customizer/actions/process_originate_params.php.

//parameters names as in the config
$phone = &$params['extension'];

//We get the last 10 digits of the number in $match
if(preg_match('~(\d{10})$~', $phone, $match)){
    //Adding a prefix to the found one
    $phone = '8' . $match[1];
}

return array(
    'state' => 'success',
    'data' => $params
);

There is a need to call through different contexts. In the example: calls from numbers (161, 162, 163) will go through the context custom-context-1; from numbers (141, 140) through the context custom-context-2; other calls will go through the standard context specified in the settings.

//parameters names as in the config
$phone = &$params['extension'];
$channel = explode('/', $params['channel']);

$contexts = array(
    'custom-context-1' => array(161, 162, 163),
    'custom-context-2' => array(141, 140),
);

foreach($contexts as $context => $phones){
    if(in_array($channel[1], $phones)){
        $params['context'] = $context;
        break;
    }
}

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