# Pause for Queue agent

For the case when an employee has moved away and cannot answer a call, it is convenient to put the agent on pause. For example, an employee dials a special extension number **\*46** and leaves for lunch.

New calls to the employee will stop coming.

When the employee returns, he dials **\*46** again and disables the pause. In modern phones, everything can be reduced to pressing a single button.

1. Go to "**Modules**" -> "**Dialplan Applications**"

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FaTBUARHtK6DKDKkG12OO%2FDialplanApplications.png?alt=media&#x26;token=db8e7f9b-e3cb-429b-a22d-828733ba6abd" alt=""><figcaption><p>Section "Dialplan applications"</p></figcaption></figure>

2. Create a new dialplan.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FyTVSdUYNLJyQqNgJ8eXe%2FNewDialplan.png?alt=media&#x26;token=559ea168-b43b-4abc-8e3e-8ec99ac2c94e" alt=""><figcaption><p>Creating a new dialplan</p></figcaption></figure>

3. Specify the name, as well as the dialplan number (in our case - **2200105**). Specify "**Dialplan Asterisk**" as the code type

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fft4rSqIONuNaGncYPIL4%2FSettingsOfDialplan.png?alt=media&#x26;token=e58eb80c-cab7-4a3c-b3aa-5f7c92ce3547" alt=""><figcaption><p>New Dialplan Settings</p></figcaption></figure>

4. Go to the "**Programme Code**" tab. Paste the following code into the black area:

```php
1,Answer()
n,Set(PeerNumber=${CHANNEL(endpoint)})
n,Set(MemberStatus=${DB(QueueMemberOnPause/${PeerNumber})})
n,Set(AppName=${IF($[ "${MemberStatus}" != "1" ]?PauseQueueMember:UnpauseQueueMember)})
n,Set(NewMemberStatus=${IF($[ "${MemberStatus}" == "1" ]?0:1)})
n,Exec(${AppName}(,Local/${PeerNumber}@internal/n))
n,Set(DB(QueueMemberOnPause/${PeerNumber})=${NewMemberStatus})
n,Playback(beep)
n,Hangup()
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FjpXtNOKSk9Q7ynntqidQ%2FProgrammeCodeForDialpan.png?alt=media&#x26;token=d2c51279-a55d-48ae-9511-91a8b85fc452" alt=""><figcaption><p>Code for dialplan</p></figcaption></figure>

5. Go to the "**System file customization**" 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' section</p></figcaption></figure>

6. Open the file "**/etc/asterisk/extensions.conf**" for editing

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

7. Paste the following code at the end of the file:

<pre class="language-php"><code class="lang-php">[all_peers](+)
exten => *46,1,Goto(applications,<a data-footnote-ref href="#user-content-fn-1">2200105</a>,1)
</code></pre>

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FHGNugIIpTvvRz1D98NBQ%2FCodeForExtensionsConf.png?alt=media&#x26;token=45341e39-240d-462f-8fd5-a3bb75b27271" alt=""><figcaption><p>Code for extensions.conf</p></figcaption></figure>

[^1]: Dialplan number
