# PJSIP вместо chan\_sip у избранных пользователей

{% hint style="info" %}
Кастомизация настраивается в файле **process\_originate\_params.php,** он находится в каталоге:
{% endhint %}

|          itgrix\_bx (Битрикс24)         |           itgrix\_amo (amoCRM)           |
| :-------------------------------------: | :--------------------------------------: |
| **/opt/itgrix\_bx/customizer/actions/** | **/opt/itgrix\_amo/customizer/actions/** |

{% hint style="info" %}
Для более ранних версий:
{% endhint %}

| itgrix\_bx (Битрикс24) ДО версии 3.4.0 | itgrix\_amo (amoCRM) ДО версии 2.6.0 |
| :------------------------------------: | :----------------------------------: |
|       **/opt/itgrix\_bx/custom/**      |     **/opt/itgrix\_amo/custom/**     |

Пример: некоторые сотрудники работают на PJSIP, а другие на chan\_sip. Нужно настроить так, чтобы у первых originate исполнялся через PJSIP.

На основе номера сотрудника (пира), меняем протокол:

```php
$channel = &$params['channel'];
list($channel_type, $peer) = explode("/", $channel);

$pjsipPeerList = array(101, 102, 103); 
if (in_array($peer, $pjsipPeerList)) {
  $channel_type = "PJSIP";
};

$channel = $channel_type . '/' . $peer;

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.itgrix.ru/custom_common/pjsip-vmesto-chan_sip-u-izbrannykh-polzovatelei.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
