# Choosing a provider when redirecting to a mobile

**Task**: Several providers A,B, C, D are installed on the PBX… The call arrives at MikoPBX through provider A. When dialing an employee's mobile number, the call must also go through provider A. **The provider must support more than one simultaneous call.**

1. Go to **System** → **System file customization**

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

2. Open the **extensions.conf** configuration file 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>

3. Set the "**Add to end of file**" mode. In the black window, add the following code snippet:

```php
[all-outgoing-custom]
exten => _[0-9*#+a-zA-Z][0-9*#+a-zA-Z]!,1,NoOp(-)
    same => n,NoOp("${PROVIDER_ID}" --- "${ONLY_THIS_PROVIDER}")
    same => n,Set(NEED_RETURN=${UNDEFINED})
    same => n,ExecIf($["${ONLY_THIS_PROVIDER}x" == "x"]?return)
    same => n,ExecIf($["${PROVIDER_ID}" != "${ONLY_THIS_PROVIDER}"]?Set(NEED_RETURN=1))
    same => n,ExecIf($["${PROVIDER_ID}" != "${ONLY_THIS_PROVIDER}"]?Set(ROUTFOUND=${UNDEFINED}))
    same => n,Return()
    
[add-trim-prefix-clid-custom]
exten => _[0-9*#+a-zA-Z][0-9*#+a-zA-Z]!,1,NoOp(start check blacklist)
    same => n,ExecIf($["${CHANNEL(channeltype)}" == "PJSIP" ]?Set(__ONLY_THIS_PROVIDER=${CHANNEL(endpoint)}))
    same => n,Return()
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FvPdL2qBCxAgiAAwSuTs3%2FCodeForExtensions.png?alt=media&#x26;token=6a3f68e6-1497-406f-b790-5400c4ae23f0" alt=""><figcaption></figcaption></figure>

4. For each provider, it is necessary to describe the [outbound routes](https://docs.mikopbx.com/mikopbx/english/manual/routing/outbound-routing)
5. Fill in the mobile numbers for employees ([see the documentation](https://docs.mikopbx.com/mikopbx/english/manual/telephony/extensions))
6. Limit the use of outgoing routes for users, use the "[User Groups](https://docs.mikopbx.com/mikopbx/english/modules/miko/module-users-groups)" module
7. Now, if an incoming call is sent to an employee's mobile phone, for example through the [IVR menu](https://docs.mikopbx.com/mikopbx/english/manual/telephony/ivr-menu), then the call will be sent through the same provider through which it came
