(Note:$onlyCallback=1; Module working with only callback mode agents)
Thanks:
https://github.com/DoubangoTelecom/sipml5
yum update
cp /etc/letsencrypt/live/yourdomain.com/cert.pem /etc/asterisk/keys
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem /etc/asterisk/keys
cd /etc/asterisk/keys
chown asterisk:asterisk cert.pem
chown asterisk:asterisk privkey.pem
Edit index.php and find this on estimated 340th line
themeSetup($smarty, $selectedMenu, $pdbACL, $pACL, $idUser);
Add the following lines after this line.
if(strpos($_SERVER[REQUEST_URI], 'agent_console') == true || strpos($_SERVER[REQUEST_URI], 'myex_config') == true)
{
$webPhoneExtension = $pACL->getUserExtension($_SESSION['issabel_user']);
$dsn1 = generarDSNSistema('asteriskuser', 'asterisk');
$pdbACL1 = new paloDB($dsn1);
$webphonePassword = $pdbACL1->fetchTable("SELECT data from sip WHERE id = '$webPhoneExtension' AND keyword = 'secret'; ")[0];
if($webPhoneExtension>0)
{
echo '<script type="text/javascript">';
echo "localStorage.setItem('mhrgl.com.identity.display_name', $webPhoneExtension);";
echo "localStorage.setItem('mhrgl.com.identity.impi', $webPhoneExtension);";
echo "localStorage.setItem('mhrgl.com.identity.impu', 'sip:'+ $webPhoneExtension+'@'+ window.location.hostname);";
echo "localStorage.setItem('mhrgl.com.identity.password', $webphonePassword[0]);";
echo "localStorage.setItem('mhrgl.com.identity.realm', window.location.hostname);";
echo "localStorage.setItem('mhrgl.com.expert.disable_video', 'true');";
echo "localStorage.setItem('mhrgl.com.expert.disable_callbtn_options', 'true');";
echo "localStorage.setItem('mhrgl.com.expert.websocket_server_url', 'wss://' + window.location.hostname + ':8089/ws');";
//echo "localStorage.setItem('mhrgl.com.expert.ice_servers', '[]');";
echo "localStorage.setItem('mhrgl.com.expert.ice_servers', '[{ url: \'stun:stun.a.google.com:19302\'}]');";
echo "</script>";
include("webphone/webphone.php");
}
}
After adding it should look something like this.
Find $onlyCallback=0; on line 52 and change like this $onlyCallback=1;