# Notification of Employment, Call Waiting

1. Go to the [System file customization](https://docs.mikopbx.com/mikopbx/english/manual/system/custom-files) section

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fn06cIfMIqk6wJhcxD3gW%2FSystemFileCustomization.png?alt=media&#x26;token=4edfbfbf-6903-46c5-b1b5-d2a62131f59e" alt=""><figcaption><p>System file customization menu</p></figcaption></figure>

2. Proceed to editing the "**modules.conf**" file

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FOOR18KwpzDhecRg5Ek3s%2FmodulesConf.png?alt=media&#x26;token=7cd59158-ba08-43dc-82c0-97c47e7a2c29" alt=""><figcaption><p>modules.conf file</p></figcaption></figure>

3. Add the following code to the end of the file:

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

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FUkQcjI9Zi3qp6v4V2Evv%2FCodeForModules.png?alt=media&#x26;token=0b0bf9ba-8f00-43ed-a616-65a9c58d41aa" alt=""><figcaption><p>Code for modules.conf </p></figcaption></figure>

4. Go to editing the file "**extensions.conf**"

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FNuELWVzuFh5rThr08jvu%2FEditExtensions.conf.png?alt=media&#x26;token=567dc075-00ed-45a7-bc10-915ccc1dc97f" alt=""><figcaption><p>extensions.conf file</p></figcaption></figure>

5. Add the following code to the end of the file:

```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://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FMJkv3LM2jfM8tobox21V%2FCodeForExtensions2.png?alt=media&#x26;token=a7393e6a-3a18-458d-b192-67bc050ce250" alt=""><figcaption></figcaption></figure>

6. In the extension card, in the "**Advanced Settings**" - "**Extra Options**" field, set the value

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

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FSq8Wo5YoIl1eJe5bJXwX%2FparametersForExtensions.png?alt=media&#x26;token=95212359-e72b-4767-b826-5c0e4ab0e7da" alt=""><figcaption></figcaption></figure>

If the employee is busy, a **beep** file (a short beep) will be played to the caller, then music will be played instead of beeps until the employee answers the call

{% hint style="warning" %}
**device\_state\_busy\_at** is the number of conversations at which the employee should be considered "busy", in this case the "**Routing Settings**" rules described in the employee card will start working.
{% endhint %}

If the problem solution does not work correctly, change the code in **extensions.conf** to:

```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
```
