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

  1. Open the extensions.conf configuration file for editing.

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

[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()
  1. For each provider, it is necessary to describe the outbound routes

  2. Fill in the mobile numbers for employees (see the documentation)

  3. Limit the use of outgoing routes for users, use the "User Groups" module

  4. Now, if an incoming call is sent to an employee's mobile phone, for example through the IVR menu, then the call will be sent through the same provider through which it came

Last updated