Let's say a conference room with the number "354233" is configured on the PBX.
When calling an employee(s) to a conference, it is always necessary to connect an external subscriber.
When disconnecting employees from the conference, the external subscriber must be disconnected
This may be required to organize communication with an external (relative to MIKOPBX) conference. It will allow saving on outgoing calls (only one line will be occupied).
In the "Telephony" section, go to "Conference" and create a new conference.
We will indicate the name of the room "Z-CONF-354233"
In this example, "DIALPLAN-APP-EC12CFAE6783FE82FD34F16E40C7386B" is the ID of the previously created application. The ID can be peeped in the browser address bar when editing the application.
We will describe additional contexts through the Customization of system files menu. We will edit the extensions.conf file.
Add the following code to the end of the file:
[z-outgoing]exten => _X!,1,Ringing() same => n,Gosub(${ISTRANSFER}dial,${EXTEN},1) same => n,Dial(PJSIP/${EXTEN}@${ZPROVIDERID},600,${DOPTIONS}TKU(z-dial-answer)b(dial_create_chan,s,1)) same => n,ExecIf($["${ISTRANSFER}x"!="x"]?Gosub(${ISTRANSFER}dial_hangup,${EXTEN},1)) same => n,Set(pt1c_UNIQUEID=${EMPTY_VALUE}) same => n,ExecIf($["${BLINDTRANSFER}x"!="x"]?AGI(check_redirect.php,${BLINDTRANSFER})) same => n,Hangup()[z-dial-answer]exten => s,1,NoOp(Answered send DTMF...) same => n,Gosub(dial_answer,${EXTEN},1) same => n,SendDTMF(${ZDTMF}) same => n,return[z-meetme]exten => _X!,1,Answer() same => n,Meetme(${EXTEN},qdMTr) same => n,Hangup()
When calling the conference number 354233, an external subscriber with the number 37127776675 will automatically connect. As soon as the subscriber answers, the extension number 354233 will be dialed. As soon as all the "internal" participants have left the conference, the external subscriber will be disconnected.
The task in the crown is needed only for additional "protection", in fact it is a restart of the php script every minute