Call the company from your mobile and dial an extension to call a third-party company
This functionality is convenient for mobile employees. When it is important that the conversation is recorded and recorded on the PBX in the call history. When it is not possible to use a softphone / or "IP-SIM".
Add a new dialplan application (see Dialplan Applications)

Assign an internal number, for example 2200109

Paste the code into the "Programme Code" tab:

In the browser's address bar, copy the application ID. It will look like "DIALPLAN-APP-6A9902C631C5E7B5AC8F501C559FD678"

Go to the "System file customization" section

Open the file "extensions.conf" for editing

Paste the following code at the end of the file:

Important points
The application will be executed for all incoming calls
It will be possible to enter an extension only if the caller's phone number is filled in the employee card, that is, the number must belong to the employee. This is done for security.
The script is not a complete product, but is open for customization
DISA — calling out through the PBX with PIN authorization
DISA (Direct Inward System Access) lets you call the PBX number, authenticate with a PIN code and then dial any external or internal number "on behalf of the company" (with the outgoing CallerID substituted). Unlike the example above, access is protected by a PIN code and/or a CID whitelist rather than by matching the number to an employee card.
Add a new dialplan application (see Dialplan Applications) and assign it an internal number, for example 2204. Code type — "PHP-AGI script".

Paste the code into the "Programme Code" tab:

Configure the constants in the
SETTINGSblock:
DISA_PIN
Access PIN. An empty string — the PIN is not requested (then protection is by DISA_CID_WHITELIST only)
DISA_CID
CallerID substituted into the outgoing call
DISA_CID_WHITELIST
Whitelist of incoming CIDs allowed to use DISA. An empty array — allowed for everyone
DISA_CONTEXT
MikoPBX dialing context. all_peers — internal numbers and outbound routes
DISA_MAX_ATTEMPTS
Number of PIN entry attempts
DISA_*_TIMEOUT
Timeouts (ms) for entering the PIN and the number
DISA_NUM_MAXLEN
Maximum length of the dialed number
DISA_*_PROMPT
Paths to the sound files (without extension)
Prepare the sound files. Upload your own recordings (for example, via the "Sound files" section or over SSH to
/storage/usbdisk1/mikopbx/media/custom/) and set their full paths in theDISA_*_PROMPTconstants. You can verify a file exists on the host with:
Route an incoming call to DISA. In the "Incoming routes" section create a route (by a specific DID if needed) and set the created dialplan application (internal number 2204) as its destination.

Important points (DISA)
DISA allows calling out through your PBX and at your expense. You must protect it with a PIN code (
DISA_PIN) and/or a CID whitelist (DISA_CID_WHITELIST). An open DISA without a PIN on a public DID is a risk of unauthorized calls.All PIN entry and dialing attempts are logged via
SystemMessages::sysLogMsg('DISA', ...)— search by theDISAtag in the system log.The substituted
DISA_CIDmust be allowed for outgoing calls by your provider, otherwise the operator will reject the call.The script is not a complete product, but is open for customization.
Last updated
Was this helpful?

