> For the complete documentation index, see [llms.txt](https://docs.mikopbx.com/mikopbx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mikopbx.com/mikopbx/faq/incoming-routing/notification-of-employment-call-waiting.md).

# Уведомление о занятости, Call Waiting

1. Перейдите в раздел [Кастомизация системных файлов](/mikopbx/manual/system/custom-files.md)

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FmRoCXGlTdLZsCYDSh3T2%2FcustomizationFiles.png?alt=media&amp;token=ec18b151-274a-4a56-9e51-17f693db0bb7" alt=""><figcaption><p>Раздел "Кастомизация системных файлов"</p></figcaption></figure>

2. Перейдите к редактированию файла "**modules.conf**"

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FMgp6ZonpsMxKMJpzgOLv%2Fmodules.conf.png?alt=media&amp;token=fb1cb973-0ab1-4456-9713-29ea0fa0c032" alt=""><figcaption><p>Редактирование файла "modules.conf"</p></figcaption></figure>

3. Добавьте в конец файла следующий код:

```php
load => func_extstate.so
```

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FRbmbPu5okMV4zGI0pCMm%2FcodeForModules.png?alt=media&amp;token=9d5d8e8a-bdca-4ab9-aa75-d43d0b33f08a" alt=""><figcaption><p>Код для "modules.conf"</p></figcaption></figure>

4. Перейдите к редактированию файла "**extensions.conf**"

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2Fgit-blob-0a1dd07707eb967d811042c18a85b2c567eb1916%2FextensionsConf%20(1).png?alt=media" alt=""><figcaption><p>Редактирование файла "extensions.conf"</p></figcaption></figure>

5. Добавьте в конец файла следующий код:

```php
[internal-users-custom]
exten => _X!,1,Progress()
  same => n,ExecIf($["${EXTENSION_STATE(${EXTEN})@internal-hints}" = "INUSE" || "${EXTENSION_STATE(${EXTEN}@internal-hints)}" = "RINGINUSE"]?Playback(beep))
  same => n,ExecIf($["${EXTENSION_STATE(${EXTEN})@internal-hints}" = "INUSE" || "${EXTENSION_STATE(${EXTEN}@internal-hints)}" = "RINGINUSE"]?Set(TRANSFER_OPTIONS=${TRANSFER_OPTIONS}m))
    same => n,return
```

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FjEy4oUB4hqRj40eqlI6f%2FcodeForExtensions.png?alt=media&amp;token=bcb8e23e-4f05-4acb-b205-dd6478955e8b" alt=""><figcaption><p>Код для "extensions.conf"</p></figcaption></figure>

6. В карточке сотрудника, в поле «**Расширенные настройки**» - «**Дополнительные параметры**» установите значение

```
[endpoint]
device_state_busy_at = 3
```

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2Fp12zcCKcxDn2sBRjUVdW%2FsettingInExtensions.png?alt=media&amp;token=7a11cde5-28b3-4c6c-8840-a53e85279479" alt=""><figcaption></figcaption></figure>

Если сотрудник будет занят, то звонящему будет проигран файл **beep** (короткий гудок), затем вместо гудков будет проигрываться музыка, пока сотрудник не ответит на вызов

{% hint style="warning" %}
**device\_state\_busy\_at** - это то количество разговоров, при котором следует считать сотрудника «занятым», в этом случае начнут работать правила «**Настройки маршрутизации**», описанные в карточке сотрудника.
{% endhint %}

В случае некорректной работы решения задачи, измените код в **extensions.conf** на:

```php
[internal-users-custom]
exten => _X!,1,Progress()
same => n,NoOp(${EXTEN})
same => n,NoOp(${DEVICE_STATE(PJSIP/${EXTEN})})
same => n,ExecIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INUSE" || "${DEVICE_STATE(PJSIP/${EXTEN})}" = "RINGINUSE"]?Background(nomer&zanjat))
same => n,ExecIf($["${DEVICE_STATE(PJSIP/${EXTEN})}" = "INUSE" || "${DEVICE_STATE(PJSIP/${EXTEN})}" = "RINGINUSE"]?Set(TRANSFER_OPTIONS=${TRANSFER_OPTIONS}m(callwaiting)))
same => n,return
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mikopbx.com/mikopbx/faq/incoming-routing/notification-of-employment-call-waiting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
